From 79d9fcd7fb438efcd25a4df80f679f87457567ef Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 19 May 2022 01:49:11 +0000 Subject: [PATCH 1/2] feat: add Examples to Explanation related messages in aiplatform v1beta1 explanation.proto PiperOrigin-RevId: 449620845 Source-Link: https://github.com/googleapis/googleapis/commit/117f86bec8295f237956e15ebfe4ed9bef43d9a7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/1d670dbb1a9ff155cf686e9544feffb75021a2f5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWQ2NzBkYmIxYTlmZjE1NWNmNjg2ZTk1NDRmZWZmYjc1MDIxYTJmNSJ9 --- owl-bot-staging/v1/.eslintignore | 7 + owl-bot-staging/v1/.eslintrc.json | 3 + owl-bot-staging/v1/.gitignore | 14 + owl-bot-staging/v1/.jsdoc.js | 55 + owl-bot-staging/v1/.mocharc.js | 33 + owl-bot-staging/v1/.prettierrc.js | 22 + owl-bot-staging/v1/README.md | 1 + owl-bot-staging/v1/linkinator.config.json | 16 + owl-bot-staging/v1/package.json | 78 + .../aiplatform/v1/accelerator_type.proto | 55 + .../cloud/aiplatform/v1/annotation.proto | 90 + .../cloud/aiplatform/v1/annotation_spec.proto | 55 + .../google/cloud/aiplatform/v1/artifact.proto | 109 + .../aiplatform/v1/batch_prediction_job.proto | 286 + .../aiplatform/v1/completion_stats.proto | 44 + .../google/cloud/aiplatform/v1/context.proto | 94 + .../cloud/aiplatform/v1/custom_job.proto | 277 + .../cloud/aiplatform/v1/data_item.proto | 70 + .../aiplatform/v1/data_labeling_job.proto | 207 + .../google/cloud/aiplatform/v1/dataset.proto | 144 + .../cloud/aiplatform/v1/dataset_service.proto | 412 + .../aiplatform/v1/deployed_index_ref.proto | 42 + .../aiplatform/v1/deployed_model_ref.proto | 42 + .../cloud/aiplatform/v1/encryption_spec.proto | 38 + .../google/cloud/aiplatform/v1/endpoint.proto | 252 + .../aiplatform/v1/endpoint_service.proto | 325 + .../cloud/aiplatform/v1/entity_type.proto | 86 + .../google/cloud/aiplatform/v1/env_var.proto | 42 + .../google/cloud/aiplatform/v1/event.proto | 80 + .../cloud/aiplatform/v1/execution.proto | 115 + .../cloud/aiplatform/v1/explanation.proto | 401 + .../aiplatform/v1/explanation_metadata.proto | 395 + .../google/cloud/aiplatform/v1/feature.proto | 154 + .../v1/feature_monitoring_stats.proto | 86 + .../aiplatform/v1/feature_selector.proto | 44 + .../cloud/aiplatform/v1/featurestore.proto | 111 + .../v1/featurestore_monitoring.proto | 149 + .../v1/featurestore_online_service.proto | 225 + .../aiplatform/v1/featurestore_service.proto | 1225 +++ .../v1/hyperparameter_tuning_job.proto | 110 + .../google/cloud/aiplatform/v1/index.proto | 96 + .../cloud/aiplatform/v1/index_endpoint.proto | 245 + .../v1/index_endpoint_service.proto | 335 + .../cloud/aiplatform/v1/index_service.proto | 277 + .../google/cloud/aiplatform/v1/io.proto | 108 + .../cloud/aiplatform/v1/job_service.proto | 1003 ++ .../cloud/aiplatform/v1/job_state.proto | 66 + .../aiplatform/v1/lineage_subgraph.proto | 42 + .../aiplatform/v1/machine_resources.proto | 204 + .../v1/manual_batch_tuning_parameters.proto | 39 + .../cloud/aiplatform/v1/metadata_schema.proto | 79 + .../aiplatform/v1/metadata_service.proto | 1257 +++ .../cloud/aiplatform/v1/metadata_store.proto | 65 + .../aiplatform/v1/migratable_resource.proto | 150 + .../aiplatform/v1/migration_service.proto | 314 + .../google/cloud/aiplatform/v1/model.proto | 559 ++ .../v1/model_deployment_monitoring_job.proto | 300 + .../aiplatform/v1/model_evaluation.proto | 116 + .../v1/model_evaluation_slice.proto | 71 + .../aiplatform/v1/model_monitoring.proto | 202 + .../cloud/aiplatform/v1/model_service.proto | 480 + .../cloud/aiplatform/v1/operation.proto | 52 + .../cloud/aiplatform/v1/pipeline_job.proto | 319 + .../aiplatform/v1/pipeline_service.proto | 403 + .../cloud/aiplatform/v1/pipeline_state.proto | 58 + .../aiplatform/v1/prediction_service.proto | 227 + .../instance/image_classification.proto | 44 + .../instance/image_object_detection.proto | 44 + .../predict/instance/image_segmentation.proto | 39 + .../instance/text_classification.proto | 38 + .../predict/instance/text_extraction.proto | 45 + .../predict/instance/text_sentiment.proto | 38 + .../instance/video_action_recognition.proto | 51 + .../instance/video_classification.proto | 51 + .../instance/video_object_tracking.proto | 51 + .../predict/params/image_classification.proto | 39 + .../params/image_object_detection.proto | 39 + .../predict/params/image_segmentation.proto | 36 + .../params/video_action_recognition.proto | 39 + .../predict/params/video_classification.proto | 64 + .../params/video_object_tracking.proto | 43 + .../predict/prediction/classification.proto | 41 + .../prediction/image_object_detection.proto | 51 + .../prediction/image_segmentation.proto | 45 + .../prediction/tabular_classification.proto | 39 + .../prediction/tabular_regression.proto | 39 + .../predict/prediction/text_extraction.proto | 52 + .../predict/prediction/text_sentiment.proto | 37 + .../prediction/video_action_recognition.proto | 54 + .../prediction/video_classification.proto | 67 + .../prediction/video_object_tracking.proto | 82 + .../automl_image_classification.proto | 128 + .../automl_image_object_detection.proto | 120 + .../automl_image_segmentation.proto | 106 + .../definition/automl_tables.proto | 285 + .../automl_text_classification.proto | 37 + .../definition/automl_text_extraction.proto | 37 + .../definition/automl_text_sentiment.proto | 44 + .../automl_video_action_recognition.proto | 62 + .../automl_video_classification.proto | 56 + .../automl_video_object_tracking.proto | 67 + .../export_evaluated_data_items_config.proto | 43 + .../cloud/aiplatform/v1/specialist_pool.proto | 62 + .../v1/specialist_pool_service.proto | 210 + .../google/cloud/aiplatform/v1/study.proto | 559 ++ .../cloud/aiplatform/v1/tensorboard.proto | 86 + .../aiplatform/v1/tensorboard_data.proto | 101 + .../v1/tensorboard_experiment.proto | 78 + .../cloud/aiplatform/v1/tensorboard_run.proto | 81 + .../aiplatform/v1/tensorboard_service.proto | 1006 ++ .../v1/tensorboard_time_series.proto | 106 + .../aiplatform/v1/training_pipeline.proto | 388 + .../google/cloud/aiplatform/v1/types.proto | 49 + .../v1/unmanaged_container_model.proto | 43 + .../aiplatform/v1/user_action_reference.proto | 47 + .../google/cloud/aiplatform/v1/value.proto | 39 + .../cloud/aiplatform/v1/vizier_service.proto | 505 + .../v1/dataset_service.create_dataset.js | 65 + .../v1/dataset_service.delete_dataset.js | 61 + .../v1/dataset_service.export_data.js | 66 + .../v1/dataset_service.get_annotation_spec.js | 64 + .../v1/dataset_service.get_dataset.js | 62 + .../v1/dataset_service.import_data.js | 67 + .../v1/dataset_service.list_annotations.js | 83 + .../v1/dataset_service.list_data_items.js | 83 + .../v1/dataset_service.list_datasets.js | 96 + .../v1/dataset_service.update_dataset.js | 68 + .../v1/endpoint_service.create_endpoint.js | 76 + .../v1/endpoint_service.delete_endpoint.js | 61 + .../v1/endpoint_service.deploy_model.js | 81 + .../v1/endpoint_service.get_endpoint.js | 60 + .../v1/endpoint_service.list_endpoints.js | 102 + .../v1/endpoint_service.undeploy_model.js | 76 + .../v1/endpoint_service.update_endpoint.js | 63 + ...ine_serving_service.read_feature_values.js | 74 + ...g_service.streaming_read_feature_values.js | 78 + ...turestore_service.batch_create_features.js | 69 + ...store_service.batch_read_feature_values.js | 108 + ...featurestore_service.create_entity_type.js | 74 + .../v1/featurestore_service.create_feature.js | 75 + ...eaturestore_service.create_featurestore.js | 75 + ...featurestore_service.delete_entity_type.js | 66 + .../v1/featurestore_service.delete_feature.js | 61 + ...eaturestore_service.delete_featurestore.js | 67 + ...turestore_service.export_feature_values.js | 85 + .../featurestore_service.get_entity_type.js | 60 + .../v1/featurestore_service.get_feature.js | 60 + .../featurestore_service.get_featurestore.js | 58 + ...turestore_service.import_feature_values.js | 111 + .../featurestore_service.list_entity_types.js | 109 + .../v1/featurestore_service.list_features.js | 119 + ...featurestore_service.list_featurestores.js | 110 + .../featurestore_service.search_features.js | 129 + ...featurestore_service.update_entity_type.js | 81 + .../v1/featurestore_service.update_feature.js | 75 + ...eaturestore_service.update_featurestore.js | 75 + ..._endpoint_service.create_index_endpoint.js | 65 + ..._endpoint_service.delete_index_endpoint.js | 61 + .../v1/index_endpoint_service.deploy_index.js | 66 + ...dex_endpoint_service.get_index_endpoint.js | 60 + ...x_endpoint_service.list_index_endpoints.js | 95 + ..._endpoint_service.mutate_deployed_index.js | 68 + .../index_endpoint_service.undeploy_index.js | 66 + ..._endpoint_service.update_index_endpoint.js | 63 + .../v1/index_service.create_index.js | 65 + .../v1/index_service.delete_index.js | 61 + .../generated/v1/index_service.get_index.js | 60 + .../v1/index_service.list_indexes.js | 80 + .../v1/index_service.update_index.js | 64 + ...job_service.cancel_batch_prediction_job.js | 60 + .../v1/job_service.cancel_custom_job.js | 60 + .../job_service.cancel_data_labeling_job.js | 60 + ...ervice.cancel_hyperparameter_tuning_job.js | 60 + ...job_service.create_batch_prediction_job.js | 64 + .../v1/job_service.create_custom_job.js | 64 + .../job_service.create_data_labeling_job.js | 64 + ...ervice.create_hyperparameter_tuning_job.js | 64 + ....create_model_deployment_monitoring_job.js | 64 + ...job_service.delete_batch_prediction_job.js | 61 + .../v1/job_service.delete_custom_job.js | 61 + .../job_service.delete_data_labeling_job.js | 61 + ...ervice.delete_hyperparameter_tuning_job.js | 61 + ....delete_model_deployment_monitoring_job.js | 61 + .../job_service.get_batch_prediction_job.js | 60 + .../v1/job_service.get_custom_job.js | 60 + .../v1/job_service.get_data_labeling_job.js | 60 + ...b_service.get_hyperparameter_tuning_job.js | 60 + ...ice.get_model_deployment_monitoring_job.js | 60 + .../job_service.list_batch_prediction_jobs.js | 89 + .../v1/job_service.list_custom_jobs.js | 88 + .../v1/job_service.list_data_labeling_jobs.js | 94 + ...service.list_hyperparameter_tuning_jobs.js | 88 + ...e.list_model_deployment_monitoring_jobs.js | 77 + ...e.pause_model_deployment_monitoring_job.js | 60 + ....resume_model_deployment_monitoring_job.js | 60 + ...l_deployment_monitoring_stats_anomalies.js | 100 + ....update_model_deployment_monitoring_job.js | 89 + ...ce.add_context_artifacts_and_executions.js | 74 + .../metadata_service.add_context_children.js | 64 + .../metadata_service.add_execution_events.js | 65 + .../v1/metadata_service.create_artifact.js | 76 + .../v1/metadata_service.create_context.js | 76 + .../v1/metadata_service.create_execution.js | 77 + ...metadata_service.create_metadata_schema.js | 77 + .../metadata_service.create_metadata_store.js | 77 + .../v1/metadata_service.delete_artifact.js | 67 + .../v1/metadata_service.delete_context.js | 72 + .../v1/metadata_service.delete_execution.js | 67 + .../metadata_service.delete_metadata_store.js | 61 + .../v1/metadata_service.get_artifact.js | 60 + .../v1/metadata_service.get_context.js | 60 + .../v1/metadata_service.get_execution.js | 60 + .../metadata_service.get_metadata_schema.js | 60 + .../v1/metadata_service.get_metadata_store.js | 60 + .../v1/metadata_service.list_artifacts.js | 102 + .../v1/metadata_service.list_contexts.js | 105 + .../v1/metadata_service.list_executions.js | 102 + .../metadata_service.list_metadata_schemas.js | 81 + .../metadata_service.list_metadata_stores.js | 77 + .../v1/metadata_service.purge_artifacts.js | 73 + .../v1/metadata_service.purge_contexts.js | 73 + .../v1/metadata_service.purge_executions.js | 73 + ...service.query_artifact_lineage_subgraph.js | 93 + ..._service.query_context_lineage_subgraph.js | 64 + ...vice.query_execution_inputs_and_outputs.js | 61 + .../v1/metadata_service.update_artifact.js | 72 + .../v1/metadata_service.update_context.js | 72 + .../v1/metadata_service.update_execution.js | 72 + ...gration_service.batch_migrate_resources.js | 67 + ...ion_service.search_migratable_resources.js | 87 + .../v1/model_service.delete_model.js | 60 + .../v1/model_service.export_model.js | 64 + .../generated/v1/model_service.get_model.js | 59 + .../v1/model_service.get_model_evaluation.js | 60 + ...odel_service.get_model_evaluation_slice.js | 60 + .../model_service.import_model_evaluation.js | 64 + ...el_service.list_model_evaluation_slices.js | 82 + .../model_service.list_model_evaluations.js | 80 + .../generated/v1/model_service.list_models.js | 102 + .../v1/model_service.update_model.js | 81 + .../v1/model_service.upload_model.js | 65 + .../pipeline_service.cancel_pipeline_job.js | 60 + ...peline_service.cancel_training_pipeline.js | 60 + .../pipeline_service.create_pipeline_job.js | 72 + ...peline_service.create_training_pipeline.js | 64 + .../pipeline_service.delete_pipeline_job.js | 61 + ...peline_service.delete_training_pipeline.js | 61 + .../v1/pipeline_service.get_pipeline_job.js | 60 + .../pipeline_service.get_training_pipeline.js | 60 + .../v1/pipeline_service.list_pipeline_jobs.js | 119 + ...ipeline_service.list_training_pipelines.js | 88 + .../v1/prediction_service.explain.js | 96 + .../v1/prediction_service.predict.js | 80 + .../v1/prediction_service.raw_predict.js | 74 + ...t_metadata.google.cloud.aiplatform.v1.json | 8555 ++++++++++++++++ ...ist_pool_service.create_specialist_pool.js | 65 + ...ist_pool_service.delete_specialist_pool.js | 66 + ...ialist_pool_service.get_specialist_pool.js | 60 + ...list_pool_service.list_specialist_pools.js | 76 + ...ist_pool_service.update_specialist_pool.js | 64 + ...d_service.batch_create_tensorboard_runs.js | 68 + ...ce.batch_create_tensorboard_time_series.js | 70 + ...batch_read_tensorboard_time_series_data.js | 68 + .../tensorboard_service.create_tensorboard.js | 65 + ...d_service.create_tensorboard_experiment.js | 72 + ...sorboard_service.create_tensorboard_run.js | 73 + ..._service.create_tensorboard_time_series.js | 73 + .../tensorboard_service.delete_tensorboard.js | 61 + ...d_service.delete_tensorboard_experiment.js | 61 + ...sorboard_service.delete_tensorboard_run.js | 61 + ..._service.delete_tensorboard_time_series.js | 61 + ...ice.export_tensorboard_time_series_data.js | 87 + .../v1/tensorboard_service.get_tensorboard.js | 60 + ...oard_service.get_tensorboard_experiment.js | 60 + ...tensorboard_service.get_tensorboard_run.js | 60 + ...ard_service.get_tensorboard_time_series.js | 60 + ...rd_service.list_tensorboard_experiments.js | 90 + ...nsorboard_service.list_tensorboard_runs.js | 90 + ...rd_service.list_tensorboard_time_series.js | 90 + .../tensorboard_service.list_tensorboards.js | 90 + ...oard_service.read_tensorboard_blob_data.js | 66 + ...rvice.read_tensorboard_time_series_data.js | 70 + .../tensorboard_service.update_tensorboard.js | 71 + ...d_service.update_tensorboard_experiment.js | 70 + ...sorboard_service.update_tensorboard_run.js | 70 + ..._service.update_tensorboard_time_series.js | 71 + ...rvice.write_tensorboard_experiment_data.js | 65 + ...oard_service.write_tensorboard_run_data.js | 69 + .../vizier_service.add_trial_measurement.js | 65 + ...ervice.check_trial_early_stopping_state.js | 61 + .../v1/vizier_service.complete_trial.js | 76 + .../v1/vizier_service.create_study.js | 64 + .../v1/vizier_service.create_trial.js | 64 + .../v1/vizier_service.delete_study.js | 59 + .../v1/vizier_service.delete_trial.js | 60 + .../generated/v1/vizier_service.get_study.js | 59 + .../generated/v1/vizier_service.get_trial.js | 60 + .../v1/vizier_service.list_optimal_trials.js | 58 + .../v1/vizier_service.list_studies.js | 71 + .../v1/vizier_service.list_trials.js | 71 + .../v1/vizier_service.lookup_study.js | 64 + .../generated/v1/vizier_service.stop_trial.js | 60 + .../v1/vizier_service.suggest_trials.js | 73 + owl-bot-staging/v1/src/index.ts | 53 + .../v1/src/v1/dataset_service_client.ts | 3594 +++++++ .../src/v1/dataset_service_client_config.json | 66 + .../v1/src/v1/dataset_service_proto_list.json | 110 + .../v1/src/v1/endpoint_service_client.ts | 3161 ++++++ .../v1/endpoint_service_client_config.json | 54 + .../src/v1/endpoint_service_proto_list.json | 110 + ...turestore_online_serving_service_client.ts | 2386 +++++ ..._online_serving_service_client_config.json | 34 + ...ore_online_serving_service_proto_list.json | 110 + .../v1/src/v1/featurestore_service_client.ts | 5310 ++++++++++ .../featurestore_service_client_config.json | 106 + .../v1/featurestore_service_proto_list.json | 110 + owl-bot-staging/v1/src/v1/gapic_metadata.json | 2199 +++++ owl-bot-staging/v1/src/v1/index.ts | 33 + .../src/v1/index_endpoint_service_client.ts | 3218 ++++++ .../index_endpoint_service_client_config.json | 58 + .../v1/index_endpoint_service_proto_list.json | 110 + .../v1/src/v1/index_service_client.ts | 2884 ++++++ .../src/v1/index_service_client_config.json | 46 + .../v1/src/v1/index_service_proto_list.json | 110 + .../v1/src/v1/job_service_client.ts | 5577 +++++++++++ .../v1/src/v1/job_service_client_config.json | 138 + .../v1/src/v1/job_service_proto_list.json | 110 + .../v1/src/v1/metadata_service_client.ts | 5917 +++++++++++ .../v1/metadata_service_client_config.json | 150 + .../src/v1/metadata_service_proto_list.json | 110 + .../v1/src/v1/migration_service_client.ts | 2642 +++++ .../v1/migration_service_client_config.json | 34 + .../src/v1/migration_service_proto_list.json | 110 + .../v1/src/v1/model_service_client.ts | 3672 +++++++ .../src/v1/model_service_client_config.json | 70 + .../v1/src/v1/model_service_proto_list.json | 110 + .../v1/src/v1/pipeline_service_client.ts | 3550 +++++++ .../v1/pipeline_service_client_config.json | 66 + .../src/v1/pipeline_service_proto_list.json | 110 + .../v1/src/v1/prediction_service_client.ts | 2532 +++++ .../v1/prediction_service_client_config.json | 38 + .../src/v1/prediction_service_proto_list.json | 110 + .../src/v1/specialist_pool_service_client.ts | 2883 ++++++ ...specialist_pool_service_client_config.json | 46 + .../specialist_pool_service_proto_list.json | 110 + .../v1/src/v1/tensorboard_service_client.ts | 5388 ++++++++++ .../v1/tensorboard_service_client_config.json | 138 + .../v1/tensorboard_service_proto_list.json | 110 + .../v1/src/v1/vizier_service_client.ts | 3713 +++++++ .../src/v1/vizier_service_client_config.json | 86 + .../v1/src/v1/vizier_service_proto_list.json | 110 + .../system-test/fixtures/sample/src/index.js | 41 + .../system-test/fixtures/sample/src/index.ts | 116 + owl-bot-staging/v1/system-test/install.ts | 49 + .../v1/test/gapic_dataset_service_v1.ts | 3419 +++++++ .../v1/test/gapic_endpoint_service_v1.ts | 2876 ++++++ ..._featurestore_online_serving_service_v1.ts | 1978 ++++ .../v1/test/gapic_featurestore_service_v1.ts | 4882 +++++++++ .../test/gapic_index_endpoint_service_v1.ts | 3020 ++++++ .../v1/test/gapic_index_service_v1.ts | 2635 +++++ .../v1/test/gapic_job_service_v1.ts | 5637 +++++++++++ .../v1/test/gapic_metadata_service_v1.ts | 5934 +++++++++++ .../v1/test/gapic_migration_service_v1.ts | 2246 +++++ .../v1/test/gapic_model_service_v1.ts | 3469 +++++++ .../v1/test/gapic_pipeline_service_v1.ts | 3195 ++++++ .../v1/test/gapic_prediction_service_v1.ts | 2069 ++++ .../test/gapic_specialist_pool_service_v1.ts | 2635 +++++ .../v1/test/gapic_tensorboard_service_v1.ts | 5557 +++++++++++ .../v1/test/gapic_vizier_service_v1.ts | 3680 +++++++ owl-bot-staging/v1/tsconfig.json | 19 + owl-bot-staging/v1/webpack.config.js | 64 + owl-bot-staging/v1beta1/.eslintignore | 7 + owl-bot-staging/v1beta1/.eslintrc.json | 3 + owl-bot-staging/v1beta1/.gitignore | 14 + owl-bot-staging/v1beta1/.jsdoc.js | 55 + owl-bot-staging/v1beta1/.mocharc.js | 33 + owl-bot-staging/v1beta1/.prettierrc.js | 22 + owl-bot-staging/v1beta1/README.md | 1 + .../v1beta1/linkinator.config.json | 16 + owl-bot-staging/v1beta1/package.json | 78 + .../aiplatform/v1beta1/accelerator_type.proto | 55 + .../cloud/aiplatform/v1beta1/annotation.proto | 90 + .../aiplatform/v1beta1/annotation_spec.proto | 55 + .../cloud/aiplatform/v1beta1/artifact.proto | 109 + .../v1beta1/batch_prediction_job.proto | 298 + .../aiplatform/v1beta1/completion_stats.proto | 44 + .../cloud/aiplatform/v1beta1/context.proto | 94 + .../cloud/aiplatform/v1beta1/custom_job.proto | 268 + .../cloud/aiplatform/v1beta1/data_item.proto | 70 + .../v1beta1/data_labeling_job.proto | 207 + .../cloud/aiplatform/v1beta1/dataset.proto | 144 + .../aiplatform/v1beta1/dataset_service.proto | 412 + .../v1beta1/deployed_index_ref.proto | 42 + .../v1beta1/deployed_model_ref.proto | 42 + .../aiplatform/v1beta1/encryption_spec.proto | 38 + .../cloud/aiplatform/v1beta1/endpoint.proto | 252 + .../aiplatform/v1beta1/endpoint_service.proto | 315 + .../aiplatform/v1beta1/entity_type.proto | 86 + .../cloud/aiplatform/v1beta1/env_var.proto | 42 + .../cloud/aiplatform/v1beta1/event.proto | 80 + .../cloud/aiplatform/v1beta1/execution.proto | 115 + .../aiplatform/v1beta1/explanation.proto | 520 + .../v1beta1/explanation_metadata.proto | 398 + .../cloud/aiplatform/v1beta1/feature.proto | 178 + .../v1beta1/feature_monitoring_stats.proto | 86 + .../aiplatform/v1beta1/feature_selector.proto | 44 + .../aiplatform/v1beta1/featurestore.proto | 129 + .../v1beta1/featurestore_monitoring.proto | 155 + .../v1beta1/featurestore_online_service.proto | 225 + .../v1beta1/featurestore_service.proto | 1225 +++ .../v1beta1/hyperparameter_tuning_job.proto | 110 + .../cloud/aiplatform/v1beta1/index.proto | 96 + .../aiplatform/v1beta1/index_endpoint.proto | 245 + .../v1beta1/index_endpoint_service.proto | 335 + .../aiplatform/v1beta1/index_service.proto | 277 + .../google/cloud/aiplatform/v1beta1/io.proto | 108 + .../aiplatform/v1beta1/job_service.proto | 1003 ++ .../cloud/aiplatform/v1beta1/job_state.proto | 66 + .../aiplatform/v1beta1/lineage_subgraph.proto | 42 + .../v1beta1/machine_resources.proto | 204 + .../manual_batch_tuning_parameters.proto | 39 + .../aiplatform/v1beta1/metadata_schema.proto | 79 + .../aiplatform/v1beta1/metadata_service.proto | 1257 +++ .../aiplatform/v1beta1/metadata_store.proto | 65 + .../v1beta1/migratable_resource.proto | 150 + .../v1beta1/migration_service.proto | 314 + .../cloud/aiplatform/v1beta1/model.proto | 588 ++ .../model_deployment_monitoring_job.proto | 300 + .../aiplatform/v1beta1/model_evaluation.proto | 94 + .../v1beta1/model_evaluation_slice.proto | 71 + .../aiplatform/v1beta1/model_monitoring.proto | 202 + .../aiplatform/v1beta1/model_service.proto | 660 ++ .../cloud/aiplatform/v1beta1/operation.proto | 52 + .../aiplatform/v1beta1/pipeline_job.proto | 340 + .../aiplatform/v1beta1/pipeline_service.proto | 403 + .../aiplatform/v1beta1/pipeline_state.proto | 58 + .../v1beta1/prediction_service.proto | 231 + .../v1beta1/schema/annotation_payload.proto | 231 + .../schema/annotation_spec_color.proto | 43 + .../v1beta1/schema/data_item_payload.proto | 69 + .../v1beta1/schema/dataset_metadata.proto | 127 + .../aiplatform/v1beta1/schema/geometry.proto | 38 + .../instance/image_classification.proto | 44 + .../instance/image_object_detection.proto | 44 + .../predict/instance/image_segmentation.proto | 39 + .../instance/text_classification.proto | 38 + .../predict/instance/text_extraction.proto | 45 + .../predict/instance/text_sentiment.proto | 38 + .../instance/video_action_recognition.proto | 51 + .../instance/video_classification.proto | 51 + .../instance/video_object_tracking.proto | 51 + .../predict/params/image_classification.proto | 39 + .../params/image_object_detection.proto | 39 + .../predict/params/image_segmentation.proto | 36 + .../params/video_action_recognition.proto | 39 + .../predict/params/video_classification.proto | 64 + .../params/video_object_tracking.proto | 43 + .../predict/prediction/classification.proto | 41 + .../prediction/image_object_detection.proto | 51 + .../prediction/image_segmentation.proto | 45 + .../prediction/tabular_classification.proto | 39 + .../prediction/tabular_regression.proto | 39 + .../predict/prediction/text_extraction.proto | 52 + .../predict/prediction/text_sentiment.proto | 37 + .../prediction/time_series_forecasting.proto | 33 + .../prediction/video_action_recognition.proto | 54 + .../prediction/video_classification.proto | 67 + .../prediction/video_object_tracking.proto | 82 + .../automl_image_classification.proto | 128 + .../automl_image_object_detection.proto | 120 + .../automl_image_segmentation.proto | 106 + .../definition/automl_tables.proto | 284 + .../automl_text_classification.proto | 37 + .../definition/automl_text_extraction.proto | 37 + .../definition/automl_text_sentiment.proto | 44 + .../automl_time_series_forecasting.proto | 287 + .../automl_video_action_recognition.proto | 62 + .../automl_video_classification.proto | 56 + .../automl_video_object_tracking.proto | 67 + .../export_evaluated_data_items_config.proto | 43 + .../aiplatform/v1beta1/specialist_pool.proto | 62 + .../v1beta1/specialist_pool_service.proto | 210 + .../cloud/aiplatform/v1beta1/study.proto | 602 ++ .../aiplatform/v1beta1/tensorboard.proto | 86 + .../aiplatform/v1beta1/tensorboard_data.proto | 101 + .../v1beta1/tensorboard_experiment.proto | 78 + .../aiplatform/v1beta1/tensorboard_run.proto | 81 + .../v1beta1/tensorboard_service.proto | 1004 ++ .../v1beta1/tensorboard_time_series.proto | 106 + .../v1beta1/training_pipeline.proto | 399 + .../cloud/aiplatform/v1beta1/types.proto | 49 + .../v1beta1/unmanaged_container_model.proto | 43 + .../v1beta1/user_action_reference.proto | 47 + .../cloud/aiplatform/v1beta1/value.proto | 39 + .../aiplatform/v1beta1/vizier_service.proto | 505 + .../v1beta1/dataset_service.create_dataset.js | 65 + .../v1beta1/dataset_service.delete_dataset.js | 61 + .../v1beta1/dataset_service.export_data.js | 66 + .../dataset_service.get_annotation_spec.js | 64 + .../v1beta1/dataset_service.get_dataset.js | 62 + .../v1beta1/dataset_service.import_data.js | 67 + .../dataset_service.list_annotations.js | 83 + .../dataset_service.list_data_items.js | 83 + .../v1beta1/dataset_service.list_datasets.js | 96 + .../v1beta1/dataset_service.update_dataset.js | 68 + .../endpoint_service.create_endpoint.js | 76 + .../endpoint_service.delete_endpoint.js | 61 + .../v1beta1/endpoint_service.deploy_model.js | 81 + .../v1beta1/endpoint_service.get_endpoint.js | 60 + .../endpoint_service.list_endpoints.js | 92 + .../endpoint_service.undeploy_model.js | 76 + .../endpoint_service.update_endpoint.js | 63 + ...ine_serving_service.read_feature_values.js | 74 + ...g_service.streaming_read_feature_values.js | 78 + ...turestore_service.batch_create_features.js | 69 + ...store_service.batch_read_feature_values.js | 108 + ...featurestore_service.create_entity_type.js | 74 + .../featurestore_service.create_feature.js | 75 + ...eaturestore_service.create_featurestore.js | 75 + ...featurestore_service.delete_entity_type.js | 66 + .../featurestore_service.delete_feature.js | 61 + ...eaturestore_service.delete_featurestore.js | 67 + ...turestore_service.export_feature_values.js | 85 + .../featurestore_service.get_entity_type.js | 60 + .../featurestore_service.get_feature.js | 60 + .../featurestore_service.get_featurestore.js | 58 + ...turestore_service.import_feature_values.js | 111 + .../featurestore_service.list_entity_types.js | 109 + .../featurestore_service.list_features.js | 119 + ...featurestore_service.list_featurestores.js | 110 + .../featurestore_service.search_features.js | 129 + ...featurestore_service.update_entity_type.js | 81 + .../featurestore_service.update_feature.js | 75 + ...eaturestore_service.update_featurestore.js | 75 + ..._endpoint_service.create_index_endpoint.js | 65 + ..._endpoint_service.delete_index_endpoint.js | 61 + .../index_endpoint_service.deploy_index.js | 66 + ...dex_endpoint_service.get_index_endpoint.js | 60 + ...x_endpoint_service.list_index_endpoints.js | 95 + ..._endpoint_service.mutate_deployed_index.js | 68 + .../index_endpoint_service.undeploy_index.js | 66 + ..._endpoint_service.update_index_endpoint.js | 63 + .../v1beta1/index_service.create_index.js | 65 + .../v1beta1/index_service.delete_index.js | 61 + .../v1beta1/index_service.get_index.js | 60 + .../v1beta1/index_service.list_indexes.js | 80 + .../v1beta1/index_service.update_index.js | 64 + ...job_service.cancel_batch_prediction_job.js | 60 + .../v1beta1/job_service.cancel_custom_job.js | 60 + .../job_service.cancel_data_labeling_job.js | 60 + ...ervice.cancel_hyperparameter_tuning_job.js | 60 + ...job_service.create_batch_prediction_job.js | 64 + .../v1beta1/job_service.create_custom_job.js | 64 + .../job_service.create_data_labeling_job.js | 64 + ...ervice.create_hyperparameter_tuning_job.js | 64 + ....create_model_deployment_monitoring_job.js | 64 + ...job_service.delete_batch_prediction_job.js | 61 + .../v1beta1/job_service.delete_custom_job.js | 61 + .../job_service.delete_data_labeling_job.js | 61 + ...ervice.delete_hyperparameter_tuning_job.js | 61 + ....delete_model_deployment_monitoring_job.js | 61 + .../job_service.get_batch_prediction_job.js | 60 + .../v1beta1/job_service.get_custom_job.js | 60 + .../job_service.get_data_labeling_job.js | 60 + ...b_service.get_hyperparameter_tuning_job.js | 60 + ...ice.get_model_deployment_monitoring_job.js | 60 + .../job_service.list_batch_prediction_jobs.js | 89 + .../v1beta1/job_service.list_custom_jobs.js | 88 + .../job_service.list_data_labeling_jobs.js | 94 + ...service.list_hyperparameter_tuning_jobs.js | 88 + ...e.list_model_deployment_monitoring_jobs.js | 77 + ...e.pause_model_deployment_monitoring_job.js | 60 + ....resume_model_deployment_monitoring_job.js | 60 + ...l_deployment_monitoring_stats_anomalies.js | 100 + ....update_model_deployment_monitoring_job.js | 89 + ...ce.add_context_artifacts_and_executions.js | 74 + .../metadata_service.add_context_children.js | 64 + .../metadata_service.add_execution_events.js | 65 + .../metadata_service.create_artifact.js | 76 + .../metadata_service.create_context.js | 76 + .../metadata_service.create_execution.js | 77 + ...metadata_service.create_metadata_schema.js | 77 + .../metadata_service.create_metadata_store.js | 77 + .../metadata_service.delete_artifact.js | 67 + .../metadata_service.delete_context.js | 72 + .../metadata_service.delete_execution.js | 67 + .../metadata_service.delete_metadata_store.js | 61 + .../v1beta1/metadata_service.get_artifact.js | 60 + .../v1beta1/metadata_service.get_context.js | 60 + .../v1beta1/metadata_service.get_execution.js | 60 + .../metadata_service.get_metadata_schema.js | 60 + .../metadata_service.get_metadata_store.js | 60 + .../metadata_service.list_artifacts.js | 102 + .../v1beta1/metadata_service.list_contexts.js | 105 + .../metadata_service.list_executions.js | 102 + .../metadata_service.list_metadata_schemas.js | 81 + .../metadata_service.list_metadata_stores.js | 77 + .../metadata_service.purge_artifacts.js | 73 + .../metadata_service.purge_contexts.js | 73 + .../metadata_service.purge_executions.js | 73 + ...service.query_artifact_lineage_subgraph.js | 93 + ..._service.query_context_lineage_subgraph.js | 64 + ...vice.query_execution_inputs_and_outputs.js | 61 + .../metadata_service.update_artifact.js | 72 + .../metadata_service.update_context.js | 72 + .../metadata_service.update_execution.js | 72 + ...gration_service.batch_migrate_resources.js | 67 + ...ion_service.search_migratable_resources.js | 87 + .../v1beta1/model_service.delete_model.js | 60 + .../model_service.delete_model_version.js | 61 + .../v1beta1/model_service.export_model.js | 66 + .../v1beta1/model_service.get_model.js | 68 + .../model_service.get_model_evaluation.js | 60 + ...odel_service.get_model_evaluation_slice.js | 60 + .../model_service.import_model_evaluation.js | 64 + ...el_service.list_model_evaluation_slices.js | 82 + .../model_service.list_model_evaluations.js | 80 + .../model_service.list_model_versions.js | 86 + .../v1beta1/model_service.list_models.js | 92 + .../model_service.merge_version_aliases.js | 75 + ...odel_service.update_explanation_dataset.js | 64 + .../v1beta1/model_service.update_model.js | 81 + .../v1beta1/model_service.upload_model.js | 77 + .../pipeline_service.cancel_pipeline_job.js | 60 + ...peline_service.cancel_training_pipeline.js | 60 + .../pipeline_service.create_pipeline_job.js | 72 + ...peline_service.create_training_pipeline.js | 64 + .../pipeline_service.delete_pipeline_job.js | 61 + ...peline_service.delete_training_pipeline.js | 61 + .../pipeline_service.get_pipeline_job.js | 60 + .../pipeline_service.get_training_pipeline.js | 60 + .../pipeline_service.list_pipeline_jobs.js | 119 + ...ipeline_service.list_training_pipelines.js | 88 + .../v1beta1/prediction_service.explain.js | 96 + .../v1beta1/prediction_service.predict.js | 80 + .../v1beta1/prediction_service.raw_predict.js | 74 + ...adata.google.cloud.aiplatform.v1beta1.json | 8739 +++++++++++++++++ ...ist_pool_service.create_specialist_pool.js | 65 + ...ist_pool_service.delete_specialist_pool.js | 66 + ...ialist_pool_service.get_specialist_pool.js | 60 + ...list_pool_service.list_specialist_pools.js | 76 + ...ist_pool_service.update_specialist_pool.js | 64 + ...d_service.batch_create_tensorboard_runs.js | 68 + ...ce.batch_create_tensorboard_time_series.js | 70 + ...batch_read_tensorboard_time_series_data.js | 68 + .../tensorboard_service.create_tensorboard.js | 65 + ...d_service.create_tensorboard_experiment.js | 72 + ...sorboard_service.create_tensorboard_run.js | 73 + ..._service.create_tensorboard_time_series.js | 73 + .../tensorboard_service.delete_tensorboard.js | 61 + ...d_service.delete_tensorboard_experiment.js | 61 + ...sorboard_service.delete_tensorboard_run.js | 61 + ..._service.delete_tensorboard_time_series.js | 61 + ...ice.export_tensorboard_time_series_data.js | 87 + .../tensorboard_service.get_tensorboard.js | 60 + ...oard_service.get_tensorboard_experiment.js | 60 + ...tensorboard_service.get_tensorboard_run.js | 60 + ...ard_service.get_tensorboard_time_series.js | 60 + ...rd_service.list_tensorboard_experiments.js | 90 + ...nsorboard_service.list_tensorboard_runs.js | 90 + ...rd_service.list_tensorboard_time_series.js | 90 + .../tensorboard_service.list_tensorboards.js | 90 + ...oard_service.read_tensorboard_blob_data.js | 66 + ...rvice.read_tensorboard_time_series_data.js | 70 + .../tensorboard_service.update_tensorboard.js | 71 + ...d_service.update_tensorboard_experiment.js | 70 + ...sorboard_service.update_tensorboard_run.js | 70 + ..._service.update_tensorboard_time_series.js | 71 + ...rvice.write_tensorboard_experiment_data.js | 65 + ...oard_service.write_tensorboard_run_data.js | 69 + .../vizier_service.add_trial_measurement.js | 65 + ...ervice.check_trial_early_stopping_state.js | 61 + .../v1beta1/vizier_service.complete_trial.js | 76 + .../v1beta1/vizier_service.create_study.js | 64 + .../v1beta1/vizier_service.create_trial.js | 64 + .../v1beta1/vizier_service.delete_study.js | 59 + .../v1beta1/vizier_service.delete_trial.js | 60 + .../v1beta1/vizier_service.get_study.js | 59 + .../v1beta1/vizier_service.get_trial.js | 60 + .../vizier_service.list_optimal_trials.js | 58 + .../v1beta1/vizier_service.list_studies.js | 71 + .../v1beta1/vizier_service.list_trials.js | 71 + .../v1beta1/vizier_service.lookup_study.js | 64 + .../v1beta1/vizier_service.stop_trial.js | 60 + .../v1beta1/vizier_service.suggest_trials.js | 73 + owl-bot-staging/v1beta1/src/index.ts | 53 + .../src/v1beta1/dataset_service_client.ts | 3594 +++++++ .../dataset_service_client_config.json | 76 + .../v1beta1/dataset_service_proto_list.json | 117 + .../src/v1beta1/endpoint_service_client.ts | 3134 ++++++ .../endpoint_service_client_config.json | 61 + .../v1beta1/endpoint_service_proto_list.json | 117 + ...turestore_online_serving_service_client.ts | 2386 +++++ ..._online_serving_service_client_config.json | 36 + ...ore_online_serving_service_proto_list.json | 117 + .../v1beta1/featurestore_service_client.ts | 5310 ++++++++++ .../featurestore_service_client_config.json | 125 + .../featurestore_service_proto_list.json | 117 + .../v1beta1/src/v1beta1/gapic_metadata.json | 2243 +++++ owl-bot-staging/v1beta1/src/v1beta1/index.ts | 33 + .../v1beta1/index_endpoint_service_client.ts | 3218 ++++++ .../index_endpoint_service_client_config.json | 65 + .../index_endpoint_service_proto_list.json | 117 + .../src/v1beta1/index_service_client.ts | 2884 ++++++ .../v1beta1/index_service_client_config.json | 51 + .../src/v1beta1/index_service_proto_list.json | 117 + .../v1beta1/src/v1beta1/job_service_client.ts | 5577 +++++++++++ .../v1beta1/job_service_client_config.json | 166 + .../src/v1beta1/job_service_proto_list.json | 117 + .../src/v1beta1/metadata_service_client.ts | 5917 +++++++++++ .../metadata_service_client_config.json | 175 + .../v1beta1/metadata_service_proto_list.json | 117 + .../src/v1beta1/migration_service_client.ts | 2642 +++++ .../migration_service_client_config.json | 34 + .../v1beta1/migration_service_proto_list.json | 117 + .../src/v1beta1/model_service_client.ts | 4184 ++++++++ .../v1beta1/model_service_client_config.json | 96 + .../src/v1beta1/model_service_proto_list.json | 117 + .../src/v1beta1/pipeline_service_client.ts | 3550 +++++++ .../pipeline_service_client_config.json | 71 + .../v1beta1/pipeline_service_proto_list.json | 117 + .../src/v1beta1/prediction_service_client.ts | 2532 +++++ .../prediction_service_client_config.json | 40 + .../prediction_service_proto_list.json | 117 + .../v1beta1/specialist_pool_service_client.ts | 2883 ++++++ ...specialist_pool_service_client_config.json | 51 + .../specialist_pool_service_proto_list.json | 117 + .../src/v1beta1/tensorboard_service_client.ts | 5387 ++++++++++ .../tensorboard_service_client_config.json | 138 + .../tensorboard_service_proto_list.json | 117 + .../src/v1beta1/vizier_service_client.ts | 3713 +++++++ .../v1beta1/vizier_service_client_config.json | 101 + .../v1beta1/vizier_service_proto_list.json | 117 + .../system-test/fixtures/sample/src/index.js | 41 + .../system-test/fixtures/sample/src/index.ts | 116 + .../v1beta1/system-test/install.ts | 49 + .../test/gapic_dataset_service_v1beta1.ts | 3419 +++++++ .../test/gapic_endpoint_service_v1beta1.ts | 2876 ++++++ ...urestore_online_serving_service_v1beta1.ts | 1978 ++++ .../gapic_featurestore_service_v1beta1.ts | 4882 +++++++++ .../gapic_index_endpoint_service_v1beta1.ts | 3020 ++++++ .../test/gapic_index_service_v1beta1.ts | 2635 +++++ .../v1beta1/test/gapic_job_service_v1beta1.ts | 5637 +++++++++++ .../test/gapic_metadata_service_v1beta1.ts | 5934 +++++++++++ .../test/gapic_migration_service_v1beta1.ts | 2246 +++++ .../test/gapic_model_service_v1beta1.ts | 4077 ++++++++ .../test/gapic_pipeline_service_v1beta1.ts | 3195 ++++++ .../test/gapic_prediction_service_v1beta1.ts | 2069 ++++ .../gapic_specialist_pool_service_v1beta1.ts | 2635 +++++ .../test/gapic_tensorboard_service_v1beta1.ts | 5557 +++++++++++ .../test/gapic_vizier_service_v1beta1.ts | 3680 +++++++ owl-bot-staging/v1beta1/tsconfig.json | 19 + owl-bot-staging/v1beta1/webpack.config.js | 64 + 753 files changed, 313936 insertions(+) create mode 100644 owl-bot-staging/v1/.eslintignore create mode 100644 owl-bot-staging/v1/.eslintrc.json create mode 100644 owl-bot-staging/v1/.gitignore create mode 100644 owl-bot-staging/v1/.jsdoc.js create mode 100644 owl-bot-staging/v1/.mocharc.js create mode 100644 owl-bot-staging/v1/.prettierrc.js create mode 100644 owl-bot-staging/v1/README.md create mode 100644 owl-bot-staging/v1/linkinator.config.json create mode 100644 owl-bot-staging/v1/package.json create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/accelerator_type.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/annotation.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/annotation_spec.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/artifact.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/completion_stats.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/context.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/custom_job.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/data_item.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/data_labeling_job.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/dataset.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/dataset_service.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/deployed_index_ref.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/deployed_model_ref.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/encryption_spec.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/endpoint.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/endpoint_service.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/entity_type.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/env_var.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/event.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/execution.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/explanation.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/explanation_metadata.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature_selector.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_service.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_endpoint.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_endpoint_service.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_service.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/io.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/job_service.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/job_state.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/lineage_subgraph.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/machine_resources.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_schema.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_service.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_store.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/migratable_resource.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/migration_service.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_evaluation.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_monitoring.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_service.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/operation.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_job.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_service.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_state.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/prediction_service.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/specialist_pool.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/specialist_pool_service.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/study.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_data.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_run.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_service.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/training_pipeline.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/types.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/user_action_reference.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/value.proto create mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/vizier_service.proto create mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.create_dataset.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.delete_dataset.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.export_data.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.get_annotation_spec.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.get_dataset.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.import_data.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.list_annotations.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.list_data_items.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.list_datasets.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.update_dataset.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/endpoint_service.create_endpoint.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/endpoint_service.delete_endpoint.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/endpoint_service.deploy_model.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/endpoint_service.get_endpoint.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/endpoint_service.list_endpoints.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/endpoint_service.undeploy_model.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/endpoint_service.update_endpoint.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_online_serving_service.read_feature_values.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_online_serving_service.streaming_read_feature_values.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.batch_create_features.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.batch_read_feature_values.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.create_entity_type.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.create_feature.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.create_featurestore.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.delete_entity_type.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.delete_feature.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.delete_featurestore.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.export_feature_values.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.get_entity_type.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.get_feature.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.get_featurestore.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.import_feature_values.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.list_entity_types.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.list_features.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.list_featurestores.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.search_features.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.update_entity_type.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.update_feature.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.update_featurestore.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/index_endpoint_service.create_index_endpoint.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/index_endpoint_service.delete_index_endpoint.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/index_endpoint_service.deploy_index.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/index_endpoint_service.get_index_endpoint.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/index_endpoint_service.list_index_endpoints.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/index_endpoint_service.mutate_deployed_index.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/index_endpoint_service.undeploy_index.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/index_endpoint_service.update_index_endpoint.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/index_service.create_index.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/index_service.delete_index.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/index_service.get_index.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/index_service.list_indexes.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/index_service.update_index.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.cancel_batch_prediction_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.cancel_custom_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.cancel_data_labeling_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.cancel_hyperparameter_tuning_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.create_batch_prediction_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.create_custom_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.create_data_labeling_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.create_hyperparameter_tuning_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.create_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.delete_batch_prediction_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.delete_custom_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.delete_data_labeling_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.delete_hyperparameter_tuning_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.delete_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.get_batch_prediction_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.get_custom_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.get_data_labeling_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.get_hyperparameter_tuning_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.get_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.list_batch_prediction_jobs.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.list_custom_jobs.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.list_data_labeling_jobs.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.list_hyperparameter_tuning_jobs.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.list_model_deployment_monitoring_jobs.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.pause_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.resume_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.search_model_deployment_monitoring_stats_anomalies.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.update_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.add_context_artifacts_and_executions.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.add_context_children.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.add_execution_events.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.create_artifact.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.create_context.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.create_execution.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.create_metadata_schema.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.create_metadata_store.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.delete_artifact.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.delete_context.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.delete_execution.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.delete_metadata_store.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.get_artifact.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.get_context.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.get_execution.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.get_metadata_schema.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.get_metadata_store.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.list_artifacts.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.list_contexts.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.list_executions.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.list_metadata_schemas.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.list_metadata_stores.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.purge_artifacts.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.purge_contexts.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.purge_executions.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.query_artifact_lineage_subgraph.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.query_context_lineage_subgraph.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.query_execution_inputs_and_outputs.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.update_artifact.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.update_context.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.update_execution.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/migration_service.batch_migrate_resources.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/migration_service.search_migratable_resources.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.delete_model.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.export_model.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.get_model.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.get_model_evaluation.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.get_model_evaluation_slice.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.import_model_evaluation.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.list_model_evaluation_slices.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.list_model_evaluations.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.list_models.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.update_model.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.upload_model.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.cancel_pipeline_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.cancel_training_pipeline.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.create_pipeline_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.create_training_pipeline.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.delete_pipeline_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.delete_training_pipeline.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.get_pipeline_job.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.get_training_pipeline.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.list_pipeline_jobs.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.list_training_pipelines.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/prediction_service.explain.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/prediction_service.predict.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/prediction_service.raw_predict.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json create mode 100644 owl-bot-staging/v1/samples/generated/v1/specialist_pool_service.create_specialist_pool.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/specialist_pool_service.delete_specialist_pool.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/specialist_pool_service.get_specialist_pool.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/specialist_pool_service.list_specialist_pools.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/specialist_pool_service.update_specialist_pool.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.batch_create_tensorboard_runs.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.batch_create_tensorboard_time_series.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.batch_read_tensorboard_time_series_data.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.create_tensorboard.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.create_tensorboard_experiment.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.create_tensorboard_run.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.create_tensorboard_time_series.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.delete_tensorboard.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.delete_tensorboard_experiment.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.delete_tensorboard_run.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.delete_tensorboard_time_series.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.export_tensorboard_time_series_data.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.get_tensorboard.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.get_tensorboard_experiment.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.get_tensorboard_run.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.get_tensorboard_time_series.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.list_tensorboard_experiments.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.list_tensorboard_runs.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.list_tensorboard_time_series.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.list_tensorboards.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.read_tensorboard_blob_data.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.read_tensorboard_time_series_data.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.update_tensorboard.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.update_tensorboard_experiment.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.update_tensorboard_run.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.update_tensorboard_time_series.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.write_tensorboard_experiment_data.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.write_tensorboard_run_data.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.add_trial_measurement.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.check_trial_early_stopping_state.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.complete_trial.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.create_study.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.create_trial.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.delete_study.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.delete_trial.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.get_study.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.get_trial.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.list_optimal_trials.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.list_studies.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.list_trials.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.lookup_study.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.stop_trial.js create mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.suggest_trials.js create mode 100644 owl-bot-staging/v1/src/index.ts create mode 100644 owl-bot-staging/v1/src/v1/dataset_service_client.ts create mode 100644 owl-bot-staging/v1/src/v1/dataset_service_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/dataset_service_proto_list.json create mode 100644 owl-bot-staging/v1/src/v1/endpoint_service_client.ts create mode 100644 owl-bot-staging/v1/src/v1/endpoint_service_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/endpoint_service_proto_list.json create mode 100644 owl-bot-staging/v1/src/v1/featurestore_online_serving_service_client.ts create mode 100644 owl-bot-staging/v1/src/v1/featurestore_online_serving_service_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/featurestore_online_serving_service_proto_list.json create mode 100644 owl-bot-staging/v1/src/v1/featurestore_service_client.ts create mode 100644 owl-bot-staging/v1/src/v1/featurestore_service_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/featurestore_service_proto_list.json create mode 100644 owl-bot-staging/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/v1/src/v1/index.ts create mode 100644 owl-bot-staging/v1/src/v1/index_endpoint_service_client.ts create mode 100644 owl-bot-staging/v1/src/v1/index_endpoint_service_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/index_endpoint_service_proto_list.json create mode 100644 owl-bot-staging/v1/src/v1/index_service_client.ts create mode 100644 owl-bot-staging/v1/src/v1/index_service_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/index_service_proto_list.json create mode 100644 owl-bot-staging/v1/src/v1/job_service_client.ts create mode 100644 owl-bot-staging/v1/src/v1/job_service_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/job_service_proto_list.json create mode 100644 owl-bot-staging/v1/src/v1/metadata_service_client.ts create mode 100644 owl-bot-staging/v1/src/v1/metadata_service_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/metadata_service_proto_list.json create mode 100644 owl-bot-staging/v1/src/v1/migration_service_client.ts create mode 100644 owl-bot-staging/v1/src/v1/migration_service_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/migration_service_proto_list.json create mode 100644 owl-bot-staging/v1/src/v1/model_service_client.ts create mode 100644 owl-bot-staging/v1/src/v1/model_service_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/model_service_proto_list.json create mode 100644 owl-bot-staging/v1/src/v1/pipeline_service_client.ts create mode 100644 owl-bot-staging/v1/src/v1/pipeline_service_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/pipeline_service_proto_list.json create mode 100644 owl-bot-staging/v1/src/v1/prediction_service_client.ts create mode 100644 owl-bot-staging/v1/src/v1/prediction_service_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/prediction_service_proto_list.json create mode 100644 owl-bot-staging/v1/src/v1/specialist_pool_service_client.ts create mode 100644 owl-bot-staging/v1/src/v1/specialist_pool_service_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/specialist_pool_service_proto_list.json create mode 100644 owl-bot-staging/v1/src/v1/tensorboard_service_client.ts create mode 100644 owl-bot-staging/v1/src/v1/tensorboard_service_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/tensorboard_service_proto_list.json create mode 100644 owl-bot-staging/v1/src/v1/vizier_service_client.ts create mode 100644 owl-bot-staging/v1/src/v1/vizier_service_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/vizier_service_proto_list.json create mode 100644 owl-bot-staging/v1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/v1/system-test/install.ts create mode 100644 owl-bot-staging/v1/test/gapic_dataset_service_v1.ts create mode 100644 owl-bot-staging/v1/test/gapic_endpoint_service_v1.ts create mode 100644 owl-bot-staging/v1/test/gapic_featurestore_online_serving_service_v1.ts create mode 100644 owl-bot-staging/v1/test/gapic_featurestore_service_v1.ts create mode 100644 owl-bot-staging/v1/test/gapic_index_endpoint_service_v1.ts create mode 100644 owl-bot-staging/v1/test/gapic_index_service_v1.ts create mode 100644 owl-bot-staging/v1/test/gapic_job_service_v1.ts create mode 100644 owl-bot-staging/v1/test/gapic_metadata_service_v1.ts create mode 100644 owl-bot-staging/v1/test/gapic_migration_service_v1.ts create mode 100644 owl-bot-staging/v1/test/gapic_model_service_v1.ts create mode 100644 owl-bot-staging/v1/test/gapic_pipeline_service_v1.ts create mode 100644 owl-bot-staging/v1/test/gapic_prediction_service_v1.ts create mode 100644 owl-bot-staging/v1/test/gapic_specialist_pool_service_v1.ts create mode 100644 owl-bot-staging/v1/test/gapic_tensorboard_service_v1.ts create mode 100644 owl-bot-staging/v1/test/gapic_vizier_service_v1.ts create mode 100644 owl-bot-staging/v1/tsconfig.json create mode 100644 owl-bot-staging/v1/webpack.config.js create mode 100644 owl-bot-staging/v1beta1/.eslintignore create mode 100644 owl-bot-staging/v1beta1/.eslintrc.json create mode 100644 owl-bot-staging/v1beta1/.gitignore create mode 100644 owl-bot-staging/v1beta1/.jsdoc.js create mode 100644 owl-bot-staging/v1beta1/.mocharc.js create mode 100644 owl-bot-staging/v1beta1/.prettierrc.js create mode 100644 owl-bot-staging/v1beta1/README.md create mode 100644 owl-bot-staging/v1beta1/linkinator.config.json create mode 100644 owl-bot-staging/v1beta1/package.json create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/artifact.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/completion_stats.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/context.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_item.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset_service.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/entity_type.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/env_var.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/event.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/execution.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_selector.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_service.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/io.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_service.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_state.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_store.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/migration_service.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/operation.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/study.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/types.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/value.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/vizier_service.proto create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.create_dataset.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.delete_dataset.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.export_data.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.get_annotation_spec.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.get_dataset.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.import_data.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.list_annotations.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.list_data_items.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.list_datasets.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.update_dataset.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/endpoint_service.create_endpoint.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/endpoint_service.delete_endpoint.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/endpoint_service.deploy_model.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/endpoint_service.get_endpoint.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/endpoint_service.list_endpoints.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/endpoint_service.undeploy_model.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/endpoint_service.update_endpoint.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_online_serving_service.read_feature_values.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_online_serving_service.streaming_read_feature_values.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.batch_create_features.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.batch_read_feature_values.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.create_entity_type.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.create_feature.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.create_featurestore.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.delete_entity_type.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.delete_feature.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.delete_featurestore.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.export_feature_values.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.get_entity_type.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.get_feature.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.get_featurestore.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.import_feature_values.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.list_entity_types.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.list_features.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.list_featurestores.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.search_features.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.update_entity_type.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.update_feature.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.update_featurestore.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_endpoint_service.create_index_endpoint.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_endpoint_service.delete_index_endpoint.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_endpoint_service.deploy_index.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_endpoint_service.get_index_endpoint.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_endpoint_service.list_index_endpoints.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_endpoint_service.mutate_deployed_index.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_endpoint_service.undeploy_index.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_endpoint_service.update_index_endpoint.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_service.create_index.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_service.delete_index.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_service.get_index.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_service.list_indexes.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_service.update_index.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.cancel_batch_prediction_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.cancel_custom_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.cancel_data_labeling_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.cancel_hyperparameter_tuning_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.create_batch_prediction_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.create_custom_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.create_data_labeling_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.create_hyperparameter_tuning_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.create_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.delete_batch_prediction_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.delete_custom_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.delete_data_labeling_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.delete_hyperparameter_tuning_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.delete_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.get_batch_prediction_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.get_custom_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.get_data_labeling_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.get_hyperparameter_tuning_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.get_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.list_batch_prediction_jobs.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.list_custom_jobs.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.list_data_labeling_jobs.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.list_hyperparameter_tuning_jobs.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.list_model_deployment_monitoring_jobs.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.pause_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.resume_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.search_model_deployment_monitoring_stats_anomalies.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.update_model_deployment_monitoring_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.add_context_artifacts_and_executions.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.add_context_children.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.add_execution_events.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.create_artifact.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.create_context.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.create_execution.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.create_metadata_schema.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.create_metadata_store.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.delete_artifact.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.delete_context.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.delete_execution.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.delete_metadata_store.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.get_artifact.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.get_context.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.get_execution.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.get_metadata_schema.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.get_metadata_store.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.list_artifacts.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.list_contexts.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.list_executions.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.list_metadata_schemas.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.list_metadata_stores.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.purge_artifacts.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.purge_contexts.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.purge_executions.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.query_artifact_lineage_subgraph.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.query_context_lineage_subgraph.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.query_execution_inputs_and_outputs.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.update_artifact.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.update_context.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.update_execution.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/migration_service.batch_migrate_resources.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/migration_service.search_migratable_resources.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.delete_model.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.delete_model_version.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.export_model.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.get_model.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.get_model_evaluation.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.get_model_evaluation_slice.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.import_model_evaluation.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.list_model_evaluation_slices.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.list_model_evaluations.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.list_model_versions.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.list_models.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.merge_version_aliases.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.update_explanation_dataset.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.update_model.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.upload_model.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.cancel_pipeline_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.cancel_training_pipeline.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.create_pipeline_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.create_training_pipeline.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.delete_pipeline_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.delete_training_pipeline.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.get_pipeline_job.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.get_training_pipeline.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.list_pipeline_jobs.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.list_training_pipelines.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/prediction_service.explain.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/prediction_service.predict.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/prediction_service.raw_predict.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/specialist_pool_service.create_specialist_pool.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/specialist_pool_service.delete_specialist_pool.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/specialist_pool_service.get_specialist_pool.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/specialist_pool_service.list_specialist_pools.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/specialist_pool_service.update_specialist_pool.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_runs.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_time_series.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.batch_read_tensorboard_time_series_data.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.create_tensorboard.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.create_tensorboard_experiment.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.create_tensorboard_run.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.create_tensorboard_time_series.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.delete_tensorboard.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_experiment.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_run.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_time_series.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.get_tensorboard.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.get_tensorboard_experiment.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.get_tensorboard_run.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.get_tensorboard_time_series.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.list_tensorboard_experiments.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.list_tensorboard_runs.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.list_tensorboard_time_series.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.list_tensorboards.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.read_tensorboard_blob_data.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.read_tensorboard_time_series_data.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.update_tensorboard.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.update_tensorboard_experiment.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.update_tensorboard_run.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.update_tensorboard_time_series.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.write_tensorboard_experiment_data.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.write_tensorboard_run_data.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.add_trial_measurement.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.check_trial_early_stopping_state.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.complete_trial.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.create_study.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.create_trial.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.delete_study.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.delete_trial.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.get_study.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.get_trial.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.list_optimal_trials.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.list_studies.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.list_trials.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.lookup_study.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.stop_trial.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.suggest_trials.js create mode 100644 owl-bot-staging/v1beta1/src/index.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/dataset_service_client.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/dataset_service_client_config.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/dataset_service_proto_list.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_client.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_client_config.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_proto_list.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client_config.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_proto_list.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_client.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_client_config.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_proto_list.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/index.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_client.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_client_config.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_proto_list.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/index_service_client.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/index_service_client_config.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/index_service_proto_list.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/job_service_client.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/job_service_client_config.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/job_service_proto_list.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/metadata_service_client.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/metadata_service_client_config.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/metadata_service_proto_list.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/migration_service_client.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/migration_service_client_config.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/migration_service_proto_list.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/model_service_client.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/model_service_client_config.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/model_service_proto_list.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_client.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_client_config.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_proto_list.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/prediction_service_client.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/prediction_service_client_config.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/prediction_service_proto_list.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_client.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_client_config.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_proto_list.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_client.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_client_config.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_proto_list.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/vizier_service_client.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/vizier_service_client_config.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/vizier_service_proto_list.json create mode 100644 owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/v1beta1/system-test/install.ts create mode 100644 owl-bot-staging/v1beta1/test/gapic_dataset_service_v1beta1.ts create mode 100644 owl-bot-staging/v1beta1/test/gapic_endpoint_service_v1beta1.ts create mode 100644 owl-bot-staging/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts create mode 100644 owl-bot-staging/v1beta1/test/gapic_featurestore_service_v1beta1.ts create mode 100644 owl-bot-staging/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts create mode 100644 owl-bot-staging/v1beta1/test/gapic_index_service_v1beta1.ts create mode 100644 owl-bot-staging/v1beta1/test/gapic_job_service_v1beta1.ts create mode 100644 owl-bot-staging/v1beta1/test/gapic_metadata_service_v1beta1.ts create mode 100644 owl-bot-staging/v1beta1/test/gapic_migration_service_v1beta1.ts create mode 100644 owl-bot-staging/v1beta1/test/gapic_model_service_v1beta1.ts create mode 100644 owl-bot-staging/v1beta1/test/gapic_pipeline_service_v1beta1.ts create mode 100644 owl-bot-staging/v1beta1/test/gapic_prediction_service_v1beta1.ts create mode 100644 owl-bot-staging/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts create mode 100644 owl-bot-staging/v1beta1/test/gapic_tensorboard_service_v1beta1.ts create mode 100644 owl-bot-staging/v1beta1/test/gapic_vizier_service_v1beta1.ts create mode 100644 owl-bot-staging/v1beta1/tsconfig.json create mode 100644 owl-bot-staging/v1beta1/webpack.config.js diff --git a/owl-bot-staging/v1/.eslintignore b/owl-bot-staging/v1/.eslintignore new file mode 100644 index 00000000..cfc348ec --- /dev/null +++ b/owl-bot-staging/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/v1/.eslintrc.json b/owl-bot-staging/v1/.eslintrc.json new file mode 100644 index 00000000..78215349 --- /dev/null +++ b/owl-bot-staging/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/v1/.gitignore b/owl-bot-staging/v1/.gitignore new file mode 100644 index 00000000..5d32b237 --- /dev/null +++ b/owl-bot-staging/v1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/v1/.jsdoc.js b/owl-bot-staging/v1/.jsdoc.js new file mode 100644 index 00000000..a5ec80d7 --- /dev/null +++ b/owl-bot-staging/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/aiplatform', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/v1/.mocharc.js b/owl-bot-staging/v1/.mocharc.js new file mode 100644 index 00000000..481c522b --- /dev/null +++ b/owl-bot-staging/v1/.mocharc.js @@ -0,0 +1,33 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/v1/.prettierrc.js b/owl-bot-staging/v1/.prettierrc.js new file mode 100644 index 00000000..494e1478 --- /dev/null +++ b/owl-bot-staging/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/v1/README.md b/owl-bot-staging/v1/README.md new file mode 100644 index 00000000..7f057918 --- /dev/null +++ b/owl-bot-staging/v1/README.md @@ -0,0 +1 @@ +Aiplatform: Nodejs Client diff --git a/owl-bot-staging/v1/linkinator.config.json b/owl-bot-staging/v1/linkinator.config.json new file mode 100644 index 00000000..befd23c8 --- /dev/null +++ b/owl-bot-staging/v1/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/owl-bot-staging/v1/package.json b/owl-bot-staging/v1/package.json new file mode 100644 index 00000000..b8fe84e8 --- /dev/null +++ b/owl-bot-staging/v1/package.json @@ -0,0 +1,78 @@ +{ + "name": "@google-cloud/aiplatform", + "version": "0.1.0", + "description": "Aiplatform client for Node.js", + "repository": "googleapis/nodejs-aiplatform", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google aiplatform", + "aiplatform", + "dataset service", + "endpoint service", + "featurestore online serving service", + "featurestore service", + "index endpoint service", + "index service", + "job service", + "metadata service", + "migration service", + "model service", + "pipeline service", + "prediction service", + "specialist pool service", + "tensorboard service", + "vizier service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^2.29.4" + }, + "devDependencies": { + "@types/mocha": "^9.1.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.8", + "c8": "^7.11.0", + "gts": "^3.1.0", + "jsdoc": "^3.6.7", + "jsdoc-fresh": "^1.1.1", + "jsdoc-region-tag": "^1.3.1", + "linkinator": "^3.0.0", + "mocha": "^9.1.4", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^13.0.0", + "ts-loader": "^9.2.6", + "typescript": "^4.5.5", + "webpack": "^5.67.0", + "webpack-cli": "^4.9.1" + }, + "engines": { + "node": ">=v10.24.0" + } +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/accelerator_type.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/accelerator_type.proto new file mode 100644 index 00000000..726ec203 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/accelerator_type.proto @@ -0,0 +1,55 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "AcceleratorTypeProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Represents a hardware accelerator type. +enum AcceleratorType { + // Unspecified accelerator type, which means no accelerator. + ACCELERATOR_TYPE_UNSPECIFIED = 0; + + // Nvidia Tesla K80 GPU. + NVIDIA_TESLA_K80 = 1; + + // Nvidia Tesla P100 GPU. + NVIDIA_TESLA_P100 = 2; + + // Nvidia Tesla V100 GPU. + NVIDIA_TESLA_V100 = 3; + + // Nvidia Tesla P4 GPU. + NVIDIA_TESLA_P4 = 4; + + // Nvidia Tesla T4 GPU. + NVIDIA_TESLA_T4 = 5; + + // Nvidia Tesla A100 GPU. + NVIDIA_TESLA_A100 = 8; + + // TPU v2. + TPU_V2 = 6; + + // TPU v3. + TPU_V3 = 7; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/annotation.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/annotation.proto new file mode 100644 index 00000000..3a104809 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/annotation.proto @@ -0,0 +1,90 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/user_action_reference.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Used to assign specific AnnotationSpec to a particular area of a DataItem or +// the whole part of the DataItem. +message Annotation { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Annotation" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}" + }; + + // Output only. Resource name of the Annotation. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Google Cloud Storage URI points to a YAML file describing [payload][google.cloud.aiplatform.v1.Annotation.payload]. The + // schema is defined as an [OpenAPI 3.0.2 Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + // The schema files that can be used here are found in + // gs://google-cloud-aiplatform/schema/dataset/annotation/, note that the + // chosen schema must be consistent with the parent Dataset's + // [metadata][google.cloud.aiplatform.v1.Dataset.metadata_schema_uri]. + string payload_schema_uri = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The schema of the payload can be found in + // [payload_schema][google.cloud.aiplatform.v1.Annotation.payload_schema_uri]. + google.protobuf.Value payload = 3 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Timestamp when this Annotation was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Annotation was last updated. + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The source of the Annotation. + UserActionReference annotation_source = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The labels with user-defined metadata to organize your Annotations. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one Annotation(System + // labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. Following system labels exist for each Annotation: + // + // * "aiplatform.googleapis.com/annotation_set_name": + // optional, name of the UI's annotation set this Annotation belongs to. + // If not set, the Annotation is not visible in the UI. + // + // * "aiplatform.googleapis.com/payload_schema": + // output only, its value is the [payload_schema's][google.cloud.aiplatform.v1.Annotation.payload_schema_uri] + // title. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/annotation_spec.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/annotation_spec.proto new file mode 100644 index 00000000..3082e3ee --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/annotation_spec.proto @@ -0,0 +1,55 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationSpecProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Identifies a concept with which DataItems may be annotated with. +message AnnotationSpec { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/AnnotationSpec" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}" + }; + + // Output only. Resource name of the AnnotationSpec. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The user-defined name of the AnnotationSpec. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Timestamp when this AnnotationSpec was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when AnnotationSpec was last updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 5 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/artifact.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/artifact.proto new file mode 100644 index 00000000..d7ef997a --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/artifact.proto @@ -0,0 +1,109 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ArtifactProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Instance of a general artifact. +message Artifact { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Artifact" + pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}" + }; + + // Describes the state of the Artifact. + enum State { + // Unspecified state for the Artifact. + STATE_UNSPECIFIED = 0; + + // A state used by systems like Vertex AI Pipelines to indicate that the + // underlying data item represented by this Artifact is being created. + PENDING = 1; + + // A state indicating that the Artifact should exist, unless something + // external to the system deletes it. + LIVE = 2; + } + + // Output only. The resource name of the Artifact. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User provided display name of the Artifact. + // May be up to 128 Unicode characters. + string display_name = 2; + + // The uniform resource identifier of the artifact file. + // May be empty if there is no actual artifact file. + string uri = 6; + + // An eTag used to perform consistent read-modify-write updates. If not set, a + // blind "overwrite" update happens. + string etag = 9; + + // The labels with user-defined metadata to organize your Artifacts. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one Artifact (System + // labels are excluded). + map labels = 10; + + // Output only. Timestamp when this Artifact was created. + google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Artifact was last updated. + google.protobuf.Timestamp update_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The state of this Artifact. This is a property of the Artifact, and does + // not imply or capture any ongoing process. This property is managed by + // clients (such as Vertex AI Pipelines), and the system does not prescribe + // or check the validity of state transitions. + State state = 13; + + // The title of the schema describing the metadata. + // + // Schema title and version is expected to be registered in earlier Create + // Schema calls. And both are used together as unique identifiers to identify + // schemas within the local metadata store. + string schema_title = 14; + + // The version of the schema in schema_name to use. + // + // Schema title and version is expected to be registered in earlier Create + // Schema calls. And both are used together as unique identifiers to identify + // schemas within the local metadata store. + string schema_version = 15; + + // Properties of the Artifact. + // The size of this field should not exceed 200KB. + google.protobuf.Struct metadata = 16; + + // Description of the Artifact + string description = 17; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto new file mode 100644 index 00000000..fc92ff0b --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto @@ -0,0 +1,286 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/completion_stats.proto"; +import "google/cloud/aiplatform/v1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1/explanation.proto"; +import "google/cloud/aiplatform/v1/io.proto"; +import "google/cloud/aiplatform/v1/job_state.proto"; +import "google/cloud/aiplatform/v1/machine_resources.proto"; +import "google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto"; +import "google/cloud/aiplatform/v1/unmanaged_container_model.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "BatchPredictionJobProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A job that uses a [Model][google.cloud.aiplatform.v1.BatchPredictionJob.model] to produce predictions +// on multiple [input instances][google.cloud.aiplatform.v1.BatchPredictionJob.input_config]. If +// predictions for significant portion of the instances fail, the job may finish +// without attempting predictions for all remaining instances. +message BatchPredictionJob { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/BatchPredictionJob" + pattern: "projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}" + }; + + // Configures the input to [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob]. + // See [Model.supported_input_storage_formats][google.cloud.aiplatform.v1.Model.supported_input_storage_formats] for Model's supported input + // formats, and how instances should be expressed via any of them. + message InputConfig { + // Required. The source of the input. + oneof source { + // The Cloud Storage location for the input instances. + GcsSource gcs_source = 2; + + // The BigQuery location of the input table. + // The schema of the table should be in the format described by the given + // context OpenAPI Schema, if one is provided. The table may contain + // additional columns that are not described by the schema, and they will + // be ignored. + BigQuerySource bigquery_source = 3; + } + + // Required. The format in which instances are given, must be one of the + // [Model's][google.cloud.aiplatform.v1.BatchPredictionJob.model] + // [supported_input_storage_formats][google.cloud.aiplatform.v1.Model.supported_input_storage_formats]. + string instances_format = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Configures the output of [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob]. + // See [Model.supported_output_storage_formats][google.cloud.aiplatform.v1.Model.supported_output_storage_formats] for supported output + // formats, and how predictions are expressed via any of them. + message OutputConfig { + // Required. The destination of the output. + oneof destination { + // The Cloud Storage location of the directory where the output is + // to be written to. In the given directory a new directory is created. + // Its name is `prediction--`, + // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. + // Inside of it files `predictions_0001.`, + // `predictions_0002.`, ..., `predictions_N.` + // are created where `` depends on chosen + // [predictions_format][google.cloud.aiplatform.v1.BatchPredictionJob.OutputConfig.predictions_format], and N may equal 0001 and depends on the total + // number of successfully predicted instances. + // If the Model has both [instance][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri] + // and [prediction][google.cloud.aiplatform.v1.PredictSchemata.parameters_schema_uri] schemata + // defined then each such file contains predictions as per the + // [predictions_format][google.cloud.aiplatform.v1.BatchPredictionJob.OutputConfig.predictions_format]. + // If prediction for any instance failed (partially or completely), then + // an additional `errors_0001.`, `errors_0002.`,..., + // `errors_N.` files are created (N depends on total number + // of failed predictions). These files contain the failed instances, + // as per their schema, followed by an additional `error` field which as + // value has [google.rpc.Status][google.rpc.Status] + // containing only `code` and `message` fields. + GcsDestination gcs_destination = 2; + + // The BigQuery project or dataset location where the output is to be + // written to. If project is provided, a new dataset is created with name + // `prediction__` + // where is made + // BigQuery-dataset-name compatible (for example, most special characters + // become underscores), and timestamp is in + // YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In the dataset + // two tables will be created, `predictions`, and `errors`. + // If the Model has both [instance][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri] + // and [prediction][google.cloud.aiplatform.v1.PredictSchemata.parameters_schema_uri] schemata + // defined then the tables have columns as follows: The `predictions` + // table contains instances for which the prediction succeeded, it + // has columns as per a concatenation of the Model's instance and + // prediction schemata. The `errors` table contains rows for which the + // prediction has failed, it has instance columns, as per the + // instance schema, followed by a single "errors" column, which as values + // has [google.rpc.Status][google.rpc.Status] + // represented as a STRUCT, and containing only `code` and `message`. + BigQueryDestination bigquery_destination = 3; + } + + // Required. The format in which Vertex AI gives the predictions, must be one of the + // [Model's][google.cloud.aiplatform.v1.BatchPredictionJob.model] + // [supported_output_storage_formats][google.cloud.aiplatform.v1.Model.supported_output_storage_formats]. + string predictions_format = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Further describes this job's output. + // Supplements [output_config][google.cloud.aiplatform.v1.BatchPredictionJob.output_config]. + message OutputInfo { + // The output location into which prediction output is written. + oneof output_location { + // Output only. The full path of the Cloud Storage directory created, into which + // the prediction output is written. + string gcs_output_directory = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The path of the BigQuery dataset created, in + // `bq://projectId.bqDatasetId` + // format, into which the prediction output is written. + string bigquery_output_dataset = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The name of the BigQuery table created, in + // `predictions_` + // format, into which the prediction output is written. + // Can be used by UI to generate the BigQuery output path, for example. + string bigquery_output_table = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Resource name of the BatchPredictionJob. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The user-defined name of this BatchPredictionJob. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The name of the Model resoure that produces the predictions via this job, + // must share the same ancestor Location. + // Starting this job has no impact on any existing deployments of the Model + // and their resources. + // Exactly one of model and unmanaged_container_model must be set. + string model = 3 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + }]; + + // Contains model information necessary to perform batch prediction without + // requiring uploading to model registry. + // Exactly one of model and unmanaged_container_model must be set. + UnmanagedContainerModel unmanaged_container_model = 28; + + // Required. Input configuration of the instances on which predictions are performed. + // The schema of any single instance may be specified via + // the [Model's][google.cloud.aiplatform.v1.BatchPredictionJob.model] + // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + // [instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri]. + InputConfig input_config = 4 [(google.api.field_behavior) = REQUIRED]; + + // The parameters that govern the predictions. The schema of the parameters + // may be specified via the [Model's][google.cloud.aiplatform.v1.BatchPredictionJob.model] + // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + // [parameters_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.parameters_schema_uri]. + google.protobuf.Value model_parameters = 5; + + // Required. The Configuration specifying where output predictions should + // be written. + // The schema of any single prediction may be specified as a concatenation + // of [Model's][google.cloud.aiplatform.v1.BatchPredictionJob.model] + // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + // [instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri] + // and + // [prediction_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.prediction_schema_uri]. + OutputConfig output_config = 6 [(google.api.field_behavior) = REQUIRED]; + + // The config of resources used by the Model during the batch prediction. If + // the Model [supports][google.cloud.aiplatform.v1.Model.supported_deployment_resources_types] + // DEDICATED_RESOURCES this config may be provided (and the job will use these + // resources), if the Model doesn't support AUTOMATIC_RESOURCES, this config + // must be provided. + BatchDedicatedResources dedicated_resources = 7; + + // Immutable. Parameters configuring the batch behavior. Currently only applicable when + // [dedicated_resources][google.cloud.aiplatform.v1.BatchPredictionJob.dedicated_resources] are used (in other cases Vertex AI does + // the tuning itself). + ManualBatchTuningParameters manual_batch_tuning_parameters = 8 [(google.api.field_behavior) = IMMUTABLE]; + + // Generate explanation with the batch prediction results. + // + // When set to `true`, the batch prediction output changes based on the + // `predictions_format` field of the + // [BatchPredictionJob.output_config][google.cloud.aiplatform.v1.BatchPredictionJob.output_config] object: + // + // * `bigquery`: output includes a column named `explanation`. The value + // is a struct that conforms to the [Explanation][google.cloud.aiplatform.v1.Explanation] object. + // * `jsonl`: The JSON objects on each line include an additional entry + // keyed `explanation`. The value of the entry is a JSON object that + // conforms to the [Explanation][google.cloud.aiplatform.v1.Explanation] object. + // * `csv`: Generating explanations for CSV format is not supported. + // + // If this field is set to true, either the [Model.explanation_spec][google.cloud.aiplatform.v1.Model.explanation_spec] or + // [explanation_spec][google.cloud.aiplatform.v1.BatchPredictionJob.explanation_spec] must be populated. + bool generate_explanation = 23; + + // Explanation configuration for this BatchPredictionJob. Can be + // specified only if [generate_explanation][google.cloud.aiplatform.v1.BatchPredictionJob.generate_explanation] is set to `true`. + // + // This value overrides the value of [Model.explanation_spec][google.cloud.aiplatform.v1.Model.explanation_spec]. All fields of + // [explanation_spec][google.cloud.aiplatform.v1.BatchPredictionJob.explanation_spec] are optional in the request. If a field of the + // [explanation_spec][google.cloud.aiplatform.v1.BatchPredictionJob.explanation_spec] object is not populated, the corresponding field of + // the [Model.explanation_spec][google.cloud.aiplatform.v1.Model.explanation_spec] object is inherited. + ExplanationSpec explanation_spec = 25; + + // Output only. Information further describing the output of this job. + OutputInfo output_info = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The detailed state of the job. + JobState state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Only populated when the job's state is JOB_STATE_FAILED or + // JOB_STATE_CANCELLED. + google.rpc.Status error = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Partial failures encountered. + // For example, single files that can't be read. + // This field never exceeds 20 entries. + // Status details fields contain standard GCP error details. + repeated google.rpc.Status partial_failures = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Information about resources that had been consumed by this job. + // Provided in real time at best effort basis, as well as a final value + // once the job completes. + // + // Note: This field currently may be not populated for batch predictions that + // use AutoML Models. + ResourcesConsumed resources_consumed = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Statistics on completed and failed prediction instances. + CompletionStats completion_stats = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the BatchPredictionJob was created. + google.protobuf.Timestamp create_time = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the BatchPredictionJob for the first time entered the + // `JOB_STATE_RUNNING` state. + google.protobuf.Timestamp start_time = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the BatchPredictionJob entered any of the following states: + // `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. + google.protobuf.Timestamp end_time = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the BatchPredictionJob was most recently updated. + google.protobuf.Timestamp update_time = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize BatchPredictionJobs. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 19; + + // Customer-managed encryption key options for a BatchPredictionJob. If this + // is set, then all resources created by the BatchPredictionJob will be + // encrypted with the provided encryption key. + EncryptionSpec encryption_spec = 24; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/completion_stats.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/completion_stats.proto new file mode 100644 index 00000000..16310ef8 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/completion_stats.proto @@ -0,0 +1,44 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "CompletionStatsProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Success and error statistics of processing multiple entities +// (for example, DataItems or structured data rows) in batch. +message CompletionStats { + // Output only. The number of entities that had been processed successfully. + int64 successful_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of entities for which any error was encountered. + int64 failed_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. In cases when enough errors are encountered a job, pipeline, or operation + // may be failed as a whole. Below is the number of entities for which the + // processing had not been finished (either in successful or failed state). + // Set to -1 if the number is unknown (for example, the operation failed + // before the total entity number could be collected). + int64 incomplete_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/context.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/context.proto new file mode 100644 index 00000000..b602a550 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/context.proto @@ -0,0 +1,94 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ContextProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Instance of a general context. +message Context { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Context" + pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}" + }; + + // Output only. The resource name of the Context. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User provided display name of the Context. + // May be up to 128 Unicode characters. + string display_name = 2; + + // An eTag used to perform consistent read-modify-write updates. If not set, a + // blind "overwrite" update happens. + string etag = 8; + + // The labels with user-defined metadata to organize your Contexts. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one Context (System + // labels are excluded). + map labels = 9; + + // Output only. Timestamp when this Context was created. + google.protobuf.Timestamp create_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Context was last updated. + google.protobuf.Timestamp update_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A list of resource names of Contexts that are parents of this Context. + // A Context may have at most 10 parent_contexts. + repeated string parent_contexts = 12 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; + + // The title of the schema describing the metadata. + // + // Schema title and version is expected to be registered in earlier Create + // Schema calls. And both are used together as unique identifiers to identify + // schemas within the local metadata store. + string schema_title = 13; + + // The version of the schema in schema_name to use. + // + // Schema title and version is expected to be registered in earlier Create + // Schema calls. And both are used together as unique identifiers to identify + // schemas within the local metadata store. + string schema_version = 14; + + // Properties of the Context. + // The size of this field should not exceed 200KB. + google.protobuf.Struct metadata = 15; + + // Description of the Context + string description = 16; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/custom_job.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/custom_job.proto new file mode 100644 index 00000000..0c7f5afa --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/custom_job.proto @@ -0,0 +1,277 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1/env_var.proto"; +import "google/cloud/aiplatform/v1/io.proto"; +import "google/cloud/aiplatform/v1/job_state.proto"; +import "google/cloud/aiplatform/v1/machine_resources.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "CustomJobProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Represents a job that runs custom workloads such as a Docker container or a +// Python package. A CustomJob can have multiple worker pools and each worker +// pool can have its own machine and input spec. A CustomJob will be cleaned up +// once the job enters terminal state (failed or succeeded). +message CustomJob { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/CustomJob" + pattern: "projects/{project}/locations/{location}/customJobs/{custom_job}" + }; + + // Output only. Resource name of a CustomJob. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the CustomJob. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Job spec. + CustomJobSpec job_spec = 4 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The detailed state of the job. + JobState state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the CustomJob was created. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the CustomJob for the first time entered the + // `JOB_STATE_RUNNING` state. + google.protobuf.Timestamp start_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the CustomJob entered any of the following states: + // `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. + google.protobuf.Timestamp end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the CustomJob was most recently updated. + google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Only populated when job's state is `JOB_STATE_FAILED` or + // `JOB_STATE_CANCELLED`. + google.rpc.Status error = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize CustomJobs. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 11; + + // Customer-managed encryption key options for a CustomJob. If this is set, + // then all resources created by the CustomJob will be encrypted with the + // provided encryption key. + EncryptionSpec encryption_spec = 12; + + // Output only. URIs for accessing [interactive + // shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) + // (one URI for each training node). Only available if + // [job_spec.enable_web_access][google.cloud.aiplatform.v1.CustomJobSpec.enable_web_access] is `true`. + // + // The keys are names of each node in the training job; for example, + // `workerpool0-0` for the primary node, `workerpool1-0` for the first node in + // the second worker pool, and `workerpool1-1` for the second node in the + // second worker pool. + // + // The values are the URIs for each node's interactive shell. + map web_access_uris = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents the spec of a CustomJob. +// Next Id: 14 +message CustomJobSpec { + // Required. The spec of the worker pools including machine type and Docker image. + // All worker pools except the first one are optional and can be skipped by + // providing an empty value. + repeated WorkerPoolSpec worker_pool_specs = 1 [(google.api.field_behavior) = REQUIRED]; + + // Scheduling options for a CustomJob. + Scheduling scheduling = 3; + + // Specifies the service account for workload run-as account. + // Users submitting jobs must have act-as permission on this run-as account. + // If unspecified, the [Vertex AI Custom Code Service + // Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) + // for the CustomJob's project is used. + string service_account = 4; + + // The full name of the Compute Engine + // [network](/compute/docs/networks-and-firewalls#networks) to which the Job + // should be peered. For example, `projects/12345/global/networks/myVPC`. + // [Format](/compute/docs/reference/rest/v1/networks/insert) + // is of the form `projects/{project}/global/networks/{network}`. + // Where {project} is a project number, as in `12345`, and {network} is a + // network name. + // + // To specify this field, you must have already [configured VPC Network + // Peering for Vertex + // AI](https://cloud.google.com/vertex-ai/docs/general/vpc-peering). + // + // If this field is left unspecified, the job is not peered with any network. + string network = 5 [(google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + }]; + + // Optional. A list of names for the reserved ip ranges under the VPC network + // that can be used for this job. + // + // If set, we will deploy the job within the provided ip ranges. Otherwise, + // the job will be deployed to any ip ranges under the provided VPC + // network. + // + // Example: ['vertex-ai-ip-range']. + repeated string reserved_ip_ranges = 13 [(google.api.field_behavior) = OPTIONAL]; + + // The Cloud Storage location to store the output of this CustomJob or + // HyperparameterTuningJob. For HyperparameterTuningJob, + // the baseOutputDirectory of + // each child CustomJob backing a Trial is set to a subdirectory of name + // [id][google.cloud.aiplatform.v1.Trial.id] under its parent HyperparameterTuningJob's + // baseOutputDirectory. + // + // The following Vertex AI environment variables will be passed to + // containers or python modules when this field is set: + // + // For CustomJob: + // + // * AIP_MODEL_DIR = `/model/` + // * AIP_CHECKPOINT_DIR = `/checkpoints/` + // * AIP_TENSORBOARD_LOG_DIR = `/logs/` + // + // For CustomJob backing a Trial of HyperparameterTuningJob: + // + // * AIP_MODEL_DIR = `//model/` + // * AIP_CHECKPOINT_DIR = `//checkpoints/` + // * AIP_TENSORBOARD_LOG_DIR = `//logs/` + GcsDestination base_output_directory = 6; + + // Optional. The name of a Vertex AI [Tensorboard][google.cloud.aiplatform.v1.Tensorboard] resource to which this CustomJob + // will upload Tensorboard logs. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + string tensorboard = 7 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Tensorboard" + } + ]; + + // Optional. Whether you want Vertex AI to enable [interactive shell + // access](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) + // to training containers. + // + // If set to `true`, you can access interactive shells at the URIs given + // by [CustomJob.web_access_uris][google.cloud.aiplatform.v1.CustomJob.web_access_uris] or [Trial.web_access_uris][google.cloud.aiplatform.v1.Trial.web_access_uris] (within + // [HyperparameterTuningJob.trials][google.cloud.aiplatform.v1.HyperparameterTuningJob.trials]). + bool enable_web_access = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the spec of a worker pool in a job. +message WorkerPoolSpec { + // The custom task to be executed in this worker pool. + oneof task { + // The custom container task. + ContainerSpec container_spec = 6; + + // The Python packaged task. + PythonPackageSpec python_package_spec = 7; + } + + // Optional. Immutable. The specification of a single machine. + MachineSpec machine_spec = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. The number of worker replicas to use for this worker pool. + int64 replica_count = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of NFS mount spec. + repeated NfsMount nfs_mounts = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Disk spec. + DiskSpec disk_spec = 5; +} + +// The spec of a Container. +message ContainerSpec { + // Required. The URI of a container image in the Container Registry that is to be run on + // each worker replica. + string image_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // The command to be invoked when the container is started. + // It overrides the entrypoint instruction in Dockerfile when provided. + repeated string command = 2; + + // The arguments to be passed when starting the container. + repeated string args = 3; + + // Environment variables to be passed to the container. + // Maximum limit is 100. + repeated EnvVar env = 4; +} + +// The spec of a Python packaged code. +message PythonPackageSpec { + // Required. The URI of a container image in Artifact Registry that will run the + // provided Python package. Vertex AI provides a wide range of executor + // images with pre-installed packages to meet users' various use cases. See + // the list of [pre-built containers for + // training](https://cloud.google.com/vertex-ai/docs/training/pre-built-containers). + // You must use an image from this list. + string executor_image_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Google Cloud Storage location of the Python package files which are + // the training program and its dependent packages. + // The maximum number of package URIs is 100. + repeated string package_uris = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Python module name to run after installing the packages. + string python_module = 3 [(google.api.field_behavior) = REQUIRED]; + + // Command line arguments to be passed to the Python task. + repeated string args = 4; + + // Environment variables to be passed to the python module. + // Maximum limit is 100. + repeated EnvVar env = 5; +} + +// All parameters related to queuing and scheduling of custom jobs. +message Scheduling { + // The maximum job running time. The default is 7 days. + google.protobuf.Duration timeout = 1; + + // Restarts the entire CustomJob if a worker gets restarted. + // This feature can be used by distributed training jobs that are not + // resilient to workers leaving and joining a job. + bool restart_job_on_worker_restart = 3; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/data_item.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/data_item.proto new file mode 100644 index 00000000..10431e74 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/data_item.proto @@ -0,0 +1,70 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "DataItemProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A piece of data in a Dataset. Could be an image, a video, a document or plain +// text. +message DataItem { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/DataItem" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}" + }; + + // Output only. The resource name of the DataItem. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this DataItem was created. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this DataItem was last updated. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The labels with user-defined metadata to organize your DataItems. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one DataItem(System + // labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. + map labels = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The data that the DataItem represents (for example, an image or a text + // snippet). The schema of the payload is stored in the parent Dataset's + // [metadata schema's][google.cloud.aiplatform.v1.Dataset.metadata_schema_uri] dataItemSchemaUri field. + google.protobuf.Value payload = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 7 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/data_labeling_job.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/data_labeling_job.proto new file mode 100644 index 00000000..f136190b --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/data_labeling_job.proto @@ -0,0 +1,207 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1/job_state.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/type/money.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "DataLabelingJobProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// DataLabelingJob is used to trigger a human labeling job on unlabeled data +// from the following Dataset: +message DataLabelingJob { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/DataLabelingJob" + pattern: "projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}" + }; + + // Output only. Resource name of the DataLabelingJob. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The user-defined name of the DataLabelingJob. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + // Display name of a DataLabelingJob. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset resource names. Right now we only support labeling from a single + // Dataset. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}` + repeated string datasets = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + } + ]; + + // Labels to assign to annotations generated by this DataLabelingJob. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. + map annotation_labels = 12; + + // Required. Number of labelers to work on each DataItem. + int32 labeler_count = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Google Cloud Storage location of the instruction pdf. This pdf is + // shared with labelers, and provides detailed description on how to label + // DataItems in Datasets. + string instruction_uri = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. Points to a YAML file stored on Google Cloud Storage describing the + // config for a specific type of DataLabelingJob. + // The schema files that can be used here are found in the + // https://storage.googleapis.com/google-cloud-aiplatform bucket in the + // /schema/datalabelingjob/inputs/ folder. + string inputs_schema_uri = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input config parameters for the DataLabelingJob. + google.protobuf.Value inputs = 7 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The detailed state of the job. + JobState state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current labeling job progress percentage scaled in interval [0, 100], + // indicating the percentage of DataItems that has been finished. + int32 labeling_progress = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Estimated cost(in US dollars) that the DataLabelingJob has incurred to + // date. + google.type.Money current_spend = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this DataLabelingJob was created. + google.protobuf.Timestamp create_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this DataLabelingJob was updated most recently. + google.protobuf.Timestamp update_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. DataLabelingJob errors. It is only populated when job's state is + // `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`. + google.rpc.Status error = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize your DataLabelingJobs. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. Following system labels exist for each DataLabelingJob: + // + // * "aiplatform.googleapis.com/schema": output only, its value is the + // [inputs_schema][google.cloud.aiplatform.v1.DataLabelingJob.inputs_schema_uri]'s title. + map labels = 11; + + // The SpecialistPools' resource names associated with this job. + repeated string specialist_pools = 16; + + // Customer-managed encryption key spec for a DataLabelingJob. If set, this + // DataLabelingJob will be secured by this key. + // + // Note: Annotations created in the DataLabelingJob are associated with + // the EncryptionSpec of the Dataset they are exported to. + EncryptionSpec encryption_spec = 20; + + // Parameters that configure the active learning pipeline. Active learning + // will label the data incrementally via several iterations. For every + // iteration, it will select a batch of data based on the sampling strategy. + ActiveLearningConfig active_learning_config = 21; +} + +// Parameters that configure the active learning pipeline. Active learning will +// label the data incrementally by several iterations. For every iteration, it +// will select a batch of data based on the sampling strategy. +message ActiveLearningConfig { + // Required. Max human labeling DataItems. The rest part will be labeled by + // machine. + oneof human_labeling_budget { + // Max number of human labeled DataItems. + int64 max_data_item_count = 1; + + // Max percent of total DataItems for human labeling. + int32 max_data_item_percentage = 2; + } + + // Active learning data sampling config. For every active learning labeling + // iteration, it will select a batch of data based on the sampling strategy. + SampleConfig sample_config = 3; + + // CMLE training config. For every active learning labeling iteration, system + // will train a machine learning model on CMLE. The trained model will be used + // by data sampling algorithm to select DataItems. + TrainingConfig training_config = 4; +} + +// Active learning data sampling config. For every active learning labeling +// iteration, it will select a batch of data based on the sampling strategy. +message SampleConfig { + // Sample strategy decides which subset of DataItems should be selected for + // human labeling in every batch. + enum SampleStrategy { + // Default will be treated as UNCERTAINTY. + SAMPLE_STRATEGY_UNSPECIFIED = 0; + + // Sample the most uncertain data to label. + UNCERTAINTY = 1; + } + + // Decides sample size for the initial batch. initial_batch_sample_percentage + // is used by default. + oneof initial_batch_sample_size { + // The percentage of data needed to be labeled in the first batch. + int32 initial_batch_sample_percentage = 1; + } + + // Decides sample size for the following batches. + // following_batch_sample_percentage is used by default. + oneof following_batch_sample_size { + // The percentage of data needed to be labeled in each following batch + // (except the first batch). + int32 following_batch_sample_percentage = 3; + } + + // Field to choose sampling strategy. Sampling strategy will decide which data + // should be selected for human labeling in every batch. + SampleStrategy sample_strategy = 5; +} + +// CMLE training config. For every active learning labeling iteration, system +// will train a machine learning model on CMLE. The trained model will be used +// by data sampling algorithm to select DataItems. +message TrainingConfig { + // The timeout hours for the CMLE training job, expressed in milli hours + // i.e. 1,000 value in this field means 1 hour. + int64 timeout_training_milli_hours = 1; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/dataset.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/dataset.proto new file mode 100644 index 00000000..6c686986 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/dataset.proto @@ -0,0 +1,144 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1/io.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "DatasetProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A collection of DataItems and Annotations on them. +message Dataset { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Dataset" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}" + }; + + // Output only. The resource name of the Dataset. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The user-defined name of the Dataset. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the Dataset. + string description = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Points to a YAML file stored on Google Cloud Storage describing additional + // information about the Dataset. + // The schema is defined as an OpenAPI 3.0.2 Schema Object. + // The schema files that can be used here are found in + // gs://google-cloud-aiplatform/schema/dataset/metadata/. + string metadata_schema_uri = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Additional information about the Dataset. + google.protobuf.Value metadata = 8 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Timestamp when this Dataset was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Dataset was last updated. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 6; + + // The labels with user-defined metadata to organize your Datasets. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one Dataset (System + // labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. Following system labels exist for each Dataset: + // + // * "aiplatform.googleapis.com/dataset_metadata_schema": output only, its + // value is the [metadata_schema's][google.cloud.aiplatform.v1.Dataset.metadata_schema_uri] title. + map labels = 7; + + // Customer-managed encryption key spec for a Dataset. If set, this Dataset + // and all sub-resources of this Dataset will be secured by this key. + EncryptionSpec encryption_spec = 11; +} + +// Describes the location from where we import data into a Dataset, together +// with the labels that will be applied to the DataItems and the Annotations. +message ImportDataConfig { + // The source of the input. + oneof source { + // The Google Cloud Storage location for the input content. + GcsSource gcs_source = 1; + } + + // Labels that will be applied to newly imported DataItems. If an identical + // DataItem as one being imported already exists in the Dataset, then these + // labels will be appended to these of the already existing one, and if labels + // with identical key is imported before, the old label value will be + // overwritten. If two DataItems are identical in the same import data + // operation, the labels will be combined and if key collision happens in this + // case, one of the values will be picked randomly. Two DataItems are + // considered identical if their content bytes are identical (e.g. image bytes + // or pdf bytes). + // These labels will be overridden by Annotation labels specified inside index + // file referenced by [import_schema_uri][google.cloud.aiplatform.v1.ImportDataConfig.import_schema_uri], e.g. jsonl file. + map data_item_labels = 2; + + // Required. Points to a YAML file stored on Google Cloud Storage describing the import + // format. Validation will be done against the schema. The schema is defined + // as an [OpenAPI 3.0.2 Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + string import_schema_uri = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Describes what part of the Dataset is to be exported, the destination of +// the export and how to export. +message ExportDataConfig { + // The destination of the output. + oneof destination { + // The Google Cloud Storage location where the output is to be written to. + // In the given directory a new directory will be created with name: + // `export-data--` where + // timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export + // output will be written into that directory. Inside that directory, + // annotations with the same schema will be grouped into sub directories + // which are named with the corresponding annotations' schema title. Inside + // these sub directories, a schema.yaml will be created to describe the + // output format. + GcsDestination gcs_destination = 1; + } + + // A filter on Annotations of the Dataset. Only Annotations on to-be-exported + // DataItems(specified by [data_items_filter][]) that match this filter will + // be exported. The filter syntax is the same as in + // [ListAnnotations][google.cloud.aiplatform.v1.DatasetService.ListAnnotations]. + string annotations_filter = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/dataset_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/dataset_service.proto new file mode 100644 index 00000000..f9f82845 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/dataset_service.proto @@ -0,0 +1,412 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/annotation.proto"; +import "google/cloud/aiplatform/v1/annotation_spec.proto"; +import "google/cloud/aiplatform/v1/data_item.proto"; +import "google/cloud/aiplatform/v1/dataset.proto"; +import "google/cloud/aiplatform/v1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "DatasetServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// The service that handles the CRUD of Vertex AI Dataset and its child +// resources. +service DatasetService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a Dataset. + rpc CreateDataset(CreateDatasetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/datasets" + body: "dataset" + }; + option (google.api.method_signature) = "parent,dataset"; + option (google.longrunning.operation_info) = { + response_type: "Dataset" + metadata_type: "CreateDatasetOperationMetadata" + }; + } + + // Gets a Dataset. + rpc GetDataset(GetDatasetRequest) returns (Dataset) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/datasets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a Dataset. + rpc UpdateDataset(UpdateDatasetRequest) returns (Dataset) { + option (google.api.http) = { + patch: "/v1/{dataset.name=projects/*/locations/*/datasets/*}" + body: "dataset" + }; + option (google.api.method_signature) = "dataset,update_mask"; + } + + // Lists Datasets in a Location. + rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/datasets" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a Dataset. + rpc DeleteDataset(DeleteDatasetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/datasets/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Imports data into a Dataset. + rpc ImportData(ImportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/datasets/*}:import" + body: "*" + }; + option (google.api.method_signature) = "name,import_configs"; + option (google.longrunning.operation_info) = { + response_type: "ImportDataResponse" + metadata_type: "ImportDataOperationMetadata" + }; + } + + // Exports data from a Dataset. + rpc ExportData(ExportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/datasets/*}:export" + body: "*" + }; + option (google.api.method_signature) = "name,export_config"; + option (google.longrunning.operation_info) = { + response_type: "ExportDataResponse" + metadata_type: "ExportDataOperationMetadata" + }; + } + + // Lists DataItems in a Dataset. + rpc ListDataItems(ListDataItemsRequest) returns (ListDataItemsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/datasets/*}/dataItems" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets an AnnotationSpec. + rpc GetAnnotationSpec(GetAnnotationSpecRequest) returns (AnnotationSpec) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Annotations belongs to a dataitem + rpc ListAnnotations(ListAnnotationsRequest) returns (ListAnnotationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/datasets/*/dataItems/*}/annotations" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for [DatasetService.CreateDataset][google.cloud.aiplatform.v1.DatasetService.CreateDataset]. +message CreateDatasetRequest { + // Required. The resource name of the Location to create the Dataset in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The Dataset to create. + Dataset dataset = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Runtime operation information for [DatasetService.CreateDataset][google.cloud.aiplatform.v1.DatasetService.CreateDataset]. +message CreateDatasetOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [DatasetService.GetDataset][google.cloud.aiplatform.v1.DatasetService.GetDataset]. +message GetDatasetRequest { + // Required. The name of the Dataset resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + } + ]; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 2; +} + +// Request message for [DatasetService.UpdateDataset][google.cloud.aiplatform.v1.DatasetService.UpdateDataset]. +message UpdateDatasetRequest { + // Required. The Dataset which replaces the resource on the server. + Dataset dataset = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. + // For the `FieldMask` definition, see [google.protobuf.FieldMask][google.protobuf.FieldMask]. + // Updatable fields: + // + // * `display_name` + // * `description` + // * `labels` + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [DatasetService.ListDatasets][google.cloud.aiplatform.v1.DatasetService.ListDatasets]. +message ListDatasetsRequest { + // Required. The name of the Dataset's parent resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // An expression for filtering the results of the request. For field names + // both snake_case and camelCase are supported. + // + // * `display_name`: supports = and != + // * `metadata_schema_uri`: supports = and != + // * `labels` supports general map functions that is: + // * `labels.key=value` - key:value equality + // * `labels.key:* or labels:key - key existence + // * A key including a space must be quoted. `labels."a key"`. + // + // Some examples: + // * `displayName="myDisplayName"` + // * `labels.myKey="myValue"` + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; + + // A comma-separated list of fields to order by, sorted in ascending order. + // Use "desc" after a field name for descending. + // Supported fields: + // * `display_name` + // * `create_time` + // * `update_time` + string order_by = 6; +} + +// Response message for [DatasetService.ListDatasets][google.cloud.aiplatform.v1.DatasetService.ListDatasets]. +message ListDatasetsResponse { + // A list of Datasets that matches the specified filter in the request. + repeated Dataset datasets = 1; + + // The standard List next-page token. + string next_page_token = 2; +} + +// Request message for [DatasetService.DeleteDataset][google.cloud.aiplatform.v1.DatasetService.DeleteDataset]. +message DeleteDatasetRequest { + // Required. The resource name of the Dataset to delete. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + } + ]; +} + +// Request message for [DatasetService.ImportData][google.cloud.aiplatform.v1.DatasetService.ImportData]. +message ImportDataRequest { + // Required. The name of the Dataset resource. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + } + ]; + + // Required. The desired input locations. The contents of all input locations will be + // imported in one batch. + repeated ImportDataConfig import_configs = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [DatasetService.ImportData][google.cloud.aiplatform.v1.DatasetService.ImportData]. +message ImportDataResponse { + +} + +// Runtime operation information for [DatasetService.ImportData][google.cloud.aiplatform.v1.DatasetService.ImportData]. +message ImportDataOperationMetadata { + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [DatasetService.ExportData][google.cloud.aiplatform.v1.DatasetService.ExportData]. +message ExportDataRequest { + // Required. The name of the Dataset resource. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + } + ]; + + // Required. The desired output location. + ExportDataConfig export_config = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [DatasetService.ExportData][google.cloud.aiplatform.v1.DatasetService.ExportData]. +message ExportDataResponse { + // All of the files that are exported in this export operation. + repeated string exported_files = 1; +} + +// Runtime operation information for [DatasetService.ExportData][google.cloud.aiplatform.v1.DatasetService.ExportData]. +message ExportDataOperationMetadata { + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; + + // A Google Cloud Storage directory which path ends with '/'. The exported + // data is stored in the directory. + string gcs_output_directory = 2; +} + +// Request message for [DatasetService.ListDataItems][google.cloud.aiplatform.v1.DatasetService.ListDataItems]. +message ListDataItemsRequest { + // Required. The resource name of the Dataset to list DataItems from. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + } + ]; + + // The standard list filter. + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; + + // A comma-separated list of fields to order by, sorted in ascending order. + // Use "desc" after a field name for descending. + string order_by = 6; +} + +// Response message for [DatasetService.ListDataItems][google.cloud.aiplatform.v1.DatasetService.ListDataItems]. +message ListDataItemsResponse { + // A list of DataItems that matches the specified filter in the request. + repeated DataItem data_items = 1; + + // The standard List next-page token. + string next_page_token = 2; +} + +// Request message for [DatasetService.GetAnnotationSpec][google.cloud.aiplatform.v1.DatasetService.GetAnnotationSpec]. +message GetAnnotationSpecRequest { + // Required. The name of the AnnotationSpec resource. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/AnnotationSpec" + } + ]; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 2; +} + +// Request message for [DatasetService.ListAnnotations][google.cloud.aiplatform.v1.DatasetService.ListAnnotations]. +message ListAnnotationsRequest { + // Required. The resource name of the DataItem to list Annotations from. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/DataItem" + } + ]; + + // The standard list filter. + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; + + // A comma-separated list of fields to order by, sorted in ascending order. + // Use "desc" after a field name for descending. + string order_by = 6; +} + +// Response message for [DatasetService.ListAnnotations][google.cloud.aiplatform.v1.DatasetService.ListAnnotations]. +message ListAnnotationsResponse { + // A list of Annotations that matches the specified filter in the request. + repeated Annotation annotations = 1; + + // The standard List next-page token. + string next_page_token = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/deployed_index_ref.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/deployed_index_ref.proto new file mode 100644 index 00000000..35c8b30c --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/deployed_index_ref.proto @@ -0,0 +1,42 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "DeployedIndexRefProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Points to a DeployedIndex. +message DeployedIndexRef { + // Immutable. A resource name of the IndexEndpoint. + string index_endpoint = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/IndexEndpoint" + } + ]; + + // Immutable. The ID of the DeployedIndex in the above IndexEndpoint. + string deployed_index_id = 2 [(google.api.field_behavior) = IMMUTABLE]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/deployed_model_ref.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/deployed_model_ref.proto new file mode 100644 index 00000000..8a7b1eb7 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/deployed_model_ref.proto @@ -0,0 +1,42 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "DeployedModelNameProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Points to a DeployedModel. +message DeployedModelRef { + // Immutable. A resource name of an Endpoint. + string endpoint = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Immutable. An ID of a DeployedModel in the above Endpoint. + string deployed_model_id = 2 [(google.api.field_behavior) = IMMUTABLE]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/encryption_spec.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/encryption_spec.proto new file mode 100644 index 00000000..15a79901 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/encryption_spec.proto @@ -0,0 +1,38 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "EncryptionSpecProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Represents a customer-managed encryption key spec that can be applied to +// a top-level resource. +message EncryptionSpec { + // Required. The Cloud KMS resource identifier of the customer managed encryption key + // used to protect a resource. Has the form: + // `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. + // The key needs to be in the same region as where the compute resource is + // created. + string kms_key_name = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/endpoint.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/endpoint.proto new file mode 100644 index 00000000..453cc89a --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/endpoint.proto @@ -0,0 +1,252 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1/explanation.proto"; +import "google/cloud/aiplatform/v1/io.proto"; +import "google/cloud/aiplatform/v1/machine_resources.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "EndpointProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Models are deployed into it, and afterwards Endpoint is called to obtain +// predictions and explanations. +message Endpoint { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Endpoint" + pattern: "projects/{project}/locations/{location}/endpoints/{endpoint}" + }; + + // Output only. The resource name of the Endpoint. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the Endpoint. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the Endpoint. + string description = 3; + + // Output only. The models deployed in this Endpoint. + // To add or remove DeployedModels use [EndpointService.DeployModel][google.cloud.aiplatform.v1.EndpointService.DeployModel] and + // [EndpointService.UndeployModel][google.cloud.aiplatform.v1.EndpointService.UndeployModel] respectively. + repeated DeployedModel deployed_models = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A map from a DeployedModel's ID to the percentage of this Endpoint's + // traffic that should be forwarded to that DeployedModel. + // + // If a DeployedModel's ID is not listed in this map, then it receives no + // traffic. + // + // The traffic percentage values must add up to 100, or map must be empty if + // the Endpoint is to not accept any traffic at a moment. + map traffic_split = 5; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 6; + + // The labels with user-defined metadata to organize your Endpoints. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 7; + + // Output only. Timestamp when this Endpoint was created. + google.protobuf.Timestamp create_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Endpoint was last updated. + google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Customer-managed encryption key spec for an Endpoint. If set, this + // Endpoint and all sub-resources of this Endpoint will be secured by + // this key. + EncryptionSpec encryption_spec = 10; + + // The full name of the Google Compute Engine + // [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks) + // to which the Endpoint should be peered. + // + // Private services access must already be configured for the network. If left + // unspecified, the Endpoint is not peered with any network. + // + // Only one of the fields, [network][google.cloud.aiplatform.v1.Endpoint.network] or + // [enable_private_service_connect][google.cloud.aiplatform.v1.Endpoint.enable_private_service_connect], + // can be set. + // + // [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert): + // `projects/{project}/global/networks/{network}`. + // Where `{project}` is a project number, as in `12345`, and `{network}` is + // network name. + string network = 13 [(google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + }]; + + // Deprecated: If true, expose the Endpoint via private service connect. + // + // Only one of the fields, [network][google.cloud.aiplatform.v1.Endpoint.network] or + // [enable_private_service_connect][google.cloud.aiplatform.v1.Endpoint.enable_private_service_connect], + // can be set. + bool enable_private_service_connect = 17 [deprecated = true]; + + // Output only. Resource name of the Model Monitoring job associated with this Endpoint + // if monitoring is enabled by [CreateModelDeploymentMonitoringJob][]. + // Format: + // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + string model_deployment_monitoring_job = 14 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" + } + ]; + + // Configures the request-response logging for online prediction. + PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; +} + +// A deployment of a Model. Endpoints contain one or more DeployedModels. +message DeployedModel { + // The prediction (for example, the machine) resources that the DeployedModel + // uses. The user is billed for the resources (at least their minimal amount) + // even if the DeployedModel receives no traffic. + // Not all Models support all resources types. See + // [Model.supported_deployment_resources_types][google.cloud.aiplatform.v1.Model.supported_deployment_resources_types]. + oneof prediction_resources { + // A description of resources that are dedicated to the DeployedModel, and + // that need a higher degree of manual configuration. + DedicatedResources dedicated_resources = 7; + + // A description of resources that to large degree are decided by Vertex + // AI, and require only a modest additional configuration. + AutomaticResources automatic_resources = 8; + } + + // Immutable. The ID of the DeployedModel. If not provided upon deployment, Vertex AI + // will generate a value for this ID. + // + // This value should be 1-10 characters, and valid characters are /[0-9]/. + string id = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. The name of the Model that this is the deployment of. Note that the Model + // may be in a different location than the DeployedModel's Endpoint. + string model = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // The display name of the DeployedModel. If not provided upon creation, + // the Model's display_name is used. + string display_name = 3; + + // Output only. Timestamp when the DeployedModel was created. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Explanation configuration for this DeployedModel. + // + // When deploying a Model using [EndpointService.DeployModel][google.cloud.aiplatform.v1.EndpointService.DeployModel], this value + // overrides the value of [Model.explanation_spec][google.cloud.aiplatform.v1.Model.explanation_spec]. All fields of + // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] are optional in the request. If a field of + // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] is not populated, the value of the same field of + // [Model.explanation_spec][google.cloud.aiplatform.v1.Model.explanation_spec] is inherited. If the corresponding + // [Model.explanation_spec][google.cloud.aiplatform.v1.Model.explanation_spec] is not populated, all fields of the + // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] will be used for the explanation configuration. + ExplanationSpec explanation_spec = 9; + + // The service account that the DeployedModel's container runs as. Specify the + // email address of the service account. If this service account is not + // specified, the container runs as a service account that doesn't have access + // to the resource project. + // + // Users deploying the Model must have the `iam.serviceAccounts.actAs` + // permission on this service account. + string service_account = 11; + + // For custom-trained Models and AutoML Tabular Models, the container of the + // DeployedModel instances will send `stderr` and `stdout` streams to + // Stackdriver Logging by default. Please note that the logs incur cost, + // which are subject to [Cloud Logging + // pricing](https://cloud.google.com/stackdriver/pricing). + // + // User can disable container logging by setting this flag to true. + bool disable_container_logging = 15; + + // These logs are like standard server access logs, containing + // information like timestamp and latency for each prediction request. + // + // Note that Stackdriver logs may incur a cost, especially if your project + // receives prediction requests at a high queries per second rate (QPS). + // Estimate your costs before enabling this option. + bool enable_access_logging = 13; + + // Output only. Provide paths for users to send predict/explain/health requests directly to + // the deployed model services running on Cloud via private services access. + // This field is populated if [network][google.cloud.aiplatform.v1.Endpoint.network] is configured. + PrivateEndpoints private_endpoints = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// PrivateEndpoints proto is used to provide paths for users to send +// requests privately. +// To send request via private service access, use predict_http_uri, +// explain_http_uri or health_http_uri. To send request via private service +// connect, use service_attachment. +message PrivateEndpoints { + // Output only. Http(s) path to send prediction requests. + string predict_http_uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Http(s) path to send explain requests. + string explain_http_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Http(s) path to send health check requests. + string health_http_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the service attachment resource. Populated if private service + // connect is enabled. + string service_attachment = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Configuration for logging request-response to a BigQuery table. +message PredictRequestResponseLoggingConfig { + // If logging is enabled or not. + bool enabled = 1; + + // Percentage of requests to be logged, expressed as a fraction in + // range(0,1]. + double sampling_rate = 2; + + // BigQuery table for logging. + // If only given a project, a new dataset will be created with name + // `logging__` where + // will be made BigQuery-dataset-name compatible (e.g. + // most special characters will become underscores). If no table name is + // given, a new table will be created with name `request_response_logging` + BigQueryDestination bigquery_destination = 3; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/endpoint_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/endpoint_service.proto new file mode 100644 index 00000000..0108728c --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/endpoint_service.proto @@ -0,0 +1,325 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/endpoint.proto"; +import "google/cloud/aiplatform/v1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "EndpointServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A service for managing Vertex AI's Endpoints. +service EndpointService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates an Endpoint. + rpc CreateEndpoint(CreateEndpointRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/endpoints" + body: "endpoint" + }; + option (google.api.method_signature) = "parent,endpoint"; + option (google.api.method_signature) = "parent,endpoint,endpoint_id"; + option (google.longrunning.operation_info) = { + response_type: "Endpoint" + metadata_type: "CreateEndpointOperationMetadata" + }; + } + + // Gets an Endpoint. + rpc GetEndpoint(GetEndpointRequest) returns (Endpoint) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/endpoints/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Endpoints in a Location. + rpc ListEndpoints(ListEndpointsRequest) returns (ListEndpointsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/endpoints" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates an Endpoint. + rpc UpdateEndpoint(UpdateEndpointRequest) returns (Endpoint) { + option (google.api.http) = { + patch: "/v1/{endpoint.name=projects/*/locations/*/endpoints/*}" + body: "endpoint" + }; + option (google.api.method_signature) = "endpoint,update_mask"; + } + + // Deletes an Endpoint. + rpc DeleteEndpoint(DeleteEndpointRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/endpoints/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Deploys a Model into this Endpoint, creating a DeployedModel within it. + rpc DeployModel(DeployModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:deployModel" + body: "*" + }; + option (google.api.method_signature) = "endpoint,deployed_model,traffic_split"; + option (google.longrunning.operation_info) = { + response_type: "DeployModelResponse" + metadata_type: "DeployModelOperationMetadata" + }; + } + + // Undeploys a Model from an Endpoint, removing a DeployedModel from it, and + // freeing all resources it's using. + rpc UndeployModel(UndeployModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:undeployModel" + body: "*" + }; + option (google.api.method_signature) = "endpoint,deployed_model_id,traffic_split"; + option (google.longrunning.operation_info) = { + response_type: "UndeployModelResponse" + metadata_type: "UndeployModelOperationMetadata" + }; + } +} + +// Request message for [EndpointService.CreateEndpoint][google.cloud.aiplatform.v1.EndpointService.CreateEndpoint]. +message CreateEndpointRequest { + // Required. The resource name of the Location to create the Endpoint in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The Endpoint to create. + Endpoint endpoint = 2 [(google.api.field_behavior) = REQUIRED]; + + // Immutable. The ID to use for endpoint, which will become the final + // component of the endpoint resource name. + // If not provided, Vertex AI will generate a value for this ID. + // + // This value should be 1-10 characters, and valid characters are /[0-9]/. + // When using HTTP/JSON, this field is populated based on a query string + // argument, such as `?endpoint_id=12345`. This is the fallback for fields + // that are not included in either the URI or the body. + string endpoint_id = 4 [(google.api.field_behavior) = IMMUTABLE]; +} + +// Runtime operation information for [EndpointService.CreateEndpoint][google.cloud.aiplatform.v1.EndpointService.CreateEndpoint]. +message CreateEndpointOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [EndpointService.GetEndpoint][google.cloud.aiplatform.v1.EndpointService.GetEndpoint] +message GetEndpointRequest { + // Required. The name of the Endpoint resource. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; +} + +// Request message for [EndpointService.ListEndpoints][google.cloud.aiplatform.v1.EndpointService.ListEndpoints]. +message ListEndpointsRequest { + // Required. The resource name of the Location from which to list the Endpoints. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. An expression for filtering the results of the request. For field names + // both snake_case and camelCase are supported. + // + // * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID, + // i.e. the last segment of the Endpoint's [resource name][google.cloud.aiplatform.v1.Endpoint.name]. + // * `display_name` supports = and, != + // * `labels` supports general map functions that is: + // * `labels.key=value` - key:value equality + // * `labels.key:* or labels:key - key existence + // * A key including a space must be quoted. `labels."a key"`. + // + // Some examples: + // * `endpoint=1` + // * `displayName="myDisplayName"` + // * `labels.myKey="myValue"` + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page size. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page token. + // Typically obtained via + // [ListEndpointsResponse.next_page_token][google.cloud.aiplatform.v1.ListEndpointsResponse.next_page_token] of the previous + // [EndpointService.ListEndpoints][google.cloud.aiplatform.v1.EndpointService.ListEndpoints] call. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5 [(google.api.field_behavior) = OPTIONAL]; + + // A comma-separated list of fields to order by, sorted in ascending order. + // Use "desc" after a field name for descending. + // Supported fields: + // * `display_name` + // * `create_time` + // * `update_time` + // + // Example: `display_name, create_time desc`. + string order_by = 6; +} + +// Response message for [EndpointService.ListEndpoints][google.cloud.aiplatform.v1.EndpointService.ListEndpoints]. +message ListEndpointsResponse { + // List of Endpoints in the requested page. + repeated Endpoint endpoints = 1; + + // A token to retrieve the next page of results. + // Pass to [ListEndpointsRequest.page_token][google.cloud.aiplatform.v1.ListEndpointsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint]. +message UpdateEndpointRequest { + // Required. The Endpoint which replaces the resource on the server. + Endpoint endpoint = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. See [google.protobuf.FieldMask][google.protobuf.FieldMask]. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [EndpointService.DeleteEndpoint][google.cloud.aiplatform.v1.EndpointService.DeleteEndpoint]. +message DeleteEndpointRequest { + // Required. The name of the Endpoint resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; +} + +// Request message for [EndpointService.DeployModel][google.cloud.aiplatform.v1.EndpointService.DeployModel]. +message DeployModelRequest { + // Required. The name of the Endpoint resource into which to deploy a Model. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Required. The DeployedModel to be created within the Endpoint. Note that + // [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] must be updated for the DeployedModel to start + // receiving traffic, either as part of this call, or via + // [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint]. + DeployedModel deployed_model = 2 [(google.api.field_behavior) = REQUIRED]; + + // A map from a DeployedModel's ID to the percentage of this Endpoint's + // traffic that should be forwarded to that DeployedModel. + // + // If this field is non-empty, then the Endpoint's + // [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be overwritten with it. + // To refer to the ID of the just being deployed Model, a "0" should be used, + // and the actual ID of the new DeployedModel will be filled in its place by + // this method. The traffic percentage values must add up to 100. + // + // If this field is empty, then the Endpoint's + // [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] is not updated. + map traffic_split = 3; +} + +// Response message for [EndpointService.DeployModel][google.cloud.aiplatform.v1.EndpointService.DeployModel]. +message DeployModelResponse { + // The DeployedModel that had been deployed in the Endpoint. + DeployedModel deployed_model = 1; +} + +// Runtime operation information for [EndpointService.DeployModel][google.cloud.aiplatform.v1.EndpointService.DeployModel]. +message DeployModelOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [EndpointService.UndeployModel][google.cloud.aiplatform.v1.EndpointService.UndeployModel]. +message UndeployModelRequest { + // Required. The name of the Endpoint resource from which to undeploy a Model. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Required. The ID of the DeployedModel to be undeployed from the Endpoint. + string deployed_model_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // If this field is provided, then the Endpoint's + // [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be overwritten with it. If + // last DeployedModel is being undeployed from the Endpoint, the + // [Endpoint.traffic_split] will always end up empty when this call returns. + // A DeployedModel will be successfully undeployed only if it doesn't have + // any traffic assigned to it when this method executes, or if this field + // unassigns any traffic to it. + map traffic_split = 3; +} + +// Response message for [EndpointService.UndeployModel][google.cloud.aiplatform.v1.EndpointService.UndeployModel]. +message UndeployModelResponse { + +} + +// Runtime operation information for [EndpointService.UndeployModel][google.cloud.aiplatform.v1.EndpointService.UndeployModel]. +message UndeployModelOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/entity_type.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/entity_type.proto new file mode 100644 index 00000000..073b5339 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/entity_type.proto @@ -0,0 +1,86 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/featurestore_monitoring.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "EntityTypeProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// An entity type is a type of object in a system that needs to be modeled and +// have stored information about. For example, driver is an entity type, and +// driver0 is an instance of an entity type driver. +message EntityType { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/EntityType" + pattern: "projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}" + }; + + // Immutable. Name of the EntityType. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + // + // The last part entity_type is assigned by the client. The entity_type can be + // up to 64 characters long and can consist only of ASCII Latin letters A-Z + // and a-z and underscore(_), and ASCII digits 0-9 starting with a letter. The + // value will be unique given a featurestore. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Optional. Description of the EntityType. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when this EntityType was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this EntityType was most recently updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The labels with user-defined metadata to organize your EntityTypes. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + // No more than 64 user labels can be associated with one EntityType (System + // labels are excluded)." + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Used to perform a consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The default monitoring configuration for all Features with value type + // ([Feature.ValueType][google.cloud.aiplatform.v1.Feature.ValueType]) BOOL, STRING, DOUBLE or INT64 under this + // EntityType. + // + // If this is populated with + // [FeaturestoreMonitoringConfig.monitoring_interval] specified, snapshot + // analysis monitoring is enabled. Otherwise, snapshot analysis monitoring is + // disabled. + FeaturestoreMonitoringConfig monitoring_config = 8 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/env_var.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/env_var.proto new file mode 100644 index 00000000..34722e36 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/env_var.proto @@ -0,0 +1,42 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "EnvVarProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Represents an environment variable present in a Container or Python Module. +message EnvVar { + // Required. Name of the environment variable. Must be a valid C identifier. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Variables that reference a $(VAR_NAME) are expanded + // using the previous defined environment variables in the container and + // any service environment variables. If a variable cannot be resolved, + // the reference in the input string will be unchanged. The $(VAR_NAME) + // syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped + // references will never be expanded, regardless of whether the variable + // exists or not. + string value = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/event.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/event.proto new file mode 100644 index 00000000..f9f925db --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/event.proto @@ -0,0 +1,80 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "EventProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// An edge describing the relationship between an Artifact and an Execution in +// a lineage graph. +message Event { + // Describes whether an Event's Artifact is the Execution's input or output. + enum Type { + // Unspecified whether input or output of the Execution. + TYPE_UNSPECIFIED = 0; + + // An input of the Execution. + INPUT = 1; + + // An output of the Execution. + OUTPUT = 2; + } + + // Required. The relative resource name of the Artifact in the Event. + string artifact = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Artifact" + } + ]; + + // Output only. The relative resource name of the Execution in the Event. + string execution = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Execution" + } + ]; + + // Output only. Time the Event occurred. + google.protobuf.Timestamp event_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The type of the Event. + Type type = 4 [(google.api.field_behavior) = REQUIRED]; + + // The labels with user-defined metadata to annotate Events. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one Event (System + // labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. + map labels = 5; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/execution.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/execution.proto new file mode 100644 index 00000000..a2b7c2b9 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/execution.proto @@ -0,0 +1,115 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ExecutionProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Instance of a general execution. +message Execution { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Execution" + pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}" + }; + + // Describes the state of the Execution. + enum State { + // Unspecified Execution state + STATE_UNSPECIFIED = 0; + + // The Execution is new + NEW = 1; + + // The Execution is running + RUNNING = 2; + + // The Execution has finished running + COMPLETE = 3; + + // The Execution has failed + FAILED = 4; + + // The Execution completed through Cache hit. + CACHED = 5; + + // The Execution was cancelled. + CANCELLED = 6; + } + + // Output only. The resource name of the Execution. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User provided display name of the Execution. + // May be up to 128 Unicode characters. + string display_name = 2; + + // The state of this Execution. This is a property of the Execution, and does + // not imply or capture any ongoing process. This property is managed by + // clients (such as Vertex AI Pipelines) and the system does not prescribe + // or check the validity of state transitions. + State state = 6; + + // An eTag used to perform consistent read-modify-write updates. If not set, a + // blind "overwrite" update happens. + string etag = 9; + + // The labels with user-defined metadata to organize your Executions. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one Execution (System + // labels are excluded). + map labels = 10; + + // Output only. Timestamp when this Execution was created. + google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Execution was last updated. + google.protobuf.Timestamp update_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The title of the schema describing the metadata. + // + // Schema title and version is expected to be registered in earlier Create + // Schema calls. And both are used together as unique identifiers to identify + // schemas within the local metadata store. + string schema_title = 13; + + // The version of the schema in `schema_title` to use. + // + // Schema title and version is expected to be registered in earlier Create + // Schema calls. And both are used together as unique identifiers to identify + // schemas within the local metadata store. + string schema_version = 14; + + // Properties of the Execution. + // The size of this field should not exceed 200KB. + google.protobuf.Struct metadata = 15; + + // Description of the Execution + string description = 16; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/explanation.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/explanation.proto new file mode 100644 index 00000000..55fd8394 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/explanation.proto @@ -0,0 +1,401 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/aiplatform/v1/explanation_metadata.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ExplanationProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Explanation of a prediction (provided in [PredictResponse.predictions][google.cloud.aiplatform.v1.PredictResponse.predictions]) +// produced by the Model on a given [instance][google.cloud.aiplatform.v1.ExplainRequest.instances]. +message Explanation { + // Output only. Feature attributions grouped by predicted outputs. + // + // For Models that predict only one output, such as regression Models that + // predict only one score, there is only one attibution that explains the + // predicted output. For Models that predict multiple outputs, such as + // multiclass Models that predict multiple classes, each element explains one + // specific item. [Attribution.output_index][google.cloud.aiplatform.v1.Attribution.output_index] can be used to identify which + // output this attribution is explaining. + // + // If users set [ExplanationParameters.top_k][google.cloud.aiplatform.v1.ExplanationParameters.top_k], the attributions are sorted + // by [instance_output_value][Attributions.instance_output_value] in + // descending order. If [ExplanationParameters.output_indices][google.cloud.aiplatform.v1.ExplanationParameters.output_indices] is specified, + // the attributions are stored by [Attribution.output_index][google.cloud.aiplatform.v1.Attribution.output_index] in the same + // order as they appear in the output_indices. + repeated Attribution attributions = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Aggregated explanation metrics for a Model over a set of instances. +message ModelExplanation { + // Output only. Aggregated attributions explaining the Model's prediction outputs over the + // set of instances. The attributions are grouped by outputs. + // + // For Models that predict only one output, such as regression Models that + // predict only one score, there is only one attibution that explains the + // predicted output. For Models that predict multiple outputs, such as + // multiclass Models that predict multiple classes, each element explains one + // specific item. [Attribution.output_index][google.cloud.aiplatform.v1.Attribution.output_index] can be used to identify which + // output this attribution is explaining. + // + // The [baselineOutputValue][google.cloud.aiplatform.v1.Attribution.baseline_output_value], + // [instanceOutputValue][google.cloud.aiplatform.v1.Attribution.instance_output_value] and + // [featureAttributions][google.cloud.aiplatform.v1.Attribution.feature_attributions] fields are + // averaged over the test data. + // + // NOTE: Currently AutoML tabular classification Models produce only one + // attribution, which averages attributions over all the classes it predicts. + // [Attribution.approximation_error][google.cloud.aiplatform.v1.Attribution.approximation_error] is not populated. + repeated Attribution mean_attributions = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Attribution that explains a particular prediction output. +message Attribution { + // Output only. Model predicted output if the input instance is constructed from the + // baselines of all the features defined in [ExplanationMetadata.inputs][google.cloud.aiplatform.v1.ExplanationMetadata.inputs]. + // The field name of the output is determined by the key in + // [ExplanationMetadata.outputs][google.cloud.aiplatform.v1.ExplanationMetadata.outputs]. + // + // If the Model's predicted output has multiple dimensions (rank > 1), this is + // the value in the output located by [output_index][google.cloud.aiplatform.v1.Attribution.output_index]. + // + // If there are multiple baselines, their output values are averaged. + double baseline_output_value = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Model predicted output on the corresponding [explanation + // instance][ExplainRequest.instances]. The field name of the output is + // determined by the key in [ExplanationMetadata.outputs][google.cloud.aiplatform.v1.ExplanationMetadata.outputs]. + // + // If the Model predicted output has multiple dimensions, this is the value in + // the output located by [output_index][google.cloud.aiplatform.v1.Attribution.output_index]. + double instance_output_value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Attributions of each explained feature. Features are extracted from + // the [prediction instances][google.cloud.aiplatform.v1.ExplainRequest.instances] according to + // [explanation metadata for inputs][google.cloud.aiplatform.v1.ExplanationMetadata.inputs]. + // + // The value is a struct, whose keys are the name of the feature. The values + // are how much the feature in the [instance][google.cloud.aiplatform.v1.ExplainRequest.instances] + // contributed to the predicted result. + // + // The format of the value is determined by the feature's input format: + // + // * If the feature is a scalar value, the attribution value is a + // [floating number][google.protobuf.Value.number_value]. + // + // * If the feature is an array of scalar values, the attribution value is + // an [array][google.protobuf.Value.list_value]. + // + // * If the feature is a struct, the attribution value is a + // [struct][google.protobuf.Value.struct_value]. The keys in the + // attribution value struct are the same as the keys in the feature + // struct. The formats of the values in the attribution struct are + // determined by the formats of the values in the feature struct. + // + // The [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.aiplatform.v1.ExplanationMetadata.feature_attributions_schema_uri] field, + // pointed to by the [ExplanationSpec][google.cloud.aiplatform.v1.ExplanationSpec] field of the + // [Endpoint.deployed_models][google.cloud.aiplatform.v1.Endpoint.deployed_models] object, points to the schema file that + // describes the features and their attribution values (if it is populated). + google.protobuf.Value feature_attributions = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The index that locates the explained prediction output. + // + // If the prediction output is a scalar value, output_index is not populated. + // If the prediction output has multiple dimensions, the length of the + // output_index list is the same as the number of dimensions of the output. + // The i-th element in output_index is the element index of the i-th dimension + // of the output vector. Indices start from 0. + repeated int32 output_index = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The display name of the output identified by [output_index][google.cloud.aiplatform.v1.Attribution.output_index]. For example, + // the predicted class name by a multi-classification Model. + // + // This field is only populated iff the Model predicts display names as a + // separate field along with the explained output. The predicted display name + // must has the same shape of the explained output, and can be located using + // output_index. + string output_display_name = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Error of [feature_attributions][google.cloud.aiplatform.v1.Attribution.feature_attributions] caused by approximation used in the + // explanation method. Lower value means more precise attributions. + // + // * For Sampled Shapley + // [attribution][google.cloud.aiplatform.v1.ExplanationParameters.sampled_shapley_attribution], + // increasing [path_count][google.cloud.aiplatform.v1.SampledShapleyAttribution.path_count] might reduce + // the error. + // * For Integrated Gradients + // [attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution], + // increasing [step_count][google.cloud.aiplatform.v1.IntegratedGradientsAttribution.step_count] might + // reduce the error. + // * For [XRAI attribution][google.cloud.aiplatform.v1.ExplanationParameters.xrai_attribution], + // increasing + // [step_count][google.cloud.aiplatform.v1.XraiAttribution.step_count] might reduce the error. + // + // See [this introduction](/vertex-ai/docs/explainable-ai/overview) + // for more information. + double approximation_error = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the explain output. Specified as the key in + // [ExplanationMetadata.outputs][google.cloud.aiplatform.v1.ExplanationMetadata.outputs]. + string output_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Specification of Model explanation. +message ExplanationSpec { + // Required. Parameters that configure explaining of the Model's predictions. + ExplanationParameters parameters = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Metadata describing the Model's input and output for explanation. + ExplanationMetadata metadata = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Parameters to configure explaining for Model's predictions. +message ExplanationParameters { + oneof method { + // An attribution method that approximates Shapley values for features that + // contribute to the label being predicted. A sampling strategy is used to + // approximate the value rather than considering all subsets of features. + // Refer to this paper for model details: https://arxiv.org/abs/1306.4265. + SampledShapleyAttribution sampled_shapley_attribution = 1; + + // An attribution method that computes Aumann-Shapley values taking + // advantage of the model's fully differentiable structure. Refer to this + // paper for more details: https://arxiv.org/abs/1703.01365 + IntegratedGradientsAttribution integrated_gradients_attribution = 2; + + // An attribution method that redistributes Integrated Gradients + // attribution to segmented regions, taking advantage of the model's fully + // differentiable structure. Refer to this paper for + // more details: https://arxiv.org/abs/1906.02825 + // + // XRAI currently performs better on natural images, like a picture of a + // house or an animal. If the images are taken in artificial environments, + // like a lab or manufacturing line, or from diagnostic equipment, like + // x-rays or quality-control cameras, use Integrated Gradients instead. + XraiAttribution xrai_attribution = 3; + } + + // If populated, returns attributions for top K indices of outputs + // (defaults to 1). Only applies to Models that predicts more than one outputs + // (e,g, multi-class Models). When set to -1, returns explanations for all + // outputs. + int32 top_k = 4; + + // If populated, only returns attributions that have + // [output_index][google.cloud.aiplatform.v1.Attribution.output_index] contained in output_indices. It + // must be an ndarray of integers, with the same shape of the output it's + // explaining. + // + // 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 populated, returns the argmax + // index of the outputs. + // + // Only applicable to Models that predict multiple outputs (e,g, multi-class + // Models that predict multiple classes). + google.protobuf.ListValue output_indices = 5; +} + +// An attribution method that approximates Shapley values for features that +// contribute to the label being predicted. A sampling strategy is used to +// approximate the value rather than considering all subsets of features. +message SampledShapleyAttribution { + // Required. The number of feature permutations to consider when approximating the + // Shapley values. + // + // Valid range of its value is [1, 50], inclusively. + int32 path_count = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// An attribution method that computes the Aumann-Shapley value taking advantage +// of the model's fully differentiable structure. Refer to this paper for +// more details: https://arxiv.org/abs/1703.01365 +message IntegratedGradientsAttribution { + // Required. The number of steps for approximating the path integral. + // A good value to start is 50 and gradually increase until the + // sum to diff property is within the desired error range. + // + // Valid range of its value is [1, 100], inclusively. + int32 step_count = 1 [(google.api.field_behavior) = REQUIRED]; + + // Config for SmoothGrad approximation of gradients. + // + // When enabled, the gradients are approximated by averaging the gradients + // from noisy samples in the vicinity of the inputs. Adding + // noise can help improve the computed gradients. Refer to this paper for more + // details: https://arxiv.org/pdf/1706.03825.pdf + SmoothGradConfig smooth_grad_config = 2; + + // Config for IG with blur baseline. + // + // When enabled, a linear path from the maximally blurred image to the input + // image is created. Using a blurred baseline instead of zero (black image) is + // motivated by the BlurIG approach explained here: + // https://arxiv.org/abs/2004.03383 + BlurBaselineConfig blur_baseline_config = 3; +} + +// An explanation method that redistributes Integrated Gradients +// attributions to segmented regions, taking advantage of the model's fully +// differentiable structure. Refer to this paper for more details: +// https://arxiv.org/abs/1906.02825 +// +// Supported only by image Models. +message XraiAttribution { + // Required. The number of steps for approximating the path integral. + // A good value to start is 50 and gradually increase until the + // sum to diff property is met within the desired error range. + // + // Valid range of its value is [1, 100], inclusively. + int32 step_count = 1 [(google.api.field_behavior) = REQUIRED]; + + // Config for SmoothGrad approximation of gradients. + // + // When enabled, the gradients are approximated by averaging the gradients + // from noisy samples in the vicinity of the inputs. Adding + // noise can help improve the computed gradients. Refer to this paper for more + // details: https://arxiv.org/pdf/1706.03825.pdf + SmoothGradConfig smooth_grad_config = 2; + + // Config for XRAI with blur baseline. + // + // When enabled, a linear path from the maximally blurred image to the input + // image is created. Using a blurred baseline instead of zero (black image) is + // motivated by the BlurIG approach explained here: + // https://arxiv.org/abs/2004.03383 + BlurBaselineConfig blur_baseline_config = 3; +} + +// Config for SmoothGrad approximation of gradients. +// +// When enabled, the gradients are approximated by averaging the gradients from +// noisy samples in the vicinity of the inputs. Adding noise can help improve +// the computed gradients. Refer to this paper for more details: +// https://arxiv.org/pdf/1706.03825.pdf +message SmoothGradConfig { + // Represents the standard deviation of the gaussian kernel + // that will be used to add noise to the interpolated inputs + // prior to computing gradients. + oneof GradientNoiseSigma { + // This is a single float value and will be used to add noise to all the + // features. Use this field when all features are normalized to have the + // same distribution: scale to range [0, 1], [-1, 1] or z-scoring, where + // features are normalized to have 0-mean and 1-variance. Learn more about + // [normalization](https://developers.google.com/machine-learning/data-prep/transform/normalization). + // + // For best results the recommended value is about 10% - 20% of the standard + // deviation of the input feature. Refer to section 3.2 of the SmoothGrad + // paper: https://arxiv.org/pdf/1706.03825.pdf. Defaults to 0.1. + // + // If the distribution is different per feature, set + // [feature_noise_sigma][google.cloud.aiplatform.v1.SmoothGradConfig.feature_noise_sigma] instead + // for each feature. + float noise_sigma = 1; + + // This is similar to [noise_sigma][google.cloud.aiplatform.v1.SmoothGradConfig.noise_sigma], but + // provides additional flexibility. A separate noise sigma can be provided + // for each feature, which is useful if their distributions are different. + // No noise is added to features that are not set. If this field is unset, + // [noise_sigma][google.cloud.aiplatform.v1.SmoothGradConfig.noise_sigma] will be used for all + // features. + FeatureNoiseSigma feature_noise_sigma = 2; + } + + // The number of gradient samples to use for + // approximation. The higher this number, the more accurate the gradient + // is, but the runtime complexity increases by this factor as well. + // Valid range of its value is [1, 50]. Defaults to 3. + int32 noisy_sample_count = 3; +} + +// Noise sigma by features. Noise sigma represents the standard deviation of the +// gaussian kernel that will be used to add noise to interpolated inputs prior +// to computing gradients. +message FeatureNoiseSigma { + // Noise sigma for a single feature. + message NoiseSigmaForFeature { + // The name of the input feature for which noise sigma is provided. The + // features are defined in + // [explanation metadata inputs][google.cloud.aiplatform.v1.ExplanationMetadata.inputs]. + string name = 1; + + // This represents the standard deviation of the Gaussian kernel that will + // be used to add noise to the feature prior to computing gradients. Similar + // to [noise_sigma][google.cloud.aiplatform.v1.SmoothGradConfig.noise_sigma] but represents the + // noise added to the current feature. Defaults to 0.1. + float sigma = 2; + } + + // Noise sigma per feature. No noise is added to features that are not set. + repeated NoiseSigmaForFeature noise_sigma = 1; +} + +// Config for blur baseline. +// +// When enabled, a linear path from the maximally blurred image to the input +// image is created. Using a blurred baseline instead of zero (black image) is +// motivated by the BlurIG approach explained here: +// https://arxiv.org/abs/2004.03383 +message BlurBaselineConfig { + // The standard deviation of the blur kernel for the blurred baseline. The + // same blurring parameter is used for both the height and the width + // dimension. If not set, the method defaults to the zero (i.e. black for + // images) baseline. + float max_blur_sigma = 1; +} + +// The [ExplanationSpec][google.cloud.aiplatform.v1.ExplanationSpec] entries that can be overridden at +// [online explanation][google.cloud.aiplatform.v1.PredictionService.Explain] time. +message ExplanationSpecOverride { + // The parameters to be overridden. Note that the + // [method][google.cloud.aiplatform.v1.ExplanationParameters.method] cannot be changed. If not specified, + // no parameter is overridden. + ExplanationParameters parameters = 1; + + // The metadata to be overridden. If not specified, no metadata is overridden. + ExplanationMetadataOverride metadata = 2; +} + +// The [ExplanationMetadata][google.cloud.aiplatform.v1.ExplanationMetadata] entries that can be overridden at +// [online explanation][google.cloud.aiplatform.v1.PredictionService.Explain] time. +message ExplanationMetadataOverride { + // The [input metadata][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata] entries to be + // overridden. + message InputMetadataOverride { + // Baseline inputs for this feature. + // + // This overrides the `input_baseline` field of the + // [ExplanationMetadata.InputMetadata][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata] + // object of the corresponding feature's input metadata. If it's not + // specified, the original baselines are not overridden. + repeated google.protobuf.Value input_baselines = 1; + } + + // Required. Overrides the [input metadata][google.cloud.aiplatform.v1.ExplanationMetadata.inputs] of the features. + // The key is the name of the feature to be overridden. The keys specified + // here must exist in the input metadata to be overridden. If a feature is + // not specified here, the corresponding feature's input metadata is not + // overridden. + map inputs = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/explanation_metadata.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/explanation_metadata.proto new file mode 100644 index 00000000..f0da95fe --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/explanation_metadata.proto @@ -0,0 +1,395 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ExplanationMetadataProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Metadata describing the Model's input and output for explanation. +message ExplanationMetadata { + // Metadata of the input of a feature. + // + // Fields other than [InputMetadata.input_baselines][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.input_baselines] are applicable only + // for Models that are using Vertex AI-provided images for Tensorflow. + message InputMetadata { + // Domain details of the input feature value. Provides numeric information + // about the feature, such as its range (min, max). If the feature has been + // pre-processed, for example with z-scoring, then it provides information + // about how to recover the original feature. For example, if the input + // feature is an image and it has been pre-processed to obtain 0-mean and + // stddev = 1 values, then original_mean, and original_stddev refer to the + // mean and stddev of the original feature (e.g. image tensor) from which + // input feature (with mean = 0 and stddev = 1) was obtained. + message FeatureValueDomain { + // The minimum permissible value for this feature. + float min_value = 1; + + // The maximum permissible value for this feature. + float max_value = 2; + + // If this input feature has been normalized to a mean value of 0, + // the original_mean specifies the mean value of the domain prior to + // normalization. + float original_mean = 3; + + // If this input feature has been normalized to a standard deviation of + // 1.0, the original_stddev specifies the standard deviation of the domain + // prior to normalization. + float original_stddev = 4; + } + + // Visualization configurations for image explanation. + message Visualization { + // Type of the image visualization. Only applicable to + // [Integrated Gradients attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution]. + enum Type { + // Should not be used. + TYPE_UNSPECIFIED = 0; + + // Shows which pixel contributed to the image prediction. + PIXELS = 1; + + // Shows which region contributed to the image prediction by outlining + // the region. + OUTLINES = 2; + } + + // Whether to only highlight pixels with positive contributions, negative + // or both. Defaults to POSITIVE. + enum Polarity { + // Default value. This is the same as POSITIVE. + POLARITY_UNSPECIFIED = 0; + + // Highlights the pixels/outlines that were most influential to the + // model's prediction. + POSITIVE = 1; + + // Setting polarity to negative highlights areas that does not lead to + // the models's current prediction. + NEGATIVE = 2; + + // Shows both positive and negative attributions. + BOTH = 3; + } + + // The color scheme used for highlighting areas. + enum ColorMap { + // Should not be used. + COLOR_MAP_UNSPECIFIED = 0; + + // Positive: green. Negative: pink. + PINK_GREEN = 1; + + // Viridis color map: A perceptually uniform color mapping which is + // easier to see by those with colorblindness and progresses from yellow + // to green to blue. Positive: yellow. Negative: blue. + VIRIDIS = 2; + + // Positive: red. Negative: red. + RED = 3; + + // Positive: green. Negative: green. + GREEN = 4; + + // Positive: green. Negative: red. + RED_GREEN = 6; + + // PiYG palette. + PINK_WHITE_GREEN = 5; + } + + // How the original image is displayed in the visualization. + enum OverlayType { + // Default value. This is the same as NONE. + OVERLAY_TYPE_UNSPECIFIED = 0; + + // No overlay. + NONE = 1; + + // The attributions are shown on top of the original image. + ORIGINAL = 2; + + // The attributions are shown on top of grayscaled version of the + // original image. + GRAYSCALE = 3; + + // The attributions are used as a mask to reveal predictive parts of + // the image and hide the un-predictive parts. + MASK_BLACK = 4; + } + + // Type of the image visualization. Only applicable to + // [Integrated Gradients attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution]. + // OUTLINES shows regions of attribution, while PIXELS shows per-pixel + // attribution. Defaults to OUTLINES. + Type type = 1; + + // Whether to only highlight pixels with positive contributions, negative + // or both. Defaults to POSITIVE. + Polarity polarity = 2; + + // The color scheme used for the highlighted areas. + // + // Defaults to PINK_GREEN for + // [Integrated Gradients attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution], + // which shows positive attributions in green and negative in pink. + // + // Defaults to VIRIDIS for + // [XRAI attribution][google.cloud.aiplatform.v1.ExplanationParameters.xrai_attribution], which + // highlights the most influential regions in yellow and the least + // influential in blue. + ColorMap color_map = 3; + + // Excludes attributions above the specified percentile from the + // highlighted areas. Using the clip_percent_upperbound and + // clip_percent_lowerbound together can be useful for filtering out noise + // and making it easier to see areas of strong attribution. Defaults to + // 99.9. + float clip_percent_upperbound = 4; + + // Excludes attributions below the specified percentile, from the + // highlighted areas. Defaults to 62. + float clip_percent_lowerbound = 5; + + // How the original image is displayed in the visualization. + // Adjusting the overlay can help increase visual clarity if the original + // image makes it difficult to view the visualization. Defaults to NONE. + OverlayType overlay_type = 6; + } + + // Defines how a feature is encoded. Defaults to IDENTITY. + enum Encoding { + // Default value. This is the same as IDENTITY. + ENCODING_UNSPECIFIED = 0; + + // The tensor represents one feature. + IDENTITY = 1; + + // The tensor represents a bag of features where each index maps to + // a feature. [InputMetadata.index_feature_mapping][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.index_feature_mapping] must be provided for + // this encoding. For example: + // ``` + // input = [27, 6.0, 150] + // index_feature_mapping = ["age", "height", "weight"] + // ``` + BAG_OF_FEATURES = 2; + + // The tensor represents a bag of features where each index maps to a + // feature. Zero values in the tensor indicates feature being + // non-existent. [InputMetadata.index_feature_mapping][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.index_feature_mapping] must be provided + // for this encoding. For example: + // ``` + // input = [2, 0, 5, 0, 1] + // index_feature_mapping = ["a", "b", "c", "d", "e"] + // ``` + BAG_OF_FEATURES_SPARSE = 3; + + // The tensor is a list of binaries representing whether a feature exists + // or not (1 indicates existence). [InputMetadata.index_feature_mapping][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.index_feature_mapping] + // must be provided for this encoding. For example: + // ``` + // input = [1, 0, 1, 0, 1] + // index_feature_mapping = ["a", "b", "c", "d", "e"] + // ``` + INDICATOR = 4; + + // The tensor is encoded into a 1-dimensional array represented by an + // encoded tensor. [InputMetadata.encoded_tensor_name][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.encoded_tensor_name] must be provided + // for this encoding. For example: + // ``` + // input = ["This", "is", "a", "test", "."] + // encoded = [0.1, 0.2, 0.3, 0.4, 0.5] + // ``` + COMBINED_EMBEDDING = 5; + + // Select this encoding when the input tensor is encoded into a + // 2-dimensional array represented by an encoded tensor. + // [InputMetadata.encoded_tensor_name][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.encoded_tensor_name] must be provided for this + // encoding. The first dimension of the encoded tensor's shape is the same + // as the input tensor's shape. For example: + // ``` + // input = ["This", "is", "a", "test", "."] + // encoded = [[0.1, 0.2, 0.3, 0.4, 0.5], + // [0.2, 0.1, 0.4, 0.3, 0.5], + // [0.5, 0.1, 0.3, 0.5, 0.4], + // [0.5, 0.3, 0.1, 0.2, 0.4], + // [0.4, 0.3, 0.2, 0.5, 0.1]] + // ``` + CONCAT_EMBEDDING = 6; + } + + // Baseline inputs for this feature. + // + // If no baseline is specified, Vertex AI chooses the baseline for this + // feature. If multiple baselines are specified, Vertex AI returns the + // average attributions across them in [Attribution.feature_attributions][google.cloud.aiplatform.v1.Attribution.feature_attributions]. + // + // For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape + // of each baseline must match the shape of the input tensor. If a scalar is + // provided, we broadcast to the same shape as the input tensor. + // + // For custom images, the element of the baselines must be in the same + // format as the feature's input in the + // [instance][google.cloud.aiplatform.v1.ExplainRequest.instances][]. The schema of any single instance + // may be specified via Endpoint's DeployedModels' + // [Model's][google.cloud.aiplatform.v1.DeployedModel.model] + // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + // [instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri]. + repeated google.protobuf.Value input_baselines = 1; + + // Name of the input tensor for this feature. Required and is only + // applicable to Vertex AI-provided images for Tensorflow. + string input_tensor_name = 2; + + // Defines how the feature is encoded into the input tensor. Defaults to + // IDENTITY. + Encoding encoding = 3; + + // Modality of the feature. Valid values are: numeric, image. Defaults to + // numeric. + string modality = 4; + + // The domain details of the input feature value. Like min/max, original + // mean or standard deviation if normalized. + FeatureValueDomain feature_value_domain = 5; + + // Specifies the index of the values of the input tensor. + // Required when the input tensor is a sparse representation. Refer to + // Tensorflow documentation for more details: + // https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor. + string indices_tensor_name = 6; + + // Specifies the shape of the values of the input if the input is a sparse + // representation. Refer to Tensorflow documentation for more details: + // https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor. + string dense_shape_tensor_name = 7; + + // A list of feature names for each index in the input tensor. + // Required when the input [InputMetadata.encoding][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.encoding] is BAG_OF_FEATURES, + // BAG_OF_FEATURES_SPARSE, INDICATOR. + repeated string index_feature_mapping = 8; + + // Encoded tensor is a transformation of the input tensor. Must be provided + // if choosing + // [Integrated Gradients attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution] + // or [XRAI attribution][google.cloud.aiplatform.v1.ExplanationParameters.xrai_attribution] and the + // input tensor is not differentiable. + // + // An encoded tensor is generated if the input tensor is encoded by a lookup + // table. + string encoded_tensor_name = 9; + + // A list of baselines for the encoded tensor. + // + // The shape of each baseline should match the shape of the encoded tensor. + // If a scalar is provided, Vertex AI broadcasts to the same shape as the + // encoded tensor. + repeated google.protobuf.Value encoded_baselines = 10; + + // Visualization configurations for image explanation. + Visualization visualization = 11; + + // Name of the group that the input belongs to. Features with the same group + // name will be treated as one feature when computing attributions. Features + // grouped together can have different shapes in value. If provided, there + // will be one single attribution generated in + // [Attribution.feature_attributions][google.cloud.aiplatform.v1.Attribution.feature_attributions], keyed by the group name. + string group_name = 12; + } + + // Metadata of the prediction output to be explained. + message OutputMetadata { + // Defines how to map [Attribution.output_index][google.cloud.aiplatform.v1.Attribution.output_index] to + // [Attribution.output_display_name][google.cloud.aiplatform.v1.Attribution.output_display_name]. + // + // If neither of the fields are specified, + // [Attribution.output_display_name][google.cloud.aiplatform.v1.Attribution.output_display_name] will not be populated. + oneof display_name_mapping { + // Static mapping between the index and display name. + // + // Use this if the outputs are a deterministic n-dimensional array, e.g. a + // list of scores of all the classes in a pre-defined order for a + // multi-classification Model. It's not feasible if the outputs are + // non-deterministic, e.g. the Model produces top-k classes or sort the + // outputs by their values. + // + // The shape of the value must be an n-dimensional array of strings. The + // number of dimensions must match that of the outputs to be explained. + // The [Attribution.output_display_name][google.cloud.aiplatform.v1.Attribution.output_display_name] is populated by locating in the + // mapping with [Attribution.output_index][google.cloud.aiplatform.v1.Attribution.output_index]. + google.protobuf.Value index_display_name_mapping = 1; + + // Specify a field name in the prediction to look for the display name. + // + // Use this if the prediction contains the display names for the outputs. + // + // The display names in the prediction must have the same shape of the + // outputs, so that it can be located by [Attribution.output_index][google.cloud.aiplatform.v1.Attribution.output_index] for + // a specific output. + string display_name_mapping_key = 2; + } + + // Name of the output tensor. Required and is only applicable to Vertex + // AI provided images for Tensorflow. + string output_tensor_name = 3; + } + + // Required. Map from feature names to feature input metadata. Keys are the name of the + // features. Values are the specification of the feature. + // + // An empty InputMetadata is valid. It describes a text feature which has the + // name specified as the key in [ExplanationMetadata.inputs][google.cloud.aiplatform.v1.ExplanationMetadata.inputs]. The baseline + // of the empty feature is chosen by Vertex AI. + // + // For Vertex AI-provided Tensorflow images, the key can be any friendly + // name of the feature. Once specified, + // [featureAttributions][google.cloud.aiplatform.v1.Attribution.feature_attributions] are keyed by + // this key (if not grouped with another feature). + // + // For custom images, the key must match with the key in + // [instance][google.cloud.aiplatform.v1.ExplainRequest.instances]. + map inputs = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Map from output names to output metadata. + // + // For Vertex AI-provided Tensorflow images, keys can be any user defined + // string that consists of any UTF-8 characters. + // + // For custom images, keys are the name of the output field in the prediction + // to be explained. + // + // Currently only one key is allowed. + map outputs = 2 [(google.api.field_behavior) = REQUIRED]; + + // Points to a YAML file stored on Google Cloud Storage describing the format + // of the [feature attributions][google.cloud.aiplatform.v1.Attribution.feature_attributions]. + // The schema is defined as an OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + // AutoML tabular Models always have this field populated by Vertex AI. + // Note: The URI given on output may be different, including the URI scheme, + // than the one given on input. The output URI will point to a location where + // the user only has a read access. + string feature_attributions_schema_uri = 3; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature.proto new file mode 100644 index 00000000..690bb364 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature.proto @@ -0,0 +1,154 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/feature_monitoring_stats.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "FeatureProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Feature Metadata information that describes an attribute of an entity type. +// For example, apple is an entity type, and color is a feature that describes +// apple. +message Feature { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Feature" + pattern: "projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}" + }; + + // A list of historical [Snapshot + // Analysis][FeaturestoreMonitoringConfig.SnapshotAnalysis] or [Import Feature + // Analysis] [FeaturestoreMonitoringConfig.ImportFeatureAnalysis] stats + // requested by user, sorted by [FeatureStatsAnomaly.start_time][google.cloud.aiplatform.v1.FeatureStatsAnomaly.start_time] descending. + message MonitoringStatsAnomaly { + // If the objective in the request is both + // Import Feature Analysis and Snapshot Analysis, this objective could be + // one of them. Otherwise, this objective should be the same as the + // objective in the request. + enum Objective { + // If it's OBJECTIVE_UNSPECIFIED, monitoring_stats will be empty. + OBJECTIVE_UNSPECIFIED = 0; + + // Stats are generated by Import Feature Analysis. + IMPORT_FEATURE_ANALYSIS = 1; + + // Stats are generated by Snapshot Analysis. + SNAPSHOT_ANALYSIS = 2; + } + + // Output only. The objective for each stats. + Objective objective = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The stats and anomalies generated at specific timestamp. + FeatureStatsAnomaly feature_stats_anomaly = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // An enum representing the value type of a feature. + enum ValueType { + // The value type is unspecified. + VALUE_TYPE_UNSPECIFIED = 0; + + // Used for Feature that is a boolean. + BOOL = 1; + + // Used for Feature that is a list of boolean. + BOOL_ARRAY = 2; + + // Used for Feature that is double. + DOUBLE = 3; + + // Used for Feature that is a list of double. + DOUBLE_ARRAY = 4; + + // Used for Feature that is INT64. + INT64 = 9; + + // Used for Feature that is a list of INT64. + INT64_ARRAY = 10; + + // Used for Feature that is string. + STRING = 11; + + // Used for Feature that is a list of String. + STRING_ARRAY = 12; + + // Used for Feature that is bytes. + BYTES = 13; + } + + // Immutable. Name of the Feature. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + // + // The last part feature is assigned by the client. The feature can be up to + // 64 characters long and can consist only of ASCII Latin letters A-Z and a-z, + // underscore(_), and ASCII digits 0-9 starting with a letter. The value will + // be unique given an entity type. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Description of the Feature. + string description = 2; + + // Required. Immutable. Type of Feature value. + ValueType value_type = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Timestamp when this EntityType was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this EntityType was most recently updated. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The labels with user-defined metadata to organize your Features. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + // No more than 64 user labels can be associated with one Feature (System + // labels are excluded)." + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Used to perform a consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 7; + + // Optional. If not set, use the monitoring_config defined for the EntityType this + // Feature belongs to. + // Only Features with type ([Feature.ValueType][google.cloud.aiplatform.v1.Feature.ValueType]) BOOL, STRING, DOUBLE or + // INT64 can enable monitoring. + // + // If set to true, all types of data monitoring are disabled despite the + // config on EntityType. + bool disable_monitoring = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The list of historical stats and anomalies with specified objectives. + repeated MonitoringStatsAnomaly monitoring_stats_anomalies = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto new file mode 100644 index 00000000..1138ec8c --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto @@ -0,0 +1,86 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "FeatureMonitoringStatsProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Stats and Anomaly generated at specific timestamp for specific Feature. +// The start_time and end_time are used to define the time range of the dataset +// that current stats belongs to, e.g. prediction traffic is bucketed into +// prediction datasets by time window. If the Dataset is not defined by time +// window, start_time = end_time. Timestamp of the stats and anomalies always +// refers to end_time. Raw stats and anomalies are stored in stats_uri or +// anomaly_uri in the tensorflow defined protos. Field data_stats contains +// almost identical information with the raw stats in Vertex AI +// defined proto, for UI to display. +message FeatureStatsAnomaly { + // Feature importance score, only populated when cross-feature monitoring is + // enabled. For now only used to represent feature attribution score within + // range [0, 1] for + // [ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_SKEW][google.cloud.aiplatform.v1.ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_SKEW] and + // [ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_DRIFT][google.cloud.aiplatform.v1.ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_DRIFT]. + double score = 1; + + // Path of the stats file for current feature values in Cloud Storage bucket. + // Format: gs:////stats. + // Example: gs://monitoring_bucket/feature_name/stats. + // Stats are stored as binary format with Protobuf message + // [tensorflow.metadata.v0.FeatureNameStatistics](https://github.com/tensorflow/metadata/blob/master/tensorflow_metadata/proto/v0/statistics.proto). + string stats_uri = 3; + + // Path of the anomaly file for current feature values in Cloud Storage + // bucket. + // Format: gs:////anomalies. + // Example: gs://monitoring_bucket/feature_name/anomalies. + // Stats are stored as binary format with Protobuf message + // Anoamlies are stored as binary format with Protobuf message + // [tensorflow.metadata.v0.AnomalyInfo] + // (https://github.com/tensorflow/metadata/blob/master/tensorflow_metadata/proto/v0/anomalies.proto). + string anomaly_uri = 4; + + // Deviation from the current stats to baseline stats. + // 1. For categorical feature, the distribution distance is calculated by + // L-inifinity norm. + // 2. For numerical feature, the distribution distance is calculated by + // Jensen–Shannon divergence. + double distribution_deviation = 5; + + // This is the threshold used when detecting anomalies. + // The threshold can be changed by user, so this one might be different from + // [ThresholdConfig.value][google.cloud.aiplatform.v1.ThresholdConfig.value]. + double anomaly_detection_threshold = 9; + + // The start timestamp of window where stats were generated. + // For objectives where time window doesn't make sense (e.g. Featurestore + // Snapshot Monitoring), start_time is only used to indicate the monitoring + // intervals, so it always equals to (end_time - monitoring_interval). + google.protobuf.Timestamp start_time = 7; + + // The end timestamp of window where stats were generated. + // For objectives where time window doesn't make sense (e.g. Featurestore + // Snapshot Monitoring), end_time indicates the timestamp of the data used to + // generate stats (e.g. timestamp we take snapshots for feature values). + google.protobuf.Timestamp end_time = 8; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature_selector.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature_selector.proto new file mode 100644 index 00000000..7a4a8e66 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature_selector.proto @@ -0,0 +1,44 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "FeatureSelectorProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Matcher for Features of an EntityType by Feature ID. +message IdMatcher { + // Required. The following are accepted as `ids`: + // + // * A single-element list containing only `*`, which selects all Features + // in the target EntityType, or + // * A list containing only Feature IDs, which selects only Features with + // those IDs in the target EntityType. + repeated string ids = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Selector for Features of an EntityType. +message FeatureSelector { + // Required. Matches Features based on ID. + IdMatcher id_matcher = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore.proto new file mode 100644 index 00000000..535ca6b9 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore.proto @@ -0,0 +1,111 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/encryption_spec.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "FeaturestoreProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Vertex AI Feature Store provides a centralized repository for organizing, +// storing, and serving ML features. The Featurestore is a top-level container +// for your features and their values. +message Featurestore { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Featurestore" + pattern: "projects/{project}/locations/{location}/featurestores/{featurestore}" + }; + + // OnlineServingConfig specifies the details for provisioning online serving + // resources. + message OnlineServingConfig { + // The number of nodes for the online store. The number of nodes doesn't + // scale automatically, but you can manually update the number of + // nodes. If set to 0, the featurestore will not have an + // online store and cannot be used for online serving. + int32 fixed_node_count = 2; + } + + // Possible states a featurestore can have. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // State when the featurestore configuration is not being updated and the + // fields reflect the current configuration of the featurestore. The + // featurestore is usable in this state. + STABLE = 1; + + // The state of the featurestore configuration when it is being updated. + // During an update, the fields reflect either the original configuration + // or the updated configuration of the featurestore. For example, + // `online_serving_config.fixed_node_count` can take minutes to update. + // While the update is in progress, the featurestore is in the UPDATING + // state, and the value of `fixed_node_count` can be the original value or + // the updated value, depending on the progress of the operation. Until the + // update completes, the actual number of nodes can still be the original + // value of `fixed_node_count`. The featurestore is still usable in this + // state. + UPDATING = 2; + } + + // Output only. Name of the Featurestore. Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Featurestore was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Featurestore was last updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The labels with user-defined metadata to organize your Featurestore. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + // No more than 64 user labels can be associated with one Featurestore(System + // labels are excluded)." + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Config for online storage resources. If unset, the featurestore will + // not have an online store and cannot be used for online serving. + OnlineServingConfig online_serving_config = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. State of the featurestore. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Customer-managed encryption key spec for data storage. If set, both of the + // online and offline data storage will be secured by this key. + EncryptionSpec encryption_spec = 10 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto new file mode 100644 index 00000000..7233658b --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto @@ -0,0 +1,149 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "FeaturestoreMonitoringProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Configuration of how features in Featurestore are monitored. +message FeaturestoreMonitoringConfig { + // Configuration of the Featurestore's Snapshot Analysis Based Monitoring. + // This type of analysis generates statistics for each Feature based on a + // snapshot of the latest feature value of each entities every + // monitoring_interval. + message SnapshotAnalysis { + // The monitoring schedule for snapshot analysis. + // For EntityType-level config: + // unset / disabled = true indicates disabled by + // default for Features under it; otherwise by default enable snapshot + // analysis monitoring with monitoring_interval for Features under it. + // Feature-level config: + // disabled = true indicates disabled regardless of the EntityType-level + // config; unset monitoring_interval indicates going with EntityType-level + // config; otherwise run snapshot analysis monitoring with + // monitoring_interval regardless of the EntityType-level config. + // Explicitly Disable the snapshot analysis based monitoring. + bool disabled = 1; + + // Configuration of the snapshot analysis based monitoring pipeline + // running interval. The value indicates number of days. + // If both + // [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days][google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days] + // and [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval][] + // are set when creating/updating EntityTypes/Features, + // [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days][google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days] + // will be used. + int32 monitoring_interval_days = 3; + + // Customized export features time window for snapshot analysis. Unit is one + // day. Default value is 3 weeks. Minimum value is 1 day. Maximum value is + // 4000 days. + int32 staleness_days = 4; + } + + // Configuration of the Featurestore's ImportFeature Analysis Based + // Monitoring. This type of analysis generates statistics for values of each + // Feature imported by every [ImportFeatureValues][] operation. + message ImportFeaturesAnalysis { + // The state defines whether to enable ImportFeature analysis. + enum State { + // Should not be used. + STATE_UNSPECIFIED = 0; + + // The default behavior of whether to enable the monitoring. + // EntityType-level config: disabled. + // Feature-level config: inherited from the configuration of EntityType + // this Feature belongs to. + DEFAULT = 1; + + // Explicitly enables import features analysis. + // EntityType-level config: by default enables import features analysis + // for all Features under it. Feature-level config: enables import + // features analysis regardless of the EntityType-level config. + ENABLED = 2; + + // Explicitly disables import features analysis. + // EntityType-level config: by default disables import features analysis + // for all Features under it. Feature-level config: disables import + // features analysis regardless of the EntityType-level config. + DISABLED = 3; + } + + // Defines the baseline to do anomaly detection for feature values imported + // by each [ImportFeatureValues][] operation. + enum Baseline { + // Should not be used. + BASELINE_UNSPECIFIED = 0; + + // Choose the later one statistics generated by either most recent + // snapshot analysis or previous import features analysis. If non of them + // exists, skip anomaly detection and only generate a statistics. + LATEST_STATS = 1; + + // Use the statistics generated by the most recent snapshot analysis if + // exists. + MOST_RECENT_SNAPSHOT_STATS = 2; + + // Use the statistics generated by the previous import features analysis + // if exists. + PREVIOUS_IMPORT_FEATURES_STATS = 3; + } + + // Whether to enable / disable / inherite default hebavior for import + // features analysis. + State state = 1; + + // The baseline used to do anomaly detection for the statistics generated by + // import features analysis. + Baseline anomaly_detection_baseline = 2; + } + + // The config for Featurestore Monitoring threshold. + message ThresholdConfig { + oneof threshold { + // Specify a threshold value that can trigger the alert. + // 1. For categorical feature, the distribution distance is calculated by + // L-inifinity norm. + // 2. For numerical feature, the distribution distance is calculated by + // Jensen–Shannon divergence. Each feature must have a non-zero threshold + // if they need to be monitored. Otherwise no alert will be triggered for + // that feature. + double value = 1; + } + } + + // The config for Snapshot Analysis Based Feature Monitoring. + SnapshotAnalysis snapshot_analysis = 1; + + // The config for ImportFeatures Analysis Based Feature Monitoring. + ImportFeaturesAnalysis import_features_analysis = 2; + + // Threshold for numerical features of anomaly detection. + // This is shared by all objectives of Featurestore Monitoring for numerical + // features (i.e. Features with type ([Feature.ValueType][google.cloud.aiplatform.v1.Feature.ValueType]) DOUBLE or INT64). + ThresholdConfig numerical_threshold_config = 3; + + // Threshold for categorical features of anomaly detection. + // This is shared by all types of Featurestore Monitoring for categorical + // features (i.e. Features with type ([Feature.ValueType][google.cloud.aiplatform.v1.Feature.ValueType]) BOOL or STRING). + ThresholdConfig categorical_threshold_config = 4; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto new file mode 100644 index 00000000..44086044 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto @@ -0,0 +1,225 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/feature_selector.proto"; +import "google/cloud/aiplatform/v1/types.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "FeaturestoreOnlineServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A service for serving online feature values. +service FeaturestoreOnlineServingService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Reads Feature values of a specific entity of an EntityType. For reading + // feature values of multiple entities of an EntityType, please use + // StreamingReadFeatureValues. + rpc ReadFeatureValues(ReadFeatureValuesRequest) returns (ReadFeatureValuesResponse) { + option (google.api.http) = { + post: "/v1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:readFeatureValues" + body: "*" + }; + option (google.api.method_signature) = "entity_type"; + } + + // Reads Feature values for multiple entities. Depending on their size, data + // for different entities may be broken + // up across multiple responses. + rpc StreamingReadFeatureValues(StreamingReadFeatureValuesRequest) returns (stream ReadFeatureValuesResponse) { + option (google.api.http) = { + post: "/v1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:streamingReadFeatureValues" + body: "*" + }; + option (google.api.method_signature) = "entity_type"; + } +} + +// Request message for [FeaturestoreOnlineServingService.ReadFeatureValues][google.cloud.aiplatform.v1.FeaturestoreOnlineServingService.ReadFeatureValues]. +message ReadFeatureValuesRequest { + // Required. The resource name of the EntityType for the entity being read. + // 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`. + string entity_type = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + } + ]; + + // Required. ID for a specific entity. For example, + // for a machine learning model predicting user clicks on a website, an entity + // ID could be `user_123`. + string entity_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Selector choosing Features of the target EntityType. + FeatureSelector feature_selector = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [FeaturestoreOnlineServingService.ReadFeatureValues][google.cloud.aiplatform.v1.FeaturestoreOnlineServingService.ReadFeatureValues]. +message ReadFeatureValuesResponse { + // Metadata for requested Features. + message FeatureDescriptor { + // Feature ID. + string id = 1; + } + + // Response header with metadata for the requested + // [ReadFeatureValuesRequest.entity_type][google.cloud.aiplatform.v1.ReadFeatureValuesRequest.entity_type] and Features. + message Header { + // The resource name of the EntityType from the + // [ReadFeatureValuesRequest][google.cloud.aiplatform.v1.ReadFeatureValuesRequest]. Value format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}`. + string entity_type = 1 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + }]; + + // List of Feature metadata corresponding to each piece of + // [ReadFeatureValuesResponse.data][]. + repeated FeatureDescriptor feature_descriptors = 2; + } + + // Entity view with Feature values. + message EntityView { + // Container to hold value(s), successive in time, for one Feature from the + // request. + message Data { + oneof data { + // Feature value if a single value is requested. + FeatureValue value = 1; + + // Feature values list if values, successive in time, are requested. + // If the requested number of values is greater than the number of + // existing Feature values, nonexistent values are omitted instead of + // being returned as empty. + FeatureValueList values = 2; + } + } + + // ID of the requested entity. + string entity_id = 1; + + // Each piece of data holds the k + // requested values for one requested Feature. If no values + // for the requested Feature exist, the corresponding cell will be empty. + // This has the same size and is in the same order as the features from the + // header [ReadFeatureValuesResponse.header][google.cloud.aiplatform.v1.ReadFeatureValuesResponse.header]. + repeated Data data = 2; + } + + // Response header. + Header header = 1; + + // Entity view with Feature values. This may be the entity in the + // Featurestore if values for all Features were requested, or a projection + // of the entity in the Featurestore if values for only some Features were + // requested. + EntityView entity_view = 2; +} + +// Request message for +// [FeaturestoreOnlineServingService.StreamingFeatureValuesRead][]. +message StreamingReadFeatureValuesRequest { + // Required. The resource name of the entities' type. + // 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`. + string entity_type = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + } + ]; + + // Required. IDs of entities to read Feature values of. The maximum number of IDs is + // 100. For example, for a machine learning model predicting user clicks on a + // website, an entity ID could be `user_123`. + repeated string entity_ids = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Selector choosing Features of the target EntityType. Feature IDs will be + // deduplicated. + FeatureSelector feature_selector = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Value for a feature. +// (-- NEXT ID: 15 --) +message FeatureValue { + // Metadata of feature value. + message Metadata { + // Feature generation timestamp. Typically, it is provided by user at + // feature ingestion time. If not, feature store + // will use the system timestamp when the data is ingested into feature + // store. For streaming ingestion, the time, aligned by days, must be no + // older than five years (1825 days) and no later than one year (366 days) + // in the future. + google.protobuf.Timestamp generate_time = 1; + } + + // Value for the feature. + oneof value { + // Bool type feature value. + bool bool_value = 1; + + // Double type feature value. + double double_value = 2; + + // Int64 feature value. + int64 int64_value = 5; + + // String feature value. + string string_value = 6; + + // A list of bool type feature value. + BoolArray bool_array_value = 7; + + // A list of double type feature value. + DoubleArray double_array_value = 8; + + // A list of int64 type feature value. + Int64Array int64_array_value = 11; + + // A list of string type feature value. + StringArray string_array_value = 12; + + // Bytes feature value. + bytes bytes_value = 13; + } + + // Metadata of feature value. + Metadata metadata = 14; +} + +// Container for list of values. +message FeatureValueList { + // A list of feature values. All of them should be the same data type. + repeated FeatureValue values = 1; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_service.proto new file mode 100644 index 00000000..706ee62d --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_service.proto @@ -0,0 +1,1225 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/entity_type.proto"; +import "google/cloud/aiplatform/v1/feature.proto"; +import "google/cloud/aiplatform/v1/feature_selector.proto"; +import "google/cloud/aiplatform/v1/featurestore.proto"; +import "google/cloud/aiplatform/v1/io.proto"; +import "google/cloud/aiplatform/v1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "FeaturestoreServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// The service that handles CRUD and List for resources for Featurestore. +service FeaturestoreService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a new Featurestore in a given project and location. + rpc CreateFeaturestore(CreateFeaturestoreRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/featurestores" + body: "featurestore" + }; + option (google.api.method_signature) = "parent,featurestore"; + option (google.api.method_signature) = "parent,featurestore,featurestore_id"; + option (google.longrunning.operation_info) = { + response_type: "Featurestore" + metadata_type: "CreateFeaturestoreOperationMetadata" + }; + } + + // Gets details of a single Featurestore. + rpc GetFeaturestore(GetFeaturestoreRequest) returns (Featurestore) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/featurestores/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Featurestores in a given project and location. + rpc ListFeaturestores(ListFeaturestoresRequest) returns (ListFeaturestoresResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/featurestores" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the parameters of a single Featurestore. + rpc UpdateFeaturestore(UpdateFeaturestoreRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{featurestore.name=projects/*/locations/*/featurestores/*}" + body: "featurestore" + }; + option (google.api.method_signature) = "featurestore,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Featurestore" + metadata_type: "UpdateFeaturestoreOperationMetadata" + }; + } + + // Deletes a single Featurestore. The Featurestore must not contain any + // EntityTypes or `force` must be set to true for the request to succeed. + rpc DeleteFeaturestore(DeleteFeaturestoreRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/featurestores/*}" + }; + option (google.api.method_signature) = "name"; + option (google.api.method_signature) = "name,force"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Creates a new EntityType in a given Featurestore. + rpc CreateEntityType(CreateEntityTypeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/featurestores/*}/entityTypes" + body: "entity_type" + }; + option (google.api.method_signature) = "parent,entity_type"; + option (google.api.method_signature) = "parent,entity_type,entity_type_id"; + option (google.longrunning.operation_info) = { + response_type: "EntityType" + metadata_type: "CreateEntityTypeOperationMetadata" + }; + } + + // Gets details of a single EntityType. + rpc GetEntityType(GetEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists EntityTypes in a given Featurestore. + rpc ListEntityTypes(ListEntityTypesRequest) returns (ListEntityTypesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/featurestores/*}/entityTypes" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the parameters of a single EntityType. + rpc UpdateEntityType(UpdateEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + patch: "/v1/{entity_type.name=projects/*/locations/*/featurestores/*/entityTypes/*}" + body: "entity_type" + }; + option (google.api.method_signature) = "entity_type,update_mask"; + } + + // Deletes a single EntityType. The EntityType must not have any Features + // or `force` must be set to true for the request to succeed. + rpc DeleteEntityType(DeleteEntityTypeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}" + }; + option (google.api.method_signature) = "name"; + option (google.api.method_signature) = "name,force"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Creates a new Feature in a given EntityType. + rpc CreateFeature(CreateFeatureRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/featurestores/*/entityTypes/*}/features" + body: "feature" + }; + option (google.api.method_signature) = "parent,feature"; + option (google.api.method_signature) = "parent,feature,feature_id"; + option (google.longrunning.operation_info) = { + response_type: "Feature" + metadata_type: "CreateFeatureOperationMetadata" + }; + } + + // Creates a batch of Features in a given EntityType. + rpc BatchCreateFeatures(BatchCreateFeaturesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/featurestores/*/entityTypes/*}/features:batchCreate" + body: "*" + }; + option (google.api.method_signature) = "parent,requests"; + option (google.longrunning.operation_info) = { + response_type: "BatchCreateFeaturesResponse" + metadata_type: "BatchCreateFeaturesOperationMetadata" + }; + } + + // Gets details of a single Feature. + rpc GetFeature(GetFeatureRequest) returns (Feature) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Features in a given EntityType. + rpc ListFeatures(ListFeaturesRequest) returns (ListFeaturesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/featurestores/*/entityTypes/*}/features" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the parameters of a single Feature. + rpc UpdateFeature(UpdateFeatureRequest) returns (Feature) { + option (google.api.http) = { + patch: "/v1/{feature.name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}" + body: "feature" + }; + option (google.api.method_signature) = "feature,update_mask"; + } + + // Deletes a single Feature. + rpc DeleteFeature(DeleteFeatureRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Imports Feature values into the Featurestore from a source storage. + // + // The progress of the import is tracked by the returned operation. The + // imported features are guaranteed to be visible to subsequent read + // operations after the operation is marked as successfully done. + // + // If an import operation fails, the Feature values returned from + // reads and exports may be inconsistent. If consistency is + // required, the caller must retry the same import request again and wait till + // the new operation returned is marked as successfully done. + // + // There are also scenarios where the caller can cause inconsistency. + // + // - Source data for import contains multiple distinct Feature values for + // the same entity ID and timestamp. + // - Source is modified during an import. This includes adding, updating, or + // removing source data and/or metadata. Examples of updating metadata + // include but are not limited to changing storage location, storage class, + // or retention policy. + // - Online serving cluster is under-provisioned. + rpc ImportFeatureValues(ImportFeatureValuesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:importFeatureValues" + body: "*" + }; + option (google.api.method_signature) = "entity_type"; + option (google.longrunning.operation_info) = { + response_type: "ImportFeatureValuesResponse" + metadata_type: "ImportFeatureValuesOperationMetadata" + }; + } + + // Batch reads Feature values from a Featurestore. + // + // This API enables batch reading Feature values, where each read + // instance in the batch may read Feature values of entities from one or + // more EntityTypes. Point-in-time correctness is guaranteed for Feature + // values of each read instance as of each instance's read timestamp. + rpc BatchReadFeatureValues(BatchReadFeatureValuesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{featurestore=projects/*/locations/*/featurestores/*}:batchReadFeatureValues" + body: "*" + }; + option (google.api.method_signature) = "featurestore"; + option (google.longrunning.operation_info) = { + response_type: "BatchReadFeatureValuesResponse" + metadata_type: "BatchReadFeatureValuesOperationMetadata" + }; + } + + // Exports Feature values from all the entities of a target EntityType. + rpc ExportFeatureValues(ExportFeatureValuesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:exportFeatureValues" + body: "*" + }; + option (google.api.method_signature) = "entity_type"; + option (google.longrunning.operation_info) = { + response_type: "ExportFeatureValuesResponse" + metadata_type: "ExportFeatureValuesOperationMetadata" + }; + } + + // Searches Features matching a query in a given project. + rpc SearchFeatures(SearchFeaturesRequest) returns (SearchFeaturesResponse) { + option (google.api.http) = { + get: "/v1/{location=projects/*/locations/*}/featurestores:searchFeatures" + }; + option (google.api.method_signature) = "location"; + option (google.api.method_signature) = "location,query"; + } +} + +// Request message for [FeaturestoreService.CreateFeaturestore][google.cloud.aiplatform.v1.FeaturestoreService.CreateFeaturestore]. +message CreateFeaturestoreRequest { + // Required. The resource name of the Location to create Featurestores. + // Format: + // `projects/{project}/locations/{location}'` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Featurestore" + } + ]; + + // Required. The Featurestore to create. + Featurestore featurestore = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for this Featurestore, which will become the final component + // of the Featurestore's resource name. + // + // This value may be up to 60 characters, and valid characters are + // `[a-z0-9_]`. The first character cannot be a number. + // + // The value must be unique within the project and location. + string featurestore_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [FeaturestoreService.GetFeaturestore][google.cloud.aiplatform.v1.FeaturestoreService.GetFeaturestore]. +message GetFeaturestoreRequest { + // Required. The name of the Featurestore resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Featurestore" + } + ]; +} + +// Request message for [FeaturestoreService.ListFeaturestores][google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores]. +message ListFeaturestoresRequest { + // Required. The resource name of the Location to list Featurestores. + // Format: + // `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Featurestore" + } + ]; + + // Lists the featurestores that match the filter expression. The following + // fields are supported: + // + // * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + // Values must be + // in RFC 3339 format. + // * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + // Values must be + // in RFC 3339 format. + // * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, + // `<=`, and `>=` comparisons. + // * `labels`: Supports key-value equality and key presence. + // + // Examples: + // + // * `create_time > "2020-01-01" OR update_time > "2020-01-01"` + // Featurestores created or updated after 2020-01-01. + // * `labels.env = "prod"` + // Featurestores with label "env" set to "prod". + string filter = 2; + + // The maximum number of Featurestores to return. The service may return fewer + // than this value. If unspecified, at most 100 Featurestores will be + // returned. The maximum value is 100; any value greater than 100 will be + // coerced to 100. + int32 page_size = 3; + + // A page token, received from a previous + // [FeaturestoreService.ListFeaturestores][google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [FeaturestoreService.ListFeaturestores][google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores] must + // match the call that provided the page token. + string page_token = 4; + + // A comma-separated list of fields to order by, sorted in ascending order. + // Use "desc" after a field name for descending. + // Supported Fields: + // + // * `create_time` + // * `update_time` + // * `online_serving_config.fixed_node_count` + string order_by = 5; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 6; +} + +// Response message for [FeaturestoreService.ListFeaturestores][google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores]. +message ListFeaturestoresResponse { + // The Featurestores matching the request. + repeated Featurestore featurestores = 1; + + // A token, which can be sent as [ListFeaturestoresRequest.page_token][google.cloud.aiplatform.v1.ListFeaturestoresRequest.page_token] to + // retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [FeaturestoreService.UpdateFeaturestore][google.cloud.aiplatform.v1.FeaturestoreService.UpdateFeaturestore]. +message UpdateFeaturestoreRequest { + // Required. The Featurestore's `name` field is used to identify the Featurestore to be + // updated. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}` + Featurestore featurestore = 1 [(google.api.field_behavior) = REQUIRED]; + + // Field mask is used to specify the fields to be overwritten in the + // Featurestore resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then only the non-empty fields present in the + // request will be overwritten. Set the update_mask to `*` to override all + // fields. + // + // Updatable fields: + // + // * `labels` + // * `online_serving_config.fixed_node_count` + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for [FeaturestoreService.DeleteFeaturestore][google.cloud.aiplatform.v1.FeaturestoreService.DeleteFeaturestore]. +message DeleteFeaturestoreRequest { + // Required. The name of the Featurestore to be deleted. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Featurestore" + } + ]; + + // If set to true, any EntityTypes and Features for this Featurestore will + // also be deleted. (Otherwise, the request will only work if the Featurestore + // has no EntityTypes.) + bool force = 2; +} + +// Request message for [FeaturestoreService.ImportFeatureValues][google.cloud.aiplatform.v1.FeaturestoreService.ImportFeatureValues]. +message ImportFeatureValuesRequest { + // Defines the Feature value(s) to import. + message FeatureSpec { + // Required. ID of the Feature to import values of. This Feature must exist in the + // target EntityType, or the request will fail. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Source column to get the Feature values from. If not set, uses the column + // with the same name as the Feature ID. + string source_field = 2; + } + + // Details about the source data, including the location of the storage and + // the format. + oneof source { + AvroSource avro_source = 2; + + BigQuerySource bigquery_source = 3; + + CsvSource csv_source = 4; + } + + // Source of Feature timestamp for all Feature values of each entity. + // Timestamps must be millisecond-aligned. + oneof feature_time_source { + // Source column that holds the Feature timestamp for all Feature + // values in each entity. + string feature_time_field = 6; + + // Single Feature timestamp for all entities being imported. The + // timestamp must not have higher than millisecond precision. + google.protobuf.Timestamp feature_time = 7; + } + + // Required. The resource name of the EntityType grouping the Features for which values + // are being imported. Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}` + string entity_type = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + } + ]; + + // Source column that holds entity IDs. If not provided, entity IDs are + // extracted from the column named `entity_id`. + string entity_id_field = 5; + + // Required. Specifications defining which Feature values to import from the entity. The + // request fails if no feature_specs are provided, and having multiple + // feature_specs for one Feature is not allowed. + repeated FeatureSpec feature_specs = 8 [(google.api.field_behavior) = REQUIRED]; + + // If set, data will not be imported for online serving. This + // is typically used for backfilling, where Feature generation timestamps are + // not in the timestamp range needed for online serving. + bool disable_online_serving = 9; + + // Specifies the number of workers that are used to write data to the + // Featurestore. Consider the online serving capacity that you require to + // achieve the desired import throughput without interfering with online + // serving. The value must be positive, and less than or equal to 100. + // If not set, defaults to using 1 worker. The low count ensures minimal + // impact on online serving performance. + int32 worker_count = 11; + + // If true, API doesn't start ingestion analysis pipeline. + bool disable_ingestion_analysis = 12; +} + +// Response message for [FeaturestoreService.ImportFeatureValues][google.cloud.aiplatform.v1.FeaturestoreService.ImportFeatureValues]. +message ImportFeatureValuesResponse { + // Number of entities that have been imported by the operation. + int64 imported_entity_count = 1; + + // Number of Feature values that have been imported by the operation. + int64 imported_feature_value_count = 2; + + // The number of rows in input source that weren't imported due to either + // * Not having any featureValues. + // * Having a null entityId. + // * Having a null timestamp. + // * Not being parsable (applicable for CSV sources). + int64 invalid_row_count = 6; +} + +// Request message for [FeaturestoreService.BatchReadFeatureValues][google.cloud.aiplatform.v1.FeaturestoreService.BatchReadFeatureValues]. +message BatchReadFeatureValuesRequest { + // Describe pass-through fields in read_instance source. + message PassThroughField { + // Required. The name of the field in the CSV header or the name of the column in + // BigQuery table. The naming restriction is the same as [Feature.name][google.cloud.aiplatform.v1.Feature.name]. + string field_name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Selects Features of an EntityType to read values of and specifies read + // settings. + message EntityTypeSpec { + // Required. ID of the EntityType to select Features. The EntityType id is the + // [entity_type_id][google.cloud.aiplatform.v1.CreateEntityTypeRequest.entity_type_id] specified + // during EntityType creation. + string entity_type_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Selectors choosing which Feature values to read from the EntityType. + FeatureSelector feature_selector = 2 [(google.api.field_behavior) = REQUIRED]; + + // Per-Feature settings for the batch read. + repeated DestinationFeatureSetting settings = 3; + } + + oneof read_option { + // Each read instance consists of exactly one read timestamp and one or more + // entity IDs identifying entities of the corresponding EntityTypes whose + // Features are requested. + // + // Each output instance contains Feature values of requested entities + // concatenated together as of the read time. + // + // An example read instance may be `foo_entity_id, bar_entity_id, + // 2020-01-01T10:00:00.123Z`. + // + // An example output instance may be `foo_entity_id, bar_entity_id, + // 2020-01-01T10:00:00.123Z, foo_entity_feature1_value, + // bar_entity_feature2_value`. + // + // Timestamp in each read instance must be millisecond-aligned. + // + // `csv_read_instances` are read instances stored in a plain-text CSV file. + // The header should be: + // [ENTITY_TYPE_ID1], [ENTITY_TYPE_ID2], ..., timestamp + // + // The columns can be in any order. + // + // Values in the timestamp column must use the RFC 3339 format, e.g. + // `2012-07-30T10:43:17.123Z`. + CsvSource csv_read_instances = 3; + + // Similar to csv_read_instances, but from BigQuery source. + BigQuerySource bigquery_read_instances = 5; + } + + // Required. The resource name of the Featurestore from which to query Feature values. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}` + string featurestore = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Featurestore" + } + ]; + + // Required. Specifies output location and format. + FeatureValueDestination destination = 4 [(google.api.field_behavior) = REQUIRED]; + + // When not empty, the specified fields in the *_read_instances source will be + // joined as-is in the output, in addition to those fields from the + // Featurestore Entity. + // + // For BigQuery source, the type of the pass-through values will be + // automatically inferred. For CSV source, the pass-through values will be + // passed as opaque bytes. + repeated PassThroughField pass_through_fields = 8; + + // Required. Specifies EntityType grouping Features to read values of and settings. + // Each EntityType referenced in + // [BatchReadFeatureValuesRequest.entity_type_specs] must have a column + // specifying entity IDs in the EntityType in + // [BatchReadFeatureValuesRequest.request][] . + repeated EntityTypeSpec entity_type_specs = 7 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [FeaturestoreService.ExportFeatureValues][google.cloud.aiplatform.v1.FeaturestoreService.ExportFeatureValues]. +message ExportFeatureValuesRequest { + // Describes exporting the latest Feature values of all entities of the + // EntityType between [start_time, snapshot_time]. + message SnapshotExport { + // Exports Feature values as of this timestamp. If not set, + // retrieve values as of now. Timestamp, if present, must not have higher + // than millisecond precision. + google.protobuf.Timestamp snapshot_time = 1; + + // Excludes Feature values with feature generation timestamp before this + // timestamp. If not set, retrieve oldest values kept in Feature Store. + // Timestamp, if present, must not have higher than millisecond precision. + google.protobuf.Timestamp start_time = 2; + } + + // Describes exporting all historical Feature values of all entities of the + // EntityType between [start_time, end_time]. + message FullExport { + // Excludes Feature values with feature generation timestamp before this + // timestamp. If not set, retrieve oldest values kept in Feature Store. + // Timestamp, if present, must not have higher than millisecond precision. + google.protobuf.Timestamp start_time = 2; + + // Exports Feature values as of this timestamp. If not set, + // retrieve values as of now. Timestamp, if present, must not have higher + // than millisecond precision. + google.protobuf.Timestamp end_time = 1; + } + + // Required. The mode in which Feature values are exported. + oneof mode { + // Exports the latest Feature values of all entities of the EntityType + // within a time range. + SnapshotExport snapshot_export = 3; + + // Exports all historical values of all entities of the EntityType within a + // time range + FullExport full_export = 7; + } + + // Required. The resource name of the EntityType from which to export Feature values. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + string entity_type = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + } + ]; + + // Required. Specifies destination location and format. + FeatureValueDestination destination = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. Selects Features to export values of. + FeatureSelector feature_selector = 5 [(google.api.field_behavior) = REQUIRED]; + + // Per-Feature export settings. + repeated DestinationFeatureSetting settings = 6; +} + +message DestinationFeatureSetting { + // Required. The ID of the Feature to apply the setting to. + string feature_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Specify the field name in the export destination. If not specified, + // Feature ID is used. + string destination_field = 2; +} + +// A destination location for Feature values and format. +message FeatureValueDestination { + oneof destination { + // Output in BigQuery format. + // [BigQueryDestination.output_uri][google.cloud.aiplatform.v1.BigQueryDestination.output_uri] in + // [FeatureValueDestination.bigquery_destination][google.cloud.aiplatform.v1.FeatureValueDestination.bigquery_destination] must refer to a table. + BigQueryDestination bigquery_destination = 1; + + // Output in TFRecord format. + // + // Below are the mapping from Feature value type + // in Featurestore to Feature value type in TFRecord: + // + // Value type in Featurestore | Value type in TFRecord + // DOUBLE, DOUBLE_ARRAY | FLOAT_LIST + // INT64, INT64_ARRAY | INT64_LIST + // STRING, STRING_ARRAY, BYTES | BYTES_LIST + // true -> byte_string("true"), false -> byte_string("false") + // BOOL, BOOL_ARRAY (true, false) | BYTES_LIST + TFRecordDestination tfrecord_destination = 2; + + // Output in CSV format. Array Feature value types are not allowed in CSV + // format. + CsvDestination csv_destination = 3; + } +} + +// Response message for [FeaturestoreService.ExportFeatureValues][google.cloud.aiplatform.v1.FeaturestoreService.ExportFeatureValues]. +message ExportFeatureValuesResponse { + +} + +// Response message for [FeaturestoreService.BatchReadFeatureValues][google.cloud.aiplatform.v1.FeaturestoreService.BatchReadFeatureValues]. +message BatchReadFeatureValuesResponse { + +} + +// Request message for [FeaturestoreService.CreateEntityType][google.cloud.aiplatform.v1.FeaturestoreService.CreateEntityType]. +message CreateEntityTypeRequest { + // Required. The resource name of the Featurestore to create EntityTypes. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Featurestore" + } + ]; + + // The EntityType to create. + EntityType entity_type = 2; + + // Required. The ID to use for the EntityType, which will become the final component of + // the EntityType's resource name. + // + // This value may be up to 60 characters, and valid characters are + // `[a-z0-9_]`. The first character cannot be a number. + // + // The value must be unique within a featurestore. + string entity_type_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [FeaturestoreService.GetEntityType][google.cloud.aiplatform.v1.FeaturestoreService.GetEntityType]. +message GetEntityTypeRequest { + // Required. The name of the EntityType resource. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + } + ]; +} + +// Request message for [FeaturestoreService.ListEntityTypes][google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes]. +message ListEntityTypesRequest { + // Required. The resource name of the Featurestore to list EntityTypes. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/EntityType" + } + ]; + + // Lists the EntityTypes that match the filter expression. The following + // filters are supported: + // + // * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + // Values must be in RFC 3339 format. + // * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + // Values must be in RFC 3339 format. + // * `labels`: Supports key-value equality as well as key presence. + // + // Examples: + // + // * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + // update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + // or updated after 2020-01-31T15:30:00.000000Z. + // * `labels.active = yes AND labels.env = prod` --> EntityTypes having both + // (active: yes) and (env: prod) labels. + // * `labels.env: *` --> Any EntityType which has a label with 'env' as the + // key. + string filter = 2; + + // The maximum number of EntityTypes to return. The service may return fewer + // than this value. If unspecified, at most 1000 EntityTypes will be returned. + // The maximum value is 1000; any value greater than 1000 will be coerced to + // 1000. + int32 page_size = 3; + + // A page token, received from a previous + // [FeaturestoreService.ListEntityTypes][google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [FeaturestoreService.ListEntityTypes][google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes] must + // match the call that provided the page token. + string page_token = 4; + + // A comma-separated list of fields to order by, sorted in ascending order. + // Use "desc" after a field name for descending. + // + // Supported fields: + // + // * `entity_type_id` + // * `create_time` + // * `update_time` + string order_by = 5; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 6; +} + +// Response message for [FeaturestoreService.ListEntityTypes][google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes]. +message ListEntityTypesResponse { + // The EntityTypes matching the request. + repeated EntityType entity_types = 1; + + // A token, which can be sent as [ListEntityTypesRequest.page_token][google.cloud.aiplatform.v1.ListEntityTypesRequest.page_token] to + // retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [FeaturestoreService.UpdateEntityType][google.cloud.aiplatform.v1.FeaturestoreService.UpdateEntityType]. +message UpdateEntityTypeRequest { + // Required. The EntityType's `name` field is used to identify the EntityType to be + // updated. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + EntityType entity_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Field mask is used to specify the fields to be overwritten in the + // EntityType resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then only the non-empty fields present in the + // request will be overwritten. Set the update_mask to `*` to override all + // fields. + // + // Updatable fields: + // + // * `description` + // * `labels` + // * `monitoring_config.snapshot_analysis.disabled` + // * `monitoring_config.snapshot_analysis.monitoring_interval_days` + // * `monitoring_config.snapshot_analysis.staleness_days` + // * `monitoring_config.import_features_analysis.state` + // * `monitoring_config.import_features_analysis.anomaly_detection_baseline` + // * `monitoring_config.numerical_threshold_config.value` + // * `monitoring_config.categorical_threshold_config.value` + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for [FeaturestoreService.DeleteEntityTypes][]. +message DeleteEntityTypeRequest { + // Required. The name of the EntityType to be deleted. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + } + ]; + + // If set to true, any Features for this EntityType will also be deleted. + // (Otherwise, the request will only work if the EntityType has no Features.) + bool force = 2; +} + +// Request message for [FeaturestoreService.CreateFeature][google.cloud.aiplatform.v1.FeaturestoreService.CreateFeature]. +message CreateFeatureRequest { + // Required. The resource name of the EntityType to create a Feature. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + } + ]; + + // Required. The Feature to create. + Feature feature = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the Feature, which will become the final component of + // the Feature's resource name. + // + // This value may be up to 60 characters, and valid characters are + // `[a-z0-9_]`. The first character cannot be a number. + // + // The value must be unique within an EntityType. + string feature_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [FeaturestoreService.BatchCreateFeatures][google.cloud.aiplatform.v1.FeaturestoreService.BatchCreateFeatures]. +message BatchCreateFeaturesRequest { + // Required. The resource name of the EntityType to create the batch of Features under. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + } + ]; + + // Required. The request message specifying the Features to create. All Features must be + // created under the same parent EntityType. The `parent` field in each child + // request message can be omitted. If `parent` is set in a child request, then + // the value must match the `parent` value in this request message. + repeated CreateFeatureRequest requests = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [FeaturestoreService.BatchCreateFeatures][google.cloud.aiplatform.v1.FeaturestoreService.BatchCreateFeatures]. +message BatchCreateFeaturesResponse { + // The Features created. + repeated Feature features = 1; +} + +// Request message for [FeaturestoreService.GetFeature][google.cloud.aiplatform.v1.FeaturestoreService.GetFeature]. +message GetFeatureRequest { + // Required. The name of the Feature resource. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Feature" + } + ]; +} + +// Request message for [FeaturestoreService.ListFeatures][google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures]. +message ListFeaturesRequest { + // Required. The resource name of the Location to list Features. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Feature" + } + ]; + + // Lists the Features that match the filter expression. The following + // filters are supported: + // + // * `value_type`: Supports = and != comparisons. + // * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + // be in RFC 3339 format. + // * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + // be in RFC 3339 format. + // * `labels`: Supports key-value equality as well as key presence. + // + // Examples: + // + // * `value_type = DOUBLE` --> Features whose type is DOUBLE. + // * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + // update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + // or updated after 2020-01-31T15:30:00.000000Z. + // * `labels.active = yes AND labels.env = prod` --> Features having both + // (active: yes) and (env: prod) labels. + // * `labels.env: *` --> Any Feature which has a label with 'env' as the + // key. + string filter = 2; + + // The maximum number of Features to return. The service may return fewer + // than this value. If unspecified, at most 1000 Features will be returned. + // The maximum value is 1000; any value greater than 1000 will be coerced to + // 1000. + int32 page_size = 3; + + // A page token, received from a previous + // [FeaturestoreService.ListFeatures][google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [FeaturestoreService.ListFeatures][google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures] must + // match the call that provided the page token. + string page_token = 4; + + // A comma-separated list of fields to order by, sorted in ascending order. + // Use "desc" after a field name for descending. + // Supported fields: + // + // * `feature_id` + // * `value_type` + // * `create_time` + // * `update_time` + string order_by = 5; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 6; + + // If set, return the most recent [ListFeaturesRequest.latest_stats_count][google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count] + // of stats for each Feature in response. Valid value is [0, 10]. If number of + // stats exists < [ListFeaturesRequest.latest_stats_count][google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count], return all + // existing stats. + int32 latest_stats_count = 7; +} + +// Response message for [FeaturestoreService.ListFeatures][google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures]. +message ListFeaturesResponse { + // The Features matching the request. + repeated Feature features = 1; + + // A token, which can be sent as [ListFeaturesRequest.page_token][google.cloud.aiplatform.v1.ListFeaturesRequest.page_token] to + // retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [FeaturestoreService.SearchFeatures][google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures]. +message SearchFeaturesRequest { + // Required. The resource name of the Location to search Features. + // Format: + // `projects/{project}/locations/{location}` + string location = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Query string that is a conjunction of field-restricted queries and/or + // field-restricted filters. Field-restricted queries and filters can be + // combined using `AND` to form a conjunction. + // + // A field query is in the form FIELD:QUERY. This implicitly checks if QUERY + // exists as a substring within Feature's FIELD. The QUERY + // and the FIELD are converted to a sequence of words (i.e. tokens) for + // comparison. This is done by: + // + // * Removing leading/trailing whitespace and tokenizing the search value. + // Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore + // `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated + // as a wildcard that matches characters within a token. + // * Ignoring case. + // * Prepending an asterisk to the first and appending an asterisk to the + // last token in QUERY. + // + // A QUERY must be either a singular token or a phrase. A phrase is one or + // multiple words enclosed in double quotation marks ("). With phrases, the + // order of the words is important. Words in the phrase must be matching in + // order and consecutively. + // + // Supported FIELDs for field-restricted queries: + // + // * `feature_id` + // * `description` + // * `entity_type_id` + // + // Examples: + // + // * `feature_id: foo` --> Matches a Feature with ID containing the substring + // `foo` (eg. `foo`, `foofeature`, `barfoo`). + // * `feature_id: foo*feature` --> Matches a Feature with ID containing the + // substring `foo*feature` (eg. `foobarfeature`). + // * `feature_id: foo AND description: bar` --> Matches a Feature with ID + // containing the substring `foo` and description containing the substring + // `bar`. + // + // + // Besides field queries, the following exact-match filters are + // supported. The exact-match filters do not support wildcards. Unlike + // field-restricted queries, exact-match filters are case-sensitive. + // + // * `feature_id`: Supports = comparisons. + // * `description`: Supports = comparisons. Multi-token filters should be + // enclosed in quotes. + // * `entity_type_id`: Supports = comparisons. + // * `value_type`: Supports = and != comparisons. + // * `labels`: Supports key-value equality as well as key presence. + // * `featurestore_id`: Supports = comparisons. + // + // Examples: + // * `description = "foo bar"` --> Any Feature with description exactly equal + // to `foo bar` + // * `value_type = DOUBLE` --> Features whose type is DOUBLE. + // * `labels.active = yes AND labels.env = prod` --> Features having both + // (active: yes) and (env: prod) labels. + // * `labels.env: *` --> Any Feature which has a label with `env` as the + // key. + string query = 3; + + // The maximum number of Features to return. The service may return fewer + // than this value. If unspecified, at most 100 Features will be returned. + // The maximum value is 100; any value greater than 100 will be coerced to + // 100. + int32 page_size = 4; + + // A page token, received from a previous + // [FeaturestoreService.SearchFeatures][google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [FeaturestoreService.SearchFeatures][google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures], except `page_size`, must + // match the call that provided the page token. + string page_token = 5; +} + +// Response message for [FeaturestoreService.SearchFeatures][google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures]. +message SearchFeaturesResponse { + // The Features matching the request. + // + // Fields returned: + // + // * `name` + // * `description` + // * `labels` + // * `create_time` + // * `update_time` + repeated Feature features = 1; + + // A token, which can be sent as [SearchFeaturesRequest.page_token][google.cloud.aiplatform.v1.SearchFeaturesRequest.page_token] to + // retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [FeaturestoreService.UpdateFeature][google.cloud.aiplatform.v1.FeaturestoreService.UpdateFeature]. +message UpdateFeatureRequest { + // Required. The Feature's `name` field is used to identify the Feature to be + // updated. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + Feature feature = 1 [(google.api.field_behavior) = REQUIRED]; + + // Field mask is used to specify the fields to be overwritten in the + // Features resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then only the non-empty fields present in the + // request will be overwritten. Set the update_mask to `*` to override all + // fields. + // + // Updatable fields: + // + // * `description` + // * `labels` + // * `disable_monitoring` + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for [FeaturestoreService.DeleteFeature][google.cloud.aiplatform.v1.FeaturestoreService.DeleteFeature]. +message DeleteFeatureRequest { + // Required. The name of the Features to be deleted. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Feature" + } + ]; +} + +// Details of operations that perform create Featurestore. +message CreateFeaturestoreOperationMetadata { + // Operation metadata for Featurestore. + GenericOperationMetadata generic_metadata = 1; +} + +// Details of operations that perform update Featurestore. +message UpdateFeaturestoreOperationMetadata { + // Operation metadata for Featurestore. + GenericOperationMetadata generic_metadata = 1; +} + +// Details of operations that perform import Feature values. +message ImportFeatureValuesOperationMetadata { + // Operation metadata for Featurestore import Feature values. + GenericOperationMetadata generic_metadata = 1; + + // Number of entities that have been imported by the operation. + int64 imported_entity_count = 2; + + // Number of Feature values that have been imported by the operation. + int64 imported_feature_value_count = 3; + + // The number of rows in input source that weren't imported due to either + // * Not having any featureValues. + // * Having a null entityId. + // * Having a null timestamp. + // * Not being parsable (applicable for CSV sources). + int64 invalid_row_count = 6; +} + +// Details of operations that exports Features values. +message ExportFeatureValuesOperationMetadata { + // Operation metadata for Featurestore export Feature values. + GenericOperationMetadata generic_metadata = 1; +} + +// Details of operations that batch reads Feature values. +message BatchReadFeatureValuesOperationMetadata { + // Operation metadata for Featurestore batch read Features values. + GenericOperationMetadata generic_metadata = 1; +} + +// Details of operations that perform create EntityType. +message CreateEntityTypeOperationMetadata { + // Operation metadata for EntityType. + GenericOperationMetadata generic_metadata = 1; +} + +// Details of operations that perform create Feature. +message CreateFeatureOperationMetadata { + // Operation metadata for Feature. + GenericOperationMetadata generic_metadata = 1; +} + +// Details of operations that perform batch create Features. +message BatchCreateFeaturesOperationMetadata { + // Operation metadata for Feature. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto new file mode 100644 index 00000000..dfe173dc --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto @@ -0,0 +1,110 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/custom_job.proto"; +import "google/cloud/aiplatform/v1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1/job_state.proto"; +import "google/cloud/aiplatform/v1/study.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "HyperparameterTuningJobProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Represents a HyperparameterTuningJob. A HyperparameterTuningJob +// has a Study specification and multiple CustomJobs with identical +// CustomJob specification. +message HyperparameterTuningJob { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/HyperparameterTuningJob" + pattern: "projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}" + }; + + // Output only. Resource name of the HyperparameterTuningJob. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the HyperparameterTuningJob. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Study configuration of the HyperparameterTuningJob. + StudySpec study_spec = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The desired total number of Trials. + int32 max_trial_count = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. The desired number of Trials to run in parallel. + int32 parallel_trial_count = 6 [(google.api.field_behavior) = REQUIRED]; + + // The number of failed Trials that need to be seen before failing + // the HyperparameterTuningJob. + // + // If set to 0, Vertex AI decides how many Trials must fail + // before the whole job fails. + int32 max_failed_trial_count = 7; + + // Required. The spec of a trial job. The same spec applies to the CustomJobs created + // in all the trials. + CustomJobSpec trial_job_spec = 8 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Trials of the HyperparameterTuningJob. + repeated Trial trials = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The detailed state of the job. + JobState state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the HyperparameterTuningJob was created. + google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the HyperparameterTuningJob for the first time entered the + // `JOB_STATE_RUNNING` state. + google.protobuf.Timestamp start_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the HyperparameterTuningJob entered any of the following states: + // `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. + google.protobuf.Timestamp end_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the HyperparameterTuningJob was most recently updated. + google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Only populated when job's state is JOB_STATE_FAILED or + // JOB_STATE_CANCELLED. + google.rpc.Status error = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize HyperparameterTuningJobs. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 16; + + // Customer-managed encryption key options for a HyperparameterTuningJob. + // If this is set, then all resources created by the HyperparameterTuningJob + // will be encrypted with the provided encryption key. + EncryptionSpec encryption_spec = 17; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index.proto new file mode 100644 index 00000000..adf329aa --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index.proto @@ -0,0 +1,96 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/deployed_index_ref.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "IndexProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A representation of a collection of database items organized in a way that +// allows for approximate nearest neighbor (a.k.a ANN) algorithms search. +message Index { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Index" + pattern: "projects/{project}/locations/{location}/indexes/{index}" + }; + + // Output only. The resource name of the Index. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the Index. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the Index. + string description = 3; + + // Immutable. Points to a YAML file stored on Google Cloud Storage describing additional + // information about the Index, that is specific to it. Unset if the Index + // does not have any additional information. + // The schema is defined as an OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + // Note: The URI given on output will be immutable and probably different, + // including the URI scheme, than the one given on input. The output URI will + // point to a location where the user only has a read access. + string metadata_schema_uri = 4 [(google.api.field_behavior) = IMMUTABLE]; + + // An additional information about the Index; the schema of the metadata can + // be found in [metadata_schema][google.cloud.aiplatform.v1.Index.metadata_schema_uri]. + google.protobuf.Value metadata = 6; + + // Output only. The pointers to DeployedIndexes created from this Index. + // An Index can be only deleted if all its DeployedIndexes had been undeployed + // first. + repeated DeployedIndexRef deployed_indexes = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 8; + + // The labels with user-defined metadata to organize your Indexes. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 9; + + // Output only. Timestamp when this Index was created. + google.protobuf.Timestamp create_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Index was most recently updated. + // This also includes any update to the contents of the Index. + // Note that Operations working on this Index may have their + // [Operations.metadata.generic_metadata.update_time] + // [google.cloud.aiplatform.v1.GenericOperationMetadata.update_time] a little after the value of this + // timestamp, yet that does not mean their results are not already reflected + // in the Index. Result of any successfully completed Operation on the Index + // is reflected in it. + google.protobuf.Timestamp update_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_endpoint.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_endpoint.proto new file mode 100644 index 00000000..9f1e9941 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_endpoint.proto @@ -0,0 +1,245 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/machine_resources.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "IndexEndpointProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Indexes are deployed into it. An IndexEndpoint can have multiple +// DeployedIndexes. +message IndexEndpoint { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/IndexEndpoint" + pattern: "projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}" + }; + + // Output only. The resource name of the IndexEndpoint. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the IndexEndpoint. + // The name can be up to 128 characters long and can consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the IndexEndpoint. + string description = 3; + + // Output only. The indexes deployed in this endpoint. + repeated DeployedIndex deployed_indexes = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 5; + + // The labels with user-defined metadata to organize your IndexEndpoints. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 6; + + // Output only. Timestamp when this IndexEndpoint was created. + google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this IndexEndpoint was last updated. + // This timestamp is not updated when the endpoint's DeployedIndexes are + // updated, e.g. due to updates of the original Indexes they are the + // deployments of. + google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The full name of the Google Compute Engine + // [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) + // to which the IndexEndpoint should be peered. + // + // Private services access must already be configured for the network. If left + // unspecified, the Endpoint is not peered with any network. + // + // [network][google.cloud.aiplatform.v1.IndexEndpoint.network] and + // [private_service_connect_config][google.cloud.aiplatform.v1.IndexEndpoint.private_service_connect_config] + // are mutually exclusive. + // + // [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert): + // projects/{project}/global/networks/{network}. + // Where {project} is a project number, as in '12345', and {network} is + // network name. + string network = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deprecated: If true, expose the IndexEndpoint via private service connect. + // + // Only one of the fields, [network][google.cloud.aiplatform.v1.IndexEndpoint.network] or + // [enable_private_service_connect][google.cloud.aiplatform.v1.IndexEndpoint.enable_private_service_connect], + // can be set. + bool enable_private_service_connect = 10 [ + deprecated = true, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// A deployment of an Index. IndexEndpoints contain one or more DeployedIndexes. +message DeployedIndex { + // Required. The user specified ID of the DeployedIndex. + // The ID can be up to 128 characters long and must start with a letter and + // only contain letters, numbers, and underscores. + // The ID must be unique within the project it is created in. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the Index this is the deployment of. + // We may refer to this Index as the DeployedIndex's "original" Index. + string index = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Index" + } + ]; + + // The display name of the DeployedIndex. If not provided upon creation, + // the Index's display_name is used. + string display_name = 3; + + // Output only. Timestamp when the DeployedIndex was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Provides paths for users to send requests directly to the deployed index + // services running on Cloud via private services access. This field is + // populated if [network][google.cloud.aiplatform.v1.IndexEndpoint.network] is configured. + IndexPrivateEndpoints private_endpoints = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The DeployedIndex may depend on various data on its original Index. + // Additionally when certain changes to the original Index are being done + // (e.g. when what the Index contains is being changed) the DeployedIndex may + // be asynchronously updated in the background to reflect this changes. + // If this timestamp's value is at least the [Index.update_time][google.cloud.aiplatform.v1.Index.update_time] of the + // original Index, it means that this DeployedIndex and the original Index are + // in sync. If this timestamp is older, then to see which updates this + // DeployedIndex already contains (and which not), one must + // [list][Operations.ListOperations] [Operations][Operation] + // [working][Operation.name] on the original Index. Only + // the successfully completed Operations with + // [Operations.metadata.generic_metadata.update_time] + // [google.cloud.aiplatform.v1.GenericOperationMetadata.update_time] + // equal or before this sync time are contained in this DeployedIndex. + google.protobuf.Timestamp index_sync_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A description of resources that the DeployedIndex uses, which to large + // degree are decided by Vertex AI, and optionally allows only a modest + // additional configuration. + // If min_replica_count is not set, the default value is 2 (we don't provide + // SLA when min_replica_count=1). If max_replica_count is not set, the + // default value is min_replica_count. The max allowed replica count is + // 1000. + AutomaticResources automatic_resources = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A description of resources that are dedicated to the DeployedIndex, and + // that need a higher degree of manual configuration. + // If min_replica_count is not set, the default value is 2 (we don't provide + // SLA when min_replica_count=1). If max_replica_count is not set, the + // default value is min_replica_count. The max allowed replica count is + // 1000. + // + // Available machine types: + // n1-standard-16 + // n1-standard-32 + DedicatedResources dedicated_resources = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, private endpoint's access logs are sent to StackDriver Logging. + // + // These logs are like standard server access logs, containing + // information like timestamp and latency for each MatchRequest. + // + // Note that Stackdriver logs may incur a cost, especially if the deployed + // index receives a high queries per second rate (QPS). + // Estimate your costs before enabling this option. + bool enable_access_logging = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the authentication is enabled for the private endpoint. + DeployedIndexAuthConfig deployed_index_auth_config = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of reserved ip ranges under the VPC network that can be + // used for this DeployedIndex. + // + // If set, we will deploy the index within the provided ip ranges. Otherwise, + // the index might be deployed to any ip ranges under the provided VPC + // network. + // + // The value sohuld be the name of the address + // (https://cloud.google.com/compute/docs/reference/rest/v1/addresses) + // Example: 'vertex-ai-ip-range'. + repeated string reserved_ip_ranges = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The deployment group can be no longer than 64 characters (eg: + // 'test', 'prod'). If not set, we will use the 'default' deployment group. + // + // Creating `deployment_groups` with `reserved_ip_ranges` is a recommended + // practice when the peered network has multiple peering ranges. This creates + // your deployments from predictable IP spaces for easier traffic + // administration. Also, one deployment_group (except 'default') can only be + // used with the same reserved_ip_ranges which means if the deployment_group + // has been used with reserved_ip_ranges: [a, b, c], using it with [a, b] or + // [d, e] is disallowed. + // + // Note: we only support up to 5 deployment groups(not including 'default'). + string deployment_group = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// Used to set up the auth on the DeployedIndex's private endpoint. +message DeployedIndexAuthConfig { + // Configuration for an authentication provider, including support for + // [JSON Web Token + // (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). + message AuthProvider { + // The list of JWT + // [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + // that are allowed to access. A JWT containing any of these audiences will + // be accepted. + repeated string audiences = 1; + + // A list of allowed JWT issuers. Each entry must be a valid Google + // service account, in the following format: + // + // `service-account-name@project-id.iam.gserviceaccount.com` + repeated string allowed_issuers = 2; + } + + // Defines the authentication provider that the DeployedIndex uses. + AuthProvider auth_provider = 1; +} + +// IndexPrivateEndpoints proto is used to provide paths for users to send +// requests via private endpoints (e.g. private service access, private service +// connect). +// To send request via private service access, use match_grpc_address. +// To send request via private service connect, use service_attachment. +message IndexPrivateEndpoints { + // Output only. The ip address used to send match gRPC requests. + string match_grpc_address = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the service attachment resource. Populated if private service + // connect is enabled. + string service_attachment = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_endpoint_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_endpoint_service.proto new file mode 100644 index 00000000..8acdb5bc --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_endpoint_service.proto @@ -0,0 +1,335 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/index_endpoint.proto"; +import "google/cloud/aiplatform/v1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "IndexEndpointServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A service for managing Vertex AI's IndexEndpoints. +service IndexEndpointService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates an IndexEndpoint. + rpc CreateIndexEndpoint(CreateIndexEndpointRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/indexEndpoints" + body: "index_endpoint" + }; + option (google.api.method_signature) = "parent,index_endpoint"; + option (google.longrunning.operation_info) = { + response_type: "IndexEndpoint" + metadata_type: "CreateIndexEndpointOperationMetadata" + }; + } + + // Gets an IndexEndpoint. + rpc GetIndexEndpoint(GetIndexEndpointRequest) returns (IndexEndpoint) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/indexEndpoints/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists IndexEndpoints in a Location. + rpc ListIndexEndpoints(ListIndexEndpointsRequest) returns (ListIndexEndpointsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/indexEndpoints" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates an IndexEndpoint. + rpc UpdateIndexEndpoint(UpdateIndexEndpointRequest) returns (IndexEndpoint) { + option (google.api.http) = { + patch: "/v1/{index_endpoint.name=projects/*/locations/*/indexEndpoints/*}" + body: "index_endpoint" + }; + option (google.api.method_signature) = "index_endpoint,update_mask"; + } + + // Deletes an IndexEndpoint. + rpc DeleteIndexEndpoint(DeleteIndexEndpointRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/indexEndpoints/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Deploys an Index into this IndexEndpoint, creating a DeployedIndex within + // it. + // Only non-empty Indexes can be deployed. + rpc DeployIndex(DeployIndexRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:deployIndex" + body: "*" + }; + option (google.api.method_signature) = "index_endpoint,deployed_index"; + option (google.longrunning.operation_info) = { + response_type: "DeployIndexResponse" + metadata_type: "DeployIndexOperationMetadata" + }; + } + + // Undeploys an Index from an IndexEndpoint, removing a DeployedIndex from it, + // and freeing all resources it's using. + rpc UndeployIndex(UndeployIndexRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:undeployIndex" + body: "*" + }; + option (google.api.method_signature) = "index_endpoint,deployed_index_id"; + option (google.longrunning.operation_info) = { + response_type: "UndeployIndexResponse" + metadata_type: "UndeployIndexOperationMetadata" + }; + } + + // Update an existing DeployedIndex under an IndexEndpoint. + rpc MutateDeployedIndex(MutateDeployedIndexRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:mutateDeployedIndex" + body: "deployed_index" + }; + option (google.api.method_signature) = "index_endpoint,deployed_index"; + option (google.longrunning.operation_info) = { + response_type: "MutateDeployedIndexResponse" + metadata_type: "MutateDeployedIndexOperationMetadata" + }; + } +} + +// Request message for [IndexEndpointService.CreateIndexEndpoint][google.cloud.aiplatform.v1.IndexEndpointService.CreateIndexEndpoint]. +message CreateIndexEndpointRequest { + // Required. The resource name of the Location to create the IndexEndpoint in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The IndexEndpoint to create. + IndexEndpoint index_endpoint = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Runtime operation information for +// [IndexEndpointService.CreateIndexEndpoint][google.cloud.aiplatform.v1.IndexEndpointService.CreateIndexEndpoint]. +message CreateIndexEndpointOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [IndexEndpointService.GetIndexEndpoint][google.cloud.aiplatform.v1.IndexEndpointService.GetIndexEndpoint] +message GetIndexEndpointRequest { + // Required. The name of the IndexEndpoint resource. + // Format: + // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/IndexEndpoint" + } + ]; +} + +// Request message for [IndexEndpointService.ListIndexEndpoints][google.cloud.aiplatform.v1.IndexEndpointService.ListIndexEndpoints]. +message ListIndexEndpointsRequest { + // Required. The resource name of the Location from which to list the IndexEndpoints. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. An expression for filtering the results of the request. For field names + // both snake_case and camelCase are supported. + // + // * `index_endpoint` supports = and !=. `index_endpoint` represents the + // IndexEndpoint ID, ie. the last segment of the IndexEndpoint's + // [resourcename][google.cloud.aiplatform.v1.IndexEndpoint.name]. + // * `display_name` supports =, != and regex() + // (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) + // * `labels` supports general map functions that is: + // `labels.key=value` - key:value equality + // `labels.key:* or labels:key - key existence + // A key including a space must be quoted. `labels."a key"`. + // + // Some examples: + // * `index_endpoint="1"` + // * `display_name="myDisplayName"` + // * `regex(display_name, "^A") -> The display name starts with an A. + // * `labels.myKey="myValue"` + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page size. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page token. + // Typically obtained via + // [ListIndexEndpointsResponse.next_page_token][google.cloud.aiplatform.v1.ListIndexEndpointsResponse.next_page_token] of the previous + // [IndexEndpointService.ListIndexEndpoints][google.cloud.aiplatform.v1.IndexEndpointService.ListIndexEndpoints] call. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [IndexEndpointService.ListIndexEndpoints][google.cloud.aiplatform.v1.IndexEndpointService.ListIndexEndpoints]. +message ListIndexEndpointsResponse { + // List of IndexEndpoints in the requested page. + repeated IndexEndpoint index_endpoints = 1; + + // A token to retrieve next page of results. + // Pass to [ListIndexEndpointsRequest.page_token][google.cloud.aiplatform.v1.ListIndexEndpointsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [IndexEndpointService.UpdateIndexEndpoint][google.cloud.aiplatform.v1.IndexEndpointService.UpdateIndexEndpoint]. +message UpdateIndexEndpointRequest { + // Required. The IndexEndpoint which replaces the resource on the server. + IndexEndpoint index_endpoint = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. See [google.protobuf.FieldMask][google.protobuf.FieldMask]. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [IndexEndpointService.DeleteIndexEndpoint][google.cloud.aiplatform.v1.IndexEndpointService.DeleteIndexEndpoint]. +message DeleteIndexEndpointRequest { + // Required. The name of the IndexEndpoint resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/IndexEndpoint" + } + ]; +} + +// Request message for [IndexEndpointService.DeployIndex][google.cloud.aiplatform.v1.IndexEndpointService.DeployIndex]. +message DeployIndexRequest { + // Required. The name of the IndexEndpoint resource into which to deploy an Index. + // Format: + // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + string index_endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/IndexEndpoint" + } + ]; + + // Required. The DeployedIndex to be created within the IndexEndpoint. + DeployedIndex deployed_index = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [IndexEndpointService.DeployIndex][google.cloud.aiplatform.v1.IndexEndpointService.DeployIndex]. +message DeployIndexResponse { + // The DeployedIndex that had been deployed in the IndexEndpoint. + DeployedIndex deployed_index = 1; +} + +// Runtime operation information for [IndexEndpointService.DeployIndex][google.cloud.aiplatform.v1.IndexEndpointService.DeployIndex]. +message DeployIndexOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; + + // The unique index id specified by user + string deployed_index_id = 2; +} + +// Request message for [IndexEndpointService.UndeployIndex][google.cloud.aiplatform.v1.IndexEndpointService.UndeployIndex]. +message UndeployIndexRequest { + // Required. The name of the IndexEndpoint resource from which to undeploy an Index. + // Format: + // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + string index_endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/IndexEndpoint" + } + ]; + + // Required. The ID of the DeployedIndex to be undeployed from the IndexEndpoint. + string deployed_index_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [IndexEndpointService.UndeployIndex][google.cloud.aiplatform.v1.IndexEndpointService.UndeployIndex]. +message UndeployIndexResponse { + +} + +// Runtime operation information for [IndexEndpointService.UndeployIndex][google.cloud.aiplatform.v1.IndexEndpointService.UndeployIndex]. +message UndeployIndexOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [IndexEndpointService.MutateDeployedIndex][google.cloud.aiplatform.v1.IndexEndpointService.MutateDeployedIndex]. +message MutateDeployedIndexRequest { + // Required. The name of the IndexEndpoint resource into which to deploy an Index. + // Format: + // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + string index_endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/IndexEndpoint" + } + ]; + + // Required. The DeployedIndex to be updated within the IndexEndpoint. + // Currently, the updatable fields are [DeployedIndex][automatic_resources] + // and [DeployedIndex][dedicated_resources] + DeployedIndex deployed_index = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [IndexEndpointService.MutateDeployedIndex][google.cloud.aiplatform.v1.IndexEndpointService.MutateDeployedIndex]. +message MutateDeployedIndexResponse { + // The DeployedIndex that had been updated in the IndexEndpoint. + DeployedIndex deployed_index = 1; +} + +// Runtime operation information for +// [IndexEndpointService.MutateDeployedIndex][google.cloud.aiplatform.v1.IndexEndpointService.MutateDeployedIndex]. +message MutateDeployedIndexOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; + + // The unique index id specified by user + string deployed_index_id = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_service.proto new file mode 100644 index 00000000..f3812b98 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_service.proto @@ -0,0 +1,277 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/index.proto"; +import "google/cloud/aiplatform/v1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "IndexServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A service for creating and managing Vertex AI's Index resources. +service IndexService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates an Index. + rpc CreateIndex(CreateIndexRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/indexes" + body: "index" + }; + option (google.api.method_signature) = "parent,index"; + option (google.longrunning.operation_info) = { + response_type: "Index" + metadata_type: "CreateIndexOperationMetadata" + }; + } + + // Gets an Index. + rpc GetIndex(GetIndexRequest) returns (Index) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/indexes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Indexes in a Location. + rpc ListIndexes(ListIndexesRequest) returns (ListIndexesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/indexes" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates an Index. + rpc UpdateIndex(UpdateIndexRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{index.name=projects/*/locations/*/indexes/*}" + body: "index" + }; + option (google.api.method_signature) = "index,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Index" + metadata_type: "UpdateIndexOperationMetadata" + }; + } + + // Deletes an Index. + // An Index can only be deleted when all its + // [DeployedIndexes][google.cloud.aiplatform.v1.Index.deployed_indexes] had been undeployed. + rpc DeleteIndex(DeleteIndexRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/indexes/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } +} + +// Request message for [IndexService.CreateIndex][google.cloud.aiplatform.v1.IndexService.CreateIndex]. +message CreateIndexRequest { + // Required. The resource name of the Location to create the Index in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The Index to create. + Index index = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Runtime operation information for [IndexService.CreateIndex][google.cloud.aiplatform.v1.IndexService.CreateIndex]. +message CreateIndexOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; + + // The operation metadata with regard to Matching Engine Index operation. + NearestNeighborSearchOperationMetadata nearest_neighbor_search_operation_metadata = 2; +} + +// Request message for [IndexService.GetIndex][google.cloud.aiplatform.v1.IndexService.GetIndex] +message GetIndexRequest { + // Required. The name of the Index resource. + // Format: + // `projects/{project}/locations/{location}/indexes/{index}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Index" + } + ]; +} + +// Request message for [IndexService.ListIndexes][google.cloud.aiplatform.v1.IndexService.ListIndexes]. +message ListIndexesRequest { + // Required. The resource name of the Location from which to list the Indexes. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The standard list filter. + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListIndexesResponse.next_page_token][google.cloud.aiplatform.v1.ListIndexesResponse.next_page_token] of the previous + // [IndexService.ListIndexes][google.cloud.aiplatform.v1.IndexService.ListIndexes] call. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for [IndexService.ListIndexes][google.cloud.aiplatform.v1.IndexService.ListIndexes]. +message ListIndexesResponse { + // List of indexes in the requested page. + repeated Index indexes = 1; + + // A token to retrieve next page of results. + // Pass to [ListIndexesRequest.page_token][google.cloud.aiplatform.v1.ListIndexesRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [IndexService.UpdateIndex][google.cloud.aiplatform.v1.IndexService.UpdateIndex]. +message UpdateIndexRequest { + // Required. The Index which updates the resource on the server. + Index index = 1 [(google.api.field_behavior) = REQUIRED]; + + // The update mask applies to the resource. + // For the `FieldMask` definition, see [google.protobuf.FieldMask][google.protobuf.FieldMask]. + google.protobuf.FieldMask update_mask = 2; +} + +// Runtime operation information for [IndexService.UpdateIndex][google.cloud.aiplatform.v1.IndexService.UpdateIndex]. +message UpdateIndexOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; + + // The operation metadata with regard to Matching Engine Index operation. + NearestNeighborSearchOperationMetadata nearest_neighbor_search_operation_metadata = 2; +} + +// Request message for [IndexService.DeleteIndex][google.cloud.aiplatform.v1.IndexService.DeleteIndex]. +message DeleteIndexRequest { + // Required. The name of the Index resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/indexes/{index}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Index" + } + ]; +} + +// Runtime operation metadata with regard to Matching Engine Index. +message NearestNeighborSearchOperationMetadata { + message RecordError { + enum RecordErrorType { + // Default, shall not be used. + ERROR_TYPE_UNSPECIFIED = 0; + + // The record is empty. + EMPTY_LINE = 1; + + // Invalid json format. + INVALID_JSON_SYNTAX = 2; + + // Invalid csv format. + INVALID_CSV_SYNTAX = 3; + + // Invalid avro format. + INVALID_AVRO_SYNTAX = 4; + + // The embedding id is not valid. + INVALID_EMBEDDING_ID = 5; + + // The size of the embedding vectors does not match with the specified + // dimension. + EMBEDDING_SIZE_MISMATCH = 6; + + // The `namespace` field is missing. + NAMESPACE_MISSING = 7; + } + + // The error type of this record. + RecordErrorType error_type = 1; + + // A human-readable message that is shown to the user to help them fix the + // error. Note that this message may change from time to time, your code + // should check against error_type as the source of truth. + string error_message = 2; + + // Cloud Storage URI pointing to the original file in user's bucket. + string source_gcs_uri = 3; + + // Empty if the embedding id is failed to parse. + string embedding_id = 4; + + // The original content of this record. + string raw_record = 5; + } + + message ContentValidationStats { + // Cloud Storage URI pointing to the original file in user's bucket. + string source_gcs_uri = 1; + + // Number of records in this file that were successfully processed. + int64 valid_record_count = 2; + + // Number of records in this file we skipped due to validate errors. + int64 invalid_record_count = 3; + + // The detail information of the partial failures encountered for those + // invalid records that couldn't be parsed. + // Up to 50 partial errors will be reported. + repeated RecordError partial_errors = 4; + } + + // The validation stats of the content (per file) to be inserted or + // updated on the Matching Engine Index resource. Populated if + // contentsDeltaUri is provided as part of [Index.metadata][google.cloud.aiplatform.v1.Index.metadata]. Please note + // that, currently for those files that are broken or has unsupported file + // format, we will not have the stats for those files. + repeated ContentValidationStats content_validation_stats = 1; + + // The ingested data size in bytes. + int64 data_bytes_count = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/io.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/io.proto new file mode 100644 index 00000000..43d5fdc6 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/io.proto @@ -0,0 +1,108 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "IoProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// The storage details for Avro input content. +message AvroSource { + // Required. Google Cloud Storage location. + GcsSource gcs_source = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The storage details for CSV input content. +message CsvSource { + // Required. Google Cloud Storage location. + GcsSource gcs_source = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The Google Cloud Storage location for the input content. +message GcsSource { + // Required. Google Cloud Storage URI(-s) to the input file(s). May contain + // wildcards. For more information on wildcards, see + // https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames. + repeated string uris = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The Google Cloud Storage location where the output is to be written to. +message GcsDestination { + // Required. Google Cloud Storage URI to output directory. If the uri doesn't end with + // '/', a '/' will be automatically appended. The directory is created if it + // doesn't exist. + string output_uri_prefix = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The BigQuery location for the input content. +message BigQuerySource { + // Required. BigQuery URI to a table, up to 2000 characters long. + // Accepted forms: + // + // * BigQuery path. For example: `bq://projectId.bqDatasetId.bqTableId`. + string input_uri = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The BigQuery location for the output content. +message BigQueryDestination { + // Required. BigQuery URI to a project or table, up to 2000 characters long. + // + // When only the project is specified, the Dataset and Table is created. + // When the full table reference is specified, the Dataset must exist and + // table must not exist. + // + // Accepted forms: + // + // * BigQuery path. For example: + // `bq://projectId` or `bq://projectId.bqDatasetId` or + // `bq://projectId.bqDatasetId.bqTableId`. + string output_uri = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The storage details for CSV output content. +message CsvDestination { + // Required. Google Cloud Storage location. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The storage details for TFRecord output content. +message TFRecordDestination { + // Required. Google Cloud Storage location. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The Container Registry location for the container image. +message ContainerRegistryDestination { + // Required. Container Registry URI of a container image. + // Only Google Container Registry and Artifact Registry are supported now. + // Accepted forms: + // + // * Google Container Registry path. For example: + // `gcr.io/projectId/imageName:tag`. + // + // * Artifact Registry path. For example: + // `us-central1-docker.pkg.dev/projectId/repoName/imageName:tag`. + // + // If a tag is not specified, "latest" will be used as the default tag. + string output_uri = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/job_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/job_service.proto new file mode 100644 index 00000000..493ee7ad --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/job_service.proto @@ -0,0 +1,1003 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/batch_prediction_job.proto"; +import "google/cloud/aiplatform/v1/custom_job.proto"; +import "google/cloud/aiplatform/v1/data_labeling_job.proto"; +import "google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto"; +import "google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto"; +import "google/cloud/aiplatform/v1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "JobServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A service for creating and managing Vertex AI's jobs. +service JobService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a CustomJob. A created CustomJob right away + // will be attempted to be run. + rpc CreateCustomJob(CreateCustomJobRequest) returns (CustomJob) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/customJobs" + body: "custom_job" + }; + option (google.api.method_signature) = "parent,custom_job"; + } + + // Gets a CustomJob. + rpc GetCustomJob(GetCustomJobRequest) returns (CustomJob) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/customJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists CustomJobs in a Location. + rpc ListCustomJobs(ListCustomJobsRequest) returns (ListCustomJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/customJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a CustomJob. + rpc DeleteCustomJob(DeleteCustomJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/customJobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Cancels a CustomJob. + // Starts asynchronous cancellation on the CustomJob. The server + // makes a best effort to cancel the job, but success is not + // guaranteed. Clients can use [JobService.GetCustomJob][google.cloud.aiplatform.v1.JobService.GetCustomJob] or + // other methods to check whether the cancellation succeeded or whether the + // job completed despite cancellation. On successful cancellation, + // the CustomJob is not deleted; instead it becomes a job with + // a [CustomJob.error][google.cloud.aiplatform.v1.CustomJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`, and [CustomJob.state][google.cloud.aiplatform.v1.CustomJob.state] is set to + // `CANCELLED`. + rpc CancelCustomJob(CancelCustomJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/customJobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a DataLabelingJob. + rpc CreateDataLabelingJob(CreateDataLabelingJobRequest) returns (DataLabelingJob) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/dataLabelingJobs" + body: "data_labeling_job" + }; + option (google.api.method_signature) = "parent,data_labeling_job"; + } + + // Gets a DataLabelingJob. + rpc GetDataLabelingJob(GetDataLabelingJobRequest) returns (DataLabelingJob) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/dataLabelingJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists DataLabelingJobs in a Location. + rpc ListDataLabelingJobs(ListDataLabelingJobsRequest) returns (ListDataLabelingJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/dataLabelingJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a DataLabelingJob. + rpc DeleteDataLabelingJob(DeleteDataLabelingJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/dataLabelingJobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Cancels a DataLabelingJob. Success of cancellation is not guaranteed. + rpc CancelDataLabelingJob(CancelDataLabelingJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/dataLabelingJobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a HyperparameterTuningJob + rpc CreateHyperparameterTuningJob(CreateHyperparameterTuningJobRequest) returns (HyperparameterTuningJob) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/hyperparameterTuningJobs" + body: "hyperparameter_tuning_job" + }; + option (google.api.method_signature) = "parent,hyperparameter_tuning_job"; + } + + // Gets a HyperparameterTuningJob + rpc GetHyperparameterTuningJob(GetHyperparameterTuningJobRequest) returns (HyperparameterTuningJob) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists HyperparameterTuningJobs in a Location. + rpc ListHyperparameterTuningJobs(ListHyperparameterTuningJobsRequest) returns (ListHyperparameterTuningJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/hyperparameterTuningJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a HyperparameterTuningJob. + rpc DeleteHyperparameterTuningJob(DeleteHyperparameterTuningJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Cancels a HyperparameterTuningJob. + // Starts asynchronous cancellation on the HyperparameterTuningJob. The server + // makes a best effort to cancel the job, but success is not + // guaranteed. Clients can use [JobService.GetHyperparameterTuningJob][google.cloud.aiplatform.v1.JobService.GetHyperparameterTuningJob] or + // other methods to check whether the cancellation succeeded or whether the + // job completed despite cancellation. On successful cancellation, + // the HyperparameterTuningJob is not deleted; instead it becomes a job with + // a [HyperparameterTuningJob.error][google.cloud.aiplatform.v1.HyperparameterTuningJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] + // of 1, corresponding to `Code.CANCELLED`, and + // [HyperparameterTuningJob.state][google.cloud.aiplatform.v1.HyperparameterTuningJob.state] is set to `CANCELLED`. + rpc CancelHyperparameterTuningJob(CancelHyperparameterTuningJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a BatchPredictionJob. A BatchPredictionJob once created will + // right away be attempted to start. + rpc CreateBatchPredictionJob(CreateBatchPredictionJobRequest) returns (BatchPredictionJob) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/batchPredictionJobs" + body: "batch_prediction_job" + }; + option (google.api.method_signature) = "parent,batch_prediction_job"; + } + + // Gets a BatchPredictionJob + rpc GetBatchPredictionJob(GetBatchPredictionJobRequest) returns (BatchPredictionJob) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/batchPredictionJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists BatchPredictionJobs in a Location. + rpc ListBatchPredictionJobs(ListBatchPredictionJobsRequest) returns (ListBatchPredictionJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/batchPredictionJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a BatchPredictionJob. Can only be called on jobs that already + // finished. + rpc DeleteBatchPredictionJob(DeleteBatchPredictionJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/batchPredictionJobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Cancels a BatchPredictionJob. + // + // Starts asynchronous cancellation on the BatchPredictionJob. The server + // makes the best effort to cancel the job, but success is not + // guaranteed. Clients can use [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob] or + // other methods to check whether the cancellation succeeded or whether the + // job completed despite cancellation. On a successful cancellation, + // the BatchPredictionJob is not deleted;instead its + // [BatchPredictionJob.state][google.cloud.aiplatform.v1.BatchPredictionJob.state] is set to `CANCELLED`. Any files already + // outputted by the job are not deleted. + rpc CancelBatchPredictionJob(CancelBatchPredictionJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/batchPredictionJobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a ModelDeploymentMonitoringJob. It will run periodically on a + // configured interval. + rpc CreateModelDeploymentMonitoringJob(CreateModelDeploymentMonitoringJobRequest) returns (ModelDeploymentMonitoringJob) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/modelDeploymentMonitoringJobs" + body: "model_deployment_monitoring_job" + }; + option (google.api.method_signature) = "parent,model_deployment_monitoring_job"; + } + + // Searches Model Monitoring Statistics generated within a given time window. + rpc SearchModelDeploymentMonitoringStatsAnomalies(SearchModelDeploymentMonitoringStatsAnomaliesRequest) returns (SearchModelDeploymentMonitoringStatsAnomaliesResponse) { + option (google.api.http) = { + post: "/v1/{model_deployment_monitoring_job=projects/*/locations/*/modelDeploymentMonitoringJobs/*}:searchModelDeploymentMonitoringStatsAnomalies" + body: "*" + }; + option (google.api.method_signature) = "model_deployment_monitoring_job,deployed_model_id"; + } + + // Gets a ModelDeploymentMonitoringJob. + rpc GetModelDeploymentMonitoringJob(GetModelDeploymentMonitoringJobRequest) returns (ModelDeploymentMonitoringJob) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists ModelDeploymentMonitoringJobs in a Location. + rpc ListModelDeploymentMonitoringJobs(ListModelDeploymentMonitoringJobsRequest) returns (ListModelDeploymentMonitoringJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/modelDeploymentMonitoringJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a ModelDeploymentMonitoringJob. + rpc UpdateModelDeploymentMonitoringJob(UpdateModelDeploymentMonitoringJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{model_deployment_monitoring_job.name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}" + body: "model_deployment_monitoring_job" + }; + option (google.api.method_signature) = "model_deployment_monitoring_job,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "ModelDeploymentMonitoringJob" + metadata_type: "UpdateModelDeploymentMonitoringJobOperationMetadata" + }; + } + + // Deletes a ModelDeploymentMonitoringJob. + rpc DeleteModelDeploymentMonitoringJob(DeleteModelDeploymentMonitoringJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Pauses a ModelDeploymentMonitoringJob. If the job is running, the server + // makes a best effort to cancel the job. Will mark + // [ModelDeploymentMonitoringJob.state][google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.state] to 'PAUSED'. + rpc PauseModelDeploymentMonitoringJob(PauseModelDeploymentMonitoringJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}:pause" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Resumes a paused ModelDeploymentMonitoringJob. It will start to run from + // next scheduled time. A deleted ModelDeploymentMonitoringJob can't be + // resumed. + rpc ResumeModelDeploymentMonitoringJob(ResumeModelDeploymentMonitoringJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}:resume" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for [JobService.CreateCustomJob][google.cloud.aiplatform.v1.JobService.CreateCustomJob]. +message CreateCustomJobRequest { + // Required. The resource name of the Location to create the CustomJob in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The CustomJob to create. + CustomJob custom_job = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [JobService.GetCustomJob][google.cloud.aiplatform.v1.JobService.GetCustomJob]. +message GetCustomJobRequest { + // Required. The name of the CustomJob resource. + // Format: + // `projects/{project}/locations/{location}/customJobs/{custom_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/CustomJob" + } + ]; +} + +// Request message for [JobService.ListCustomJobs][google.cloud.aiplatform.v1.JobService.ListCustomJobs]. +message ListCustomJobsRequest { + // Required. The resource name of the Location to list the CustomJobs from. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The standard list filter. + // + // Supported fields: + // + // * `display_name` supports = and !=. + // + // * `state` supports = and !=. + // + // Some examples of using the filter are: + // + // * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + // + // * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + // + // * `NOT display_name="my_job"` + // + // * `state="JOB_STATE_FAILED"` + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListCustomJobsResponse.next_page_token][google.cloud.aiplatform.v1.ListCustomJobsResponse.next_page_token] of the previous + // [JobService.ListCustomJobs][google.cloud.aiplatform.v1.JobService.ListCustomJobs] call. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for [JobService.ListCustomJobs][google.cloud.aiplatform.v1.JobService.ListCustomJobs] +message ListCustomJobsResponse { + // List of CustomJobs in the requested page. + repeated CustomJob custom_jobs = 1; + + // A token to retrieve the next page of results. + // Pass to [ListCustomJobsRequest.page_token][google.cloud.aiplatform.v1.ListCustomJobsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [JobService.DeleteCustomJob][google.cloud.aiplatform.v1.JobService.DeleteCustomJob]. +message DeleteCustomJobRequest { + // Required. The name of the CustomJob resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/customJobs/{custom_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/CustomJob" + } + ]; +} + +// Request message for [JobService.CancelCustomJob][google.cloud.aiplatform.v1.JobService.CancelCustomJob]. +message CancelCustomJobRequest { + // Required. The name of the CustomJob to cancel. + // Format: + // `projects/{project}/locations/{location}/customJobs/{custom_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/CustomJob" + } + ]; +} + +// Request message for [JobService.CreateDataLabelingJob][google.cloud.aiplatform.v1.JobService.CreateDataLabelingJob]. +message CreateDataLabelingJobRequest { + // Required. The parent of the DataLabelingJob. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The DataLabelingJob to create. + DataLabelingJob data_labeling_job = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [JobService.GetDataLabelingJob][google.cloud.aiplatform.v1.JobService.GetDataLabelingJob]. +message GetDataLabelingJobRequest { + // Required. The name of the DataLabelingJob. + // Format: + // `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/DataLabelingJob" + } + ]; +} + +// Request message for [JobService.ListDataLabelingJobs][google.cloud.aiplatform.v1.JobService.ListDataLabelingJobs]. +message ListDataLabelingJobsRequest { + // Required. The parent of the DataLabelingJob. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The standard list filter. + // + // Supported fields: + // + // * `display_name` supports = and !=. + // + // * `state` supports = and !=. + // + // Some examples of using the filter are: + // + // * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + // + // * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + // + // * `NOT display_name="my_job"` + // + // * `state="JOB_STATE_FAILED"` + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + string page_token = 4; + + // Mask specifying which fields to read. FieldMask represents a set of + // symbolic field paths. For example, the mask can be `paths: "name"`. The + // "name" here is a field in DataLabelingJob. + // If this field is not set, all fields of the DataLabelingJob are returned. + google.protobuf.FieldMask read_mask = 5; + + // A comma-separated list of fields to order by, sorted in ascending order by + // default. + // Use `desc` after a field name for descending. + string order_by = 6; +} + +// Response message for [JobService.ListDataLabelingJobs][google.cloud.aiplatform.v1.JobService.ListDataLabelingJobs]. +message ListDataLabelingJobsResponse { + // A list of DataLabelingJobs that matches the specified filter in the + // request. + repeated DataLabelingJob data_labeling_jobs = 1; + + // The standard List next-page token. + string next_page_token = 2; +} + +// Request message for [JobService.DeleteDataLabelingJob][google.cloud.aiplatform.v1.JobService.DeleteDataLabelingJob]. +message DeleteDataLabelingJobRequest { + // Required. The name of the DataLabelingJob to be deleted. + // Format: + // `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/DataLabelingJob" + } + ]; +} + +// Request message for [JobService.CancelDataLabelingJob][google.cloud.aiplatform.v1.JobService.CancelDataLabelingJob]. +message CancelDataLabelingJobRequest { + // Required. The name of the DataLabelingJob. + // Format: + // `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/DataLabelingJob" + } + ]; +} + +// Request message for [JobService.CreateHyperparameterTuningJob][google.cloud.aiplatform.v1.JobService.CreateHyperparameterTuningJob]. +message CreateHyperparameterTuningJobRequest { + // Required. The resource name of the Location to create the HyperparameterTuningJob in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The HyperparameterTuningJob to create. + HyperparameterTuningJob hyperparameter_tuning_job = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [JobService.GetHyperparameterTuningJob][google.cloud.aiplatform.v1.JobService.GetHyperparameterTuningJob]. +message GetHyperparameterTuningJobRequest { + // Required. The name of the HyperparameterTuningJob resource. + // Format: + // `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/HyperparameterTuningJob" + } + ]; +} + +// Request message for [JobService.ListHyperparameterTuningJobs][google.cloud.aiplatform.v1.JobService.ListHyperparameterTuningJobs]. +message ListHyperparameterTuningJobsRequest { + // Required. The resource name of the Location to list the HyperparameterTuningJobs + // from. Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The standard list filter. + // + // Supported fields: + // + // * `display_name` supports = and !=. + // + // * `state` supports = and !=. + // + // Some examples of using the filter are: + // + // * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + // + // * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + // + // * `NOT display_name="my_job"` + // + // * `state="JOB_STATE_FAILED"` + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListHyperparameterTuningJobsResponse.next_page_token][google.cloud.aiplatform.v1.ListHyperparameterTuningJobsResponse.next_page_token] of the previous + // [JobService.ListHyperparameterTuningJobs][google.cloud.aiplatform.v1.JobService.ListHyperparameterTuningJobs] call. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for [JobService.ListHyperparameterTuningJobs][google.cloud.aiplatform.v1.JobService.ListHyperparameterTuningJobs] +message ListHyperparameterTuningJobsResponse { + // List of HyperparameterTuningJobs in the requested page. + // [HyperparameterTuningJob.trials][google.cloud.aiplatform.v1.HyperparameterTuningJob.trials] of the jobs will be not be returned. + repeated HyperparameterTuningJob hyperparameter_tuning_jobs = 1; + + // A token to retrieve the next page of results. + // Pass to [ListHyperparameterTuningJobsRequest.page_token][google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest.page_token] to obtain that + // page. + string next_page_token = 2; +} + +// Request message for [JobService.DeleteHyperparameterTuningJob][google.cloud.aiplatform.v1.JobService.DeleteHyperparameterTuningJob]. +message DeleteHyperparameterTuningJobRequest { + // Required. The name of the HyperparameterTuningJob resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/HyperparameterTuningJob" + } + ]; +} + +// Request message for [JobService.CancelHyperparameterTuningJob][google.cloud.aiplatform.v1.JobService.CancelHyperparameterTuningJob]. +message CancelHyperparameterTuningJobRequest { + // Required. The name of the HyperparameterTuningJob to cancel. + // Format: + // `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/HyperparameterTuningJob" + } + ]; +} + +// Request message for [JobService.CreateBatchPredictionJob][google.cloud.aiplatform.v1.JobService.CreateBatchPredictionJob]. +message CreateBatchPredictionJobRequest { + // Required. The resource name of the Location to create the BatchPredictionJob in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The BatchPredictionJob to create. + BatchPredictionJob batch_prediction_job = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob]. +message GetBatchPredictionJobRequest { + // Required. The name of the BatchPredictionJob resource. + // Format: + // `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/BatchPredictionJob" + } + ]; +} + +// Request message for [JobService.ListBatchPredictionJobs][google.cloud.aiplatform.v1.JobService.ListBatchPredictionJobs]. +message ListBatchPredictionJobsRequest { + // Required. The resource name of the Location to list the BatchPredictionJobs + // from. Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The standard list filter. + // + // Supported fields: + // + // * `display_name` supports = and !=. + // + // * `state` supports = and !=. + // + // * `model_display_name` supports = and != + // + // Some examples of using the filter are: + // + // * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + // + // * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + // + // * `NOT display_name="my_job"` + // + // * `state="JOB_STATE_FAILED"` + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListBatchPredictionJobsResponse.next_page_token][google.cloud.aiplatform.v1.ListBatchPredictionJobsResponse.next_page_token] of the previous + // [JobService.ListBatchPredictionJobs][google.cloud.aiplatform.v1.JobService.ListBatchPredictionJobs] call. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for [JobService.ListBatchPredictionJobs][google.cloud.aiplatform.v1.JobService.ListBatchPredictionJobs] +message ListBatchPredictionJobsResponse { + // List of BatchPredictionJobs in the requested page. + repeated BatchPredictionJob batch_prediction_jobs = 1; + + // A token to retrieve the next page of results. + // Pass to [ListBatchPredictionJobsRequest.page_token][google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest.page_token] to obtain that + // page. + string next_page_token = 2; +} + +// Request message for [JobService.DeleteBatchPredictionJob][google.cloud.aiplatform.v1.JobService.DeleteBatchPredictionJob]. +message DeleteBatchPredictionJobRequest { + // Required. The name of the BatchPredictionJob resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/BatchPredictionJob" + } + ]; +} + +// Request message for [JobService.CancelBatchPredictionJob][google.cloud.aiplatform.v1.JobService.CancelBatchPredictionJob]. +message CancelBatchPredictionJobRequest { + // Required. The name of the BatchPredictionJob to cancel. + // Format: + // `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/BatchPredictionJob" + } + ]; +} + +// Request message for +// [JobService.CreateModelDeploymentMonitoringJob][google.cloud.aiplatform.v1.JobService.CreateModelDeploymentMonitoringJob]. +message CreateModelDeploymentMonitoringJobRequest { + // Required. The parent of the ModelDeploymentMonitoringJob. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The ModelDeploymentMonitoringJob to create + ModelDeploymentMonitoringJob model_deployment_monitoring_job = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [JobService.SearchModelDeploymentMonitoringStatsAnomalies][google.cloud.aiplatform.v1.JobService.SearchModelDeploymentMonitoringStatsAnomalies]. +message SearchModelDeploymentMonitoringStatsAnomaliesRequest { + // Stats requested for specific objective. + message StatsAnomaliesObjective { + ModelDeploymentMonitoringObjectiveType type = 1; + + // If set, all attribution scores between + // [SearchModelDeploymentMonitoringStatsAnomaliesRequest.start_time][google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest.start_time] and + // [SearchModelDeploymentMonitoringStatsAnomaliesRequest.end_time][google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest.end_time] are + // fetched, and page token doesn't take affect in this case. + // Only used to retrieve attribution score for the top Features which has + // the highest attribution score in the latest monitoring run. + int32 top_feature_count = 4; + } + + // Required. ModelDeploymentMonitoring Job resource name. + // Format: + // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + string model_deployment_monitoring_job = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" + } + ]; + + // Required. The DeployedModel ID of the + // [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. + string deployed_model_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // The feature display name. If specified, only return the stats belonging to + // this feature. Format: + // [ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name][google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name], + // example: "user_destination". + string feature_display_name = 3; + + // Required. Objectives of the stats to retrieve. + repeated StatsAnomaliesObjective objectives = 4 [(google.api.field_behavior) = REQUIRED]; + + // The standard list page size. + int32 page_size = 5; + + // A page token received from a previous + // [JobService.SearchModelDeploymentMonitoringStatsAnomalies][google.cloud.aiplatform.v1.JobService.SearchModelDeploymentMonitoringStatsAnomalies] + // call. + string page_token = 6; + + // The earliest timestamp of stats being generated. + // If not set, indicates fetching stats till the earliest possible one. + google.protobuf.Timestamp start_time = 7; + + // The latest timestamp of stats being generated. + // If not set, indicates feching stats till the latest possible one. + google.protobuf.Timestamp end_time = 8; +} + +// Response message for +// [JobService.SearchModelDeploymentMonitoringStatsAnomalies][google.cloud.aiplatform.v1.JobService.SearchModelDeploymentMonitoringStatsAnomalies]. +message SearchModelDeploymentMonitoringStatsAnomaliesResponse { + // Stats retrieved for requested objectives. + // There are at most 1000 + // [ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.prediction_stats][google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.prediction_stats] + // in the response. + repeated ModelMonitoringStatsAnomalies monitoring_stats = 1; + + // The page token that can be used by the next + // [JobService.SearchModelDeploymentMonitoringStatsAnomalies][google.cloud.aiplatform.v1.JobService.SearchModelDeploymentMonitoringStatsAnomalies] + // call. + string next_page_token = 2; +} + +// Request message for +// [JobService.GetModelDeploymentMonitoringJob][google.cloud.aiplatform.v1.JobService.GetModelDeploymentMonitoringJob]. +message GetModelDeploymentMonitoringJobRequest { + // Required. The resource name of the ModelDeploymentMonitoringJob. + // Format: + // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" + } + ]; +} + +// Request message for +// [JobService.ListModelDeploymentMonitoringJobs][google.cloud.aiplatform.v1.JobService.ListModelDeploymentMonitoringJobs]. +message ListModelDeploymentMonitoringJobsRequest { + // Required. The parent of the ModelDeploymentMonitoringJob. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The standard list filter. + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + string page_token = 4; + + // Mask specifying which fields to read + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for +// [JobService.ListModelDeploymentMonitoringJobs][google.cloud.aiplatform.v1.JobService.ListModelDeploymentMonitoringJobs]. +message ListModelDeploymentMonitoringJobsResponse { + // A list of ModelDeploymentMonitoringJobs that matches the specified filter + // in the request. + repeated ModelDeploymentMonitoringJob model_deployment_monitoring_jobs = 1; + + // The standard List next-page token. + string next_page_token = 2; +} + +// Request message for +// [JobService.UpdateModelDeploymentMonitoringJob][google.cloud.aiplatform.v1.JobService.UpdateModelDeploymentMonitoringJob]. +message UpdateModelDeploymentMonitoringJobRequest { + // Required. The model monitoring configuration which replaces the resource on the + // server. + ModelDeploymentMonitoringJob model_deployment_monitoring_job = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask is used to specify the fields to be overwritten in the + // ModelDeploymentMonitoringJob resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then only the non-empty fields present in the + // request will be overwritten. Set the update_mask to `*` to override all + // fields. + // For the objective config, the user can either provide the update mask for + // model_deployment_monitoring_objective_configs or any combination of its + // nested fields, such as: + // model_deployment_monitoring_objective_configs.objective_config.training_dataset. + // + // Updatable fields: + // + // * `display_name` + // * `model_deployment_monitoring_schedule_config` + // * `model_monitoring_alert_config` + // * `logging_sampling_strategy` + // * `labels` + // * `log_ttl` + // * `enable_monitoring_pipeline_logs` + // . and + // * `model_deployment_monitoring_objective_configs` + // . or + // * `model_deployment_monitoring_objective_configs.objective_config.training_dataset` + // * `model_deployment_monitoring_objective_configs.objective_config.training_prediction_skew_detection_config` + // * `model_deployment_monitoring_objective_configs.objective_config.prediction_drift_detection_config` + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [JobService.DeleteModelDeploymentMonitoringJob][google.cloud.aiplatform.v1.JobService.DeleteModelDeploymentMonitoringJob]. +message DeleteModelDeploymentMonitoringJobRequest { + // Required. The resource name of the model monitoring job to delete. + // Format: + // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" + } + ]; +} + +// Request message for +// [JobService.PauseModelDeploymentMonitoringJob][google.cloud.aiplatform.v1.JobService.PauseModelDeploymentMonitoringJob]. +message PauseModelDeploymentMonitoringJobRequest { + // Required. The resource name of the ModelDeploymentMonitoringJob to pause. + // Format: + // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" + } + ]; +} + +// Request message for +// [JobService.ResumeModelDeploymentMonitoringJob][google.cloud.aiplatform.v1.JobService.ResumeModelDeploymentMonitoringJob]. +message ResumeModelDeploymentMonitoringJobRequest { + // Required. The resource name of the ModelDeploymentMonitoringJob to resume. + // Format: + // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" + } + ]; +} + +// Runtime operation information for +// [JobService.UpdateModelDeploymentMonitoringJob][google.cloud.aiplatform.v1.JobService.UpdateModelDeploymentMonitoringJob]. +message UpdateModelDeploymentMonitoringJobOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/job_state.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/job_state.proto new file mode 100644 index 00000000..45b101c0 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/job_state.proto @@ -0,0 +1,66 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "JobStateProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Describes the state of a job. +enum JobState { + // The job state is unspecified. + JOB_STATE_UNSPECIFIED = 0; + + // The job has been just created or resumed and processing has not yet begun. + JOB_STATE_QUEUED = 1; + + // The service is preparing to run the job. + JOB_STATE_PENDING = 2; + + // The job is in progress. + JOB_STATE_RUNNING = 3; + + // The job completed successfully. + JOB_STATE_SUCCEEDED = 4; + + // The job failed. + JOB_STATE_FAILED = 5; + + // The job is being cancelled. From this state the job may only go to + // either `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`. + JOB_STATE_CANCELLING = 6; + + // The job has been cancelled. + JOB_STATE_CANCELLED = 7; + + // The job has been stopped, and can be resumed. + JOB_STATE_PAUSED = 8; + + // The job has expired. + JOB_STATE_EXPIRED = 9; + + // The job is being updated. The job is only able to be updated at RUNNING + // state; if the update operation succeeds, job goes back to RUNNING state; if + // the update operation fails, the job goes back to RUNNING state with error + // messages written to [ModelDeploymentMonitoringJob.partial_errors][] field + // if it is a ModelDeploymentMonitoringJob. + JOB_STATE_UPDATING = 10; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/lineage_subgraph.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/lineage_subgraph.proto new file mode 100644 index 00000000..7ad020b6 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/lineage_subgraph.proto @@ -0,0 +1,42 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/cloud/aiplatform/v1/artifact.proto"; +import "google/cloud/aiplatform/v1/event.proto"; +import "google/cloud/aiplatform/v1/execution.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "LineageSubgraphProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A subgraph of the overall lineage graph. Event edges connect Artifact and +// Execution nodes. +message LineageSubgraph { + // The Artifact nodes in the subgraph. + repeated Artifact artifacts = 1; + + // The Execution nodes in the subgraph. + repeated Execution executions = 2; + + // The Event edges between Artifacts and Executions in the subgraph. + repeated Event events = 3; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/machine_resources.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/machine_resources.proto new file mode 100644 index 00000000..9bcf37c1 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/machine_resources.proto @@ -0,0 +1,204 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/aiplatform/v1/accelerator_type.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "MachineResourcesProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Specification of a single machine. +message MachineSpec { + // Immutable. The type of the machine. + // + // See the [list of machine types supported for + // prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types) + // + // See the [list of machine types supported for custom + // training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types). + // + // For [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] this field is optional, and the default + // value is `n1-standard-2`. For [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob] or as part of + // [WorkerPoolSpec][google.cloud.aiplatform.v1.WorkerPoolSpec] this field is required. + string machine_type = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The type of accelerator(s) that may be attached to the machine as per + // [accelerator_count][google.cloud.aiplatform.v1.MachineSpec.accelerator_count]. + AcceleratorType accelerator_type = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // The number of accelerators to attach to the machine. + int32 accelerator_count = 3; +} + +// A description of resources that are dedicated to a DeployedModel, and +// that need a higher degree of manual configuration. +message DedicatedResources { + // Required. Immutable. The specification of a single machine used by the prediction. + MachineSpec machine_spec = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The minimum number of machine replicas this DeployedModel will be always + // deployed on. This value must be greater than or equal to 1. + // + // If traffic against the DeployedModel increases, it may dynamically be + // deployed onto more replicas, and as traffic decreases, some of these extra + // replicas may be freed. + int32 min_replica_count = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Immutable. The maximum number of replicas this DeployedModel may be deployed on when + // the traffic against it increases. If the requested value is too large, + // the deployment will error, but if deployment succeeds then the ability + // to scale the model to that many replicas is guaranteed (barring service + // outages). If traffic against the DeployedModel increases beyond what its + // replicas at maximum may handle, a portion of the traffic will be dropped. + // If this value is not provided, will use [min_replica_count][google.cloud.aiplatform.v1.DedicatedResources.min_replica_count] as the + // default value. + // + // The value of this field impacts the charge against Vertex CPU and GPU + // quotas. Specifically, you will be charged for (max_replica_count * + // number of cores in the selected machine type) and (max_replica_count * + // number of GPUs per replica in the selected machine type). + int32 max_replica_count = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The metric specifications that overrides a resource + // utilization metric (CPU utilization, accelerator's duty cycle, and so on) + // target value (default to 60 if not set). At most one entry is allowed per + // metric. + // + // If [machine_spec.accelerator_count][google.cloud.aiplatform.v1.MachineSpec.accelerator_count] is + // above 0, the autoscaling will be based on both CPU utilization and + // accelerator's duty cycle metrics and scale up when either metrics exceeds + // its target value while scale down if both metrics are under their target + // value. The default target value is 60 for both metrics. + // + // If [machine_spec.accelerator_count][google.cloud.aiplatform.v1.MachineSpec.accelerator_count] is + // 0, the autoscaling will be based on CPU utilization metric only with + // default target value 60 if not explicitly set. + // + // For example, in the case of Online Prediction, if you want to override + // target CPU utilization to 80, you should set + // [autoscaling_metric_specs.metric_name][google.cloud.aiplatform.v1.AutoscalingMetricSpec.metric_name] + // to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and + // [autoscaling_metric_specs.target][google.cloud.aiplatform.v1.AutoscalingMetricSpec.target] to `80`. + repeated AutoscalingMetricSpec autoscaling_metric_specs = 4 [(google.api.field_behavior) = IMMUTABLE]; +} + +// A description of resources that to large degree are decided by Vertex AI, +// and require only a modest additional configuration. +// Each Model supporting these resources documents its specific guidelines. +message AutomaticResources { + // Immutable. The minimum number of replicas this DeployedModel will be always deployed + // on. If traffic against it increases, it may dynamically be deployed onto + // more replicas up to [max_replica_count][google.cloud.aiplatform.v1.AutomaticResources.max_replica_count], and as traffic decreases, some + // of these extra replicas may be freed. + // If the requested value is too large, the deployment will error. + int32 min_replica_count = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The maximum number of replicas this DeployedModel may be deployed on when + // the traffic against it increases. If the requested value is too large, + // the deployment will error, but if deployment succeeds then the ability + // to scale the model to that many replicas is guaranteed (barring service + // outages). If traffic against the DeployedModel increases beyond what its + // replicas at maximum may handle, a portion of the traffic will be dropped. + // If this value is not provided, a no upper bound for scaling under heavy + // traffic will be assume, though Vertex AI may be unable to scale beyond + // certain replica number. + int32 max_replica_count = 2 [(google.api.field_behavior) = IMMUTABLE]; +} + +// A description of resources that are used for performing batch operations, are +// dedicated to a Model, and need manual configuration. +message BatchDedicatedResources { + // Required. Immutable. The specification of a single machine. + MachineSpec machine_spec = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Immutable. The number of machine replicas used at the start of the batch operation. + // If not set, Vertex AI decides starting number, not greater than + // [max_replica_count][google.cloud.aiplatform.v1.BatchDedicatedResources.max_replica_count] + int32 starting_replica_count = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The maximum number of machine replicas the batch operation may be scaled + // to. The default value is 10. + int32 max_replica_count = 3 [(google.api.field_behavior) = IMMUTABLE]; +} + +// Statistics information about resource consumption. +message ResourcesConsumed { + // Output only. The number of replica hours used. Note that many replicas may run in + // parallel, and additionally any given work may be queued for some time. + // Therefore this value is not strictly related to wall time. + double replica_hours = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents the spec of disk options. +message DiskSpec { + // Type of the boot disk (default is "pd-ssd"). + // Valid values: "pd-ssd" (Persistent Disk Solid State Drive) or + // "pd-standard" (Persistent Disk Hard Disk Drive). + string boot_disk_type = 1; + + // Size in GB of the boot disk (default is 100GB). + int32 boot_disk_size_gb = 2; +} + +// Represents a mount configuration for Network File System (NFS) to mount. +message NfsMount { + // Required. IP address of the NFS server. + string server = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Source path exported from NFS server. + // Has to start with '/', and combined with the ip address, it indicates + // the source mount path in the form of `server:path` + string path = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Destination mount path. The NFS will be mounted for the user under + // /mnt/nfs/ + string mount_point = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The metric specification that defines the target resource utilization +// (CPU utilization, accelerator's duty cycle, and so on) for calculating the +// desired replica count. +message AutoscalingMetricSpec { + // Required. The resource metric name. + // Supported metrics: + // + // * For Online Prediction: + // * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle` + // * `aiplatform.googleapis.com/prediction/online/cpu/utilization` + string metric_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The target resource utilization in percentage (1% - 100%) for the given + // metric; once the real usage deviates from the target by a certain + // percentage, the machine replicas change. The default value is 60 + // (representing 60%) if not provided. + int32 target = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto new file mode 100644 index 00000000..54002126 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto @@ -0,0 +1,39 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ManualBatchTuningParametersProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Manual batch tuning parameters. +message ManualBatchTuningParameters { + // Immutable. The number of the records (e.g. instances) of the operation given in + // each batch to a machine replica. Machine type, and size of a single + // record should be considered when setting this parameter, higher value + // speeds up the batch operation's execution, but too high value will result + // in a whole batch not fitting in a machine's memory, and the whole + // operation will fail. + // The default value is 4. + int32 batch_size = 1 [(google.api.field_behavior) = IMMUTABLE]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_schema.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_schema.proto new file mode 100644 index 00000000..b00a1552 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_schema.proto @@ -0,0 +1,79 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "MetadataSchemaProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Instance of a general MetadataSchema. +message MetadataSchema { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/MetadataSchema" + pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}" + }; + + // Describes the type of the MetadataSchema. + enum MetadataSchemaType { + // Unspecified type for the MetadataSchema. + METADATA_SCHEMA_TYPE_UNSPECIFIED = 0; + + // A type indicating that the MetadataSchema will be used by Artifacts. + ARTIFACT_TYPE = 1; + + // A typee indicating that the MetadataSchema will be used by Executions. + EXECUTION_TYPE = 2; + + // A state indicating that the MetadataSchema will be used by Contexts. + CONTEXT_TYPE = 3; + } + + // Output only. The resource name of the MetadataSchema. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The version of the MetadataSchema. The version's format must match + // the following regular expression: `^[0-9]+[.][0-9]+[.][0-9]+$`, which would + // allow to order/compare different versions. Example: 1.0.0, 1.0.1, etc. + string schema_version = 2; + + // Required. The raw YAML string representation of the MetadataSchema. The combination + // of [MetadataSchema.version] and the schema name given by `title` in + // [MetadataSchema.schema] must be unique within a MetadataStore. + // + // The schema is defined as an OpenAPI 3.0.2 + // [MetadataSchema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject) + string schema = 3 [(google.api.field_behavior) = REQUIRED]; + + // The type of the MetadataSchema. This is a property that identifies which + // metadata types will use the MetadataSchema. + MetadataSchemaType schema_type = 4; + + // Output only. Timestamp when this MetadataSchema was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Description of the Metadata Schema + string description = 6; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_service.proto new file mode 100644 index 00000000..c601d46a --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_service.proto @@ -0,0 +1,1257 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/artifact.proto"; +import "google/cloud/aiplatform/v1/context.proto"; +import "google/cloud/aiplatform/v1/event.proto"; +import "google/cloud/aiplatform/v1/execution.proto"; +import "google/cloud/aiplatform/v1/lineage_subgraph.proto"; +import "google/cloud/aiplatform/v1/metadata_schema.proto"; +import "google/cloud/aiplatform/v1/metadata_store.proto"; +import "google/cloud/aiplatform/v1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "MetadataServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Service for reading and writing metadata entries. +service MetadataService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Initializes a MetadataStore, including allocation of resources. + rpc CreateMetadataStore(CreateMetadataStoreRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/metadataStores" + body: "metadata_store" + }; + option (google.api.method_signature) = "parent,metadata_store,metadata_store_id"; + option (google.longrunning.operation_info) = { + response_type: "MetadataStore" + metadata_type: "CreateMetadataStoreOperationMetadata" + }; + } + + // Retrieves a specific MetadataStore. + rpc GetMetadataStore(GetMetadataStoreRequest) returns (MetadataStore) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/metadataStores/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists MetadataStores for a Location. + rpc ListMetadataStores(ListMetadataStoresRequest) returns (ListMetadataStoresResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/metadataStores" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a single MetadataStore and all its child resources (Artifacts, + // Executions, and Contexts). + rpc DeleteMetadataStore(DeleteMetadataStoreRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/metadataStores/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteMetadataStoreOperationMetadata" + }; + } + + // Creates an Artifact associated with a MetadataStore. + rpc CreateArtifact(CreateArtifactRequest) returns (Artifact) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/metadataStores/*}/artifacts" + body: "artifact" + }; + option (google.api.method_signature) = "parent,artifact,artifact_id"; + } + + // Retrieves a specific Artifact. + rpc GetArtifact(GetArtifactRequest) returns (Artifact) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Artifacts in the MetadataStore. + rpc ListArtifacts(ListArtifactsRequest) returns (ListArtifactsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/metadataStores/*}/artifacts" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a stored Artifact. + rpc UpdateArtifact(UpdateArtifactRequest) returns (Artifact) { + option (google.api.http) = { + patch: "/v1/{artifact.name=projects/*/locations/*/metadataStores/*/artifacts/*}" + body: "artifact" + }; + option (google.api.method_signature) = "artifact,update_mask"; + } + + // Deletes an Artifact. + rpc DeleteArtifact(DeleteArtifactRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Purges Artifacts. + rpc PurgeArtifacts(PurgeArtifactsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/metadataStores/*}/artifacts:purge" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "PurgeArtifactsResponse" + metadata_type: "PurgeArtifactsMetadata" + }; + } + + // Creates a Context associated with a MetadataStore. + rpc CreateContext(CreateContextRequest) returns (Context) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/metadataStores/*}/contexts" + body: "context" + }; + option (google.api.method_signature) = "parent,context,context_id"; + } + + // Retrieves a specific Context. + rpc GetContext(GetContextRequest) returns (Context) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Contexts on the MetadataStore. + rpc ListContexts(ListContextsRequest) returns (ListContextsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/metadataStores/*}/contexts" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a stored Context. + rpc UpdateContext(UpdateContextRequest) returns (Context) { + option (google.api.http) = { + patch: "/v1/{context.name=projects/*/locations/*/metadataStores/*/contexts/*}" + body: "context" + }; + option (google.api.method_signature) = "context,update_mask"; + } + + // Deletes a stored Context. + rpc DeleteContext(DeleteContextRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Purges Contexts. + rpc PurgeContexts(PurgeContextsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/metadataStores/*}/contexts:purge" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "PurgeContextsResponse" + metadata_type: "PurgeContextsMetadata" + }; + } + + // Adds a set of Artifacts and Executions to a Context. If any of the + // Artifacts or Executions have already been added to a Context, they are + // simply skipped. + rpc AddContextArtifactsAndExecutions(AddContextArtifactsAndExecutionsRequest) returns (AddContextArtifactsAndExecutionsResponse) { + option (google.api.http) = { + post: "/v1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:addContextArtifactsAndExecutions" + body: "*" + }; + option (google.api.method_signature) = "context,artifacts,executions"; + } + + // Adds a set of Contexts as children to a parent Context. If any of the + // child Contexts have already been added to the parent Context, they are + // simply skipped. If this call would create a cycle or cause any Context to + // have more than 10 parents, the request will fail with an INVALID_ARGUMENT + // error. + rpc AddContextChildren(AddContextChildrenRequest) returns (AddContextChildrenResponse) { + option (google.api.http) = { + post: "/v1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:addContextChildren" + body: "*" + }; + option (google.api.method_signature) = "context,child_contexts"; + } + + // Retrieves Artifacts and Executions within the specified Context, connected + // by Event edges and returned as a LineageSubgraph. + rpc QueryContextLineageSubgraph(QueryContextLineageSubgraphRequest) returns (LineageSubgraph) { + option (google.api.http) = { + get: "/v1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:queryContextLineageSubgraph" + }; + option (google.api.method_signature) = "context"; + } + + // Creates an Execution associated with a MetadataStore. + rpc CreateExecution(CreateExecutionRequest) returns (Execution) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/metadataStores/*}/executions" + body: "execution" + }; + option (google.api.method_signature) = "parent,execution,execution_id"; + } + + // Retrieves a specific Execution. + rpc GetExecution(GetExecutionRequest) returns (Execution) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/metadataStores/*/executions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Executions in the MetadataStore. + rpc ListExecutions(ListExecutionsRequest) returns (ListExecutionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/metadataStores/*}/executions" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a stored Execution. + rpc UpdateExecution(UpdateExecutionRequest) returns (Execution) { + option (google.api.http) = { + patch: "/v1/{execution.name=projects/*/locations/*/metadataStores/*/executions/*}" + body: "execution" + }; + option (google.api.method_signature) = "execution,update_mask"; + } + + // Deletes an Execution. + rpc DeleteExecution(DeleteExecutionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/metadataStores/*/executions/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Purges Executions. + rpc PurgeExecutions(PurgeExecutionsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/metadataStores/*}/executions:purge" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "PurgeExecutionsResponse" + metadata_type: "PurgeExecutionsMetadata" + }; + } + + // Adds Events to the specified Execution. An Event indicates whether an + // Artifact was used as an input or output for an Execution. If an Event + // already exists between the Execution and the Artifact, the Event is + // skipped. + rpc AddExecutionEvents(AddExecutionEventsRequest) returns (AddExecutionEventsResponse) { + option (google.api.http) = { + post: "/v1/{execution=projects/*/locations/*/metadataStores/*/executions/*}:addExecutionEvents" + body: "*" + }; + option (google.api.method_signature) = "execution,events"; + } + + // Obtains the set of input and output Artifacts for this Execution, in the + // form of LineageSubgraph that also contains the Execution and connecting + // Events. + rpc QueryExecutionInputsAndOutputs(QueryExecutionInputsAndOutputsRequest) returns (LineageSubgraph) { + option (google.api.http) = { + get: "/v1/{execution=projects/*/locations/*/metadataStores/*/executions/*}:queryExecutionInputsAndOutputs" + }; + option (google.api.method_signature) = "execution"; + } + + // Creates a MetadataSchema. + rpc CreateMetadataSchema(CreateMetadataSchemaRequest) returns (MetadataSchema) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/metadataStores/*}/metadataSchemas" + body: "metadata_schema" + }; + option (google.api.method_signature) = "parent,metadata_schema,metadata_schema_id"; + } + + // Retrieves a specific MetadataSchema. + rpc GetMetadataSchema(GetMetadataSchemaRequest) returns (MetadataSchema) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/metadataStores/*/metadataSchemas/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists MetadataSchemas. + rpc ListMetadataSchemas(ListMetadataSchemasRequest) returns (ListMetadataSchemasResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/metadataStores/*}/metadataSchemas" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves lineage of an Artifact represented through Artifacts and + // Executions connected by Event edges and returned as a LineageSubgraph. + rpc QueryArtifactLineageSubgraph(QueryArtifactLineageSubgraphRequest) returns (LineageSubgraph) { + option (google.api.http) = { + get: "/v1/{artifact=projects/*/locations/*/metadataStores/*/artifacts/*}:queryArtifactLineageSubgraph" + }; + option (google.api.method_signature) = "artifact"; + } +} + +// Request message for [MetadataService.CreateMetadataStore][google.cloud.aiplatform.v1.MetadataService.CreateMetadataStore]. +message CreateMetadataStoreRequest { + // Required. The resource name of the Location where the MetadataStore should + // be created. + // Format: `projects/{project}/locations/{location}/` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The MetadataStore to create. + MetadataStore metadata_store = 2 [(google.api.field_behavior) = REQUIRED]; + + // The {metadatastore} portion of the resource name with the format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + // If not provided, the MetadataStore's ID will be a UUID generated by the + // service. + // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + // Must be unique across all MetadataStores in the parent Location. + // (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + // if the caller can't view the preexisting MetadataStore.) + string metadata_store_id = 3; +} + +// Details of operations that perform [MetadataService.CreateMetadataStore][google.cloud.aiplatform.v1.MetadataService.CreateMetadataStore]. +message CreateMetadataStoreOperationMetadata { + // Operation metadata for creating a MetadataStore. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [MetadataService.GetMetadataStore][google.cloud.aiplatform.v1.MetadataService.GetMetadataStore]. +message GetMetadataStoreRequest { + // Required. The resource name of the MetadataStore to retrieve. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/MetadataStore" + } + ]; +} + +// Request message for [MetadataService.ListMetadataStores][google.cloud.aiplatform.v1.MetadataService.ListMetadataStores]. +message ListMetadataStoresRequest { + // Required. The Location whose MetadataStores should be listed. + // Format: + // `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of Metadata Stores to return. The service may return + // fewer. + // Must be in range 1-1000, inclusive. Defaults to 100. + int32 page_size = 2; + + // A page token, received from a previous + // [MetadataService.ListMetadataStores][google.cloud.aiplatform.v1.MetadataService.ListMetadataStores] call. Provide this to retrieve the + // subsequent page. + // + // When paginating, all other provided parameters must match the call that + // provided the page token. (Otherwise the request will fail with + // INVALID_ARGUMENT error.) + string page_token = 3; +} + +// Response message for [MetadataService.ListMetadataStores][google.cloud.aiplatform.v1.MetadataService.ListMetadataStores]. +message ListMetadataStoresResponse { + // The MetadataStores found for the Location. + repeated MetadataStore metadata_stores = 1; + + // A token, which can be sent as + // [ListMetadataStoresRequest.page_token][google.cloud.aiplatform.v1.ListMetadataStoresRequest.page_token] to retrieve the next + // page. If this field is not populated, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [MetadataService.DeleteMetadataStore][google.cloud.aiplatform.v1.MetadataService.DeleteMetadataStore]. +message DeleteMetadataStoreRequest { + // Required. The resource name of the MetadataStore to delete. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/MetadataStore" + } + ]; + + // Deprecated: Field is no longer supported. + bool force = 2 [deprecated = true]; +} + +// Details of operations that perform [MetadataService.DeleteMetadataStore][google.cloud.aiplatform.v1.MetadataService.DeleteMetadataStore]. +message DeleteMetadataStoreOperationMetadata { + // Operation metadata for deleting a MetadataStore. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [MetadataService.CreateArtifact][google.cloud.aiplatform.v1.MetadataService.CreateArtifact]. +message CreateArtifactRequest { + // Required. The resource name of the MetadataStore where the Artifact should + // be created. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/MetadataStore" + } + ]; + + // Required. The Artifact to create. + Artifact artifact = 2 [(google.api.field_behavior) = REQUIRED]; + + // The {artifact} portion of the resource name with the format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + // If not provided, the Artifact's ID will be a UUID generated by the service. + // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + // Must be unique across all Artifacts in the parent MetadataStore. (Otherwise + // the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the + // caller can't view the preexisting Artifact.) + string artifact_id = 3; +} + +// Request message for [MetadataService.GetArtifact][google.cloud.aiplatform.v1.MetadataService.GetArtifact]. +message GetArtifactRequest { + // Required. The resource name of the Artifact to retrieve. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Artifact" + } + ]; +} + +// Request message for [MetadataService.ListArtifacts][google.cloud.aiplatform.v1.MetadataService.ListArtifacts]. +message ListArtifactsRequest { + // Required. The MetadataStore whose Artifacts should be listed. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Artifact" + } + ]; + + // The maximum number of Artifacts to return. The service may return fewer. + // Must be in range 1-1000, inclusive. Defaults to 100. + int32 page_size = 2; + + // A page token, received from a previous [MetadataService.ListArtifacts][google.cloud.aiplatform.v1.MetadataService.ListArtifacts] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other provided parameters must match the call that + // provided the page token. (Otherwise the request will fail with + // INVALID_ARGUMENT error.) + string page_token = 3; + + // Filter specifying the boolean condition for the Artifacts to satisfy in + // order to be part of the result set. + // The syntax to define filter query is based on https://google.aip.dev/160. + // The supported set of filters include the following: + // + // * **Attribute filtering**: + // For example: `display_name = "test"`. + // Supported fields include: `name`, `display_name`, `uri`, `state`, + // `schema_title`, `create_time`, and `update_time`. + // Time fields, such as `create_time` and `update_time`, require values + // specified in RFC-3339 format. + // For example: `create_time = "2020-11-19T11:30:00-04:00"` + // * **Metadata field**: + // To filter on metadata fields use traversal operation as follows: + // `metadata..`. + // For example: `metadata.field_1.number_value = 10.0` + // * **Context based filtering**: + // To filter Artifacts based on the contexts to which they belong, use the + // function operator with the full resource name + // `in_context()`. + // For example: + // `in_context("projects//locations//metadataStores//contexts/")` + // + // Each of the above supported filter types can be combined together using + // logical operators (`AND` & `OR`). + // + // For example: `display_name = "test" AND metadata.field1.bool_value = true`. + string filter = 4; +} + +// Response message for [MetadataService.ListArtifacts][google.cloud.aiplatform.v1.MetadataService.ListArtifacts]. +message ListArtifactsResponse { + // The Artifacts retrieved from the MetadataStore. + repeated Artifact artifacts = 1; + + // A token, which can be sent as [ListArtifactsRequest.page_token][google.cloud.aiplatform.v1.ListArtifactsRequest.page_token] + // to retrieve the next page. + // If this field is not populated, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [MetadataService.UpdateArtifact][google.cloud.aiplatform.v1.MetadataService.UpdateArtifact]. +message UpdateArtifactRequest { + // Required. The Artifact containing updates. + // The Artifact's [Artifact.name][google.cloud.aiplatform.v1.Artifact.name] field is used to identify the Artifact to + // be updated. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + Artifact artifact = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A FieldMask indicating which fields should be updated. + // Functionality of this field is not yet supported. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; + + // If set to true, and the [Artifact][google.cloud.aiplatform.v1.Artifact] is not found, a new [Artifact][google.cloud.aiplatform.v1.Artifact] is + // created. + bool allow_missing = 3; +} + +// Request message for [MetadataService.DeleteArtifact][google.cloud.aiplatform.v1.MetadataService.DeleteArtifact]. +message DeleteArtifactRequest { + // Required. The resource name of the Artifact to delete. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Artifact" + } + ]; + + // Optional. The etag of the Artifact to delete. + // If this is provided, it must match the server's etag. Otherwise, the + // request will fail with a FAILED_PRECONDITION. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [MetadataService.PurgeArtifacts][google.cloud.aiplatform.v1.MetadataService.PurgeArtifacts]. +message PurgeArtifactsRequest { + // Required. The metadata store to purge Artifacts from. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Artifact" + } + ]; + + // Required. A required filter matching the Artifacts to be purged. + // E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Flag to indicate to actually perform the purge. + // If `force` is set to false, the method will return a sample of + // Artifact names that would be deleted. + bool force = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [MetadataService.PurgeArtifacts][google.cloud.aiplatform.v1.MetadataService.PurgeArtifacts]. +message PurgeArtifactsResponse { + // The number of Artifacts that this request deleted (or, if `force` is false, + // the number of Artifacts that will be deleted). This can be an estimate. + int64 purge_count = 1; + + // A sample of the Artifact names that will be deleted. + // Only populated if `force` is set to false. The maximum number of samples is + // 100 (it is possible to return fewer). + repeated string purge_sample = 2 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Artifact" + }]; +} + +// Details of operations that perform [MetadataService.PurgeArtifacts][google.cloud.aiplatform.v1.MetadataService.PurgeArtifacts]. +message PurgeArtifactsMetadata { + // Operation metadata for purging Artifacts. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [MetadataService.CreateContext][google.cloud.aiplatform.v1.MetadataService.CreateContext]. +message CreateContextRequest { + // Required. The resource name of the MetadataStore where the Context should be + // created. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/MetadataStore" + } + ]; + + // Required. The Context to create. + Context context = 2 [(google.api.field_behavior) = REQUIRED]; + + // The {context} portion of the resource name with the format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`. + // If not provided, the Context's ID will be a UUID generated by the service. + // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + // Must be unique across all Contexts in the parent MetadataStore. (Otherwise + // the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the + // caller can't view the preexisting Context.) + string context_id = 3; +} + +// Request message for [MetadataService.GetContext][google.cloud.aiplatform.v1.MetadataService.GetContext]. +message GetContextRequest { + // Required. The resource name of the Context to retrieve. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; +} + +// Request message for [MetadataService.ListContexts][google.cloud.aiplatform.v1.MetadataService.ListContexts] +message ListContextsRequest { + // Required. The MetadataStore whose Contexts should be listed. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Context" + } + ]; + + // The maximum number of Contexts to return. The service may return fewer. + // Must be in range 1-1000, inclusive. Defaults to 100. + int32 page_size = 2; + + // A page token, received from a previous [MetadataService.ListContexts][google.cloud.aiplatform.v1.MetadataService.ListContexts] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other provided parameters must match the call that + // provided the page token. (Otherwise the request will fail with + // INVALID_ARGUMENT error.) + string page_token = 3; + + // Filter specifying the boolean condition for the Contexts to satisfy in + // order to be part of the result set. + // The syntax to define filter query is based on https://google.aip.dev/160. + // Following are the supported set of filters: + // + // * **Attribute filtering**: + // For example: `display_name = "test"`. + // Supported fields include: `name`, `display_name`, `schema_title`, + // `create_time`, and `update_time`. + // Time fields, such as `create_time` and `update_time`, require values + // specified in RFC-3339 format. + // For example: `create_time = "2020-11-19T11:30:00-04:00"`. + // * **Metadata field**: + // To filter on metadata fields use traversal operation as follows: + // `metadata..`. + // For example: `metadata.field_1.number_value = 10.0`. + // * **Parent Child filtering**: + // To filter Contexts based on parent-child relationship use the HAS + // operator as follows: + // + // ``` + // parent_contexts: + // "projects//locations//metadataStores//contexts/" + // child_contexts: + // "projects//locations//metadataStores//contexts/" + // ``` + // + // Each of the above supported filters can be combined together using + // logical operators (`AND` & `OR`). + // + // For example: `display_name = "test" AND metadata.field1.bool_value = true`. + string filter = 4; +} + +// Response message for [MetadataService.ListContexts][google.cloud.aiplatform.v1.MetadataService.ListContexts]. +message ListContextsResponse { + // The Contexts retrieved from the MetadataStore. + repeated Context contexts = 1; + + // A token, which can be sent as [ListContextsRequest.page_token][google.cloud.aiplatform.v1.ListContextsRequest.page_token] + // to retrieve the next page. + // If this field is not populated, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [MetadataService.UpdateContext][google.cloud.aiplatform.v1.MetadataService.UpdateContext]. +message UpdateContextRequest { + // Required. The Context containing updates. + // The Context's [Context.name][google.cloud.aiplatform.v1.Context.name] field is used to identify the Context to be + // updated. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + Context context = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A FieldMask indicating which fields should be updated. + // Functionality of this field is not yet supported. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; + + // If set to true, and the [Context][google.cloud.aiplatform.v1.Context] is not found, a new [Context][google.cloud.aiplatform.v1.Context] is + // created. + bool allow_missing = 3; +} + +// Request message for [MetadataService.DeleteContext][google.cloud.aiplatform.v1.MetadataService.DeleteContext]. +message DeleteContextRequest { + // Required. The resource name of the Context to delete. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; + + // The force deletion semantics is still undefined. + // Users should not use this field. + bool force = 2; + + // Optional. The etag of the Context to delete. + // If this is provided, it must match the server's etag. Otherwise, the + // request will fail with a FAILED_PRECONDITION. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [MetadataService.PurgeContexts][google.cloud.aiplatform.v1.MetadataService.PurgeContexts]. +message PurgeContextsRequest { + // Required. The metadata store to purge Contexts from. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Context" + } + ]; + + // Required. A required filter matching the Contexts to be purged. + // E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Flag to indicate to actually perform the purge. + // If `force` is set to false, the method will return a sample of + // Context names that would be deleted. + bool force = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [MetadataService.PurgeContexts][google.cloud.aiplatform.v1.MetadataService.PurgeContexts]. +message PurgeContextsResponse { + // The number of Contexts that this request deleted (or, if `force` is false, + // the number of Contexts that will be deleted). This can be an estimate. + int64 purge_count = 1; + + // A sample of the Context names that will be deleted. + // Only populated if `force` is set to false. The maximum number of samples is + // 100 (it is possible to return fewer). + repeated string purge_sample = 2 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + }]; +} + +// Details of operations that perform [MetadataService.PurgeContexts][google.cloud.aiplatform.v1.MetadataService.PurgeContexts]. +message PurgeContextsMetadata { + // Operation metadata for purging Contexts. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [MetadataService.AddContextArtifactsAndExecutions][google.cloud.aiplatform.v1.MetadataService.AddContextArtifactsAndExecutions]. +message AddContextArtifactsAndExecutionsRequest { + // Required. The resource name of the Context that the Artifacts and Executions + // belong to. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + string context = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; + + // The resource names of the Artifacts to attribute to the Context. + // + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + repeated string artifacts = 2 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Artifact" + }]; + + // The resource names of the Executions to associate with the + // Context. + // + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + repeated string executions = 3 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Execution" + }]; +} + +// Response message for [MetadataService.AddContextArtifactsAndExecutions][google.cloud.aiplatform.v1.MetadataService.AddContextArtifactsAndExecutions]. +message AddContextArtifactsAndExecutionsResponse { + +} + +// Request message for [MetadataService.AddContextChildren][google.cloud.aiplatform.v1.MetadataService.AddContextChildren]. +message AddContextChildrenRequest { + // Required. The resource name of the parent Context. + // + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + string context = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; + + // The resource names of the child Contexts. + repeated string child_contexts = 2 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + }]; +} + +// Response message for [MetadataService.AddContextChildren][google.cloud.aiplatform.v1.MetadataService.AddContextChildren]. +message AddContextChildrenResponse { + +} + +// Request message for [MetadataService.QueryContextLineageSubgraph][google.cloud.aiplatform.v1.MetadataService.QueryContextLineageSubgraph]. +message QueryContextLineageSubgraphRequest { + // Required. The resource name of the Context whose Artifacts and Executions + // should be retrieved as a LineageSubgraph. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + // + // The request may error with FAILED_PRECONDITION if the number of Artifacts, + // the number of Executions, or the number of Events that would be returned + // for the Context exceeds 1000. + string context = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; +} + +// Request message for [MetadataService.CreateExecution][google.cloud.aiplatform.v1.MetadataService.CreateExecution]. +message CreateExecutionRequest { + // Required. The resource name of the MetadataStore where the Execution should + // be created. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/MetadataStore" + } + ]; + + // Required. The Execution to create. + Execution execution = 2 [(google.api.field_behavior) = REQUIRED]; + + // The {execution} portion of the resource name with the format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + // If not provided, the Execution's ID will be a UUID generated by the + // service. + // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + // Must be unique across all Executions in the parent MetadataStore. + // (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + // if the caller can't view the preexisting Execution.) + string execution_id = 3; +} + +// Request message for [MetadataService.GetExecution][google.cloud.aiplatform.v1.MetadataService.GetExecution]. +message GetExecutionRequest { + // Required. The resource name of the Execution to retrieve. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Execution" + } + ]; +} + +// Request message for [MetadataService.ListExecutions][google.cloud.aiplatform.v1.MetadataService.ListExecutions]. +message ListExecutionsRequest { + // Required. The MetadataStore whose Executions should be listed. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Execution" + } + ]; + + // The maximum number of Executions to return. The service may return fewer. + // Must be in range 1-1000, inclusive. Defaults to 100. + int32 page_size = 2; + + // A page token, received from a previous [MetadataService.ListExecutions][google.cloud.aiplatform.v1.MetadataService.ListExecutions] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other provided parameters must match the call that + // provided the page token. (Otherwise the request will fail with an + // INVALID_ARGUMENT error.) + string page_token = 3; + + // Filter specifying the boolean condition for the Executions to satisfy in + // order to be part of the result set. + // The syntax to define filter query is based on https://google.aip.dev/160. + // Following are the supported set of filters: + // + // * **Attribute filtering**: + // For example: `display_name = "test"`. + // Supported fields include: `name`, `display_name`, `state`, + // `schema_title`, `create_time`, and `update_time`. + // Time fields, such as `create_time` and `update_time`, require values + // specified in RFC-3339 format. + // For example: `create_time = "2020-11-19T11:30:00-04:00"`. + // * **Metadata field**: + // To filter on metadata fields use traversal operation as follows: + // `metadata..` + // For example: `metadata.field_1.number_value = 10.0` + // * **Context based filtering**: + // To filter Executions based on the contexts to which they belong use + // the function operator with the full resource name: + // `in_context()`. + // For example: + // `in_context("projects//locations//metadataStores//contexts/")` + // + // Each of the above supported filters can be combined together using + // logical operators (`AND` & `OR`). + // For example: `display_name = "test" AND metadata.field1.bool_value = true`. + string filter = 4; +} + +// Response message for [MetadataService.ListExecutions][google.cloud.aiplatform.v1.MetadataService.ListExecutions]. +message ListExecutionsResponse { + // The Executions retrieved from the MetadataStore. + repeated Execution executions = 1; + + // A token, which can be sent as [ListExecutionsRequest.page_token][google.cloud.aiplatform.v1.ListExecutionsRequest.page_token] + // to retrieve the next page. + // If this field is not populated, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [MetadataService.UpdateExecution][google.cloud.aiplatform.v1.MetadataService.UpdateExecution]. +message UpdateExecutionRequest { + // Required. The Execution containing updates. + // The Execution's [Execution.name][google.cloud.aiplatform.v1.Execution.name] field is used to identify the Execution + // to be updated. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + Execution execution = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A FieldMask indicating which fields should be updated. + // Functionality of this field is not yet supported. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; + + // If set to true, and the [Execution][google.cloud.aiplatform.v1.Execution] is not found, a new [Execution][google.cloud.aiplatform.v1.Execution] + // is created. + bool allow_missing = 3; +} + +// Request message for [MetadataService.DeleteExecution][google.cloud.aiplatform.v1.MetadataService.DeleteExecution]. +message DeleteExecutionRequest { + // Required. The resource name of the Execution to delete. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Execution" + } + ]; + + // Optional. The etag of the Execution to delete. + // If this is provided, it must match the server's etag. Otherwise, the + // request will fail with a FAILED_PRECONDITION. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [MetadataService.PurgeExecutions][google.cloud.aiplatform.v1.MetadataService.PurgeExecutions]. +message PurgeExecutionsRequest { + // Required. The metadata store to purge Executions from. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Execution" + } + ]; + + // Required. A required filter matching the Executions to be purged. + // E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Flag to indicate to actually perform the purge. + // If `force` is set to false, the method will return a sample of + // Execution names that would be deleted. + bool force = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [MetadataService.PurgeExecutions][google.cloud.aiplatform.v1.MetadataService.PurgeExecutions]. +message PurgeExecutionsResponse { + // The number of Executions that this request deleted (or, if `force` is + // false, the number of Executions that will be deleted). This can be an + // estimate. + int64 purge_count = 1; + + // A sample of the Execution names that will be deleted. + // Only populated if `force` is set to false. The maximum number of samples is + // 100 (it is possible to return fewer). + repeated string purge_sample = 2 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Execution" + }]; +} + +// Details of operations that perform [MetadataService.PurgeExecutions][google.cloud.aiplatform.v1.MetadataService.PurgeExecutions]. +message PurgeExecutionsMetadata { + // Operation metadata for purging Executions. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [MetadataService.AddExecutionEvents][google.cloud.aiplatform.v1.MetadataService.AddExecutionEvents]. +message AddExecutionEventsRequest { + // Required. The resource name of the Execution that the Events connect + // Artifacts with. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + string execution = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Execution" + } + ]; + + // The Events to create and add. + repeated Event events = 2; +} + +// Response message for [MetadataService.AddExecutionEvents][google.cloud.aiplatform.v1.MetadataService.AddExecutionEvents]. +message AddExecutionEventsResponse { + +} + +// Request message for [MetadataService.QueryExecutionInputsAndOutputs][google.cloud.aiplatform.v1.MetadataService.QueryExecutionInputsAndOutputs]. +message QueryExecutionInputsAndOutputsRequest { + // Required. The resource name of the Execution whose input and output Artifacts should + // be retrieved as a LineageSubgraph. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + string execution = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Execution" + } + ]; +} + +// Request message for [MetadataService.CreateMetadataSchema][google.cloud.aiplatform.v1.MetadataService.CreateMetadataSchema]. +message CreateMetadataSchemaRequest { + // Required. The resource name of the MetadataStore where the MetadataSchema should + // be created. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/MetadataStore" + } + ]; + + // Required. The MetadataSchema to create. + MetadataSchema metadata_schema = 2 [(google.api.field_behavior) = REQUIRED]; + + // The {metadata_schema} portion of the resource name with the format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` + // If not provided, the MetadataStore's ID will be a UUID generated by the + // service. + // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + // Must be unique across all MetadataSchemas in the parent Location. + // (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + // if the caller can't view the preexisting MetadataSchema.) + string metadata_schema_id = 3; +} + +// Request message for [MetadataService.GetMetadataSchema][google.cloud.aiplatform.v1.MetadataService.GetMetadataSchema]. +message GetMetadataSchemaRequest { + // Required. The resource name of the MetadataSchema to retrieve. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/MetadataSchema" + } + ]; +} + +// Request message for [MetadataService.ListMetadataSchemas][google.cloud.aiplatform.v1.MetadataService.ListMetadataSchemas]. +message ListMetadataSchemasRequest { + // Required. The MetadataStore whose MetadataSchemas should be listed. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/MetadataSchema" + } + ]; + + // The maximum number of MetadataSchemas to return. The service may return + // fewer. + // Must be in range 1-1000, inclusive. Defaults to 100. + int32 page_size = 2; + + // A page token, received from a previous + // [MetadataService.ListMetadataSchemas][google.cloud.aiplatform.v1.MetadataService.ListMetadataSchemas] call. Provide this to retrieve the + // next page. + // + // When paginating, all other provided parameters must match the call that + // provided the page token. (Otherwise the request will fail with + // INVALID_ARGUMENT error.) + string page_token = 3; + + // A query to filter available MetadataSchemas for matching results. + string filter = 4; +} + +// Response message for [MetadataService.ListMetadataSchemas][google.cloud.aiplatform.v1.MetadataService.ListMetadataSchemas]. +message ListMetadataSchemasResponse { + // The MetadataSchemas found for the MetadataStore. + repeated MetadataSchema metadata_schemas = 1; + + // A token, which can be sent as + // [ListMetadataSchemasRequest.page_token][google.cloud.aiplatform.v1.ListMetadataSchemasRequest.page_token] to retrieve the next + // page. If this field is not populated, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [MetadataService.QueryArtifactLineageSubgraph][google.cloud.aiplatform.v1.MetadataService.QueryArtifactLineageSubgraph]. +message QueryArtifactLineageSubgraphRequest { + // Required. The resource name of the Artifact whose Lineage needs to be retrieved as a + // LineageSubgraph. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + // + // The request may error with FAILED_PRECONDITION if the number of Artifacts, + // the number of Executions, or the number of Events that would be returned + // for the Context exceeds 1000. + string artifact = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Artifact" + } + ]; + + // Specifies the size of the lineage graph in terms of number of hops from the + // specified artifact. + // Negative Value: INVALID_ARGUMENT error is returned + // 0: Only input artifact is returned. + // No value: Transitive closure is performed to return the complete graph. + int32 max_hops = 2; + + // Filter specifying the boolean condition for the Artifacts to satisfy in + // order to be part of the Lineage Subgraph. + // The syntax to define filter query is based on https://google.aip.dev/160. + // The supported set of filters include the following: + // + // * **Attribute filtering**: + // For example: `display_name = "test"` + // Supported fields include: `name`, `display_name`, `uri`, `state`, + // `schema_title`, `create_time`, and `update_time`. + // Time fields, such as `create_time` and `update_time`, require values + // specified in RFC-3339 format. + // For example: `create_time = "2020-11-19T11:30:00-04:00"` + // * **Metadata field**: + // To filter on metadata fields use traversal operation as follows: + // `metadata..`. + // For example: `metadata.field_1.number_value = 10.0` + // + // Each of the above supported filter types can be combined together using + // logical operators (`AND` & `OR`). + // + // For example: `display_name = "test" AND metadata.field1.bool_value = true`. + string filter = 3; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_store.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_store.proto new file mode 100644 index 00000000..31e7fd2c --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_store.proto @@ -0,0 +1,65 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/encryption_spec.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "MetadataProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Instance of a metadata store. Contains a set of metadata that can be +// queried. +message MetadataStore { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/MetadataStore" + pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}" + }; + + // Represents state information for a MetadataStore. + message MetadataStoreState { + // The disk utilization of the MetadataStore in bytes. + int64 disk_utilization_bytes = 1; + } + + // Output only. The resource name of the MetadataStore instance. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this MetadataStore was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this MetadataStore was last updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Customer-managed encryption key spec for a Metadata Store. If set, this + // Metadata Store and all sub-resources of this Metadata Store are secured + // using this key. + EncryptionSpec encryption_spec = 5; + + // Description of the MetadataStore. + string description = 6; + + // Output only. State information of the MetadataStore. + MetadataStoreState state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/migratable_resource.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/migratable_resource.proto new file mode 100644 index 00000000..3306029a --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/migratable_resource.proto @@ -0,0 +1,150 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "MigratableResourceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; +option (google.api.resource_definition) = { + type: "ml.googleapis.com/Version" + pattern: "projects/{project}/models/{model}/versions/{version}" +}; +option (google.api.resource_definition) = { + type: "automl.googleapis.com/Model" + pattern: "projects/{project}/locations/{location}/models/{model}" +}; +option (google.api.resource_definition) = { + type: "automl.googleapis.com/Dataset" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}" +}; +option (google.api.resource_definition) = { + type: "datalabeling.googleapis.com/Dataset" + pattern: "projects/{project}/datasets/{dataset}" +}; +option (google.api.resource_definition) = { + type: "datalabeling.googleapis.com/AnnotatedDataset" + pattern: "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}" +}; + +// Represents one resource that exists in automl.googleapis.com, +// datalabeling.googleapis.com or ml.googleapis.com. +message MigratableResource { + // Represents one model Version in ml.googleapis.com. + message MlEngineModelVersion { + // The ml.googleapis.com endpoint that this model Version currently lives + // in. + // Example values: + // + // * ml.googleapis.com + // * us-centrall-ml.googleapis.com + // * europe-west4-ml.googleapis.com + // * asia-east1-ml.googleapis.com + string endpoint = 1; + + // Full resource name of ml engine model Version. + // Format: `projects/{project}/models/{model}/versions/{version}`. + string version = 2 [(google.api.resource_reference) = { + type: "ml.googleapis.com/Version" + }]; + } + + // Represents one Model in automl.googleapis.com. + message AutomlModel { + // Full resource name of automl Model. + // Format: + // `projects/{project}/locations/{location}/models/{model}`. + string model = 1 [(google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + }]; + + // The Model's display name in automl.googleapis.com. + string model_display_name = 3; + } + + // Represents one Dataset in automl.googleapis.com. + message AutomlDataset { + // Full resource name of automl Dataset. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}`. + string dataset = 1 [(google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + }]; + + // The Dataset's display name in automl.googleapis.com. + string dataset_display_name = 4; + } + + // Represents one Dataset in datalabeling.googleapis.com. + message DataLabelingDataset { + // Represents one AnnotatedDataset in datalabeling.googleapis.com. + message DataLabelingAnnotatedDataset { + // Full resource name of data labeling AnnotatedDataset. + // Format: + // `projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}`. + string annotated_dataset = 1 [(google.api.resource_reference) = { + type: "datalabeling.googleapis.com/AnnotatedDataset" + }]; + + // The AnnotatedDataset's display name in datalabeling.googleapis.com. + string annotated_dataset_display_name = 3; + } + + // Full resource name of data labeling Dataset. + // Format: + // `projects/{project}/datasets/{dataset}`. + string dataset = 1 [(google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Dataset" + }]; + + // The Dataset's display name in datalabeling.googleapis.com. + string dataset_display_name = 4; + + // The migratable AnnotatedDataset in datalabeling.googleapis.com belongs to + // the data labeling Dataset. + repeated DataLabelingAnnotatedDataset data_labeling_annotated_datasets = 3; + } + + oneof resource { + // Output only. Represents one Version in ml.googleapis.com. + MlEngineModelVersion ml_engine_model_version = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Represents one Model in automl.googleapis.com. + AutomlModel automl_model = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Represents one Dataset in automl.googleapis.com. + AutomlDataset automl_dataset = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Represents one Dataset in datalabeling.googleapis.com. + DataLabelingDataset data_labeling_dataset = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Timestamp when the last migration attempt on this MigratableResource + // started. Will not be set if there's no migration attempt on this + // MigratableResource. + google.protobuf.Timestamp last_migrate_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this MigratableResource was last updated. + google.protobuf.Timestamp last_update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/migration_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/migration_service.proto new file mode 100644 index 00000000..bcacf30a --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/migration_service.proto @@ -0,0 +1,314 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/migratable_resource.proto"; +import "google/cloud/aiplatform/v1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "MigrationServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A service that migrates resources from automl.googleapis.com, +// datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. +service MigrationService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Searches all of the resources in automl.googleapis.com, + // datalabeling.googleapis.com and ml.googleapis.com that can be migrated to + // Vertex AI's given location. + rpc SearchMigratableResources(SearchMigratableResourcesRequest) returns (SearchMigratableResourcesResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/migratableResources:search" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Batch migrates resources from ml.googleapis.com, automl.googleapis.com, + // and datalabeling.googleapis.com to Vertex AI. + rpc BatchMigrateResources(BatchMigrateResourcesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/migratableResources:batchMigrate" + body: "*" + }; + option (google.api.method_signature) = "parent,migrate_resource_requests"; + option (google.longrunning.operation_info) = { + response_type: "BatchMigrateResourcesResponse" + metadata_type: "BatchMigrateResourcesOperationMetadata" + }; + } +} + +// Request message for [MigrationService.SearchMigratableResources][google.cloud.aiplatform.v1.MigrationService.SearchMigratableResources]. +message SearchMigratableResourcesRequest { + // Required. The location that the migratable resources should be searched from. + // It's the Vertex AI location that the resources can be migrated to, not + // the resources' original location. + // Format: + // `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The standard page size. + // The default and maximum value is 100. + int32 page_size = 2; + + // The standard page token. + string page_token = 3; + + // A filter for your search. You can use the following types of filters: + // + // * Resource type filters. The following strings filter for a specific type + // of [MigratableResource][google.cloud.aiplatform.v1.MigratableResource]: + // * `ml_engine_model_version:*` + // * `automl_model:*` + // * `automl_dataset:*` + // * `data_labeling_dataset:*` + // * "Migrated or not" filters. The following strings filter for resources + // that either have or have not already been migrated: + // * `last_migrate_time:*` filters for migrated resources. + // * `NOT last_migrate_time:*` filters for not yet migrated resources. + string filter = 4; +} + +// Response message for [MigrationService.SearchMigratableResources][google.cloud.aiplatform.v1.MigrationService.SearchMigratableResources]. +message SearchMigratableResourcesResponse { + // All migratable resources that can be migrated to the + // location specified in the request. + repeated MigratableResource migratable_resources = 1; + + // The standard next-page token. + // The migratable_resources may not fill page_size in + // SearchMigratableResourcesRequest even when there are subsequent pages. + string next_page_token = 2; +} + +// Request message for [MigrationService.BatchMigrateResources][google.cloud.aiplatform.v1.MigrationService.BatchMigrateResources]. +message BatchMigrateResourcesRequest { + // Required. The location of the migrated resource will live in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The request messages specifying the resources to migrate. + // They must be in the same location as the destination. + // Up to 50 resources can be migrated in one batch. + repeated MigrateResourceRequest migrate_resource_requests = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Config of migrating one resource from automl.googleapis.com, +// datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. +message MigrateResourceRequest { + // Config for migrating version in ml.googleapis.com to Vertex AI's Model. + message MigrateMlEngineModelVersionConfig { + // Required. The ml.googleapis.com endpoint that this model version should be migrated + // from. + // Example values: + // + // * ml.googleapis.com + // + // * us-centrall-ml.googleapis.com + // + // * europe-west4-ml.googleapis.com + // + // * asia-east1-ml.googleapis.com + string endpoint = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Full resource name of ml engine model version. + // Format: `projects/{project}/models/{model}/versions/{version}`. + string model_version = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ml.googleapis.com/Version" + } + ]; + + // Required. Display name of the model in Vertex AI. + // System will pick a display name if unspecified. + string model_display_name = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // Config for migrating Model in automl.googleapis.com to Vertex AI's Model. + message MigrateAutomlModelConfig { + // Required. Full resource name of automl Model. + // Format: + // `projects/{project}/locations/{location}/models/{model}`. + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // Optional. Display name of the model in Vertex AI. + // System will pick a display name if unspecified. + string model_display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Config for migrating Dataset in automl.googleapis.com to Vertex AI's + // Dataset. + message MigrateAutomlDatasetConfig { + // Required. Full resource name of automl Dataset. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}`. + string dataset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; + + // Required. Display name of the Dataset in Vertex AI. + // System will pick a display name if unspecified. + string dataset_display_name = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Config for migrating Dataset in datalabeling.googleapis.com to Vertex + // AI's Dataset. + message MigrateDataLabelingDatasetConfig { + // Config for migrating AnnotatedDataset in datalabeling.googleapis.com to + // Vertex AI's SavedQuery. + message MigrateDataLabelingAnnotatedDatasetConfig { + // Required. Full resource name of data labeling AnnotatedDataset. + // Format: + // `projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}`. + string annotated_dataset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/AnnotatedDataset" + } + ]; + } + + // Required. Full resource name of data labeling Dataset. + // Format: + // `projects/{project}/datasets/{dataset}`. + string dataset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Dataset" + } + ]; + + // Optional. Display name of the Dataset in Vertex AI. + // System will pick a display name if unspecified. + string dataset_display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configs for migrating AnnotatedDataset in datalabeling.googleapis.com to + // Vertex AI's SavedQuery. The specified AnnotatedDatasets have to belong + // to the datalabeling Dataset. + repeated MigrateDataLabelingAnnotatedDatasetConfig migrate_data_labeling_annotated_dataset_configs = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + oneof request { + // Config for migrating Version in ml.googleapis.com to Vertex AI's Model. + MigrateMlEngineModelVersionConfig migrate_ml_engine_model_version_config = 1; + + // Config for migrating Model in automl.googleapis.com to Vertex AI's + // Model. + MigrateAutomlModelConfig migrate_automl_model_config = 2; + + // Config for migrating Dataset in automl.googleapis.com to Vertex AI's + // Dataset. + MigrateAutomlDatasetConfig migrate_automl_dataset_config = 3; + + // Config for migrating Dataset in datalabeling.googleapis.com to + // Vertex AI's Dataset. + MigrateDataLabelingDatasetConfig migrate_data_labeling_dataset_config = 4; + } +} + +// Response message for [MigrationService.BatchMigrateResources][google.cloud.aiplatform.v1.MigrationService.BatchMigrateResources]. +message BatchMigrateResourcesResponse { + // Successfully migrated resources. + repeated MigrateResourceResponse migrate_resource_responses = 1; +} + +// Describes a successfully migrated resource. +message MigrateResourceResponse { + // After migration, the resource name in Vertex AI. + oneof migrated_resource { + // Migrated Dataset's resource name. + string dataset = 1 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + }]; + + // Migrated Model's resource name. + string model = 2 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + }]; + } + + // Before migration, the identifier in ml.googleapis.com, + // automl.googleapis.com or datalabeling.googleapis.com. + MigratableResource migratable_resource = 3; +} + +// Runtime operation information for [MigrationService.BatchMigrateResources][google.cloud.aiplatform.v1.MigrationService.BatchMigrateResources]. +message BatchMigrateResourcesOperationMetadata { + // Represents a partial result in batch migration operation for one + // [MigrateResourceRequest][google.cloud.aiplatform.v1.MigrateResourceRequest]. + message PartialResult { + // If the resource's migration is ongoing, none of the result will be set. + // If the resource's migration is finished, either error or one of the + // migrated resource name will be filled. + oneof result { + // The error result of the migration request in case of failure. + google.rpc.Status error = 2; + + // Migrated model resource name. + string model = 3 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + }]; + + // Migrated dataset resource name. + string dataset = 4 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + }]; + } + + // It's the same as the value in + // [MigrateResourceRequest.migrate_resource_requests][]. + MigrateResourceRequest request = 1; + } + + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; + + // Partial results that reflect the latest migration operation progress. + repeated PartialResult partial_results = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model.proto new file mode 100644 index 00000000..32e617dd --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model.proto @@ -0,0 +1,559 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/deployed_model_ref.proto"; +import "google/cloud/aiplatform/v1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1/env_var.proto"; +import "google/cloud/aiplatform/v1/explanation.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ModelProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A trained machine learning Model. +message Model { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Model" + pattern: "projects/{project}/locations/{location}/models/{model}" + }; + + // Represents export format supported by the Model. + // All formats export to Google Cloud Storage. + message ExportFormat { + // The Model content that can be exported. + enum ExportableContent { + // Should not be used. + EXPORTABLE_CONTENT_UNSPECIFIED = 0; + + // Model artifact and any of its supported files. Will be exported to the + // location specified by the `artifactDestination` field of the + // [ExportModelRequest.output_config][google.cloud.aiplatform.v1.ExportModelRequest.output_config] object. + ARTIFACT = 1; + + // The container image that is to be used when deploying this Model. Will + // be exported to the location specified by the `imageDestination` field + // of the [ExportModelRequest.output_config][google.cloud.aiplatform.v1.ExportModelRequest.output_config] object. + IMAGE = 2; + } + + // Output only. The ID of the export format. + // The possible format IDs are: + // + // * `tflite` + // Used for Android mobile devices. + // + // * `edgetpu-tflite` + // Used for [Edge TPU](https://cloud.google.com/edge-tpu/) devices. + // + // * `tf-saved-model` + // A tensorflow model in SavedModel format. + // + // * `tf-js` + // A [TensorFlow.js](https://www.tensorflow.org/js) model that can be used + // in the browser and in Node.js using JavaScript. + // + // * `core-ml` + // Used for iOS mobile devices. + // + // * `custom-trained` + // A Model that was uploaded or trained by custom code. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The content of this Model that may be exported. + repeated ExportableContent exportable_contents = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Identifies a type of Model's prediction resources. + enum DeploymentResourcesType { + // Should not be used. + DEPLOYMENT_RESOURCES_TYPE_UNSPECIFIED = 0; + + // Resources that are dedicated to the [DeployedModel][google.cloud.aiplatform.v1.DeployedModel], and that need a + // higher degree of manual configuration. + DEDICATED_RESOURCES = 1; + + // Resources that to large degree are decided by Vertex AI, and require + // only a modest additional configuration. + AUTOMATIC_RESOURCES = 2; + } + + // The resource name of the Model. + string name = 1; + + // Required. The display name of the Model. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the Model. + string description = 3; + + // The schemata that describe formats of the Model's predictions and + // explanations as given and returned via + // [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict] and [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain]. + PredictSchemata predict_schemata = 4; + + // Immutable. Points to a YAML file stored on Google Cloud Storage describing additional + // information about the Model, that is specific to it. Unset if the Model + // does not have any additional information. + // The schema is defined as an OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + // AutoML Models always have this field populated by Vertex AI, if no + // additional metadata is needed, this field is set to an empty string. + // Note: The URI given on output will be immutable and probably different, + // including the URI scheme, than the one given on input. The output URI will + // point to a location where the user only has a read access. + string metadata_schema_uri = 5 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. An additional information about the Model; the schema of the metadata can + // be found in [metadata_schema][google.cloud.aiplatform.v1.Model.metadata_schema_uri]. + // Unset if the Model does not have any additional information. + google.protobuf.Value metadata = 6 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The formats in which this Model may be exported. If empty, this Model is + // not available for export. + repeated ExportFormat supported_export_formats = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The resource name of the TrainingPipeline that uploaded this Model, if + // any. + string training_pipeline = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TrainingPipeline" + } + ]; + + // Input only. The specification of the container that is to be used when deploying + // this Model. The specification is ingested upon + // [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel], and all binaries it contains are copied + // and stored internally by Vertex AI. + // Not present for AutoML Models. + ModelContainerSpec container_spec = 9 [(google.api.field_behavior) = INPUT_ONLY]; + + // Immutable. The path to the directory containing the Model artifact and any of its + // supporting files. + // Not present for AutoML Models. + string artifact_uri = 26 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. When this Model is deployed, its prediction resources are described by the + // `prediction_resources` field of the [Endpoint.deployed_models][google.cloud.aiplatform.v1.Endpoint.deployed_models] object. + // Because not all Models support all resource configuration types, the + // configuration types this Model supports are listed here. If no + // configuration types are listed, the Model cannot be deployed to an + // [Endpoint][google.cloud.aiplatform.v1.Endpoint] and does not support + // online predictions ([PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict] or + // [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain]). Such a Model can serve predictions by + // using a [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob], if it has at least one entry each in + // [supported_input_storage_formats][google.cloud.aiplatform.v1.Model.supported_input_storage_formats] and + // [supported_output_storage_formats][google.cloud.aiplatform.v1.Model.supported_output_storage_formats]. + repeated DeploymentResourcesType supported_deployment_resources_types = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The formats this Model supports in + // [BatchPredictionJob.input_config][google.cloud.aiplatform.v1.BatchPredictionJob.input_config]. If + // [PredictSchemata.instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri] exists, the instances + // should be given as per that schema. + // + // The possible formats are: + // + // * `jsonl` + // The JSON Lines format, where each instance is a single line. Uses + // [GcsSource][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig.gcs_source]. + // + // * `csv` + // The CSV format, where each instance is a single comma-separated line. + // The first line in the file is the header, containing comma-separated field + // names. Uses [GcsSource][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig.gcs_source]. + // + // * `tf-record` + // The TFRecord format, where each instance is a single record in tfrecord + // syntax. Uses [GcsSource][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig.gcs_source]. + // + // * `tf-record-gzip` + // Similar to `tf-record`, but the file is gzipped. Uses + // [GcsSource][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig.gcs_source]. + // + // * `bigquery` + // Each instance is a single row in BigQuery. Uses + // [BigQuerySource][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig.bigquery_source]. + // + // * `file-list` + // Each line of the file is the location of an instance to process, uses + // `gcs_source` field of the + // [InputConfig][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig] object. + // + // + // If this Model doesn't support any of these formats it means it cannot be + // used with a [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob]. However, if it has + // [supported_deployment_resources_types][google.cloud.aiplatform.v1.Model.supported_deployment_resources_types], it could serve online + // predictions by using [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict] or + // [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain]. + repeated string supported_input_storage_formats = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The formats this Model supports in + // [BatchPredictionJob.output_config][google.cloud.aiplatform.v1.BatchPredictionJob.output_config]. If both + // [PredictSchemata.instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri] and + // [PredictSchemata.prediction_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.prediction_schema_uri] exist, the predictions + // are returned together with their instances. In other words, the + // prediction has the original instance data first, followed + // by the actual prediction content (as per the schema). + // + // The possible formats are: + // + // * `jsonl` + // The JSON Lines format, where each prediction is a single line. Uses + // [GcsDestination][google.cloud.aiplatform.v1.BatchPredictionJob.OutputConfig.gcs_destination]. + // + // * `csv` + // The CSV format, where each prediction is a single comma-separated line. + // The first line in the file is the header, containing comma-separated field + // names. Uses + // [GcsDestination][google.cloud.aiplatform.v1.BatchPredictionJob.OutputConfig.gcs_destination]. + // + // * `bigquery` + // Each prediction is a single row in a BigQuery table, uses + // [BigQueryDestination][google.cloud.aiplatform.v1.BatchPredictionJob.OutputConfig.bigquery_destination] + // . + // + // + // If this Model doesn't support any of these formats it means it cannot be + // used with a [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob]. However, if it has + // [supported_deployment_resources_types][google.cloud.aiplatform.v1.Model.supported_deployment_resources_types], it could serve online + // predictions by using [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict] or + // [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain]. + repeated string supported_output_storage_formats = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Model was uploaded into Vertex AI. + google.protobuf.Timestamp create_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Model was most recently updated. + google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The pointers to DeployedModels created from this Model. Note that + // Model could have been deployed to Endpoints in different Locations. + repeated DeployedModelRef deployed_models = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The default explanation specification for this Model. + // + // The Model can be used for [requesting + // explanation][PredictionService.Explain] after being + // [deployed][google.cloud.aiplatform.v1.EndpointService.DeployModel] if it is populated. + // The Model can be used for [batch + // explanation][BatchPredictionJob.generate_explanation] if it is populated. + // + // All fields of the explanation_spec can be overridden by + // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] of + // [DeployModelRequest.deployed_model][google.cloud.aiplatform.v1.DeployModelRequest.deployed_model], or + // [explanation_spec][google.cloud.aiplatform.v1.BatchPredictionJob.explanation_spec] of + // [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob]. + // + // If the default explanation specification is not set for this Model, this + // Model can still be used for [requesting + // explanation][PredictionService.Explain] by setting + // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] of + // [DeployModelRequest.deployed_model][google.cloud.aiplatform.v1.DeployModelRequest.deployed_model] and for [batch + // explanation][BatchPredictionJob.generate_explanation] by setting + // [explanation_spec][google.cloud.aiplatform.v1.BatchPredictionJob.explanation_spec] of + // [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob]. + ExplanationSpec explanation_spec = 23; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 16; + + // The labels with user-defined metadata to organize your Models. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 17; + + // Customer-managed encryption key spec for a Model. If set, this + // Model and all sub-resources of this Model will be secured by this key. + EncryptionSpec encryption_spec = 24; +} + +// Contains the schemata used in Model's predictions and explanations via +// [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict], [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain] and +// [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob]. +message PredictSchemata { + // Immutable. Points to a YAML file stored on Google Cloud Storage describing the format + // of a single instance, which are used in [PredictRequest.instances][google.cloud.aiplatform.v1.PredictRequest.instances], + // [ExplainRequest.instances][google.cloud.aiplatform.v1.ExplainRequest.instances] and + // [BatchPredictionJob.input_config][google.cloud.aiplatform.v1.BatchPredictionJob.input_config]. + // The schema is defined as an OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + // AutoML Models always have this field populated by Vertex AI. + // Note: The URI given on output will be immutable and probably different, + // including the URI scheme, than the one given on input. The output URI will + // point to a location where the user only has a read access. + string instance_schema_uri = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Points to a YAML file stored on Google Cloud Storage describing the + // parameters of prediction and explanation via + // [PredictRequest.parameters][google.cloud.aiplatform.v1.PredictRequest.parameters], [ExplainRequest.parameters][google.cloud.aiplatform.v1.ExplainRequest.parameters] and + // [BatchPredictionJob.model_parameters][google.cloud.aiplatform.v1.BatchPredictionJob.model_parameters]. + // The schema is defined as an OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + // AutoML Models always have this field populated by Vertex AI, if no + // parameters are supported, then it is set to an empty string. + // Note: The URI given on output will be immutable and probably different, + // including the URI scheme, than the one given on input. The output URI will + // point to a location where the user only has a read access. + string parameters_schema_uri = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Points to a YAML file stored on Google Cloud Storage describing the format + // of a single prediction produced by this Model, which are returned via + // [PredictResponse.predictions][google.cloud.aiplatform.v1.PredictResponse.predictions], [ExplainResponse.explanations][google.cloud.aiplatform.v1.ExplainResponse.explanations], and + // [BatchPredictionJob.output_config][google.cloud.aiplatform.v1.BatchPredictionJob.output_config]. + // The schema is defined as an OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + // AutoML Models always have this field populated by Vertex AI. + // Note: The URI given on output will be immutable and probably different, + // including the URI scheme, than the one given on input. The output URI will + // point to a location where the user only has a read access. + string prediction_schema_uri = 3 [(google.api.field_behavior) = IMMUTABLE]; +} + +// Specification of a container for serving predictions. Some fields in this +// message correspond to fields in the [Kubernetes Container v1 core +// specification](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). +message ModelContainerSpec { + // Required. Immutable. URI of the Docker image to be used as the custom container for serving + // predictions. This URI must identify an image in Artifact Registry or + // Container Registry. Learn more about the [container publishing + // requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#publishing), + // including permissions requirements for the Vertex AI Service Agent. + // + // The container image is ingested upon [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel], stored + // internally, and this original path is afterwards not used. + // + // To learn about the requirements for the Docker image itself, see + // [Custom container + // requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#). + // + // You can use the URI to one of Vertex AI's [pre-built container images for + // prediction](https://cloud.google.com/vertex-ai/docs/predictions/pre-built-containers) + // in this field. + string image_uri = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Immutable. Specifies the command that runs when the container starts. This overrides + // the container's + // [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint). + // Specify this field as an array of executable and arguments, similar to a + // Docker `ENTRYPOINT`'s "exec" form, not its "shell" form. + // + // If you do not specify this field, then the container's `ENTRYPOINT` runs, + // in conjunction with the [args][google.cloud.aiplatform.v1.ModelContainerSpec.args] field or the + // container's [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd), + // if either exists. If this field is not specified and the container does not + // have an `ENTRYPOINT`, then refer to the Docker documentation about [how + // `CMD` and `ENTRYPOINT` + // interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). + // + // If you specify this field, then you can also specify the `args` field to + // provide additional arguments for this command. However, if you specify this + // field, then the container's `CMD` is ignored. See the + // [Kubernetes documentation about how the + // `command` and `args` fields interact with a container's `ENTRYPOINT` and + // `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). + // + // In this field, you can reference [environment variables set by Vertex + // AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) + // and environment variables set in the [env][google.cloud.aiplatform.v1.ModelContainerSpec.env] field. + // You cannot reference environment variables set in the Docker image. In + // order for environment variables to be expanded, reference them by using the + // following syntax: + // $(VARIABLE_NAME) + // Note that this differs from Bash variable expansion, which does not use + // parentheses. If a variable cannot be resolved, the reference in the input + // string is used unchanged. To avoid variable expansion, you can escape this + // syntax with `$$`; for example: + // $$(VARIABLE_NAME) + // This field corresponds to the `command` field of the Kubernetes Containers + // [v1 core + // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). + repeated string command = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Specifies arguments for the command that runs when the container starts. + // This overrides the container's + // [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd). Specify + // this field as an array of executable and arguments, similar to a Docker + // `CMD`'s "default parameters" form. + // + // If you don't specify this field but do specify the + // [command][google.cloud.aiplatform.v1.ModelContainerSpec.command] field, then the command from the + // `command` field runs without any additional arguments. See the + // [Kubernetes documentation about how the + // `command` and `args` fields interact with a container's `ENTRYPOINT` and + // `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). + // + // If you don't specify this field and don't specify the `command` field, + // then the container's + // [`ENTRYPOINT`](https://docs.docker.com/engine/reference/builder/#cmd) and + // `CMD` determine what runs based on their default behavior. See the Docker + // documentation about [how `CMD` and `ENTRYPOINT` + // interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). + // + // In this field, you can reference [environment variables + // set by Vertex + // AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) + // and environment variables set in the [env][google.cloud.aiplatform.v1.ModelContainerSpec.env] field. + // You cannot reference environment variables set in the Docker image. In + // order for environment variables to be expanded, reference them by using the + // following syntax: + // $(VARIABLE_NAME) + // Note that this differs from Bash variable expansion, which does not use + // parentheses. If a variable cannot be resolved, the reference in the input + // string is used unchanged. To avoid variable expansion, you can escape this + // syntax with `$$`; for example: + // $$(VARIABLE_NAME) + // This field corresponds to the `args` field of the Kubernetes Containers + // [v1 core + // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). + repeated string args = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. List of environment variables to set in the container. After the container + // starts running, code running in the container can read these environment + // variables. + // + // Additionally, the [command][google.cloud.aiplatform.v1.ModelContainerSpec.command] and + // [args][google.cloud.aiplatform.v1.ModelContainerSpec.args] fields can reference these variables. Later + // entries in this list can also reference earlier entries. For example, the + // following example sets the variable `VAR_2` to have the value `foo bar`: + // + // ```json + // [ + // { + // "name": "VAR_1", + // "value": "foo" + // }, + // { + // "name": "VAR_2", + // "value": "$(VAR_1) bar" + // } + // ] + // ``` + // + // If you switch the order of the variables in the example, then the expansion + // does not occur. + // + // This field corresponds to the `env` field of the Kubernetes Containers + // [v1 core + // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). + repeated EnvVar env = 4 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. List of ports to expose from the container. Vertex AI sends any + // prediction requests that it receives to the first port on this list. Vertex + // AI also sends + // [liveness and health + // checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#liveness) + // to this port. + // + // If you do not specify this field, it defaults to following value: + // + // ```json + // [ + // { + // "containerPort": 8080 + // } + // ] + // ``` + // + // Vertex AI does not use ports other than the first one listed. This field + // corresponds to the `ports` field of the Kubernetes Containers + // [v1 core + // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). + repeated Port ports = 5 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. HTTP path on the container to send prediction requests to. Vertex AI + // forwards requests sent using + // [projects.locations.endpoints.predict][google.cloud.aiplatform.v1.PredictionService.Predict] to this + // path on the container's IP address and port. Vertex AI then returns the + // container's response in the API response. + // + // For example, if you set this field to `/foo`, then when Vertex AI + // receives a prediction request, it forwards the request body in a POST + // request to the `/foo` path on the port of your container specified by the + // first value of this `ModelContainerSpec`'s + // [ports][google.cloud.aiplatform.v1.ModelContainerSpec.ports] field. + // + // If you don't specify this field, it defaults to the following value when + // you [deploy this Model to an Endpoint][google.cloud.aiplatform.v1.EndpointService.DeployModel]: + // /v1/endpoints/ENDPOINT/deployedModels/DEPLOYED_MODEL:predict + // The placeholders in this value are replaced as follows: + // + // * ENDPOINT: The last segment (following `endpoints/`)of the + // Endpoint.name][] field of the Endpoint where this Model has been + // deployed. (Vertex AI makes this value available to your container code + // as the [`AIP_ENDPOINT_ID` environment + // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) + // + // * DEPLOYED_MODEL: [DeployedModel.id][google.cloud.aiplatform.v1.DeployedModel.id] of the `DeployedModel`. + // (Vertex AI makes this value available to your container code + // as the [`AIP_DEPLOYED_MODEL_ID` environment + // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) + string predict_route = 6 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. HTTP path on the container to send health checks to. Vertex AI + // intermittently sends GET requests to this path on the container's IP + // address and port to check that the container is healthy. Read more about + // [health + // checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#health). + // + // For example, if you set this field to `/bar`, then Vertex AI + // intermittently sends a GET request to the `/bar` path on the port of your + // container specified by the first value of this `ModelContainerSpec`'s + // [ports][google.cloud.aiplatform.v1.ModelContainerSpec.ports] field. + // + // If you don't specify this field, it defaults to the following value when + // you [deploy this Model to an Endpoint][google.cloud.aiplatform.v1.EndpointService.DeployModel]: + // /v1/endpoints/ENDPOINT/deployedModels/DEPLOYED_MODEL:predict + // The placeholders in this value are replaced as follows: + // + // * ENDPOINT: The last segment (following `endpoints/`)of the + // Endpoint.name][] field of the Endpoint where this Model has been + // deployed. (Vertex AI makes this value available to your container code + // as the [`AIP_ENDPOINT_ID` environment + // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) + // + // * DEPLOYED_MODEL: [DeployedModel.id][google.cloud.aiplatform.v1.DeployedModel.id] of the `DeployedModel`. + // (Vertex AI makes this value available to your container code as the + // [`AIP_DEPLOYED_MODEL_ID` environment + // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) + string health_route = 7 [(google.api.field_behavior) = IMMUTABLE]; +} + +// Represents a network port in a container. +message Port { + // The number of the port to expose on the pod's IP address. + // Must be a valid port number, between 1 and 65535 inclusive. + int32 container_port = 3; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto new file mode 100644 index 00000000..822e5926 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto @@ -0,0 +1,300 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1/feature_monitoring_stats.proto"; +import "google/cloud/aiplatform/v1/io.proto"; +import "google/cloud/aiplatform/v1/job_state.proto"; +import "google/cloud/aiplatform/v1/model_monitoring.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ModelDeploymentMonitoringJobProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// The Model Monitoring Objective types. +enum ModelDeploymentMonitoringObjectiveType { + // Default value, should not be set. + MODEL_DEPLOYMENT_MONITORING_OBJECTIVE_TYPE_UNSPECIFIED = 0; + + // Raw feature values' stats to detect skew between Training-Prediction + // datasets. + RAW_FEATURE_SKEW = 1; + + // Raw feature values' stats to detect drift between Serving-Prediction + // datasets. + RAW_FEATURE_DRIFT = 2; + + // Feature attribution scores to detect skew between Training-Prediction + // datasets. + FEATURE_ATTRIBUTION_SKEW = 3; + + // Feature attribution scores to detect skew between Prediction datasets + // collected within different time windows. + FEATURE_ATTRIBUTION_DRIFT = 4; +} + +// Represents a job that runs periodically to monitor the deployed models in an +// endpoint. It will analyze the logged training & prediction data to detect any +// abnormal behaviors. +message ModelDeploymentMonitoringJob { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" + pattern: "projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}" + }; + + // All metadata of most recent monitoring pipelines. + message LatestMonitoringPipelineMetadata { + // The time that most recent monitoring pipelines that is related to this + // run. + google.protobuf.Timestamp run_time = 1; + + // The status of the most recent monitoring pipeline. + google.rpc.Status status = 2; + } + + // The state to Specify the monitoring pipeline. + enum MonitoringScheduleState { + // Unspecified state. + MONITORING_SCHEDULE_STATE_UNSPECIFIED = 0; + + // The pipeline is picked up and wait to run. + PENDING = 1; + + // The pipeline is offline and will be scheduled for next run. + OFFLINE = 2; + + // The pipeline is running. + RUNNING = 3; + } + + // Output only. Resource name of a ModelDeploymentMonitoringJob. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The user-defined name of the ModelDeploymentMonitoringJob. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + // Display name of a ModelDeploymentMonitoringJob. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Endpoint resource name. + // Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Output only. The detailed state of the monitoring job. + // When the job is still creating, the state will be 'PENDING'. + // Once the job is successfully created, the state will be 'RUNNING'. + // Pause the job, the state will be 'PAUSED'. + // Resume the job, the state will return to 'RUNNING'. + JobState state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Schedule state when the monitoring job is in Running state. + MonitoringScheduleState schedule_state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Latest triggered monitoring pipeline metadata. + LatestMonitoringPipelineMetadata latest_monitoring_pipeline_metadata = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The config for monitoring objectives. This is a per DeployedModel config. + // Each DeployedModel needs to be configured separately. + repeated ModelDeploymentMonitoringObjectiveConfig model_deployment_monitoring_objective_configs = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. Schedule config for running the monitoring job. + ModelDeploymentMonitoringScheduleConfig model_deployment_monitoring_schedule_config = 7 [(google.api.field_behavior) = REQUIRED]; + + // Required. Sample Strategy for logging. + SamplingStrategy logging_sampling_strategy = 8 [(google.api.field_behavior) = REQUIRED]; + + // Alert config for model monitoring. + ModelMonitoringAlertConfig model_monitoring_alert_config = 15; + + // YAML schema file uri describing the format of a single instance, + // which are given to format this Endpoint's prediction (and explanation). + // If not set, we will generate predict schema from collected predict + // requests. + string predict_instance_schema_uri = 9; + + // Sample Predict instance, same format as [PredictRequest.instances][google.cloud.aiplatform.v1.PredictRequest.instances], + // this can be set as a replacement of + // [ModelDeploymentMonitoringJob.predict_instance_schema_uri][google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.predict_instance_schema_uri]. If not set, + // we will generate predict schema from collected predict requests. + google.protobuf.Value sample_predict_instance = 19; + + // YAML schema file uri describing the format of a single instance that you + // want Tensorflow Data Validation (TFDV) to analyze. + // + // If this field is empty, all the feature data types are inferred from + // [predict_instance_schema_uri][google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.predict_instance_schema_uri], + // meaning that TFDV will use the data in the exact format(data type) as + // prediction request/response. + // If there are any data type differences between predict instance and TFDV + // instance, this field can be used to override the schema. + // For models trained with Vertex AI, this field must be set as all the + // fields in predict instance formatted as string. + string analysis_instance_schema_uri = 16; + + // Output only. The created bigquery tables for the job under customer project. Customer + // could do their own query & analysis. There could be 4 log tables in + // maximum: + // 1. Training data logging predict request/response + // 2. Serving data logging predict request/response + repeated ModelDeploymentMonitoringBigQueryTable bigquery_tables = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The TTL of BigQuery tables in user projects which stores logs. + // A day is the basic unit of the TTL and we take the ceil of TTL/86400(a + // day). e.g. { second: 3600} indicates ttl = 1 day. + google.protobuf.Duration log_ttl = 17; + + // The labels with user-defined metadata to organize your + // ModelDeploymentMonitoringJob. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 11; + + // Output only. Timestamp when this ModelDeploymentMonitoringJob was created. + google.protobuf.Timestamp create_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this ModelDeploymentMonitoringJob was updated most recently. + google.protobuf.Timestamp update_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this monitoring pipeline will be scheduled to run for the + // next round. + google.protobuf.Timestamp next_schedule_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Stats anomalies base folder path. + GcsDestination stats_anomalies_base_directory = 20; + + // Customer-managed encryption key spec for a ModelDeploymentMonitoringJob. If + // set, this ModelDeploymentMonitoringJob and all sub-resources of this + // ModelDeploymentMonitoringJob will be secured by this key. + EncryptionSpec encryption_spec = 21; + + // If true, the scheduled monitoring pipeline logs are sent to + // Google Cloud Logging, including pipeline status and anomalies detected. + // Please note the logs incur cost, which are subject to [Cloud Logging + // pricing](https://cloud.google.com/logging#pricing). + bool enable_monitoring_pipeline_logs = 22; + + // Output only. Only populated when the job's state is `JOB_STATE_FAILED` or + // `JOB_STATE_CANCELLED`. + google.rpc.Status error = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// ModelDeploymentMonitoringBigQueryTable specifies the BigQuery table name +// as well as some information of the logs stored in this table. +message ModelDeploymentMonitoringBigQueryTable { + // Indicates where does the log come from. + enum LogSource { + // Unspecified source. + LOG_SOURCE_UNSPECIFIED = 0; + + // Logs coming from Training dataset. + TRAINING = 1; + + // Logs coming from Serving traffic. + SERVING = 2; + } + + // Indicates what type of traffic does the log belong to. + enum LogType { + // Unspecified type. + LOG_TYPE_UNSPECIFIED = 0; + + // Predict logs. + PREDICT = 1; + + // Explain logs. + EXPLAIN = 2; + } + + // The source of log. + LogSource log_source = 1; + + // The type of log. + LogType log_type = 2; + + // The created BigQuery table to store logs. Customer could do their own query + // & analysis. Format: + // `bq://.model_deployment_monitoring_._` + string bigquery_table_path = 3; +} + +// ModelDeploymentMonitoringObjectiveConfig contains the pair of +// deployed_model_id to ModelMonitoringObjectiveConfig. +message ModelDeploymentMonitoringObjectiveConfig { + // The DeployedModel ID of the objective config. + string deployed_model_id = 1; + + // The objective config of for the modelmonitoring job of this deployed model. + ModelMonitoringObjectiveConfig objective_config = 2; +} + +// The config for scheduling monitoring job. +message ModelDeploymentMonitoringScheduleConfig { + // Required. The model monitoring job scheduling interval. It will be rounded up to next + // full hour. This defines how often the monitoring jobs are triggered. + google.protobuf.Duration monitor_interval = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Statistics and anomalies generated by Model Monitoring. +message ModelMonitoringStatsAnomalies { + // Historical Stats (and Anomalies) for a specific Feature. + message FeatureHistoricStatsAnomalies { + // Display Name of the Feature. + string feature_display_name = 1; + + // Threshold for anomaly detection. + ThresholdConfig threshold = 3; + + // Stats calculated for the Training Dataset. + FeatureStatsAnomaly training_stats = 4; + + // A list of historical stats generated by different time window's + // Prediction Dataset. + repeated FeatureStatsAnomaly prediction_stats = 5; + } + + // Model Monitoring Objective those stats and anomalies belonging to. + ModelDeploymentMonitoringObjectiveType objective = 1; + + // Deployed Model ID. + string deployed_model_id = 2; + + // Number of anomalies within all stats. + int32 anomaly_count = 3; + + // A list of historical Stats and Anomalies generated for all Features. + repeated FeatureHistoricStatsAnomalies feature_stats = 4; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_evaluation.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_evaluation.proto new file mode 100644 index 00000000..5fc333e6 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_evaluation.proto @@ -0,0 +1,116 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/explanation.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ModelEvaluationProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A collection of metrics calculated by comparing Model's predictions on all of +// the test data against annotations from the test data. +message ModelEvaluation { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/ModelEvaluation" + pattern: "projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}" + }; + + message ModelEvaluationExplanationSpec { + // Explanation type. + // + // For AutoML Image Classification models, possible values are: + // + // * `image-integrated-gradients` + // * `image-xrai` + string explanation_type = 1; + + // Explanation spec details. + ExplanationSpec explanation_spec = 2; + } + + // Output only. The resource name of the ModelEvaluation. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The display name of the ModelEvaluation. + string display_name = 10; + + // Points to a YAML file stored on Google Cloud Storage describing the + // [metrics][google.cloud.aiplatform.v1.ModelEvaluation.metrics] of this ModelEvaluation. The schema is + // defined as an OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + string metrics_schema_uri = 2; + + // Evaluation metrics of the Model. The schema of the metrics is stored in + // [metrics_schema_uri][google.cloud.aiplatform.v1.ModelEvaluation.metrics_schema_uri] + google.protobuf.Value metrics = 3; + + // Output only. Timestamp when this ModelEvaluation was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // All possible [dimensions][ModelEvaluationSlice.slice.dimension] of + // ModelEvaluationSlices. The dimensions can be used as the filter of the + // [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices] request, in the form of + // `slice.dimension = `. + repeated string slice_dimensions = 5; + + // Points to a YAML file stored on Google Cloud Storage describing + // [EvaluatedDataItemView.data_item_payload][] and + // [EvaluatedAnnotation.data_item_payload][]. The schema is defined as an + // OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + // + // This field is not populated if there are neither EvaluatedDataItemViews nor + // EvaluatedAnnotations under this ModelEvaluation. + string data_item_schema_uri = 6; + + // Points to a YAML file stored on Google Cloud Storage describing + // [EvaluatedDataItemView.predictions][], + // [EvaluatedDataItemView.ground_truths][], + // [EvaluatedAnnotation.predictions][], and + // [EvaluatedAnnotation.ground_truths][]. The schema is defined as an + // OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + // + // This field is not populated if there are neither EvaluatedDataItemViews nor + // EvaluatedAnnotations under this ModelEvaluation. + string annotation_schema_uri = 7; + + // Aggregated explanation metrics for the Model's prediction output over the + // data this ModelEvaluation uses. This field is populated only if the Model + // is evaluated with explanations, and only for AutoML tabular Models. + // + ModelExplanation model_explanation = 8; + + // Describes the values of [ExplanationSpec][google.cloud.aiplatform.v1.ExplanationSpec] that are used for explaining + // the predicted values on the evaluated data. + repeated ModelEvaluationExplanationSpec explanation_specs = 9; + + // The metadata of the ModelEvaluation. + // For the ModelEvaluation uploaded from Managed Pipeline, metadata contains a + // structured value with keys of "pipeline_job_id", "evaluation_dataset_type", + // "evaluation_dataset_path". + google.protobuf.Value metadata = 11; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto new file mode 100644 index 00000000..f28b0135 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto @@ -0,0 +1,71 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ModelEvaluationSliceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A collection of metrics calculated by comparing Model's predictions on a +// slice of the test data against ground truth annotations. +message ModelEvaluationSlice { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/ModelEvaluationSlice" + pattern: "projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}" + }; + + // Definition of a slice. + message Slice { + // Output only. The dimension of the slice. + // Well-known dimensions are: + // * `annotationSpec`: This slice is on the test data that has either + // ground truth or prediction with [AnnotationSpec.display_name][google.cloud.aiplatform.v1.AnnotationSpec.display_name] + // equals to [value][google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.value]. + string dimension = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The value of the dimension in this slice. + string value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The resource name of the ModelEvaluationSlice. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The slice of the test data that is used to evaluate the Model. + Slice slice = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Points to a YAML file stored on Google Cloud Storage describing the + // [metrics][google.cloud.aiplatform.v1.ModelEvaluationSlice.metrics] of this ModelEvaluationSlice. The + // schema is defined as an OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + string metrics_schema_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Sliced evaluation metrics of the Model. The schema of the metrics is stored + // in [metrics_schema_uri][google.cloud.aiplatform.v1.ModelEvaluationSlice.metrics_schema_uri] + google.protobuf.Value metrics = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this ModelEvaluationSlice was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_monitoring.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_monitoring.proto new file mode 100644 index 00000000..0daff79d --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_monitoring.proto @@ -0,0 +1,202 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/io.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ModelMonitoringProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Next ID: 8 +message ModelMonitoringObjectiveConfig { + // Training Dataset information. + message TrainingDataset { + oneof data_source { + // The resource name of the Dataset used to train this Model. + string dataset = 3 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + }]; + + // The Google Cloud Storage uri of the unmanaged Dataset used to train + // this Model. + GcsSource gcs_source = 4; + + // The BigQuery table of the unmanaged Dataset used to train this + // Model. + BigQuerySource bigquery_source = 5; + } + + // Data format of the dataset, only applicable if the input is from + // Google Cloud Storage. + // The possible formats are: + // + // "tf-record" + // The source file is a TFRecord file. + // + // "csv" + // The source file is a CSV file. + string data_format = 2; + + // The target field name the model is to predict. + // This field will be excluded when doing Predict and (or) Explain for the + // training data. + string target_field = 6; + + // Strategy to sample data from Training Dataset. + // If not set, we process the whole dataset. + SamplingStrategy logging_sampling_strategy = 7; + } + + // The config for Training & Prediction data skew detection. It specifies the + // training dataset sources and the skew detection parameters. + message TrainingPredictionSkewDetectionConfig { + // Key is the feature name and value is the threshold. If a feature needs to + // be monitored for skew, a value threshold must be configured for that + // feature. The threshold here is against feature distribution distance + // between the training and prediction feature. + map skew_thresholds = 1; + + // Key is the feature name and value is the threshold. The threshold here is + // against attribution score distance between the training and prediction + // feature. + map attribution_score_skew_thresholds = 2; + } + + // The config for Prediction data drift detection. + message PredictionDriftDetectionConfig { + // Key is the feature name and value is the threshold. If a feature needs to + // be monitored for drift, a value threshold must be configured for that + // feature. The threshold here is against feature distribution distance + // between different time windws. + map drift_thresholds = 1; + + // Key is the feature name and value is the threshold. The threshold here is + // against attribution score distance between different time windows. + map attribution_score_drift_thresholds = 2; + } + + // The config for integrating with Vertex Explainable AI. Only applicable if + // the Model has explanation_spec populated. + message ExplanationConfig { + // Output from [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob] for Model Monitoring baseline dataset, + // which can be used to generate baseline attribution scores. + message ExplanationBaseline { + // The storage format of the predictions generated BatchPrediction job. + enum PredictionFormat { + // Should not be set. + PREDICTION_FORMAT_UNSPECIFIED = 0; + + // Predictions are in JSONL files. + JSONL = 2; + + // Predictions are in BigQuery. + BIGQUERY = 3; + } + + // The configuration specifying of BatchExplain job output. This can be + // used to generate the baseline of feature attribution scores. + oneof destination { + // Cloud Storage location for BatchExplain output. + GcsDestination gcs = 2; + + // BigQuery location for BatchExplain output. + BigQueryDestination bigquery = 3; + } + + // The storage format of the predictions generated BatchPrediction job. + PredictionFormat prediction_format = 1; + } + + // If want to analyze the Vertex Explainable AI feature attribute scores or + // not. If set to true, Vertex AI will log the feature attributions from + // explain response and do the skew/drift detection for them. + bool enable_feature_attributes = 1; + + // Predictions generated by the BatchPredictionJob using baseline dataset. + ExplanationBaseline explanation_baseline = 2; + } + + // Training dataset for models. This field has to be set only if + // TrainingPredictionSkewDetectionConfig is specified. + TrainingDataset training_dataset = 1; + + // The config for skew between training data and prediction data. + TrainingPredictionSkewDetectionConfig training_prediction_skew_detection_config = 2; + + // The config for drift of prediction data. + PredictionDriftDetectionConfig prediction_drift_detection_config = 3; + + // The config for integrating with Vertex Explainable AI. + ExplanationConfig explanation_config = 5; +} + +// Next ID: 3 +message ModelMonitoringAlertConfig { + // The config for email alert. + message EmailAlertConfig { + // The email addresses to send the alert. + repeated string user_emails = 1; + } + + oneof alert { + // Email alert config. + EmailAlertConfig email_alert_config = 1; + } + + // Dump the anomalies to Cloud Logging. The anomalies will be put to json + // payload encoded from proto + // [google.cloud.aiplatform.logging.ModelMonitoringAnomaliesLogEntry][]. + // This can be further sinked to Pub/Sub or any other services supported + // by Cloud Logging. + bool enable_logging = 2; +} + +// The config for feature monitoring threshold. +// Next ID: 3 +message ThresholdConfig { + oneof threshold { + // Specify a threshold value that can trigger the alert. + // If this threshold config is for feature distribution distance: + // 1. For categorical feature, the distribution distance is calculated by + // L-inifinity norm. + // 2. For numerical feature, the distribution distance is calculated by + // Jensen–Shannon divergence. + // Each feature must have a non-zero threshold if they need to be monitored. + // Otherwise no alert will be triggered for that feature. + double value = 1; + } +} + +// Sampling Strategy for logging, can be for both training and prediction +// dataset. +// Next ID: 2 +message SamplingStrategy { + // Requests are randomly selected. + message RandomSampleConfig { + // Sample rate (0, 1] + double sample_rate = 1; + } + + // Random sample config. Will support more sampling strategies later. + RandomSampleConfig random_sample_config = 1; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_service.proto new file mode 100644 index 00000000..726d3ec2 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_service.proto @@ -0,0 +1,480 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/io.proto"; +import "google/cloud/aiplatform/v1/model.proto"; +import "google/cloud/aiplatform/v1/model_evaluation.proto"; +import "google/cloud/aiplatform/v1/model_evaluation_slice.proto"; +import "google/cloud/aiplatform/v1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ModelServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A service for managing Vertex AI's machine learning Models. +service ModelService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Uploads a Model artifact into Vertex AI. + rpc UploadModel(UploadModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/models:upload" + body: "*" + }; + option (google.api.method_signature) = "parent,model"; + option (google.longrunning.operation_info) = { + response_type: "UploadModelResponse" + metadata_type: "UploadModelOperationMetadata" + }; + } + + // Gets a Model. + rpc GetModel(GetModelRequest) returns (Model) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/models/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Models in a Location. + rpc ListModels(ListModelsRequest) returns (ListModelsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/models" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a Model. + rpc UpdateModel(UpdateModelRequest) returns (Model) { + option (google.api.http) = { + patch: "/v1/{model.name=projects/*/locations/*/models/*}" + body: "model" + }; + option (google.api.method_signature) = "model,update_mask"; + } + + // Deletes a Model. + // + // A model cannot be deleted if any [Endpoint][google.cloud.aiplatform.v1.Endpoint] resource has a + // [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] based on the model in its + // [deployed_models][google.cloud.aiplatform.v1.Endpoint.deployed_models] field. + rpc DeleteModel(DeleteModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/models/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Exports a trained, exportable Model to a location specified by the + // user. A Model is considered to be exportable if it has at least one + // [supported export format][google.cloud.aiplatform.v1.Model.supported_export_formats]. + rpc ExportModel(ExportModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:export" + body: "*" + }; + option (google.api.method_signature) = "name,output_config"; + option (google.longrunning.operation_info) = { + response_type: "ExportModelResponse" + metadata_type: "ExportModelOperationMetadata" + }; + } + + // Imports an externally generated ModelEvaluation. + rpc ImportModelEvaluation(ImportModelEvaluationRequest) returns (ModelEvaluation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/models/*}/evaluations:import" + body: "*" + }; + option (google.api.method_signature) = "parent,model_evaluation"; + } + + // Gets a ModelEvaluation. + rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/models/*/evaluations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists ModelEvaluations in a Model. + rpc ListModelEvaluations(ListModelEvaluationsRequest) returns (ListModelEvaluationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/models/*}/evaluations" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a ModelEvaluationSlice. + rpc GetModelEvaluationSlice(GetModelEvaluationSliceRequest) returns (ModelEvaluationSlice) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/models/*/evaluations/*/slices/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists ModelEvaluationSlices in a ModelEvaluation. + rpc ListModelEvaluationSlices(ListModelEvaluationSlicesRequest) returns (ListModelEvaluationSlicesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/models/*/evaluations/*}/slices" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel]. +message UploadModelRequest { + // Required. The resource name of the Location into which to upload the Model. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The Model to create. + Model model = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Details of [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel] operation. +message UploadModelOperationMetadata { + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; +} + +// Response message of [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel] operation. +message UploadModelResponse { + // The name of the uploaded Model resource. + // Format: `projects/{project}/locations/{location}/models/{model}` + string model = 1 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + }]; +} + +// Request message for [ModelService.GetModel][google.cloud.aiplatform.v1.ModelService.GetModel]. +message GetModelRequest { + // Required. The name of the Model resource. + // Format: `projects/{project}/locations/{location}/models/{model}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; +} + +// Request message for [ModelService.ListModels][google.cloud.aiplatform.v1.ModelService.ListModels]. +message ListModelsRequest { + // Required. The resource name of the Location to list the Models from. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // An expression for filtering the results of the request. For field names + // both snake_case and camelCase are supported. + // + // * `model` supports = and !=. `model` represents the Model ID, + // i.e. the last segment of the Model's [resource name][google.cloud.aiplatform.v1.Model.name]. + // * `display_name` supports = and != + // * `labels` supports general map functions that is: + // * `labels.key=value` - key:value equality + // * `labels.key:* or labels:key - key existence + // * A key including a space must be quoted. `labels."a key"`. + // + // Some examples: + // * `model=1234` + // * `displayName="myDisplayName"` + // * `labels.myKey="myValue"` + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListModelsResponse.next_page_token][google.cloud.aiplatform.v1.ListModelsResponse.next_page_token] of the previous + // [ModelService.ListModels][google.cloud.aiplatform.v1.ModelService.ListModels] call. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; + + // A comma-separated list of fields to order by, sorted in ascending order. + // Use "desc" after a field name for descending. + // Supported fields: + // * `display_name` + // * `create_time` + // * `update_time` + // + // Example: `display_name, create_time desc`. + string order_by = 6; +} + +// Response message for [ModelService.ListModels][google.cloud.aiplatform.v1.ModelService.ListModels] +message ListModelsResponse { + // List of Models in the requested page. + repeated Model models = 1; + + // A token to retrieve next page of results. + // Pass to [ListModelsRequest.page_token][google.cloud.aiplatform.v1.ListModelsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [ModelService.UpdateModel][google.cloud.aiplatform.v1.ModelService.UpdateModel]. +message UpdateModelRequest { + // Required. The Model which replaces the resource on the server. + // When Model Versioning is enabled, the model.name will be used to determine + // whether to update the model or model version. + // 1. model.name with the @ value, e.g. models/123@1, refers to a version + // specific update. + // 2. model.name without the @ value, e.g. models/123, refers to a model + // update. + // 3. model.name with @-, e.g. models/123@-, refers to a model update. + // 4. Supported model fields: display_name, description; supported + // version-specific fields: version_description. Labels are supported in both + // scenarios. Both the model labels and the version labels are merged when a + // model is returned. When updating labels, if the request is for + // model-specific update, model label gets updated. Otherwise, version labels + // get updated. + // 5. A model name or model version name fields update mismatch will cause a + // precondition error. + // 6. One request cannot update both the model and the version fields. You + // must update them separately. + Model model = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. + // For the `FieldMask` definition, see [google.protobuf.FieldMask][google.protobuf.FieldMask]. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [ModelService.DeleteModel][google.cloud.aiplatform.v1.ModelService.DeleteModel]. +message DeleteModelRequest { + // Required. The name of the Model resource to be deleted. + // Format: `projects/{project}/locations/{location}/models/{model}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; +} + +// Request message for [ModelService.ExportModel][google.cloud.aiplatform.v1.ModelService.ExportModel]. +message ExportModelRequest { + // Output configuration for the Model export. + message OutputConfig { + // The ID of the format in which the Model must be exported. Each Model + // lists the [export formats it supports][google.cloud.aiplatform.v1.Model.supported_export_formats]. + // If no value is provided here, then the first from the list of the Model's + // supported formats is used by default. + string export_format_id = 1; + + // The Cloud Storage location where the Model artifact is to be + // written to. Under the directory given as the destination a new one with + // name "`model-export--`", + // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, + // will be created. Inside, the Model and any of its supporting files + // will be written. + // This field should only be set when the `exportableContent` field of the + // [Model.supported_export_formats] object contains `ARTIFACT`. + GcsDestination artifact_destination = 3; + + // The Google Container Registry or Artifact Registry uri where the + // Model container image will be copied to. + // This field should only be set when the `exportableContent` field of the + // [Model.supported_export_formats] object contains `IMAGE`. + ContainerRegistryDestination image_destination = 4; + } + + // Required. The resource name of the Model to export. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // Required. The desired output location and configuration. + OutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Details of [ModelService.ExportModel][google.cloud.aiplatform.v1.ModelService.ExportModel] operation. +message ExportModelOperationMetadata { + // Further describes the output of the ExportModel. Supplements + // [ExportModelRequest.OutputConfig][google.cloud.aiplatform.v1.ExportModelRequest.OutputConfig]. + message OutputInfo { + // Output only. If the Model artifact is being exported to Google Cloud Storage this is + // the full path of the directory created, into which the Model files are + // being written to. + string artifact_output_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If the Model image is being exported to Google Container Registry or + // Artifact Registry this is the full path of the image created. + string image_output_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; + + // Output only. Information further describing the output of this Model export. + OutputInfo output_info = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Response message of [ModelService.ExportModel][google.cloud.aiplatform.v1.ModelService.ExportModel] operation. +message ExportModelResponse { + +} + +// Request message for [ModelService.ImportModelEvaluation][google.cloud.aiplatform.v1.ModelService.ImportModelEvaluation] +message ImportModelEvaluationRequest { + // Required. The name of the parent model resource. + // Format: `projects/{project}/locations/{location}/models/{model}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // Required. Model evaluation resource to be imported. + ModelEvaluation model_evaluation = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [ModelService.GetModelEvaluation][google.cloud.aiplatform.v1.ModelService.GetModelEvaluation]. +message GetModelEvaluationRequest { + // Required. The name of the ModelEvaluation resource. + // Format: + // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelEvaluation" + } + ]; +} + +// Request message for [ModelService.ListModelEvaluations][google.cloud.aiplatform.v1.ModelService.ListModelEvaluations]. +message ListModelEvaluationsRequest { + // Required. The resource name of the Model to list the ModelEvaluations from. + // Format: `projects/{project}/locations/{location}/models/{model}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // The standard list filter. + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListModelEvaluationsResponse.next_page_token][google.cloud.aiplatform.v1.ListModelEvaluationsResponse.next_page_token] of the previous + // [ModelService.ListModelEvaluations][google.cloud.aiplatform.v1.ModelService.ListModelEvaluations] call. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for [ModelService.ListModelEvaluations][google.cloud.aiplatform.v1.ModelService.ListModelEvaluations]. +message ListModelEvaluationsResponse { + // List of ModelEvaluations in the requested page. + repeated ModelEvaluation model_evaluations = 1; + + // A token to retrieve next page of results. + // Pass to [ListModelEvaluationsRequest.page_token][google.cloud.aiplatform.v1.ListModelEvaluationsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [ModelService.GetModelEvaluationSlice][google.cloud.aiplatform.v1.ModelService.GetModelEvaluationSlice]. +message GetModelEvaluationSliceRequest { + // Required. The name of the ModelEvaluationSlice resource. + // Format: + // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelEvaluationSlice" + } + ]; +} + +// Request message for [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices]. +message ListModelEvaluationSlicesRequest { + // Required. The resource name of the ModelEvaluation to list the ModelEvaluationSlices + // from. Format: + // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelEvaluation" + } + ]; + + // The standard list filter. + // + // * `slice.dimension` - for =. + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListModelEvaluationSlicesResponse.next_page_token][google.cloud.aiplatform.v1.ListModelEvaluationSlicesResponse.next_page_token] of the previous + // [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices] call. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices]. +message ListModelEvaluationSlicesResponse { + // List of ModelEvaluations in the requested page. + repeated ModelEvaluationSlice model_evaluation_slices = 1; + + // A token to retrieve next page of results. + // Pass to [ListModelEvaluationSlicesRequest.page_token][google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest.page_token] to obtain that + // page. + string next_page_token = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/operation.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/operation.proto new file mode 100644 index 00000000..da7c5dcc --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/operation.proto @@ -0,0 +1,52 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "OperationProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Generic Metadata shared by all operations. +message GenericOperationMetadata { + // Output only. Partial failures encountered. + // E.g. single files that couldn't be read. + // This field should never exceed 20 entries. + // Status details field will contain standard GCP error details. + repeated google.rpc.Status partial_failures = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the operation was created. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the operation was updated for the last time. + // If the operation has finished (successfully or not), this is the finish + // time. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Details of operations that perform deletes of any entities. +message DeleteOperationMetadata { + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_job.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_job.proto new file mode 100644 index 00000000..21f92926 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_job.proto @@ -0,0 +1,319 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/artifact.proto"; +import "google/cloud/aiplatform/v1/context.proto"; +import "google/cloud/aiplatform/v1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1/execution.proto"; +import "google/cloud/aiplatform/v1/pipeline_state.proto"; +import "google/cloud/aiplatform/v1/value.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "Pipeline"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Network" + pattern: "projects/{project}/global/networks/{network}" +}; + +// An instance of a machine learning PipelineJob. +message PipelineJob { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/PipelineJob" + pattern: "projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}" + }; + + // The runtime config of a PipelineJob. + message RuntimeConfig { + // Deprecated. Use [RuntimeConfig.parameter_values][google.cloud.aiplatform.v1.PipelineJob.RuntimeConfig.parameter_values] instead. The runtime + // parameters of the PipelineJob. The parameters will be passed into + // [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_spec] to replace the placeholders at runtime. + // This field is used by pipelines built using + // `PipelineJob.pipeline_spec.schema_version` 2.0.0 or lower, such as + // pipelines built using Kubeflow Pipelines SDK 1.8 or lower. + map parameters = 1 [deprecated = true]; + + // Required. A path in a Cloud Storage bucket, which will be treated as the root + // output directory of the pipeline. It is used by the system to + // generate the paths of output artifacts. The artifact paths are generated + // with a sub-path pattern `{job_id}/{task_id}/{output_key}` under the + // specified output directory. The service account specified in this + // pipeline must have the `storage.objects.get` and `storage.objects.create` + // permissions for this bucket. + string gcs_output_directory = 2 [(google.api.field_behavior) = REQUIRED]; + + // The runtime parameters of the PipelineJob. The parameters will be + // passed into [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_spec] to replace the placeholders + // at runtime. This field is used by pipelines built using + // `PipelineJob.pipeline_spec.schema_version` 2.1.0, such as pipelines built + // using Kubeflow Pipelines SDK 1.9 or higher and the v2 DSL. + map parameter_values = 3; + } + + // Output only. The resource name of the PipelineJob. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The display name of the Pipeline. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + string display_name = 2; + + // Output only. Pipeline creation time. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Pipeline start time. + google.protobuf.Timestamp start_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Pipeline end time. + google.protobuf.Timestamp end_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this PipelineJob was most recently updated. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The spec of the pipeline. + google.protobuf.Struct pipeline_spec = 7; + + // Output only. The detailed state of the job. + PipelineState state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The details of pipeline run. Not available in the list view. + PipelineJobDetail job_detail = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error that occurred during pipeline execution. + // Only populated when the pipeline's state is FAILED or CANCELLED. + google.rpc.Status error = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize PipelineJob. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 11; + + // Runtime config of the pipeline. + RuntimeConfig runtime_config = 12; + + // Customer-managed encryption key spec for a pipelineJob. If set, this + // PipelineJob and all of its sub-resources will be secured by this key. + EncryptionSpec encryption_spec = 16; + + // The service account that the pipeline workload runs as. + // If not specified, the Compute Engine default service account in the project + // will be used. + // See + // https://cloud.google.com/compute/docs/access/service-accounts#default_service_account + // + // Users starting the pipeline must have the `iam.serviceAccounts.actAs` + // permission on this service account. + string service_account = 17; + + // The full name of the Compute Engine + // [network](/compute/docs/networks-and-firewalls#networks) to which the + // Pipeline Job's workload should be peered. For example, + // `projects/12345/global/networks/myVPC`. + // [Format](/compute/docs/reference/rest/v1/networks/insert) + // is of the form `projects/{project}/global/networks/{network}`. + // Where {project} is a project number, as in `12345`, and {network} is a + // network name. + // + // Private services access must already be configured for the network. + // Pipeline job will apply the network configuration to the GCP resources + // being launched, if applied, such as Vertex AI + // Training or Dataflow job. If left unspecified, the workload is not peered + // with any network. + string network = 18 [(google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + }]; +} + +// The runtime detail of PipelineJob. +message PipelineJobDetail { + // Output only. The context of the pipeline. + Context pipeline_context = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The context of the current pipeline run. + Context pipeline_run_context = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The runtime details of the tasks under the pipeline. + repeated PipelineTaskDetail task_details = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The runtime detail of a task execution. +message PipelineTaskDetail { + // A single record of the task status. + message PipelineTaskStatus { + // Output only. Update time of this status. + google.protobuf.Timestamp update_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of the task. + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error that occurred during the state. May be set when the state is + // any of the non-final state (PENDING/RUNNING/CANCELLING) or FAILED state. + // If the state is FAILED, the error here is final and not going to be + // retried. + // If the state is a non-final state, the error indicates a system-error + // being retried. + google.rpc.Status error = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // A list of artifact metadata. + message ArtifactList { + // Output only. A list of artifact metadata. + repeated Artifact artifacts = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Specifies state of TaskExecution + enum State { + // Unspecified. + STATE_UNSPECIFIED = 0; + + // Specifies pending state for the task. + PENDING = 1; + + // Specifies task is being executed. + RUNNING = 2; + + // Specifies task completed successfully. + SUCCEEDED = 3; + + // Specifies Task cancel is in pending state. + CANCEL_PENDING = 4; + + // Specifies task is being cancelled. + CANCELLING = 5; + + // Specifies task was cancelled. + CANCELLED = 6; + + // Specifies task failed. + FAILED = 7; + + // Specifies task was skipped due to cache hit. + SKIPPED = 8; + + // Specifies that the task was not triggered because the task's trigger + // policy is not satisfied. The trigger policy is specified in the + // `condition` field of [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_spec]. + NOT_TRIGGERED = 9; + } + + // Output only. The system generated ID of the task. + int64 task_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The id of the parent task if the task is within a component scope. + // Empty if the task is at the root level. + int64 parent_task_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user specified name of the task that is defined in + // [PipelineJob.spec][]. + string task_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Task create time. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Task start time. + google.protobuf.Timestamp start_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Task end time. + google.protobuf.Timestamp end_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The detailed execution info. + PipelineTaskExecutorDetail executor_detail = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the task. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The execution metadata of the task. + Execution execution = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error that occurred during task execution. + // Only populated when the task's state is FAILED or CANCELLED. + google.rpc.Status error = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A list of task status. This field keeps a record of task status evolving + // over time. + repeated PipelineTaskStatus pipeline_task_status = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The runtime input artifacts of the task. + map inputs = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The runtime output artifacts of the task. + map outputs = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The runtime detail of a pipeline executor. +message PipelineTaskExecutorDetail { + // The detail of a container execution. It contains the job names of the + // lifecycle of a container execution. + message ContainerDetail { + // Output only. The name of the [CustomJob][google.cloud.aiplatform.v1.CustomJob] for the main container execution. + string main_job = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/CustomJob" + } + ]; + + // Output only. The name of the [CustomJob][google.cloud.aiplatform.v1.CustomJob] for the pre-caching-check container + // execution. This job will be available if the + // [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_spec] specifies the `pre_caching_check` hook in + // the lifecycle events. + string pre_caching_check_job = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/CustomJob" + } + ]; + } + + // The detailed info for a custom job executor. + message CustomJobDetail { + option deprecated = true; + + // Output only. The name of the [CustomJob][google.cloud.aiplatform.v1.CustomJob]. + string job = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/CustomJob" + } + ]; + } + + oneof details { + // Output only. The detailed info for a container executor. + ContainerDetail container_detail = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The detailed info for a custom job executor. + CustomJobDetail custom_job_detail = 2 [ + deprecated = true, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + } +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_service.proto new file mode 100644 index 00000000..d749ecc8 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_service.proto @@ -0,0 +1,403 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/pipeline_job.proto"; +import "google/cloud/aiplatform/v1/training_pipeline.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "PipelineServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A service for creating and managing Vertex AI's pipelines. This includes both +// `TrainingPipeline` resources (used for AutoML and custom training) and +// `PipelineJob` resources (used for Vertex AI Pipelines). +service PipelineService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a TrainingPipeline. A created TrainingPipeline right away will be + // attempted to be run. + rpc CreateTrainingPipeline(CreateTrainingPipelineRequest) returns (TrainingPipeline) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/trainingPipelines" + body: "training_pipeline" + }; + option (google.api.method_signature) = "parent,training_pipeline"; + } + + // Gets a TrainingPipeline. + rpc GetTrainingPipeline(GetTrainingPipelineRequest) returns (TrainingPipeline) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/trainingPipelines/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists TrainingPipelines in a Location. + rpc ListTrainingPipelines(ListTrainingPipelinesRequest) returns (ListTrainingPipelinesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/trainingPipelines" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a TrainingPipeline. + rpc DeleteTrainingPipeline(DeleteTrainingPipelineRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/trainingPipelines/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Cancels a TrainingPipeline. + // Starts asynchronous cancellation on the TrainingPipeline. The server + // makes a best effort to cancel the pipeline, but success is not + // guaranteed. Clients can use [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline] or + // other methods to check whether the cancellation succeeded or whether the + // pipeline completed despite cancellation. On successful cancellation, + // the TrainingPipeline is not deleted; instead it becomes a pipeline with + // a [TrainingPipeline.error][google.cloud.aiplatform.v1.TrainingPipeline.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`, and [TrainingPipeline.state][google.cloud.aiplatform.v1.TrainingPipeline.state] is set to + // `CANCELLED`. + rpc CancelTrainingPipeline(CancelTrainingPipelineRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/trainingPipelines/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a PipelineJob. A PipelineJob will run immediately when created. + rpc CreatePipelineJob(CreatePipelineJobRequest) returns (PipelineJob) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/pipelineJobs" + body: "pipeline_job" + }; + option (google.api.method_signature) = "parent,pipeline_job,pipeline_job_id"; + } + + // Gets a PipelineJob. + rpc GetPipelineJob(GetPipelineJobRequest) returns (PipelineJob) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/pipelineJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists PipelineJobs in a Location. + rpc ListPipelineJobs(ListPipelineJobsRequest) returns (ListPipelineJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/pipelineJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a PipelineJob. + rpc DeletePipelineJob(DeletePipelineJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/pipelineJobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Cancels a PipelineJob. + // Starts asynchronous cancellation on the PipelineJob. The server + // makes a best effort to cancel the pipeline, but success is not + // guaranteed. Clients can use [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1.PipelineService.GetPipelineJob] or + // other methods to check whether the cancellation succeeded or whether the + // pipeline completed despite cancellation. On successful cancellation, + // the PipelineJob is not deleted; instead it becomes a pipeline with + // a [PipelineJob.error][google.cloud.aiplatform.v1.PipelineJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`, and [PipelineJob.state][google.cloud.aiplatform.v1.PipelineJob.state] is set to + // `CANCELLED`. + rpc CancelPipelineJob(CancelPipelineJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/pipelineJobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for [PipelineService.CreateTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.CreateTrainingPipeline]. +message CreateTrainingPipelineRequest { + // Required. The resource name of the Location to create the TrainingPipeline in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The TrainingPipeline to create. + TrainingPipeline training_pipeline = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline]. +message GetTrainingPipelineRequest { + // Required. The name of the TrainingPipeline resource. + // Format: + // `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TrainingPipeline" + } + ]; +} + +// Request message for [PipelineService.ListTrainingPipelines][google.cloud.aiplatform.v1.PipelineService.ListTrainingPipelines]. +message ListTrainingPipelinesRequest { + // Required. The resource name of the Location to list the TrainingPipelines from. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The standard list filter. + // Supported fields: + // + // * `display_name` supports = and !=. + // + // * `state` supports = and !=. + // + // Some examples of using the filter are: + // + // * `state="PIPELINE_STATE_SUCCEEDED" AND display_name="my_pipeline"` + // + // * `state="PIPELINE_STATE_RUNNING" OR display_name="my_pipeline"` + // + // * `NOT display_name="my_pipeline"` + // + // * `state="PIPELINE_STATE_FAILED"` + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListTrainingPipelinesResponse.next_page_token][google.cloud.aiplatform.v1.ListTrainingPipelinesResponse.next_page_token] of the previous + // [PipelineService.ListTrainingPipelines][google.cloud.aiplatform.v1.PipelineService.ListTrainingPipelines] call. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for [PipelineService.ListTrainingPipelines][google.cloud.aiplatform.v1.PipelineService.ListTrainingPipelines] +message ListTrainingPipelinesResponse { + // List of TrainingPipelines in the requested page. + repeated TrainingPipeline training_pipelines = 1; + + // A token to retrieve the next page of results. + // Pass to [ListTrainingPipelinesRequest.page_token][google.cloud.aiplatform.v1.ListTrainingPipelinesRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [PipelineService.DeleteTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.DeleteTrainingPipeline]. +message DeleteTrainingPipelineRequest { + // Required. The name of the TrainingPipeline resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TrainingPipeline" + } + ]; +} + +// Request message for [PipelineService.CancelTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.CancelTrainingPipeline]. +message CancelTrainingPipelineRequest { + // Required. The name of the TrainingPipeline to cancel. + // Format: + // `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TrainingPipeline" + } + ]; +} + +// Request message for [PipelineService.CreatePipelineJob][google.cloud.aiplatform.v1.PipelineService.CreatePipelineJob]. +message CreatePipelineJobRequest { + // Required. The resource name of the Location to create the PipelineJob in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The PipelineJob to create. + PipelineJob pipeline_job = 2 [(google.api.field_behavior) = REQUIRED]; + + // The ID to use for the PipelineJob, which will become the final component of + // the PipelineJob name. If not provided, an ID will be automatically + // generated. + // + // This value should be less than 128 characters, and valid characters + // are /[a-z][0-9]-/. + string pipeline_job_id = 3; +} + +// Request message for [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1.PipelineService.GetPipelineJob]. +message GetPipelineJobRequest { + // Required. The name of the PipelineJob resource. + // Format: + // `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/PipelineJob" + } + ]; +} + +// Request message for [PipelineService.ListPipelineJobs][google.cloud.aiplatform.v1.PipelineService.ListPipelineJobs]. +message ListPipelineJobsRequest { + // Required. The resource name of the Location to list the PipelineJobs from. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Lists the PipelineJobs that match the filter expression. The following + // fields are supported: + // + // * `pipeline_name`: Supports `=` and `!=` comparisons. + // * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. + // * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. + // for example, can check if pipeline's display_name contains *step* by doing + // display_name:\"*step*\" + // * `state`: Supports `=` and `!=` comparisons. + // * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + // Values must be in RFC 3339 format. + // * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + // Values must be in RFC 3339 format. + // * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + // Values must be in RFC 3339 format. + // * `labels`: Supports key-value equality and key presence. + // * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. + // * `template_metadata.version_name`: Supports `=`, `!=` comparisons, and `:` + // wildcard. + // + // Filter expressions can be combined together using logical operators + // (`AND` & `OR`). + // For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. + // + // The syntax to define filter expression is based on + // https://google.aip.dev/160. + // + // Examples: + // + // * `create_time>"2021-05-18T00:00:00Z" OR + // update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated + // after 2020-05-18 00:00:00 UTC. + // * `labels.env = "prod"` + // PipelineJobs with label "env" set to "prod". + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListPipelineJobsResponse.next_page_token][google.cloud.aiplatform.v1.ListPipelineJobsResponse.next_page_token] of the previous + // [PipelineService.ListPipelineJobs][google.cloud.aiplatform.v1.PipelineService.ListPipelineJobs] call. + string page_token = 4; + + // A comma-separated list of fields to order by. The default sort order is in + // ascending order. Use "desc" after a field name for descending. You can have + // multiple order_by fields provided e.g. "create_time desc, end_time", + // "end_time, start_time, update_time" For example, using "create_time desc, + // end_time" will order results by create time in descending order, and if + // there are multiple jobs having the same create time, order them by the end + // time in ascending order. if order_by is not specified, it will order by + // default order is create time in descending order. Supported fields: + // * `create_time` + // * `update_time` + // * `end_time` + // * `start_time` + string order_by = 6; +} + +// Response message for [PipelineService.ListPipelineJobs][google.cloud.aiplatform.v1.PipelineService.ListPipelineJobs] +message ListPipelineJobsResponse { + // List of PipelineJobs in the requested page. + repeated PipelineJob pipeline_jobs = 1; + + // A token to retrieve the next page of results. + // Pass to [ListPipelineJobsRequest.page_token][google.cloud.aiplatform.v1.ListPipelineJobsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [PipelineService.DeletePipelineJob][google.cloud.aiplatform.v1.PipelineService.DeletePipelineJob]. +message DeletePipelineJobRequest { + // Required. The name of the PipelineJob resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/PipelineJob" + } + ]; +} + +// Request message for [PipelineService.CancelPipelineJob][google.cloud.aiplatform.v1.PipelineService.CancelPipelineJob]. +message CancelPipelineJobRequest { + // Required. The name of the PipelineJob to cancel. + // Format: + // `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/PipelineJob" + } + ]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_state.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_state.proto new file mode 100644 index 00000000..a06ae8ab --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_state.proto @@ -0,0 +1,58 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "PipelineStateProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Describes the state of a pipeline. +enum PipelineState { + // The pipeline state is unspecified. + PIPELINE_STATE_UNSPECIFIED = 0; + + // The pipeline has been created or resumed, and processing has not yet + // begun. + PIPELINE_STATE_QUEUED = 1; + + // The service is preparing to run the pipeline. + PIPELINE_STATE_PENDING = 2; + + // The pipeline is in progress. + PIPELINE_STATE_RUNNING = 3; + + // The pipeline completed successfully. + PIPELINE_STATE_SUCCEEDED = 4; + + // The pipeline failed. + PIPELINE_STATE_FAILED = 5; + + // The pipeline is being cancelled. From this state, the pipeline may only go + // to either PIPELINE_STATE_SUCCEEDED, PIPELINE_STATE_FAILED or + // PIPELINE_STATE_CANCELLED. + PIPELINE_STATE_CANCELLING = 6; + + // The pipeline has been cancelled. + PIPELINE_STATE_CANCELLED = 7; + + // The pipeline has been stopped, and can be resumed. + PIPELINE_STATE_PAUSED = 8; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/prediction_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/prediction_service.proto new file mode 100644 index 00000000..e2ba4349 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/prediction_service.proto @@ -0,0 +1,227 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/httpbody.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/explanation.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "PredictionServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A service for online predictions and explanations. +service PredictionService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Perform an online prediction. + rpc Predict(PredictRequest) returns (PredictResponse) { + option (google.api.http) = { + post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:predict" + body: "*" + }; + option (google.api.method_signature) = "endpoint,instances,parameters"; + } + + // Perform an online prediction with an arbitrary HTTP payload. + // + // The response includes the following HTTP headers: + // + // * `X-Vertex-AI-Endpoint-Id`: ID of the [Endpoint][google.cloud.aiplatform.v1.Endpoint] that served this + // prediction. + // + // * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] + // that served this prediction. + rpc RawPredict(RawPredictRequest) returns (google.api.HttpBody) { + option (google.api.http) = { + post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:rawPredict" + body: "*" + }; + option (google.api.method_signature) = "endpoint,http_body"; + } + + // Perform an online explanation. + // + // If [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id] is specified, + // the corresponding DeployModel must have + // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] + // populated. If [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id] + // is not specified, all DeployedModels must have + // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] + // populated. Only deployed AutoML tabular Models have + // explanation_spec. + rpc Explain(ExplainRequest) returns (ExplainResponse) { + option (google.api.http) = { + post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:explain" + body: "*" + }; + option (google.api.method_signature) = "endpoint,instances,parameters,deployed_model_id"; + } +} + +// Request message for [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict]. +message PredictRequest { + // Required. The name of the Endpoint requested to serve the prediction. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Required. The instances that are the input to the prediction call. + // A DeployedModel may have an upper limit on the number of instances it + // supports per request, and when it is exceeded the prediction call errors + // in case of AutoML Models, or, in case of customer created Models, the + // behaviour is as documented by that Model. + // The schema of any single instance may be specified via Endpoint's + // DeployedModels' [Model's][google.cloud.aiplatform.v1.DeployedModel.model] + // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + // [instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri]. + repeated google.protobuf.Value instances = 2 [(google.api.field_behavior) = REQUIRED]; + + // The parameters that govern the prediction. The schema of the parameters may + // be specified via Endpoint's DeployedModels' [Model's ][google.cloud.aiplatform.v1.DeployedModel.model] + // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + // [parameters_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.parameters_schema_uri]. + google.protobuf.Value parameters = 3; +} + +// Response message for [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict]. +message PredictResponse { + // The predictions that are the output of the predictions call. + // The schema of any single prediction may be specified via Endpoint's + // DeployedModels' [Model's ][google.cloud.aiplatform.v1.DeployedModel.model] + // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + // [prediction_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.prediction_schema_uri]. + repeated google.protobuf.Value predictions = 1; + + // ID of the Endpoint's DeployedModel that served this prediction. + string deployed_model_id = 2; + + // Output only. The resource name of the Model which is deployed as the DeployedModel that + // this prediction hits. + string model = 3 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // Output only. The [display name][google.cloud.aiplatform.v1.Model.display_name] of the Model which is deployed as + // the DeployedModel that this prediction hits. + string model_display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for [PredictionService.RawPredict][google.cloud.aiplatform.v1.PredictionService.RawPredict]. +message RawPredictRequest { + // Required. The name of the Endpoint requested to serve the prediction. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // The prediction input. Supports HTTP headers and arbitrary data payload. + // + // A [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] may have an upper limit on the number of instances it + // supports per request. When this limit it is exceeded for an AutoML model, + // the [RawPredict][google.cloud.aiplatform.v1.PredictionService.RawPredict] method returns an error. + // When this limit is exceeded for a custom-trained model, the behavior varies + // depending on the model. + // + // You can specify the schema for each instance in the + // [predict_schemata.instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri] + // field when you create a [Model][google.cloud.aiplatform.v1.Model]. This schema applies when you deploy the + // `Model` as a `DeployedModel` to an [Endpoint][google.cloud.aiplatform.v1.Endpoint] and use the `RawPredict` + // method. + google.api.HttpBody http_body = 2; +} + +// Request message for [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain]. +message ExplainRequest { + // Required. The name of the Endpoint requested to serve the explanation. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Required. The instances that are the input to the explanation call. + // A DeployedModel may have an upper limit on the number of instances it + // supports per request, and when it is exceeded the explanation call errors + // in case of AutoML Models, or, in case of customer created Models, the + // behaviour is as documented by that Model. + // The schema of any single instance may be specified via Endpoint's + // DeployedModels' [Model's][google.cloud.aiplatform.v1.DeployedModel.model] + // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + // [instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri]. + repeated google.protobuf.Value instances = 2 [(google.api.field_behavior) = REQUIRED]; + + // The parameters that govern the prediction. The schema of the parameters may + // be specified via Endpoint's DeployedModels' [Model's ][google.cloud.aiplatform.v1.DeployedModel.model] + // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] + // [parameters_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.parameters_schema_uri]. + google.protobuf.Value parameters = 4; + + // If specified, overrides the + // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] of the DeployedModel. + // Can be used for explaining prediction results with different + // configurations, such as: + // - Explaining top-5 predictions results as opposed to top-1; + // - Increasing path count or step count of the attribution methods to reduce + // approximate errors; + // - Using different baselines for explaining the prediction results. + ExplanationSpecOverride explanation_spec_override = 5; + + // If specified, this ExplainRequest will be served by the chosen + // DeployedModel, overriding [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split]. + string deployed_model_id = 3; +} + +// Response message for [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain]. +message ExplainResponse { + // The explanations of the Model's [PredictResponse.predictions][google.cloud.aiplatform.v1.PredictResponse.predictions]. + // + // It has the same number of elements as [instances][google.cloud.aiplatform.v1.ExplainRequest.instances] + // to be explained. + repeated Explanation explanations = 1; + + // ID of the Endpoint's DeployedModel that served this explanation. + string deployed_model_id = 2; + + // The predictions that are the output of the predictions call. + // Same as [PredictResponse.predictions][google.cloud.aiplatform.v1.PredictResponse.predictions]. + repeated google.protobuf.Value predictions = 3; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto new file mode 100644 index 00000000..75222795 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto @@ -0,0 +1,44 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.instance; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Instance"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/instance;instance"; +option java_multiple_files = true; +option java_outer_classname = "ImageClassificationPredictionInstanceProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.instance"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Instance"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Instance"; + +// Prediction input format for Image Classification. +message ImageClassificationPredictionInstance { + // The image bytes or Cloud Storage URI to make the prediction on. + string content = 1; + + // The MIME type of the content of the image. Only the images in below listed + // MIME types are supported. + // - image/jpeg + // - image/gif + // - image/png + // - image/webp + // - image/bmp + // - image/tiff + // - image/vnd.microsoft.icon + string mime_type = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto new file mode 100644 index 00000000..5e531733 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto @@ -0,0 +1,44 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.instance; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Instance"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/instance;instance"; +option java_multiple_files = true; +option java_outer_classname = "ImageObjectDetectionPredictionInstanceProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.instance"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Instance"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Instance"; + +// Prediction input format for Image Object Detection. +message ImageObjectDetectionPredictionInstance { + // The image bytes or Cloud Storage URI to make the prediction on. + string content = 1; + + // The MIME type of the content of the image. Only the images in below listed + // MIME types are supported. + // - image/jpeg + // - image/gif + // - image/png + // - image/webp + // - image/bmp + // - image/tiff + // - image/vnd.microsoft.icon + string mime_type = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto new file mode 100644 index 00000000..b4682c03 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto @@ -0,0 +1,39 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.instance; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Instance"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/instance;instance"; +option java_multiple_files = true; +option java_outer_classname = "ImageSegmentationPredictionInstanceProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.instance"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Instance"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Instance"; + +// Prediction input format for Image Segmentation. +message ImageSegmentationPredictionInstance { + // The image bytes to make the predictions on. + string content = 1; + + // The MIME type of the content of the image. Only the images in below listed + // MIME types are supported. + // - image/jpeg + // - image/png + string mime_type = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto new file mode 100644 index 00000000..cfd43170 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto @@ -0,0 +1,38 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.instance; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Instance"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/instance;instance"; +option java_multiple_files = true; +option java_outer_classname = "TextClassificationPredictionInstanceProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.instance"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Instance"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Instance"; + +// Prediction input format for Text Classification. +message TextClassificationPredictionInstance { + // The text snippet to make the predictions on. + string content = 1; + + // The MIME type of the text snippet. The supported MIME types are listed + // below. + // - text/plain + string mime_type = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto new file mode 100644 index 00000000..697ee119 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto @@ -0,0 +1,45 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.instance; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Instance"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/instance;instance"; +option java_multiple_files = true; +option java_outer_classname = "TextExtractionPredictionInstanceProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.instance"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Instance"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Instance"; + +// Prediction input format for Text Extraction. +message TextExtractionPredictionInstance { + // The text snippet to make the predictions on. + string content = 1; + + // The MIME type of the text snippet. The supported MIME types are listed + // below. + // - text/plain + string mime_type = 2; + + // This field is only used for batch prediction. If a key is provided, the + // batch prediction result will by mapped to this key. If omitted, then the + // batch prediction result will contain the entire input instance. Vertex AI + // will not check if keys in the request are duplicates, so it is up to the + // caller to ensure the keys are unique. + string key = 3; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto new file mode 100644 index 00000000..a06c7c2f --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto @@ -0,0 +1,38 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.instance; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Instance"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/instance;instance"; +option java_multiple_files = true; +option java_outer_classname = "TextSentimentPredictionInstanceProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.instance"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Instance"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Instance"; + +// Prediction input format for Text Sentiment. +message TextSentimentPredictionInstance { + // The text snippet to make the predictions on. + string content = 1; + + // The MIME type of the text snippet. The supported MIME types are listed + // below. + // - text/plain + string mime_type = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto new file mode 100644 index 00000000..9ab477e2 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto @@ -0,0 +1,51 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.instance; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Instance"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/instance;instance"; +option java_multiple_files = true; +option java_outer_classname = "VideoActionRecognitionPredictionInstanceProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.instance"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Instance"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Instance"; + +// Prediction input format for Video Action Recognition. +message VideoActionRecognitionPredictionInstance { + // The Google Cloud Storage location of the video on which to perform the + // prediction. + string content = 1; + + // The MIME type of the content of the video. Only the following are + // supported: video/mp4 video/avi video/quicktime + string mime_type = 2; + + // The beginning, inclusive, of the video's time segment on which to perform + // the prediction. Expressed as a number of seconds as measured from the + // start of the video, with "s" appended at the end. Fractions are allowed, + // up to a microsecond precision. + string time_segment_start = 3; + + // The end, exclusive, of the video's time segment on which to perform + // the prediction. Expressed as a number of seconds as measured from the + // start of the video, with "s" appended at the end. Fractions are allowed, + // up to a microsecond precision, and "inf" or "Infinity" is allowed, which + // means the end of the video. + string time_segment_end = 4; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto new file mode 100644 index 00000000..68cb3cb3 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto @@ -0,0 +1,51 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.instance; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Instance"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/instance;instance"; +option java_multiple_files = true; +option java_outer_classname = "VideoClassificationPredictionInstanceProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.instance"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Instance"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Instance"; + +// Prediction input format for Video Classification. +message VideoClassificationPredictionInstance { + // The Google Cloud Storage location of the video on which to perform the + // prediction. + string content = 1; + + // The MIME type of the content of the video. Only the following are + // supported: video/mp4 video/avi video/quicktime + string mime_type = 2; + + // The beginning, inclusive, of the video's time segment on which to perform + // the prediction. Expressed as a number of seconds as measured from the + // start of the video, with "s" appended at the end. Fractions are allowed, + // up to a microsecond precision. + string time_segment_start = 3; + + // The end, exclusive, of the video's time segment on which to perform + // the prediction. Expressed as a number of seconds as measured from the + // start of the video, with "s" appended at the end. Fractions are allowed, + // up to a microsecond precision, and "inf" or "Infinity" is allowed, which + // means the end of the video. + string time_segment_end = 4; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto new file mode 100644 index 00000000..34adc840 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto @@ -0,0 +1,51 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.instance; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Instance"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/instance;instance"; +option java_multiple_files = true; +option java_outer_classname = "VideoObjectTrackingPredictionInstanceProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.instance"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Instance"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Instance"; + +// Prediction input format for Video Object Tracking. +message VideoObjectTrackingPredictionInstance { + // The Google Cloud Storage location of the video on which to perform the + // prediction. + string content = 1; + + // The MIME type of the content of the video. Only the following are + // supported: video/mp4 video/avi video/quicktime + string mime_type = 2; + + // The beginning, inclusive, of the video's time segment on which to perform + // the prediction. Expressed as a number of seconds as measured from the + // start of the video, with "s" appended at the end. Fractions are allowed, + // up to a microsecond precision. + string time_segment_start = 3; + + // The end, exclusive, of the video's time segment on which to perform + // the prediction. Expressed as a number of seconds as measured from the + // start of the video, with "s" appended at the end. Fractions are allowed, + // up to a microsecond precision, and "inf" or "Infinity" is allowed, which + // means the end of the video. + string time_segment_end = 4; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto new file mode 100644 index 00000000..b3cb7e20 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto @@ -0,0 +1,39 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.params; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Params"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/params;params"; +option java_multiple_files = true; +option java_outer_classname = "ImageClassificationPredictionParamsProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.params"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Params"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Params"; + +// Prediction model parameters for Image Classification. +message ImageClassificationPredictionParams { + // The Model only returns predictions with at least this confidence score. + // Default value is 0.0 + float confidence_threshold = 1; + + // The Model only returns up to that many top, by confidence score, + // predictions per instance. If this number is very high, the Model may return + // fewer predictions. Default value is 10. + int32 max_predictions = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto new file mode 100644 index 00000000..34130f7c --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto @@ -0,0 +1,39 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.params; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Params"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/params;params"; +option java_multiple_files = true; +option java_outer_classname = "ImageObjectDetectionPredictionParamsProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.params"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Params"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Params"; + +// Prediction model parameters for Image Object Detection. +message ImageObjectDetectionPredictionParams { + // The Model only returns predictions with at least this confidence score. + // Default value is 0.0 + float confidence_threshold = 1; + + // The Model only returns up to that many top, by confidence score, + // predictions per instance. Note that number of returned predictions is also + // limited by metadata's predictionsLimit. Default value is 10. + int32 max_predictions = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto new file mode 100644 index 00000000..50e06ee8 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto @@ -0,0 +1,36 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.params; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Params"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/params;params"; +option java_multiple_files = true; +option java_outer_classname = "ImageSegmentationPredictionParamsProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.params"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Params"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Params"; + +// Prediction model parameters for Image Segmentation. +message ImageSegmentationPredictionParams { + // When the model predicts category of pixels of the image, it will only + // provide predictions for pixels that it is at least this much confident + // about. All other pixels will be classified as background. Default value is + // 0.5. + float confidence_threshold = 1; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto new file mode 100644 index 00000000..aa640722 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto @@ -0,0 +1,39 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.params; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Params"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/params;params"; +option java_multiple_files = true; +option java_outer_classname = "VideoActionRecognitionPredictionParamsProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.params"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Params"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Params"; + +// Prediction model parameters for Video Action Recognition. +message VideoActionRecognitionPredictionParams { + // The Model only returns predictions with at least this confidence score. + // Default value is 0.0 + float confidence_threshold = 1; + + // The model only returns up to that many top, by confidence score, + // predictions per frame of the video. If this number is very high, the + // Model may return fewer predictions per frame. Default value is 50. + int32 max_predictions = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto new file mode 100644 index 00000000..ec062072 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto @@ -0,0 +1,64 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.params; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Params"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/params;params"; +option java_multiple_files = true; +option java_outer_classname = "VideoClassificationPredictionParamsProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.params"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Params"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Params"; + +// Prediction model parameters for Video Classification. +message VideoClassificationPredictionParams { + // The Model only returns predictions with at least this confidence score. + // Default value is 0.0 + float confidence_threshold = 1; + + // The Model only returns up to that many top, by confidence score, + // predictions per instance. If this number is very high, the Model may return + // fewer predictions. Default value is 10,000. + int32 max_predictions = 2; + + // Set to true to request segment-level classification. Vertex AI returns + // labels and their confidence scores for the entire time segment of the + // video that user specified in the input instance. + // Default value is true + bool segment_classification = 3; + + // Set to true to request shot-level classification. Vertex AI determines + // the boundaries for each camera shot in the entire time segment of the + // video that user specified in the input instance. Vertex AI then + // returns labels and their confidence scores for each detected shot, along + // with the start and end time of the shot. + // WARNING: Model evaluation is not done for this classification type, + // the quality of it depends on the training data, but there are no metrics + // provided to describe that quality. + // Default value is false + bool shot_classification = 4; + + // Set to true to request classification for a video at one-second intervals. + // Vertex AI returns labels and their confidence scores for each second of + // the entire time segment of the video that user specified in the input + // WARNING: Model evaluation is not done for this classification type, the + // quality of it depends on the training data, but there are no metrics + // provided to describe that quality. Default value is false + bool one_sec_interval_classification = 5; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto new file mode 100644 index 00000000..579dc4d4 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto @@ -0,0 +1,43 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.params; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Params"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/params;params"; +option java_multiple_files = true; +option java_outer_classname = "VideoObjectTrackingPredictionParamsProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.params"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Params"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Params"; + +// Prediction model parameters for Video Object Tracking. +message VideoObjectTrackingPredictionParams { + // The Model only returns predictions with at least this confidence score. + // Default value is 0.0 + float confidence_threshold = 1; + + // The model only returns up to that many top, by confidence score, + // predictions per frame of the video. If this number is very high, the + // Model may return fewer predictions per frame. Default value is 50. + int32 max_predictions = 2; + + // Only bounding boxes with shortest edge at least that long as a relative + // value of video frame size are returned. Default value is 0.0. + float min_bounding_box_size = 3; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto new file mode 100644 index 00000000..b8e396ab --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto @@ -0,0 +1,41 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.prediction; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "ClassificationPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; + +// Prediction output format for Image and Text Classification. +message ClassificationPredictionResult { + // The resource IDs of the AnnotationSpecs that had been identified. + repeated int64 ids = 1; + + // The display names of the AnnotationSpecs that had been identified, order + // matches the IDs. + repeated string display_names = 2; + + // The Model's confidences in correctness of the predicted IDs, higher value + // means higher confidence. Order matches the Ids. + repeated float confidences = 3; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto new file mode 100644 index 00000000..50d76ecc --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto @@ -0,0 +1,51 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.prediction; + +import "google/protobuf/struct.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "ImageObjectDetectionPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; + +// Prediction output format for Image Object Detection. +message ImageObjectDetectionPredictionResult { + // The resource IDs of the AnnotationSpecs that had been identified, ordered + // by the confidence score descendingly. + repeated int64 ids = 1; + + // The display names of the AnnotationSpecs that had been identified, order + // matches the IDs. + repeated string display_names = 2; + + // The Model's confidences in correctness of the predicted IDs, higher value + // means higher confidence. Order matches the Ids. + repeated float confidences = 3; + + // Bounding boxes, i.e. the rectangles over the image, that pinpoint + // the found AnnotationSpecs. Given in order that matches the IDs. Each + // bounding box is an array of 4 numbers `xMin`, `xMax`, `yMin`, and + // `yMax`, which represent the extremal coordinates of the box. They are + // relative to the image size, and the point 0,0 is in the top left + // of the image. + repeated google.protobuf.ListValue bboxes = 4; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto new file mode 100644 index 00000000..f245f1e1 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto @@ -0,0 +1,45 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.prediction; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "ImageSegmentationPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; + +// Prediction output format for Image Segmentation. +message ImageSegmentationPredictionResult { + // A PNG image where each pixel in the mask represents the category in which + // the pixel in the original image was predicted to belong to. The size of + // this image will be the same as the original image. The mapping between the + // AnntoationSpec and the color can be found in model's metadata. The model + // will choose the most likely category and if none of the categories reach + // the confidence threshold, the pixel will be marked as background. + string category_mask = 1; + + // A one channel image which is encoded as an 8bit lossless PNG. The size of + // the image will be the same as the original image. For a specific pixel, + // darker color means less confidence in correctness of the cateogry in the + // categoryMask for the corresponding pixel. Black means no confidence and + // white means complete confidence. + string confidence_mask = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto new file mode 100644 index 00000000..25cd6672 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto @@ -0,0 +1,39 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.prediction; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "TabularClassificationPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; + +// Prediction output format for Tabular Classification. +message TabularClassificationPredictionResult { + // The name of the classes being classified, contains all possible values of + // the target column. + repeated string classes = 1; + + // The model's confidence in each class being correct, higher + // value means higher confidence. The N-th score corresponds to + // the N-th class in classes. + repeated float scores = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto new file mode 100644 index 00000000..a26c3cb2 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto @@ -0,0 +1,39 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.prediction; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "TabularRegressionPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; + +// Prediction output format for Tabular Regression. +message TabularRegressionPredictionResult { + // The regression value. + float value = 1; + + // The lower bound of the prediction interval. + float lower_bound = 2; + + // The upper bound of the prediction interval. + float upper_bound = 3; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto new file mode 100644 index 00000000..00ca7694 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto @@ -0,0 +1,52 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.prediction; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "TextExtractionPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; + +// Prediction output format for Text Extraction. +message TextExtractionPredictionResult { + // The resource IDs of the AnnotationSpecs that had been identified, + // ordered by the confidence score descendingly. + repeated int64 ids = 1; + + // The display names of the AnnotationSpecs that had been identified, + // order matches the IDs. + repeated string display_names = 2; + + // The start offsets, inclusive, of the text segment in which the + // AnnotationSpec has been identified. Expressed as a zero-based number + // of characters as measured from the start of the text snippet. + repeated int64 text_segment_start_offsets = 3; + + // The end offsets, inclusive, of the text segment in which the + // AnnotationSpec has been identified. Expressed as a zero-based number + // of characters as measured from the start of the text snippet. + repeated int64 text_segment_end_offsets = 4; + + // The Model's confidences in correctness of the predicted IDs, higher + // value means higher confidence. Order matches the Ids. + repeated float confidences = 5; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto new file mode 100644 index 00000000..09d24248 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto @@ -0,0 +1,37 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.prediction; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "TextSentimentPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; + +// Prediction output format for Text Sentiment +message TextSentimentPredictionResult { + // The integer sentiment labels between 0 (inclusive) and sentimentMax label + // (inclusive), while 0 maps to the least positive sentiment and + // sentimentMax maps to the most positive one. The higher the score is, the + // more positive the sentiment in the text snippet is. Note: sentimentMax is + // an integer value between 1 (inclusive) and 10 (inclusive). + int32 sentiment = 1; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto new file mode 100644 index 00000000..6cd59711 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto @@ -0,0 +1,54 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.prediction; + +import "google/protobuf/duration.proto"; +import "google/protobuf/wrappers.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "VideoActionRecognitionPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; + +// Prediction output format for Video Action Recognition. +message VideoActionRecognitionPredictionResult { + // The resource ID of the AnnotationSpec that had been identified. + string id = 1; + + // The display name of the AnnotationSpec that had been identified. + string display_name = 2; + + // The beginning, inclusive, of the video's time segment in which the + // AnnotationSpec has been identified. Expressed as a number of seconds as + // measured from the start of the video, with fractions up to a microsecond + // precision, and with "s" appended at the end. + google.protobuf.Duration time_segment_start = 4; + + // The end, exclusive, of the video's time segment in which the + // AnnotationSpec has been identified. Expressed as a number of seconds as + // measured from the start of the video, with fractions up to a microsecond + // precision, and with "s" appended at the end. + google.protobuf.Duration time_segment_end = 5; + + // The Model's confidence in correction of this prediction, higher + // value means higher confidence. + google.protobuf.FloatValue confidence = 6; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto new file mode 100644 index 00000000..5d33c5ae --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto @@ -0,0 +1,67 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.prediction; + +import "google/protobuf/duration.proto"; +import "google/protobuf/wrappers.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "VideoClassificationPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; + +// Prediction output format for Video Classification. +message VideoClassificationPredictionResult { + // The resource ID of the AnnotationSpec that had been identified. + string id = 1; + + // The display name of the AnnotationSpec that had been identified. + string display_name = 2; + + // The type of the prediction. The requested types can be configured + // via parameters. This will be one of + // - segment-classification + // - shot-classification + // - one-sec-interval-classification + string type = 3; + + // The beginning, inclusive, of the video's time segment in which the + // AnnotationSpec has been identified. Expressed as a number of seconds as + // measured from the start of the video, with fractions up to a microsecond + // precision, and with "s" appended at the end. Note that for + // 'segment-classification' prediction type, this equals the original + // 'timeSegmentStart' from the input instance, for other types it is the + // start of a shot or a 1 second interval respectively. + google.protobuf.Duration time_segment_start = 4; + + // The end, exclusive, of the video's time segment in which the + // AnnotationSpec has been identified. Expressed as a number of seconds as + // measured from the start of the video, with fractions up to a microsecond + // precision, and with "s" appended at the end. Note that for + // 'segment-classification' prediction type, this equals the original + // 'timeSegmentEnd' from the input instance, for other types it is the end + // of a shot or a 1 second interval respectively. + google.protobuf.Duration time_segment_end = 5; + + // The Model's confidence in correction of this prediction, higher + // value means higher confidence. + google.protobuf.FloatValue confidence = 6; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto new file mode 100644 index 00000000..20ecbb1a --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto @@ -0,0 +1,82 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.predict.prediction; + +import "google/protobuf/duration.proto"; +import "google/protobuf/wrappers.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "VideoObjectTrackingPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; + +// Prediction output format for Video Object Tracking. +message VideoObjectTrackingPredictionResult { + // The fields `xMin`, `xMax`, `yMin`, and `yMax` refer to a bounding box, + // i.e. the rectangle over the video frame pinpointing the found + // AnnotationSpec. The coordinates are relative to the frame size, and the + // point 0,0 is in the top left of the frame. + message Frame { + // A time (frame) of a video in which the object has been detected. + // Expressed as a number of seconds as measured from the + // start of the video, with fractions up to a microsecond precision, and + // with "s" appended at the end. + google.protobuf.Duration time_offset = 1; + + // The leftmost coordinate of the bounding box. + google.protobuf.FloatValue x_min = 2; + + // The rightmost coordinate of the bounding box. + google.protobuf.FloatValue x_max = 3; + + // The topmost coordinate of the bounding box. + google.protobuf.FloatValue y_min = 4; + + // The bottommost coordinate of the bounding box. + google.protobuf.FloatValue y_max = 5; + } + + // The resource ID of the AnnotationSpec that had been identified. + string id = 1; + + // The display name of the AnnotationSpec that had been identified. + string display_name = 2; + + // The beginning, inclusive, of the video's time segment in which the + // object instance has been detected. Expressed as a number of seconds as + // measured from the start of the video, with fractions up to a microsecond + // precision, and with "s" appended at the end. + google.protobuf.Duration time_segment_start = 3; + + // The end, inclusive, of the video's time segment in which the + // object instance has been detected. Expressed as a number of seconds as + // measured from the start of the video, with fractions up to a microsecond + // precision, and with "s" appended at the end. + google.protobuf.Duration time_segment_end = 4; + + // The Model's confidence in correction of this prediction, higher + // value means higher confidence. + google.protobuf.FloatValue confidence = 5; + + // All of the frames of the video in which a single object instance has been + // detected. The bounding boxes in the frames identify the same object. + repeated Frame frames = 6; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto new file mode 100644 index 00000000..f51227cf --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto @@ -0,0 +1,128 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLImageClassificationProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Image Classification Model. +message AutoMlImageClassification { + // The input parameters of this TrainingJob. + AutoMlImageClassificationInputs inputs = 1; + + // The metadata information. + AutoMlImageClassificationMetadata metadata = 2; +} + +message AutoMlImageClassificationInputs { + enum ModelType { + // Should not be set. + MODEL_TYPE_UNSPECIFIED = 0; + + // A Model best tailored to be used within Google Cloud, and which cannot + // be exported. + // Default. + CLOUD = 1; + + // A model that, in addition to being available within Google + // Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow + // or Core ML model and used on a mobile or edge device afterwards. + // Expected to have low latency, but may have lower prediction + // quality than other mobile models. + MOBILE_TF_LOW_LATENCY_1 = 2; + + // A model that, in addition to being available within Google + // Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow + // or Core ML model and used on a mobile or edge device with afterwards. + MOBILE_TF_VERSATILE_1 = 3; + + // A model that, in addition to being available within Google + // Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow + // or Core ML model and used on a mobile or edge device afterwards. + // Expected to have a higher latency, but should also have a higher + // prediction quality than other mobile models. + MOBILE_TF_HIGH_ACCURACY_1 = 4; + } + + ModelType model_type = 1; + + // The ID of the `base` model. If it is specified, the new model will be + // trained based on the `base` model. Otherwise, the new model will be + // trained from scratch. The `base` model must be in the same + // Project and Location as the new Model to train, and have the same + // modelType. + string base_model_id = 2; + + // The training budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. The actual + // metadata.costMilliNodeHours will be equal or less than this value. + // If further model training ceases to provide any improvements, it will + // stop without using the full budget and the metadata.successfulStopReason + // will be `model-converged`. + // Note, node_hour = actual_hour * number_of_nodes_involved. + // For modelType `cloud`(default), the budget must be between 8,000 + // and 800,000 milli node hours, inclusive. The default value is 192,000 + // which represents one day in wall time, considering 8 nodes are used. + // For model types `mobile-tf-low-latency-1`, `mobile-tf-versatile-1`, + // `mobile-tf-high-accuracy-1`, the training budget must be between + // 1,000 and 100,000 milli node hours, inclusive. + // The default value is 24,000 which represents one day in wall time on a + // single node that is used. + int64 budget_milli_node_hours = 3; + + // Use the entire training budget. This disables the early stopping feature. + // When false the early stopping feature is enabled, which means that + // AutoML Image Classification might stop training before the entire + // training budget has been used. + bool disable_early_stopping = 4; + + // If false, a single-label (multi-class) Model will be trained (i.e. + // assuming that for each image just up to one annotation may be + // applicable). If true, a multi-label Model will be trained (i.e. + // assuming that for each image multiple annotations may be applicable). + bool multi_label = 5; +} + +message AutoMlImageClassificationMetadata { + enum SuccessfulStopReason { + // Should not be set. + SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0; + + // The inputs.budgetMilliNodeHours had been reached. + BUDGET_REACHED = 1; + + // Further training of the Model ceased to increase its quality, since it + // already has converged. + MODEL_CONVERGED = 2; + } + + // The actual training cost of creating this model, expressed in + // milli node hours, i.e. 1,000 value in this field means 1 node hour. + // Guaranteed to not exceed inputs.budgetMilliNodeHours. + int64 cost_milli_node_hours = 1; + + // For successful job completions, this is the reason why the job has + // finished. + SuccessfulStopReason successful_stop_reason = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto new file mode 100644 index 00000000..62e7ae2c --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto @@ -0,0 +1,120 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLImageObjectDetectionProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Image Object Detection Model. +message AutoMlImageObjectDetection { + // The input parameters of this TrainingJob. + AutoMlImageObjectDetectionInputs inputs = 1; + + // The metadata information + AutoMlImageObjectDetectionMetadata metadata = 2; +} + +message AutoMlImageObjectDetectionInputs { + enum ModelType { + // Should not be set. + MODEL_TYPE_UNSPECIFIED = 0; + + // A model best tailored to be used within Google Cloud, and which cannot + // be exported. Expected to have a higher latency, but should also have a + // higher prediction quality than other cloud models. + CLOUD_HIGH_ACCURACY_1 = 1; + + // A model best tailored to be used within Google Cloud, and which cannot + // be exported. Expected to have a low latency, but may have lower + // prediction quality than other cloud models. + CLOUD_LOW_LATENCY_1 = 2; + + // A model that, in addition to being available within Google + // Cloud can also be exported (see ModelService.ExportModel) and + // used on a mobile or edge device with TensorFlow afterwards. + // Expected to have low latency, but may have lower prediction + // quality than other mobile models. + MOBILE_TF_LOW_LATENCY_1 = 3; + + // A model that, in addition to being available within Google + // Cloud can also be exported (see ModelService.ExportModel) and + // used on a mobile or edge device with TensorFlow afterwards. + MOBILE_TF_VERSATILE_1 = 4; + + // A model that, in addition to being available within Google + // Cloud, can also be exported (see ModelService.ExportModel) and + // used on a mobile or edge device with TensorFlow afterwards. + // Expected to have a higher latency, but should also have a higher + // prediction quality than other mobile models. + MOBILE_TF_HIGH_ACCURACY_1 = 5; + } + + ModelType model_type = 1; + + // The training budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. The actual + // metadata.costMilliNodeHours will be equal or less than this value. + // If further model training ceases to provide any improvements, it will + // stop without using the full budget and the metadata.successfulStopReason + // will be `model-converged`. + // Note, node_hour = actual_hour * number_of_nodes_involved. + // For modelType `cloud`(default), the budget must be between 20,000 + // and 900,000 milli node hours, inclusive. The default value is 216,000 + // which represents one day in wall time, considering 9 nodes are used. + // For model types `mobile-tf-low-latency-1`, `mobile-tf-versatile-1`, + // `mobile-tf-high-accuracy-1` + // the training budget must be between 1,000 and 100,000 milli node hours, + // inclusive. The default value is 24,000 which represents one day in + // wall time on a single node that is used. + int64 budget_milli_node_hours = 2; + + // Use the entire training budget. This disables the early stopping feature. + // When false the early stopping feature is enabled, which means that AutoML + // Image Object Detection might stop training before the entire training + // budget has been used. + bool disable_early_stopping = 3; +} + +message AutoMlImageObjectDetectionMetadata { + enum SuccessfulStopReason { + // Should not be set. + SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0; + + // The inputs.budgetMilliNodeHours had been reached. + BUDGET_REACHED = 1; + + // Further training of the Model ceased to increase its quality, since it + // already has converged. + MODEL_CONVERGED = 2; + } + + // The actual training cost of creating this model, expressed in + // milli node hours, i.e. 1,000 value in this field means 1 node hour. + // Guaranteed to not exceed inputs.budgetMilliNodeHours. + int64 cost_milli_node_hours = 1; + + // For successful job completions, this is the reason why the job has + // finished. + SuccessfulStopReason successful_stop_reason = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto new file mode 100644 index 00000000..00af43c1 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto @@ -0,0 +1,106 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLImageSegmentationProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Image Segmentation Model. +message AutoMlImageSegmentation { + // The input parameters of this TrainingJob. + AutoMlImageSegmentationInputs inputs = 1; + + // The metadata information. + AutoMlImageSegmentationMetadata metadata = 2; +} + +message AutoMlImageSegmentationInputs { + enum ModelType { + // Should not be set. + MODEL_TYPE_UNSPECIFIED = 0; + + // A model to be used via prediction calls to uCAIP API. Expected + // to have a higher latency, but should also have a higher prediction + // quality than other models. + CLOUD_HIGH_ACCURACY_1 = 1; + + // A model to be used via prediction calls to uCAIP API. Expected + // to have a lower latency but relatively lower prediction quality. + CLOUD_LOW_ACCURACY_1 = 2; + + // A model that, in addition to being available within Google + // Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow + // model and used on a mobile or edge device afterwards. + // Expected to have low latency, but may have lower prediction + // quality than other mobile models. + MOBILE_TF_LOW_LATENCY_1 = 3; + } + + ModelType model_type = 1; + + // The training budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. The actual + // metadata.costMilliNodeHours will be equal or less than this value. + // If further model training ceases to provide any improvements, it will + // stop without using the full budget and the metadata.successfulStopReason + // will be `model-converged`. + // Note, node_hour = actual_hour * number_of_nodes_involved. Or + // actaul_wall_clock_hours = train_budget_milli_node_hours / + // (number_of_nodes_involved * 1000) + // For modelType `cloud-high-accuracy-1`(default), the budget must be between + // 20,000 and 2,000,000 milli node hours, inclusive. The default value is + // 192,000 which represents one day in wall time + // (1000 milli * 24 hours * 8 nodes). + int64 budget_milli_node_hours = 2; + + // The ID of the `base` model. If it is specified, the new model will be + // trained based on the `base` model. Otherwise, the new model will be + // trained from scratch. The `base` model must be in the same + // Project and Location as the new Model to train, and have the same + // modelType. + string base_model_id = 3; +} + +message AutoMlImageSegmentationMetadata { + enum SuccessfulStopReason { + // Should not be set. + SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0; + + // The inputs.budgetMilliNodeHours had been reached. + BUDGET_REACHED = 1; + + // Further training of the Model ceased to increase its quality, since it + // already has converged. + MODEL_CONVERGED = 2; + } + + // The actual training cost of creating this model, expressed in + // milli node hours, i.e. 1,000 value in this field means 1 node hour. + // Guaranteed to not exceed inputs.budgetMilliNodeHours. + int64 cost_milli_node_hours = 1; + + // For successful job completions, this is the reason why the job has + // finished. + SuccessfulStopReason successful_stop_reason = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto new file mode 100644 index 00000000..0c4ee2d6 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto @@ -0,0 +1,285 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.trainingjob.definition; + +import "google/api/field_behavior.proto"; +import "google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLTablesProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Tables Model. +message AutoMlTables { + // The input parameters of this TrainingJob. + AutoMlTablesInputs inputs = 1; + + // The metadata information. + AutoMlTablesMetadata metadata = 2; +} + +message AutoMlTablesInputs { + message Transformation { + // Training pipeline will infer the proper transformation based on the + // statistic of dataset. + message AutoTransformation { + string column_name = 1; + } + + // Training pipeline will perform following transformation functions. + // * The value converted to float32. + // * The z_score of the value. + // * log(value+1) when the value is greater than or equal to 0. Otherwise, + // this transformation is not applied and the value is considered a + // missing value. + // * z_score of log(value+1) when the value is greater than or equal to 0. + // Otherwise, this transformation is not applied and the value is + // considered a missing value. + // * A boolean value that indicates whether the value is valid. + message NumericTransformation { + string column_name = 1; + + // If invalid values is allowed, the training pipeline will create a + // boolean feature that indicated whether the value is valid. + // Otherwise, the training pipeline will discard the input row from + // trainining data. + bool invalid_values_allowed = 2; + } + + // Training pipeline will perform following transformation functions. + // * The categorical string as is--no change to case, punctuation, + // spelling, + // tense, and so on. + // * Convert the category name to a dictionary lookup index and generate an + // embedding for each index. + // * Categories that appear less than 5 times in the training dataset are + // treated as the "unknown" category. The "unknown" category gets its own + // special lookup index and resulting embedding. + message CategoricalTransformation { + string column_name = 1; + } + + // Training pipeline will perform following transformation functions. + // * Apply the transformation functions for Numerical columns. + // * Determine the year, month, day,and weekday. Treat each value from the + // * timestamp as a Categorical column. + // * Invalid numerical values (for example, values that fall outside of a + // typical timestamp range, or are extreme values) receive no special + // treatment and are not removed. + message TimestampTransformation { + string column_name = 1; + + // The format in which that time field is expressed. The time_format must + // either be one of: + // * `unix-seconds` + // * `unix-milliseconds` + // * `unix-microseconds` + // * `unix-nanoseconds` + // (for respectively number of seconds, milliseconds, microseconds and + // nanoseconds since start of the Unix epoch); + // or be written in `strftime` syntax. If time_format is not set, then the + // default format is RFC 3339 `date-time` format, where + // `time-offset` = `"Z"` (e.g. 1985-04-12T23:20:50.52Z) + string time_format = 2; + + // If invalid values is allowed, the training pipeline will create a + // boolean feature that indicated whether the value is valid. + // Otherwise, the training pipeline will discard the input row from + // trainining data. + bool invalid_values_allowed = 3; + } + + // Training pipeline will perform following transformation functions. + // * The text as is--no change to case, punctuation, spelling, tense, and + // so + // on. + // * Tokenize text to words. Convert each words to a dictionary lookup + // index + // and generate an embedding for each index. Combine the embedding of all + // elements into a single embedding using the mean. + // * Tokenization is based on unicode script boundaries. + // * Missing values get their own lookup index and resulting embedding. + // * Stop-words receive no special treatment and are not removed. + message TextTransformation { + string column_name = 1; + } + + // Treats the column as numerical array and performs following + // transformation functions. + // * All transformations for Numerical types applied to the average of the + // all elements. + // * The average of empty arrays is treated as zero. + message NumericArrayTransformation { + string column_name = 1; + + // If invalid values is allowed, the training pipeline will create a + // boolean feature that indicated whether the value is valid. + // Otherwise, the training pipeline will discard the input row from + // trainining data. + bool invalid_values_allowed = 2; + } + + // Treats the column as categorical array and performs following + // transformation functions. + // * For each element in the array, convert the category name to a + // dictionary + // lookup index and generate an embedding for each index. + // Combine the embedding of all elements into a single embedding using + // the mean. + // * Empty arrays treated as an embedding of zeroes. + message CategoricalArrayTransformation { + string column_name = 1; + } + + // Treats the column as text array and performs following transformation + // functions. + // * Concatenate all text values in the array into a single text value + // using + // a space (" ") as a delimiter, and then treat the result as a single + // text value. Apply the transformations for Text columns. + // * Empty arrays treated as an empty text. + message TextArrayTransformation { + string column_name = 1; + } + + // The transformation that the training pipeline will apply to the input + // columns. + oneof transformation_detail { + AutoTransformation auto = 1; + + NumericTransformation numeric = 2; + + CategoricalTransformation categorical = 3; + + TimestampTransformation timestamp = 4; + + TextTransformation text = 5; + + NumericArrayTransformation repeated_numeric = 6; + + CategoricalArrayTransformation repeated_categorical = 7; + + TextArrayTransformation repeated_text = 8; + } + } + + // Additional optimization objective configuration. Required for + // `maximize-precision-at-recall` and `maximize-recall-at-precision`, + // otherwise unused. + oneof additional_optimization_objective_config { + // Required when optimization_objective is "maximize-precision-at-recall". + // Must be between 0 and 1, inclusive. + float optimization_objective_recall_value = 5; + + // Required when optimization_objective is "maximize-recall-at-precision". + // Must be between 0 and 1, inclusive. + float optimization_objective_precision_value = 6; + } + + // The type of prediction the Model is to produce. + // "classification" - Predict one out of multiple target values is + // picked for each row. + // "regression" - Predict a value based on its relation to other values. + // This type is available only to columns that contain + // semantically numeric values, i.e. integers or floating + // point number, even if stored as e.g. strings. + string prediction_type = 1; + + // The column name of the target column that the model is to predict. + string target_column = 2; + + // Each transformation will apply transform function to given input column. + // And the result will be used for training. + // When creating transformation for BigQuery Struct column, the column should + // be flattened using "." as the delimiter. + repeated Transformation transformations = 3; + + // Objective function the model is optimizing towards. The training process + // creates a model that maximizes/minimizes the value of the objective + // function over the validation set. + // + // The supported optimization objectives depend on the prediction type. + // If the field is not set, a default objective function is used. + // + // classification (binary): + // "maximize-au-roc" (default) - Maximize the area under the receiver + // operating characteristic (ROC) curve. + // "minimize-log-loss" - Minimize log loss. + // "maximize-au-prc" - Maximize the area under the precision-recall curve. + // "maximize-precision-at-recall" - Maximize precision for a specified + // recall value. + // "maximize-recall-at-precision" - Maximize recall for a specified + // precision value. + // + // classification (multi-class): + // "minimize-log-loss" (default) - Minimize log loss. + // + // regression: + // "minimize-rmse" (default) - Minimize root-mean-squared error (RMSE). + // "minimize-mae" - Minimize mean-absolute error (MAE). + // "minimize-rmsle" - Minimize root-mean-squared log error (RMSLE). + string optimization_objective = 4; + + // Required. The train budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. + // + // The training cost of the model will not exceed this budget. The final cost + // will be attempted to be close to the budget, though may end up being (even) + // noticeably smaller - at the backend's discretion. This especially may + // happen when further model training ceases to provide any improvements. + // + // If the budget is set to a value known to be insufficient to train a + // model for the given dataset, the training won't be attempted and + // will error. + // + // The train budget must be between 1,000 and 72,000 milli node hours, + // inclusive. + int64 train_budget_milli_node_hours = 7; + + // Use the entire training budget. This disables the early stopping feature. + // By default, the early stopping feature is enabled, which means that AutoML + // Tables might stop training before the entire training budget has been used. + bool disable_early_stopping = 8; + + // Column name that should be used as the weight column. + // Higher values in this column give more importance to the row + // during model training. The column must have numeric values between 0 and + // 10000 inclusively; 0 means the row is ignored for training. If weight + // column field is not set, then all rows are assumed to have equal weight + // of 1. + string weight_column_name = 9; + + // Configuration for exporting test set predictions to a BigQuery table. If + // this configuration is absent, then the export is not performed. + ExportEvaluatedDataItemsConfig export_evaluated_data_items_config = 10; + + // Additional experiment flags for the Tables training pipeline. + repeated string additional_experiments = 11; +} + +// Model metadata specific to AutoML Tables. +message AutoMlTablesMetadata { + // Output only. The actual training cost of the model, expressed in milli + // node hours, i.e. 1,000 value in this field means 1 node hour. Guaranteed + // to not exceed the train budget. + int64 train_cost_milli_node_hours = 1; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto new file mode 100644 index 00000000..8723af0e --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto @@ -0,0 +1,37 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLTextClassificationProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Text Classification Model. +message AutoMlTextClassification { + // The input parameters of this TrainingJob. + AutoMlTextClassificationInputs inputs = 1; +} + +message AutoMlTextClassificationInputs { + bool multi_label = 1; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto new file mode 100644 index 00000000..db33c3f5 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto @@ -0,0 +1,37 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLTextExtractionProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Text Extraction Model. +message AutoMlTextExtraction { + // The input parameters of this TrainingJob. + AutoMlTextExtractionInputs inputs = 1; +} + +message AutoMlTextExtractionInputs { + +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto new file mode 100644 index 00000000..153a57fe --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto @@ -0,0 +1,44 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLTextSentimentProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Text Sentiment Model. +message AutoMlTextSentiment { + // The input parameters of this TrainingJob. + AutoMlTextSentimentInputs inputs = 1; +} + +message AutoMlTextSentimentInputs { + // A sentiment is expressed as an integer ordinal, where higher value + // means a more positive sentiment. The range of sentiments that will be used + // is between 0 and sentimentMax (inclusive on both ends), and all the values + // in the range must be represented in the dataset before a model can be + // created. + // Only the Annotations with this sentimentMax will be used for training. + // sentimentMax value must be between 1 and 10 (inclusive). + int32 sentiment_max = 1; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto new file mode 100644 index 00000000..86f723b7 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto @@ -0,0 +1,62 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLVideoActionRecognitionProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Video Action Recognition +// Model. +message AutoMlVideoActionRecognition { + // The input parameters of this TrainingJob. + AutoMlVideoActionRecognitionInputs inputs = 1; +} + +message AutoMlVideoActionRecognitionInputs { + enum ModelType { + // Should not be set. + MODEL_TYPE_UNSPECIFIED = 0; + + // A model best tailored to be used within Google Cloud, and which c annot + // be exported. Default. + CLOUD = 1; + + // A model that, in addition to being available within Google Cloud, can + // also be exported (see ModelService.ExportModel) as a TensorFlow or + // TensorFlow Lite model and used on a mobile or edge device afterwards. + MOBILE_VERSATILE_1 = 2; + + // A model that, in addition to being available within Google Cloud, can + // also be exported (see ModelService.ExportModel) to a Jetson device + // afterwards. + MOBILE_JETSON_VERSATILE_1 = 3; + + // A model that, in addition to being available within Google Cloud, can + // also be exported (see ModelService.ExportModel) as a TensorFlow or + // TensorFlow Lite model and used on a Coral device afterwards. + MOBILE_CORAL_VERSATILE_1 = 4; + } + + ModelType model_type = 1; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto new file mode 100644 index 00000000..ff0d78f0 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto @@ -0,0 +1,56 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLVideoClassificationProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Video Classification Model. +message AutoMlVideoClassification { + // The input parameters of this TrainingJob. + AutoMlVideoClassificationInputs inputs = 1; +} + +message AutoMlVideoClassificationInputs { + enum ModelType { + // Should not be set. + MODEL_TYPE_UNSPECIFIED = 0; + + // A model best tailored to be used within Google Cloud, and which cannot + // be exported. Default. + CLOUD = 1; + + // A model that, in addition to being available within Google Cloud, can + // also be exported (see ModelService.ExportModel) as a TensorFlow or + // TensorFlow Lite model and used on a mobile or edge device afterwards. + MOBILE_VERSATILE_1 = 2; + + // A model that, in addition to being available within Google Cloud, can + // also be exported (see ModelService.ExportModel) to a Jetson device + // afterwards. + MOBILE_JETSON_VERSATILE_1 = 3; + } + + ModelType model_type = 1; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto new file mode 100644 index 00000000..52cba9f3 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto @@ -0,0 +1,67 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLVideoObjectTrackingProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Video ObjectTracking Model. +message AutoMlVideoObjectTracking { + // The input parameters of this TrainingJob. + AutoMlVideoObjectTrackingInputs inputs = 1; +} + +message AutoMlVideoObjectTrackingInputs { + enum ModelType { + // Should not be set. + MODEL_TYPE_UNSPECIFIED = 0; + + // A model best tailored to be used within Google Cloud, and which c annot + // be exported. Default. + CLOUD = 1; + + // A model that, in addition to being available within Google Cloud, can + // also be exported (see ModelService.ExportModel) as a TensorFlow or + // TensorFlow Lite model and used on a mobile or edge device afterwards. + MOBILE_VERSATILE_1 = 2; + + // A versatile model that is meant to be exported (see + // ModelService.ExportModel) and used on a Google Coral device. + MOBILE_CORAL_VERSATILE_1 = 3; + + // A model that trades off quality for low latency, to be exported (see + // ModelService.ExportModel) and used on a Google Coral device. + MOBILE_CORAL_LOW_LATENCY_1 = 4; + + // A versatile model that is meant to be exported (see + // ModelService.ExportModel) and used on an NVIDIA Jetson device. + MOBILE_JETSON_VERSATILE_1 = 5; + + // A model that trades off quality for low latency, to be exported (see + // ModelService.ExportModel) and used on an NVIDIA Jetson device. + MOBILE_JETSON_LOW_LATENCY_1 = 6; + } + + ModelType model_type = 1; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto new file mode 100644 index 00000000..ac0d3235 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto @@ -0,0 +1,43 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "ExportEvaluatedDataItemsConfigProto"; +option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; + +// Configuration for exporting test set predictions to a BigQuery table. +message ExportEvaluatedDataItemsConfig { + // URI of desired destination BigQuery table. Expected format: + // bq://:: + // + // If not specified, then results are exported to the following auto-created + // BigQuery table: + // :export_evaluated_examples__.evaluated_examples + string destination_bigquery_uri = 1; + + // If true and an export destination is specified, then the contents of the + // destination are overwritten. Otherwise, if the export destination already + // exists, then the export operation fails. + bool override_existing_table = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/specialist_pool.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/specialist_pool.proto new file mode 100644 index 00000000..0e620e6a --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/specialist_pool.proto @@ -0,0 +1,62 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "SpecialistPoolProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// SpecialistPool represents customers' own workforce to work on their data +// labeling jobs. It includes a group of specialist managers and workers. +// Managers are responsible for managing the workers in this pool as well as +// customers' data labeling jobs associated with this pool. Customers create +// specialist pool as well as start data labeling jobs on Cloud, managers and +// workers handle the jobs using CrowdCompute console. +message SpecialistPool { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/SpecialistPool" + pattern: "projects/{project}/locations/{location}/specialistPools/{specialist_pool}" + }; + + // Required. The resource name of the SpecialistPool. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The user-defined name of the SpecialistPool. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + // This field should be unique on project-level. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The number of managers in this SpecialistPool. + int32 specialist_managers_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The email addresses of the managers in the SpecialistPool. + repeated string specialist_manager_emails = 4; + + // Output only. The resource name of the pending data labeling jobs. + repeated string pending_data_labeling_jobs = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The email addresses of workers in the SpecialistPool. + repeated string specialist_worker_emails = 7; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/specialist_pool_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/specialist_pool_service.proto new file mode 100644 index 00000000..c45cc767 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/specialist_pool_service.proto @@ -0,0 +1,210 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/operation.proto"; +import "google/cloud/aiplatform/v1/specialist_pool.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "SpecialistPoolServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A service for creating and managing Customer SpecialistPools. +// When customers start Data Labeling jobs, they can reuse/create Specialist +// Pools to bring their own Specialists to label the data. +// Customers can add/remove Managers for the Specialist Pool on Cloud console, +// then Managers will get email notifications to manage Specialists and tasks on +// CrowdCompute console. +service SpecialistPoolService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a SpecialistPool. + rpc CreateSpecialistPool(CreateSpecialistPoolRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/specialistPools" + body: "specialist_pool" + }; + option (google.api.method_signature) = "parent,specialist_pool"; + option (google.longrunning.operation_info) = { + response_type: "SpecialistPool" + metadata_type: "CreateSpecialistPoolOperationMetadata" + }; + } + + // Gets a SpecialistPool. + rpc GetSpecialistPool(GetSpecialistPoolRequest) returns (SpecialistPool) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/specialistPools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists SpecialistPools in a Location. + rpc ListSpecialistPools(ListSpecialistPoolsRequest) returns (ListSpecialistPoolsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/specialistPools" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a SpecialistPool as well as all Specialists in the pool. + rpc DeleteSpecialistPool(DeleteSpecialistPoolRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/specialistPools/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Updates a SpecialistPool. + rpc UpdateSpecialistPool(UpdateSpecialistPoolRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{specialist_pool.name=projects/*/locations/*/specialistPools/*}" + body: "specialist_pool" + }; + option (google.api.method_signature) = "specialist_pool,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "SpecialistPool" + metadata_type: "UpdateSpecialistPoolOperationMetadata" + }; + } +} + +// Request message for [SpecialistPoolService.CreateSpecialistPool][google.cloud.aiplatform.v1.SpecialistPoolService.CreateSpecialistPool]. +message CreateSpecialistPoolRequest { + // Required. The parent Project name for the new SpecialistPool. + // The form is `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The SpecialistPool to create. + SpecialistPool specialist_pool = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Runtime operation information for +// [SpecialistPoolService.CreateSpecialistPool][google.cloud.aiplatform.v1.SpecialistPoolService.CreateSpecialistPool]. +message CreateSpecialistPoolOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [SpecialistPoolService.GetSpecialistPool][google.cloud.aiplatform.v1.SpecialistPoolService.GetSpecialistPool]. +message GetSpecialistPoolRequest { + // Required. The name of the SpecialistPool resource. + // The form is + // `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/SpecialistPool" + } + ]; +} + +// Request message for [SpecialistPoolService.ListSpecialistPools][google.cloud.aiplatform.v1.SpecialistPoolService.ListSpecialistPools]. +message ListSpecialistPoolsRequest { + // Required. The name of the SpecialistPool's parent resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The standard list page size. + int32 page_size = 2; + + // The standard list page token. + // Typically obtained by [ListSpecialistPoolsResponse.next_page_token][google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.next_page_token] of + // the previous [SpecialistPoolService.ListSpecialistPools][google.cloud.aiplatform.v1.SpecialistPoolService.ListSpecialistPools] call. Return + // first page if empty. + string page_token = 3; + + // Mask specifying which fields to read. FieldMask represents a set of + google.protobuf.FieldMask read_mask = 4; +} + +// Response message for [SpecialistPoolService.ListSpecialistPools][google.cloud.aiplatform.v1.SpecialistPoolService.ListSpecialistPools]. +message ListSpecialistPoolsResponse { + // A list of SpecialistPools that matches the specified filter in the request. + repeated SpecialistPool specialist_pools = 1; + + // The standard List next-page token. + string next_page_token = 2; +} + +// Request message for [SpecialistPoolService.DeleteSpecialistPool][google.cloud.aiplatform.v1.SpecialistPoolService.DeleteSpecialistPool]. +message DeleteSpecialistPoolRequest { + // Required. The resource name of the SpecialistPool to delete. Format: + // `projects/{project}/locations/{location}/specialistPools/{specialist_pool}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/SpecialistPool" + } + ]; + + // If set to true, any specialist managers in this SpecialistPool will also be + // deleted. (Otherwise, the request will only work if the SpecialistPool has + // no specialist managers.) + bool force = 2; +} + +// Request message for [SpecialistPoolService.UpdateSpecialistPool][google.cloud.aiplatform.v1.SpecialistPoolService.UpdateSpecialistPool]. +message UpdateSpecialistPoolRequest { + // Required. The SpecialistPool which replaces the resource on the server. + SpecialistPool specialist_pool = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Runtime operation metadata for +// [SpecialistPoolService.UpdateSpecialistPool][google.cloud.aiplatform.v1.SpecialistPoolService.UpdateSpecialistPool]. +message UpdateSpecialistPoolOperationMetadata { + // Output only. The name of the SpecialistPool to which the specialists are being added. + // Format: + // `projects/{project_id}/locations/{location_id}/specialistPools/{specialist_pool}` + string specialist_pool = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/SpecialistPool" + } + ]; + + // The operation generic information. + GenericOperationMetadata generic_metadata = 2; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/study.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/study.proto new file mode 100644 index 00000000..96b3c8ff --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/study.proto @@ -0,0 +1,559 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "StudyProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A message representing a Study. +message Study { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Study" + pattern: "projects/{project}/locations/{location}/studies/{study}" + }; + + // Describes the Study state. + enum State { + // The study state is unspecified. + STATE_UNSPECIFIED = 0; + + // The study is active. + ACTIVE = 1; + + // The study is stopped due to an internal error. + INACTIVE = 2; + + // The study is done when the service exhausts the parameter search space + // or max_trial_count is reached. + COMPLETED = 3; + } + + // Output only. The name of a study. The study's globally unique identifier. + // Format: `projects/{project}/locations/{location}/studies/{study}` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Describes the Study, default value is empty string. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Configuration of the Study. + StudySpec study_spec = 3 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The detailed state of a Study. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the study was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A human readable reason why the Study is inactive. + // This should be empty if a study is ACTIVE or COMPLETED. + string inactive_reason = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A message representing a Trial. A Trial contains a unique set of Parameters +// that has been or will be evaluated, along with the objective metrics got by +// running the Trial. +message Trial { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Trial" + pattern: "projects/{project}/locations/{location}/studies/{study}/trials/{trial}" + }; + + // A message representing a parameter to be tuned. + message Parameter { + // Output only. The ID of the parameter. The parameter should be defined in + // [StudySpec's Parameters][google.cloud.aiplatform.v1.StudySpec.parameters]. + string parameter_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The value of the parameter. + // `number_value` will be set if a parameter defined in StudySpec is + // in type 'INTEGER', 'DOUBLE' or 'DISCRETE'. + // `string_value` will be set if a parameter defined in StudySpec is + // in type 'CATEGORICAL'. + google.protobuf.Value value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Describes a Trial state. + enum State { + // The Trial state is unspecified. + STATE_UNSPECIFIED = 0; + + // Indicates that a specific Trial has been requested, but it has not yet + // been suggested by the service. + REQUESTED = 1; + + // Indicates that the Trial has been suggested. + ACTIVE = 2; + + // Indicates that the Trial should stop according to the service. + STOPPING = 3; + + // Indicates that the Trial is completed successfully. + SUCCEEDED = 4; + + // Indicates that the Trial should not be attempted again. + // The service will set a Trial to INFEASIBLE when it's done but missing + // the final_measurement. + INFEASIBLE = 5; + } + + // Output only. Resource name of the Trial assigned by the service. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The identifier of the Trial assigned by the service. + string id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The detailed state of the Trial. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The parameters of the Trial. + repeated Parameter parameters = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The final measurement containing the objective value. + Measurement final_measurement = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A list of measurements that are strictly lexicographically + // ordered by their induced tuples (steps, elapsed_duration). + // These are used for early stopping computations. + repeated Measurement measurements = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the Trial was started. + google.protobuf.Timestamp start_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the Trial's status changed to `SUCCEEDED` or `INFEASIBLE`. + google.protobuf.Timestamp end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The identifier of the client that originally requested this Trial. + // Each client is identified by a unique client_id. When a client + // asks for a suggestion, Vertex AI Vizier will assign it a Trial. The client + // should evaluate the Trial, complete it, and report back to Vertex AI + // Vizier. If suggestion is asked again by same client_id before the Trial is + // completed, the same Trial will be returned. Multiple clients with + // different client_ids can ask for suggestions simultaneously, each of them + // will get their own Trial. + string client_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A human readable string describing why the Trial is + // infeasible. This is set only if Trial state is `INFEASIBLE`. + string infeasible_reason = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The CustomJob name linked to the Trial. + // It's set for a HyperparameterTuningJob's Trial. + string custom_job = 11 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/CustomJob" + } + ]; + + // Output only. URIs for accessing [interactive + // shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) + // (one URI for each training node). Only available if this trial is part of + // a [HyperparameterTuningJob][google.cloud.aiplatform.v1.HyperparameterTuningJob] and the job's + // [trial_job_spec.enable_web_access][google.cloud.aiplatform.v1.CustomJobSpec.enable_web_access] field + // is `true`. + // + // The keys are names of each node used for the trial; for example, + // `workerpool0-0` for the primary node, `workerpool1-0` for the first node in + // the second worker pool, and `workerpool1-1` for the second node in the + // second worker pool. + // + // The values are the URIs for each node's interactive shell. + map web_access_uris = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents specification of a Study. +message StudySpec { + // Represents a metric to optimize. + message MetricSpec { + // The available types of optimization goals. + enum GoalType { + // Goal Type will default to maximize. + GOAL_TYPE_UNSPECIFIED = 0; + + // Maximize the goal metric. + MAXIMIZE = 1; + + // Minimize the goal metric. + MINIMIZE = 2; + } + + // Required. The ID of the metric. Must not contain whitespaces and must be unique + // amongst all MetricSpecs. + string metric_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The optimization goal of the metric. + GoalType goal = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Represents a single parameter to optimize. + message ParameterSpec { + // Value specification for a parameter in `DOUBLE` type. + message DoubleValueSpec { + // Required. Inclusive minimum value of the parameter. + double min_value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Inclusive maximum value of the parameter. + double max_value = 2 [(google.api.field_behavior) = REQUIRED]; + + // A default value for a `DOUBLE` parameter that is assumed to be a + // relatively good starting point. Unset value signals that there is no + // offered starting point. + // + // Currently only supported by the Vertex AI Vizier service. Not supported + // by HyperparamterTuningJob or TrainingPipeline. + optional double default_value = 4; + } + + // Value specification for a parameter in `INTEGER` type. + message IntegerValueSpec { + // Required. Inclusive minimum value of the parameter. + int64 min_value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Inclusive maximum value of the parameter. + int64 max_value = 2 [(google.api.field_behavior) = REQUIRED]; + + // A default value for an `INTEGER` parameter that is assumed to be a + // relatively good starting point. Unset value signals that there is no + // offered starting point. + // + // Currently only supported by the Vertex AI Vizier service. Not supported + // by HyperparamterTuningJob or TrainingPipeline. + optional int64 default_value = 4; + } + + // Value specification for a parameter in `CATEGORICAL` type. + message CategoricalValueSpec { + // Required. The list of possible categories. + repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; + + // A default value for a `CATEGORICAL` parameter that is assumed to be a + // relatively good starting point. Unset value signals that there is no + // offered starting point. + // + // Currently only supported by the Vizier service. Not supported by + // HyperparamterTuningJob or TrainingPipeline. + optional string default_value = 3; + } + + // Value specification for a parameter in `DISCRETE` type. + message DiscreteValueSpec { + // Required. A list of possible values. + // The list should be in increasing order and at least 1e-10 apart. + // For instance, this parameter might have possible settings of 1.5, 2.5, + // and 4.0. This list should not contain more than 1,000 values. + repeated double values = 1 [(google.api.field_behavior) = REQUIRED]; + + // A default value for a `DISCRETE` parameter that is assumed to be a + // relatively good starting point. Unset value signals that there is no + // offered starting point. It automatically rounds to the + // nearest feasible discrete point. + // + // Currently only supported by the Vizier service. Not supported by + // HyperparamterTuningJob or TrainingPipeline. + optional double default_value = 3; + } + + // Represents a parameter spec with condition from its parent parameter. + message ConditionalParameterSpec { + // Represents the spec to match discrete values from parent parameter. + message DiscreteValueCondition { + // Required. Matches values of the parent parameter of 'DISCRETE' type. + // All values must exist in `discrete_value_spec` of parent parameter. + // + // The Epsilon of the value matching is 1e-10. + repeated double values = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Represents the spec to match integer values from parent parameter. + message IntValueCondition { + // Required. Matches values of the parent parameter of 'INTEGER' type. + // All values must lie in `integer_value_spec` of parent parameter. + repeated int64 values = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Represents the spec to match categorical values from parent parameter. + message CategoricalValueCondition { + // Required. Matches values of the parent parameter of 'CATEGORICAL' type. + // All values must exist in `categorical_value_spec` of parent + // parameter. + repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A set of parameter values from the parent ParameterSpec's feasible + // space. + oneof parent_value_condition { + // The spec for matching values from a parent parameter of + // `DISCRETE` type. + DiscreteValueCondition parent_discrete_values = 2; + + // The spec for matching values from a parent parameter of `INTEGER` + // type. + IntValueCondition parent_int_values = 3; + + // The spec for matching values from a parent parameter of + // `CATEGORICAL` type. + CategoricalValueCondition parent_categorical_values = 4; + } + + // Required. The spec for a conditional parameter. + ParameterSpec parameter_spec = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The type of scaling that should be applied to this parameter. + enum ScaleType { + // By default, no scaling is applied. + SCALE_TYPE_UNSPECIFIED = 0; + + // Scales the feasible space to (0, 1) linearly. + UNIT_LINEAR_SCALE = 1; + + // Scales the feasible space logarithmically to (0, 1). The entire + // feasible space must be strictly positive. + UNIT_LOG_SCALE = 2; + + // Scales the feasible space "reverse" logarithmically to (0, 1). The + // result is that values close to the top of the feasible space are spread + // out more than points near the bottom. The entire feasible space must be + // strictly positive. + UNIT_REVERSE_LOG_SCALE = 3; + } + + oneof parameter_value_spec { + // The value spec for a 'DOUBLE' parameter. + DoubleValueSpec double_value_spec = 2; + + // The value spec for an 'INTEGER' parameter. + IntegerValueSpec integer_value_spec = 3; + + // The value spec for a 'CATEGORICAL' parameter. + CategoricalValueSpec categorical_value_spec = 4; + + // The value spec for a 'DISCRETE' parameter. + DiscreteValueSpec discrete_value_spec = 5; + } + + // Required. The ID of the parameter. Must not contain whitespaces and must be unique + // amongst all ParameterSpecs. + string parameter_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // How the parameter should be scaled. + // Leave unset for `CATEGORICAL` parameters. + ScaleType scale_type = 6; + + // A conditional parameter node is active if the parameter's value matches + // the conditional node's parent_value_condition. + // + // If two items in conditional_parameter_specs have the same name, they + // must have disjoint parent_value_condition. + repeated ConditionalParameterSpec conditional_parameter_specs = 10; + } + + // The decay curve automated stopping rule builds a Gaussian Process + // Regressor to predict the final objective value of a Trial based on the + // already completed Trials and the intermediate measurements of the current + // Trial. Early stopping is requested for the current Trial if there is very + // low probability to exceed the optimal value found so far. + message DecayCurveAutomatedStoppingSpec { + // True if [Measurement.elapsed_duration][google.cloud.aiplatform.v1.Measurement.elapsed_duration] is used as the x-axis of each + // Trials Decay Curve. Otherwise, [Measurement.step_count][google.cloud.aiplatform.v1.Measurement.step_count] will be used + // as the x-axis. + bool use_elapsed_duration = 1; + } + + // The median automated stopping rule stops a pending Trial if the Trial's + // best objective_value is strictly below the median 'performance' of all + // completed Trials reported up to the Trial's last measurement. + // Currently, 'performance' refers to the running average of the objective + // values reported by the Trial in each measurement. + message MedianAutomatedStoppingSpec { + // True if median automated stopping rule applies on + // [Measurement.elapsed_duration][google.cloud.aiplatform.v1.Measurement.elapsed_duration]. It means that elapsed_duration + // field of latest measurement of current Trial is used to compute median + // objective value for each completed Trials. + bool use_elapsed_duration = 1; + } + + // Configuration for ConvexAutomatedStoppingSpec. + // When there are enough completed trials (configured by + // min_measurement_count), for pending trials with enough measurements and + // steps, the policy first computes an overestimate of the objective value at + // max_num_steps according to the slope of the incomplete objective value + // curve. No prediction can be made if the curve is completely flat. If the + // overestimation is worse than the best objective value of the completed + // trials, this pending trial will be early-stopped, but a last measurement + // will be added to the pending trial with max_num_steps and predicted + // objective value from the autoregression model. + message ConvexAutomatedStoppingSpec { + // Steps used in predicting the final objective for early stopped trials. In + // general, it's set to be the same as the defined steps in training / + // tuning. If not defined, it will learn it from the completed trials. When + // use_steps is false, this field is set to the maximum elapsed seconds. + int64 max_step_count = 1; + + // Minimum number of steps for a trial to complete. Trials which do not have + // a measurement with step_count > min_step_count won't be considered for + // early stopping. It's ok to set it to 0, and a trial can be early stopped + // at any stage. By default, min_step_count is set to be one-tenth of the + // max_step_count. + // When use_elapsed_duration is true, this field is set to the minimum + // elapsed seconds. + int64 min_step_count = 2; + + // The minimal number of measurements in a Trial. Early-stopping checks + // will not trigger if less than min_measurement_count+1 completed trials or + // pending trials with less than min_measurement_count measurements. If not + // defined, the default value is 5. + int64 min_measurement_count = 3; + + // The hyper-parameter name used in the tuning job that stands for learning + // rate. Leave it blank if learning rate is not in a parameter in tuning. + // The learning_rate is used to estimate the objective value of the ongoing + // trial. + string learning_rate_parameter_name = 4; + + // This bool determines whether or not the rule is applied based on + // elapsed_secs or steps. If use_elapsed_duration==false, the early stopping + // decision is made according to the predicted objective values according to + // the target steps. If use_elapsed_duration==true, elapsed_secs is used + // instead of steps. Also, in this case, the parameters max_num_steps and + // min_num_steps are overloaded to contain max_elapsed_seconds and + // min_elapsed_seconds. + bool use_elapsed_duration = 5; + } + + // The available search algorithms for the Study. + enum Algorithm { + // The default algorithm used by Vertex AI for [hyperparameter + // tuning](https://cloud.google.com/vertex-ai/docs/training/hyperparameter-tuning-overview) + // and [Vertex AI Vizier](https://cloud.google.com/vertex-ai/docs/vizier). + ALGORITHM_UNSPECIFIED = 0; + + // Simple grid search within the feasible space. To use grid search, + // all parameters must be `INTEGER`, `CATEGORICAL`, or `DISCRETE`. + GRID_SEARCH = 2; + + // Simple random search within the feasible space. + RANDOM_SEARCH = 3; + } + + // Describes the noise level of the repeated observations. + // + // "Noisy" means that the repeated observations with the same Trial parameters + // may lead to different metric evaluations. + enum ObservationNoise { + // The default noise level chosen by Vertex AI. + OBSERVATION_NOISE_UNSPECIFIED = 0; + + // Vertex AI assumes that the objective function is (nearly) + // perfectly reproducible, and will never repeat the same Trial + // parameters. + LOW = 1; + + // Vertex AI will estimate the amount of noise in metric + // evaluations, it may repeat the same Trial parameters more than once. + HIGH = 2; + } + + // This indicates which measurement to use if/when the service automatically + // selects the final measurement from previously reported intermediate + // measurements. Choose this based on two considerations: + // A) Do you expect your measurements to monotonically improve? + // If so, choose LAST_MEASUREMENT. On the other hand, if you're in a + // situation where your system can "over-train" and you expect the + // performance to get better for a while but then start declining, + // choose BEST_MEASUREMENT. + // B) Are your measurements significantly noisy and/or irreproducible? + // If so, BEST_MEASUREMENT will tend to be over-optimistic, and it + // may be better to choose LAST_MEASUREMENT. + // If both or neither of (A) and (B) apply, it doesn't matter which + // selection type is chosen. + enum MeasurementSelectionType { + // Will be treated as LAST_MEASUREMENT. + MEASUREMENT_SELECTION_TYPE_UNSPECIFIED = 0; + + // Use the last measurement reported. + LAST_MEASUREMENT = 1; + + // Use the best measurement reported. + BEST_MEASUREMENT = 2; + } + + oneof automated_stopping_spec { + // The automated early stopping spec using decay curve rule. + DecayCurveAutomatedStoppingSpec decay_curve_stopping_spec = 4; + + // The automated early stopping spec using median rule. + MedianAutomatedStoppingSpec median_automated_stopping_spec = 5; + + // The automated early stopping spec using convex stopping rule. + ConvexAutomatedStoppingSpec convex_automated_stopping_spec = 9; + } + + // Required. Metric specs for the Study. + repeated MetricSpec metrics = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The set of parameters to tune. + repeated ParameterSpec parameters = 2 [(google.api.field_behavior) = REQUIRED]; + + // The search algorithm specified for the Study. + Algorithm algorithm = 3; + + // The observation noise level of the study. + // Currently only supported by the Vertex AI Vizier service. Not supported by + // HyperparamterTuningJob or TrainingPipeline. + ObservationNoise observation_noise = 6; + + // Describe which measurement selection type will be used + MeasurementSelectionType measurement_selection_type = 7; +} + +// A message representing a Measurement of a Trial. A Measurement contains +// the Metrics got by executing a Trial using suggested hyperparameter +// values. +message Measurement { + // A message representing a metric in the measurement. + message Metric { + // Output only. The ID of the Metric. The Metric should be defined in + // [StudySpec's Metrics][google.cloud.aiplatform.v1.StudySpec.metrics]. + string metric_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The value for this metric. + double value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Time that the Trial has been running at the point of this Measurement. + google.protobuf.Duration elapsed_duration = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of steps the machine learning model has been trained for. + // Must be non-negative. + int64 step_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A list of metrics got by evaluating the objective functions using suggested + // Parameter values. + repeated Metric metrics = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard.proto new file mode 100644 index 00000000..84a245d9 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard.proto @@ -0,0 +1,86 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/encryption_spec.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "TensorboardProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Tensorboard is a physical database that stores users' training metrics. +// A default Tensorboard is provided in each region of a GCP project. +// If needed users can also create extra Tensorboards in their projects. +message Tensorboard { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Tensorboard" + pattern: "projects/{project}/locations/{location}/tensorboards/{tensorboard}" + }; + + // Output only. Name of the Tensorboard. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. User provided name of this Tensorboard. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Description of this Tensorboard. + string description = 3; + + // Customer-managed encryption key spec for a Tensorboard. If set, this + // Tensorboard and all sub-resources of this Tensorboard will be secured by + // this key. + EncryptionSpec encryption_spec = 11; + + // Output only. Consumer project Cloud Storage path prefix used to store blob data, which + // can either be a bucket or directory. Does not end with a '/'. + string blob_storage_path_prefix = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of Runs stored in this Tensorboard. + int32 run_count = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Tensorboard was created. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Tensorboard was last updated. + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize your Tensorboards. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one Tensorboard + // (System labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. + map labels = 8; + + // Used to perform a consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 9; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_data.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_data.proto new file mode 100644 index 00000000..c65db694 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_data.proto @@ -0,0 +1,101 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/aiplatform/v1/tensorboard_time_series.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "TensorboardDataProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// All the data stored in a TensorboardTimeSeries. +message TimeSeriesData { + // Required. The ID of the TensorboardTimeSeries, which will become the final component + // of the TensorboardTimeSeries' resource name + string tensorboard_time_series_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Immutable. The value type of this time series. All the values in this time series data + // must match this value type. + TensorboardTimeSeries.ValueType value_type = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Data points in this time series. + repeated TimeSeriesDataPoint values = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A TensorboardTimeSeries data point. +message TimeSeriesDataPoint { + // Value of this time series data point. + oneof value { + // A scalar value. + Scalar scalar = 3; + + // A tensor value. + TensorboardTensor tensor = 4; + + // A blob sequence value. + TensorboardBlobSequence blobs = 5; + } + + // Wall clock timestamp when this data point is generated by the end user. + google.protobuf.Timestamp wall_time = 1; + + // Step index of this data point within the run. + int64 step = 2; +} + +// One point viewable on a scalar metric plot. +message Scalar { + // Value of the point at this step / timestamp. + double value = 1; +} + +// One point viewable on a tensor metric plot. +message TensorboardTensor { + // Required. Serialized form of + // https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/tensor.proto + bytes value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Version number of TensorProto used to serialize [value][google.cloud.aiplatform.v1.TensorboardTensor.value]. + int32 version_number = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// One point viewable on a blob metric plot, but mostly just a wrapper message +// to work around repeated fields can't be used directly within `oneof` fields. +message TensorboardBlobSequence { + // List of blobs contained within the sequence. + repeated TensorboardBlob values = 1; +} + +// One blob (e.g, image, graph) viewable on a blob metric plot. +message TensorboardBlob { + // Output only. A URI safe key uniquely identifying a blob. Can be used to locate the blob + // stored in the Cloud Storage bucket of the consumer project. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The bytes of the blob is not present unless it's returned by the + // ReadTensorboardBlobData endpoint. + bytes data = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto new file mode 100644 index 00000000..9d7fe120 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto @@ -0,0 +1,78 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "TensorboardExperimentProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A TensorboardExperiment is a group of TensorboardRuns, that are typically the +// results of a training job run, in a Tensorboard. +message TensorboardExperiment { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/TensorboardExperiment" + pattern: "projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}" + }; + + // Output only. Name of the TensorboardExperiment. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User provided name of this TensorboardExperiment. + string display_name = 2; + + // Description of this TensorboardExperiment. + string description = 3; + + // Output only. Timestamp when this TensorboardExperiment was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this TensorboardExperiment was last updated. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize your Datasets. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one Dataset (System + // labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. Following system labels exist for each Dataset: + // * "aiplatform.googleapis.com/dataset_metadata_schema": + // - output only, its value is the + // [metadata_schema's][metadata_schema_uri] title. + map labels = 6; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 7; + + // Immutable. Source of the TensorboardExperiment. Example: a custom training job. + string source = 8 [(google.api.field_behavior) = IMMUTABLE]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_run.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_run.proto new file mode 100644 index 00000000..0f7b5eff --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_run.proto @@ -0,0 +1,81 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "TensorboardRunProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// TensorboardRun maps to a specific execution of a training job with a given +// set of hyperparameter values, model definition, dataset, etc +message TensorboardRun { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/TensorboardRun" + pattern: "projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}" + }; + + // Output only. Name of the TensorboardRun. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. User provided name of this TensorboardRun. + // This value must be unique among all TensorboardRuns + // belonging to the same parent TensorboardExperiment. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Description of this TensorboardRun. + string description = 3; + + // Output only. Timestamp when this TensorboardRun was created. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this TensorboardRun was last updated. + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize your TensorboardRuns. + // + // This field will be used to filter and visualize Runs in the Tensorboard UI. + // For example, a Vertex AI training job can set a label + // aiplatform.googleapis.com/training_job_id=xxxxx to all the runs created + // within that job. An end user can set a label experiment_id=xxxxx for all + // the runs produced in a Jupyter notebook. These runs can be grouped by a + // label value and visualized together in the Tensorboard UI. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one TensorboardRun + // (System labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. + map labels = 8; + + // Used to perform a consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 9; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_service.proto new file mode 100644 index 00000000..ed81dd1f --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_service.proto @@ -0,0 +1,1006 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/operation.proto"; +import "google/cloud/aiplatform/v1/tensorboard.proto"; +import "google/cloud/aiplatform/v1/tensorboard_data.proto"; +import "google/cloud/aiplatform/v1/tensorboard_experiment.proto"; +import "google/cloud/aiplatform/v1/tensorboard_run.proto"; +import "google/cloud/aiplatform/v1/tensorboard_time_series.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "TensorboardServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// TensorboardService +service TensorboardService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Creates a Tensorboard. + rpc CreateTensorboard(CreateTensorboardRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/tensorboards" + body: "tensorboard" + }; + option (google.api.method_signature) = "parent,tensorboard"; + option (google.longrunning.operation_info) = { + response_type: "Tensorboard" + metadata_type: "CreateTensorboardOperationMetadata" + }; + } + + // Gets a Tensorboard. + rpc GetTensorboard(GetTensorboardRequest) returns (Tensorboard) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/tensorboards/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a Tensorboard. + rpc UpdateTensorboard(UpdateTensorboardRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{tensorboard.name=projects/*/locations/*/tensorboards/*}" + body: "tensorboard" + }; + option (google.api.method_signature) = "tensorboard,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Tensorboard" + metadata_type: "UpdateTensorboardOperationMetadata" + }; + } + + // Lists Tensorboards in a Location. + rpc ListTensorboards(ListTensorboardsRequest) returns (ListTensorboardsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/tensorboards" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a Tensorboard. + rpc DeleteTensorboard(DeleteTensorboardRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/tensorboards/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Creates a TensorboardExperiment. + rpc CreateTensorboardExperiment(CreateTensorboardExperimentRequest) returns (TensorboardExperiment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/tensorboards/*}/experiments" + body: "tensorboard_experiment" + }; + option (google.api.method_signature) = "parent,tensorboard_experiment,tensorboard_experiment_id"; + } + + // Gets a TensorboardExperiment. + rpc GetTensorboardExperiment(GetTensorboardExperimentRequest) returns (TensorboardExperiment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a TensorboardExperiment. + rpc UpdateTensorboardExperiment(UpdateTensorboardExperimentRequest) returns (TensorboardExperiment) { + option (google.api.http) = { + patch: "/v1/{tensorboard_experiment.name=projects/*/locations/*/tensorboards/*/experiments/*}" + body: "tensorboard_experiment" + }; + option (google.api.method_signature) = "tensorboard_experiment,update_mask"; + } + + // Lists TensorboardExperiments in a Location. + rpc ListTensorboardExperiments(ListTensorboardExperimentsRequest) returns (ListTensorboardExperimentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/tensorboards/*}/experiments" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a TensorboardExperiment. + rpc DeleteTensorboardExperiment(DeleteTensorboardExperimentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Creates a TensorboardRun. + rpc CreateTensorboardRun(CreateTensorboardRunRequest) returns (TensorboardRun) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs" + body: "tensorboard_run" + }; + option (google.api.method_signature) = "parent,tensorboard_run,tensorboard_run_id"; + } + + // Batch create TensorboardRuns. + rpc BatchCreateTensorboardRuns(BatchCreateTensorboardRunsRequest) returns (BatchCreateTensorboardRunsResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs:batchCreate" + body: "*" + }; + option (google.api.method_signature) = "parent,requests"; + } + + // Gets a TensorboardRun. + rpc GetTensorboardRun(GetTensorboardRunRequest) returns (TensorboardRun) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a TensorboardRun. + rpc UpdateTensorboardRun(UpdateTensorboardRunRequest) returns (TensorboardRun) { + option (google.api.http) = { + patch: "/v1/{tensorboard_run.name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}" + body: "tensorboard_run" + }; + option (google.api.method_signature) = "tensorboard_run,update_mask"; + } + + // Lists TensorboardRuns in a Location. + rpc ListTensorboardRuns(ListTensorboardRunsRequest) returns (ListTensorboardRunsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a TensorboardRun. + rpc DeleteTensorboardRun(DeleteTensorboardRunRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Batch create TensorboardTimeSeries that belong to a TensorboardExperiment. + rpc BatchCreateTensorboardTimeSeries(BatchCreateTensorboardTimeSeriesRequest) returns (BatchCreateTensorboardTimeSeriesResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs/*/timeSeries:batchCreate" + body: "*" + }; + option (google.api.method_signature) = "parent,requests"; + } + + // Creates a TensorboardTimeSeries. + rpc CreateTensorboardTimeSeries(CreateTensorboardTimeSeriesRequest) returns (TensorboardTimeSeries) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/timeSeries" + body: "tensorboard_time_series" + }; + option (google.api.method_signature) = "parent,tensorboard_time_series"; + } + + // Gets a TensorboardTimeSeries. + rpc GetTensorboardTimeSeries(GetTensorboardTimeSeriesRequest) returns (TensorboardTimeSeries) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a TensorboardTimeSeries. + rpc UpdateTensorboardTimeSeries(UpdateTensorboardTimeSeriesRequest) returns (TensorboardTimeSeries) { + option (google.api.http) = { + patch: "/v1/{tensorboard_time_series.name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}" + body: "tensorboard_time_series" + }; + option (google.api.method_signature) = "tensorboard_time_series,update_mask"; + } + + // Lists TensorboardTimeSeries in a Location. + rpc ListTensorboardTimeSeries(ListTensorboardTimeSeriesRequest) returns (ListTensorboardTimeSeriesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/timeSeries" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a TensorboardTimeSeries. + rpc DeleteTensorboardTimeSeries(DeleteTensorboardTimeSeriesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Reads multiple TensorboardTimeSeries' data. The data point number limit is + // 1000 for scalars, 100 for tensors and blob references. If the number of + // data points stored is less than the limit, all data will be returned. + // Otherwise, that limit number of data points will be randomly selected from + // this time series and returned. + rpc BatchReadTensorboardTimeSeriesData(BatchReadTensorboardTimeSeriesDataRequest) returns (BatchReadTensorboardTimeSeriesDataResponse) { + option (google.api.http) = { + get: "/v1/{tensorboard=projects/*/locations/*/tensorboards/*}/experiments/*/runs/*/timeSeries:batchRead" + }; + option (google.api.method_signature) = "tensorboard"; + } + + // Reads a TensorboardTimeSeries' data. By default, if the number of data + // points stored is less than 1000, all data will be returned. Otherwise, 1000 + // data points will be randomly selected from this time series and returned. + // This value can be changed by changing max_data_points, which can't be + // greater than 10k. + rpc ReadTensorboardTimeSeriesData(ReadTensorboardTimeSeriesDataRequest) returns (ReadTensorboardTimeSeriesDataResponse) { + option (google.api.http) = { + get: "/v1/{tensorboard_time_series=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}:read" + }; + option (google.api.method_signature) = "tensorboard_time_series"; + } + + // Gets bytes of TensorboardBlobs. + // This is to allow reading blob data stored in consumer project's Cloud + // Storage bucket without users having to obtain Cloud Storage access + // permission. + rpc ReadTensorboardBlobData(ReadTensorboardBlobDataRequest) returns (stream ReadTensorboardBlobDataResponse) { + option (google.api.http) = { + get: "/v1/{time_series=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}:readBlobData" + }; + option (google.api.method_signature) = "time_series"; + } + + // Write time series data points of multiple TensorboardTimeSeries in multiple + // TensorboardRun's. If any data fail to be ingested, an error will be + // returned. + rpc WriteTensorboardExperimentData(WriteTensorboardExperimentDataRequest) returns (WriteTensorboardExperimentDataResponse) { + option (google.api.http) = { + post: "/v1/{tensorboard_experiment=projects/*/locations/*/tensorboards/*/experiments/*}:write" + body: "*" + }; + option (google.api.method_signature) = "tensorboard_experiment,write_run_data_requests"; + } + + // Write time series data points into multiple TensorboardTimeSeries under + // a TensorboardRun. If any data fail to be ingested, an error will be + // returned. + rpc WriteTensorboardRunData(WriteTensorboardRunDataRequest) returns (WriteTensorboardRunDataResponse) { + option (google.api.http) = { + post: "/v1/{tensorboard_run=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}:write" + body: "*" + }; + option (google.api.method_signature) = "tensorboard_run,time_series_data"; + } + + // Exports a TensorboardTimeSeries' data. Data is returned in paginated + // responses. + rpc ExportTensorboardTimeSeriesData(ExportTensorboardTimeSeriesDataRequest) returns (ExportTensorboardTimeSeriesDataResponse) { + option (google.api.http) = { + post: "/v1/{tensorboard_time_series=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}:exportTensorboardTimeSeries" + body: "*" + }; + option (google.api.method_signature) = "tensorboard_time_series"; + } +} + +// Request message for [TensorboardService.CreateTensorboard][google.cloud.aiplatform.v1.TensorboardService.CreateTensorboard]. +message CreateTensorboardRequest { + // Required. The resource name of the Location to create the Tensorboard in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Tensorboard" + } + ]; + + // Required. The Tensorboard to create. + Tensorboard tensorboard = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [TensorboardService.GetTensorboard][google.cloud.aiplatform.v1.TensorboardService.GetTensorboard]. +message GetTensorboardRequest { + // Required. The name of the Tensorboard resource. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Tensorboard" + } + ]; +} + +// Request message for [TensorboardService.ListTensorboards][google.cloud.aiplatform.v1.TensorboardService.ListTensorboards]. +message ListTensorboardsRequest { + // Required. The resource name of the Location to list Tensorboards. + // Format: + // `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Tensorboard" + } + ]; + + // Lists the Tensorboards that match the filter expression. + string filter = 2; + + // The maximum number of Tensorboards to return. The service may return + // fewer than this value. If unspecified, at most 100 Tensorboards will be + // returned. The maximum value is 100; values above 100 will be coerced to + // 100. + int32 page_size = 3; + + // A page token, received from a previous + // [TensorboardService.ListTensorboards][google.cloud.aiplatform.v1.TensorboardService.ListTensorboards] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [TensorboardService.ListTensorboards][google.cloud.aiplatform.v1.TensorboardService.ListTensorboards] must + // match the call that provided the page token. + string page_token = 4; + + // Field to use to sort the list. + string order_by = 5; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 6; +} + +// Response message for [TensorboardService.ListTensorboards][google.cloud.aiplatform.v1.TensorboardService.ListTensorboards]. +message ListTensorboardsResponse { + // The Tensorboards mathching the request. + repeated Tensorboard tensorboards = 1; + + // A token, which can be sent as [ListTensorboardsRequest.page_token][google.cloud.aiplatform.v1.ListTensorboardsRequest.page_token] + // to retrieve the next page. If this field is omitted, there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for [TensorboardService.UpdateTensorboard][google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboard]. +message UpdateTensorboardRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // Tensorboard resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten if new + // values are specified. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Tensorboard's `name` field is used to identify the + // Tensorboard to be updated. Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + Tensorboard tensorboard = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [TensorboardService.DeleteTensorboard][google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboard]. +message DeleteTensorboardRequest { + // Required. The name of the Tensorboard to be deleted. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Tensorboard" + } + ]; +} + +// Request message for [TensorboardService.CreateTensorboardExperiment][google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardExperiment]. +message CreateTensorboardExperimentRequest { + // Required. The resource name of the Tensorboard to create the TensorboardExperiment + // in. Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardExperiment" + } + ]; + + // The TensorboardExperiment to create. + TensorboardExperiment tensorboard_experiment = 2; + + // Required. The ID to use for the Tensorboard experiment, which will become the final + // component of the Tensorboard experiment's resource name. + // + // This value should be 1-128 characters, and valid characters + // are /[a-z][0-9]-/. + string tensorboard_experiment_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [TensorboardService.GetTensorboardExperiment][google.cloud.aiplatform.v1.TensorboardService.GetTensorboardExperiment]. +message GetTensorboardExperimentRequest { + // Required. The name of the TensorboardExperiment resource. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardExperiment" + } + ]; +} + +// Request message for [TensorboardService.ListTensorboardExperiments][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments]. +message ListTensorboardExperimentsRequest { + // Required. The resource name of the Tensorboard to list TensorboardExperiments. + // Format: + // 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/TensorboardExperiment" + } + ]; + + // Lists the TensorboardExperiments that match the filter expression. + string filter = 2; + + // The maximum number of TensorboardExperiments to return. The service may + // return fewer than this value. If unspecified, at most 50 + // TensorboardExperiments will be returned. The maximum value is 1000; values + // above 1000 will be coerced to 1000. + int32 page_size = 3; + + // A page token, received from a previous + // [TensorboardService.ListTensorboardExperiments][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [TensorboardService.ListTensorboardExperiments][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments] must + // match the call that provided the page token. + string page_token = 4; + + // Field to use to sort the list. + string order_by = 5; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 6; +} + +// Response message for [TensorboardService.ListTensorboardExperiments][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments]. +message ListTensorboardExperimentsResponse { + // The TensorboardExperiments mathching the request. + repeated TensorboardExperiment tensorboard_experiments = 1; + + // A token, which can be sent as + // [ListTensorboardExperimentsRequest.page_token][google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest.page_token] to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [TensorboardService.UpdateTensorboardExperiment][google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardExperiment]. +message UpdateTensorboardExperimentRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // TensorboardExperiment resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten if new + // values are specified. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The TensorboardExperiment's `name` field is used to identify the + // TensorboardExperiment to be updated. Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + TensorboardExperiment tensorboard_experiment = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [TensorboardService.DeleteTensorboardExperiment][google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardExperiment]. +message DeleteTensorboardExperimentRequest { + // Required. The name of the TensorboardExperiment to be deleted. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardExperiment" + } + ]; +} + +// Request message for [TensorboardService.BatchCreateTensorboardRuns][google.cloud.aiplatform.v1.TensorboardService.BatchCreateTensorboardRuns]. +message BatchCreateTensorboardRunsRequest { + // Required. The resource name of the TensorboardExperiment to create the + // TensorboardRuns in. Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + // The parent field in the CreateTensorboardRunRequest messages must match + // this field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardExperiment" + } + ]; + + // Required. The request message specifying the TensorboardRuns to create. + // A maximum of 1000 TensorboardRuns can be created in a batch. + repeated CreateTensorboardRunRequest requests = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [TensorboardService.BatchCreateTensorboardRuns][google.cloud.aiplatform.v1.TensorboardService.BatchCreateTensorboardRuns]. +message BatchCreateTensorboardRunsResponse { + // The created TensorboardRuns. + repeated TensorboardRun tensorboard_runs = 1; +} + +// Request message for [TensorboardService.CreateTensorboardRun][google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardRun]. +message CreateTensorboardRunRequest { + // Required. The resource name of the TensorboardExperiment to create the TensorboardRun + // in. Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardRun" + } + ]; + + // Required. The TensorboardRun to create. + TensorboardRun tensorboard_run = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the Tensorboard run, which will become the final + // component of the Tensorboard run's resource name. + // + // This value should be 1-128 characters, and valid characters + // are /[a-z][0-9]-/. + string tensorboard_run_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [TensorboardService.GetTensorboardRun][google.cloud.aiplatform.v1.TensorboardService.GetTensorboardRun]. +message GetTensorboardRunRequest { + // Required. The name of the TensorboardRun resource. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardRun" + } + ]; +} + +// Request message for [TensorboardService.ReadTensorboardBlobData][google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardBlobData]. +message ReadTensorboardBlobDataRequest { + // Required. The resource name of the TensorboardTimeSeries to list Blobs. + // Format: + // 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + string time_series = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardTimeSeries" + } + ]; + + // IDs of the blobs to read. + repeated string blob_ids = 2; +} + +// Response message for [TensorboardService.ReadTensorboardBlobData][google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardBlobData]. +message ReadTensorboardBlobDataResponse { + // Blob messages containing blob bytes. + repeated TensorboardBlob blobs = 1; +} + +// Request message for [TensorboardService.ListTensorboardRuns][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns]. +message ListTensorboardRunsRequest { + // Required. The resource name of the TensorboardExperiment to list TensorboardRuns. + // Format: + // 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/TensorboardRun" + } + ]; + + // Lists the TensorboardRuns that match the filter expression. + string filter = 2; + + // The maximum number of TensorboardRuns to return. The service may return + // fewer than this value. If unspecified, at most 50 TensorboardRuns will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 3; + + // A page token, received from a previous + // [TensorboardService.ListTensorboardRuns][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [TensorboardService.ListTensorboardRuns][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns] must + // match the call that provided the page token. + string page_token = 4; + + // Field to use to sort the list. + string order_by = 5; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 6; +} + +// Response message for [TensorboardService.ListTensorboardRuns][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns]. +message ListTensorboardRunsResponse { + // The TensorboardRuns mathching the request. + repeated TensorboardRun tensorboard_runs = 1; + + // A token, which can be sent as [ListTensorboardRunsRequest.page_token][google.cloud.aiplatform.v1.ListTensorboardRunsRequest.page_token] to + // retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [TensorboardService.UpdateTensorboardRun][google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardRun]. +message UpdateTensorboardRunRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // TensorboardRun resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten if new + // values are specified. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The TensorboardRun's `name` field is used to identify the TensorboardRun to + // be updated. Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + TensorboardRun tensorboard_run = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [TensorboardService.DeleteTensorboardRun][google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardRun]. +message DeleteTensorboardRunRequest { + // Required. The name of the TensorboardRun to be deleted. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardRun" + } + ]; +} + +// Request message for [TensorboardService.BatchCreateTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.BatchCreateTensorboardTimeSeries]. +message BatchCreateTensorboardTimeSeriesRequest { + // Required. The resource name of the TensorboardExperiment to create the + // TensorboardTimeSeries in. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + // The TensorboardRuns referenced by the parent fields in the + // CreateTensorboardTimeSeriesRequest messages must be sub resources of this + // TensorboardExperiment. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardExperiment" + } + ]; + + // Required. The request message specifying the TensorboardTimeSeries to create. + // A maximum of 1000 TensorboardTimeSeries can be created in a batch. + repeated CreateTensorboardTimeSeriesRequest requests = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [TensorboardService.BatchCreateTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.BatchCreateTensorboardTimeSeries]. +message BatchCreateTensorboardTimeSeriesResponse { + // The created TensorboardTimeSeries. + repeated TensorboardTimeSeries tensorboard_time_series = 1; +} + +// Request message for [TensorboardService.CreateTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardTimeSeries]. +message CreateTensorboardTimeSeriesRequest { + // Required. The resource name of the TensorboardRun to create the + // TensorboardTimeSeries in. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardTimeSeries" + } + ]; + + // Optional. The user specified unique ID to use for the TensorboardTimeSeries, which + // will become the final component of the TensorboardTimeSeries's resource + // name. + // This value should match "[a-z0-9][a-z0-9-]{0, 127}" + string tensorboard_time_series_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The TensorboardTimeSeries to create. + TensorboardTimeSeries tensorboard_time_series = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [TensorboardService.GetTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.GetTensorboardTimeSeries]. +message GetTensorboardTimeSeriesRequest { + // Required. The name of the TensorboardTimeSeries resource. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardTimeSeries" + } + ]; +} + +// Request message for [TensorboardService.ListTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries]. +message ListTensorboardTimeSeriesRequest { + // Required. The resource name of the TensorboardRun to list TensorboardTimeSeries. + // Format: + // 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/TensorboardTimeSeries" + } + ]; + + // Lists the TensorboardTimeSeries that match the filter expression. + string filter = 2; + + // The maximum number of TensorboardTimeSeries to return. The service may + // return fewer than this value. If unspecified, at most 50 + // TensorboardTimeSeries will be returned. The maximum value is 1000; values + // above 1000 will be coerced to 1000. + int32 page_size = 3; + + // A page token, received from a previous + // [TensorboardService.ListTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [TensorboardService.ListTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries] must + // match the call that provided the page token. + string page_token = 4; + + // Field to use to sort the list. + string order_by = 5; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 6; +} + +// Response message for [TensorboardService.ListTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries]. +message ListTensorboardTimeSeriesResponse { + // The TensorboardTimeSeries mathching the request. + repeated TensorboardTimeSeries tensorboard_time_series = 1; + + // A token, which can be sent as + // [ListTensorboardTimeSeriesRequest.page_token][google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest.page_token] to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [TensorboardService.UpdateTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardTimeSeries]. +message UpdateTensorboardTimeSeriesRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // TensorboardTimeSeries resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten if new + // values are specified. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The TensorboardTimeSeries' `name` field is used to identify the + // TensorboardTimeSeries to be updated. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + TensorboardTimeSeries tensorboard_time_series = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [TensorboardService.DeleteTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardTimeSeries]. +message DeleteTensorboardTimeSeriesRequest { + // Required. The name of the TensorboardTimeSeries to be deleted. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardTimeSeries" + } + ]; +} + +// Request message for +// [TensorboardService.BatchReadTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.BatchReadTensorboardTimeSeriesData]. +message BatchReadTensorboardTimeSeriesDataRequest { + // Required. The resource name of the Tensorboard containing TensorboardTimeSeries to + // read data from. Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}`. + // The TensorboardTimeSeries referenced by [time_series][google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest.time_series] must be sub + // resources of this Tensorboard. + string tensorboard = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Tensorboard" + } + ]; + + // Required. The resource names of the TensorboardTimeSeries to read data from. Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + repeated string time_series = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardTimeSeries" + } + ]; +} + +// Response message for +// [TensorboardService.BatchReadTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.BatchReadTensorboardTimeSeriesData]. +message BatchReadTensorboardTimeSeriesDataResponse { + // The returned time series data. + repeated TimeSeriesData time_series_data = 1; +} + +// Request message for [TensorboardService.ReadTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardTimeSeriesData]. +message ReadTensorboardTimeSeriesDataRequest { + // Required. The resource name of the TensorboardTimeSeries to read data from. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + string tensorboard_time_series = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardTimeSeries" + } + ]; + + // The maximum number of TensorboardTimeSeries' data to return. + // + // This value should be a positive integer. + // This value can be set to -1 to return all data. + int32 max_data_points = 2; + + // Reads the TensorboardTimeSeries' data that match the filter expression. + string filter = 3; +} + +// Response message for [TensorboardService.ReadTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardTimeSeriesData]. +message ReadTensorboardTimeSeriesDataResponse { + // The returned time series data. + TimeSeriesData time_series_data = 1; +} + +// Request message for [TensorboardService.WriteTensorboardExperimentData][google.cloud.aiplatform.v1.TensorboardService.WriteTensorboardExperimentData]. +message WriteTensorboardExperimentDataRequest { + // Required. The resource name of the TensorboardExperiment to write data to. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + string tensorboard_experiment = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardExperiment" + } + ]; + + // Required. Requests containing per-run TensorboardTimeSeries data to write. + repeated WriteTensorboardRunDataRequest write_run_data_requests = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [TensorboardService.WriteTensorboardExperimentData][google.cloud.aiplatform.v1.TensorboardService.WriteTensorboardExperimentData]. +message WriteTensorboardExperimentDataResponse { + +} + +// Request message for [TensorboardService.WriteTensorboardRunData][google.cloud.aiplatform.v1.TensorboardService.WriteTensorboardRunData]. +message WriteTensorboardRunDataRequest { + // Required. The resource name of the TensorboardRun to write data to. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + string tensorboard_run = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardRun" + } + ]; + + // Required. The TensorboardTimeSeries data to write. + // Values with in a time series are indexed by their step value. + // Repeated writes to the same step will overwrite the existing value for that + // step. + // The upper limit of data points per write request is 5000. + repeated TimeSeriesData time_series_data = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [TensorboardService.WriteTensorboardRunData][google.cloud.aiplatform.v1.TensorboardService.WriteTensorboardRunData]. +message WriteTensorboardRunDataResponse { + +} + +// Request message for [TensorboardService.ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData]. +message ExportTensorboardTimeSeriesDataRequest { + // Required. The resource name of the TensorboardTimeSeries to export data from. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + string tensorboard_time_series = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardTimeSeries" + } + ]; + + // Exports the TensorboardTimeSeries' data that match the filter expression. + string filter = 2; + + // The maximum number of data points to return per page. + // The default page_size will be 1000. Values must be between 1 and 10000. + // Values above 10000 will be coerced to 10000. + int32 page_size = 3; + + // A page token, received from a previous + // [TensorboardService.ExportTensorboardTimeSeries][] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [TensorboardService.ExportTensorboardTimeSeries][] must + // match the call that provided the page token. + string page_token = 4; + + // Field to use to sort the TensorboardTimeSeries' data. + // By default, TensorboardTimeSeries' data will be returned in a pseudo random + // order. + string order_by = 5; +} + +// Response message for [TensorboardService.ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData]. +message ExportTensorboardTimeSeriesDataResponse { + // The returned time series data points. + repeated TimeSeriesDataPoint time_series_data_points = 1; + + // A token, which can be sent as + // [ExportTensorboardTimeSeriesRequest.page_token][] to retrieve the next + // page. If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Details of operations that perform create Tensorboard. +message CreateTensorboardOperationMetadata { + // Operation metadata for Tensorboard. + GenericOperationMetadata generic_metadata = 1; +} + +// Details of operations that perform update Tensorboard. +message UpdateTensorboardOperationMetadata { + // Operation metadata for Tensorboard. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto new file mode 100644 index 00000000..eff288e5 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto @@ -0,0 +1,106 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "TensorboardTimeSeriesProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// TensorboardTimeSeries maps to times series produced in training runs +message TensorboardTimeSeries { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/TensorboardTimeSeries" + pattern: "projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}" + }; + + // Describes metadata for a TensorboardTimeSeries. + message Metadata { + // Output only. Max step index of all data points within a TensorboardTimeSeries. + int64 max_step = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Max wall clock timestamp of all data points within a + // TensorboardTimeSeries. + google.protobuf.Timestamp max_wall_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The largest blob sequence length (number of blobs) of all data points in + // this time series, if its ValueType is BLOB_SEQUENCE. + int64 max_blob_sequence_length = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // An enum representing the value type of a TensorboardTimeSeries. + enum ValueType { + // The value type is unspecified. + VALUE_TYPE_UNSPECIFIED = 0; + + // Used for TensorboardTimeSeries that is a list of scalars. + // E.g. accuracy of a model over epochs/time. + SCALAR = 1; + + // Used for TensorboardTimeSeries that is a list of tensors. + // E.g. histograms of weights of layer in a model over epoch/time. + TENSOR = 2; + + // Used for TensorboardTimeSeries that is a list of blob sequences. + // E.g. set of sample images with labels over epochs/time. + BLOB_SEQUENCE = 3; + } + + // Output only. Name of the TensorboardTimeSeries. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. User provided name of this TensorboardTimeSeries. + // This value should be unique among all TensorboardTimeSeries resources + // belonging to the same TensorboardRun resource (parent resource). + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Description of this TensorboardTimeSeries. + string description = 3; + + // Required. Immutable. Type of TensorboardTimeSeries value. + ValueType value_type = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Timestamp when this TensorboardTimeSeries was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this TensorboardTimeSeries was last updated. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Used to perform a consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 7; + + // Immutable. Name of the plugin this time series pertain to. Such as Scalar, Tensor, + // Blob + string plugin_name = 8 [(google.api.field_behavior) = IMMUTABLE]; + + // Data of the current plugin, with the size limited to 65KB. + bytes plugin_data = 9; + + // Output only. Scalar, Tensor, or Blob metadata for this TensorboardTimeSeries. + Metadata metadata = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/training_pipeline.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/training_pipeline.proto new file mode 100644 index 00000000..0660f82e --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/training_pipeline.proto @@ -0,0 +1,388 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1/io.proto"; +import "google/cloud/aiplatform/v1/model.proto"; +import "google/cloud/aiplatform/v1/pipeline_state.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "TrainingPipelineProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// The TrainingPipeline orchestrates tasks associated with training a Model. It +// always executes the training task, and optionally may also +// export data from Vertex AI's Dataset which becomes the training input, +// [upload][google.cloud.aiplatform.v1.ModelService.UploadModel] the Model to Vertex AI, and evaluate the +// Model. +message TrainingPipeline { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/TrainingPipeline" + pattern: "projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}" + }; + + // Output only. Resource name of the TrainingPipeline. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The user-defined name of this TrainingPipeline. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Specifies Vertex AI owned input data that may be used for training the + // Model. The TrainingPipeline's [training_task_definition][google.cloud.aiplatform.v1.TrainingPipeline.training_task_definition] should make + // clear whether this config is used and if there are any special requirements + // on how it should be filled. If nothing about this config is mentioned in + // the [training_task_definition][google.cloud.aiplatform.v1.TrainingPipeline.training_task_definition], then it should be assumed that the + // TrainingPipeline does not depend on this configuration. + InputDataConfig input_data_config = 3; + + // Required. A Google Cloud Storage path to the YAML file that defines the training task + // which is responsible for producing the model artifact, and may also include + // additional auxiliary work. + // The definition files that can be used here are found in + // gs://google-cloud-aiplatform/schema/trainingjob/definition/. + // Note: The URI given on output will be immutable and probably different, + // including the URI scheme, than the one given on input. The output URI will + // point to a location where the user only has a read access. + string training_task_definition = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The training task's parameter(s), as specified in the + // [training_task_definition][google.cloud.aiplatform.v1.TrainingPipeline.training_task_definition]'s `inputs`. + google.protobuf.Value training_task_inputs = 5 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The metadata information as specified in the [training_task_definition][google.cloud.aiplatform.v1.TrainingPipeline.training_task_definition]'s + // `metadata`. This metadata is an auxiliary runtime and final information + // about the training task. While the pipeline is running this information is + // populated only at a best effort basis. Only present if the + // pipeline's [training_task_definition][google.cloud.aiplatform.v1.TrainingPipeline.training_task_definition] contains `metadata` object. + google.protobuf.Value training_task_metadata = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Describes the Model that may be uploaded (via [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel]) + // by this TrainingPipeline. The TrainingPipeline's + // [training_task_definition][google.cloud.aiplatform.v1.TrainingPipeline.training_task_definition] should make clear whether this Model + // description should be populated, and if there are any special requirements + // regarding how it should be filled. If nothing is mentioned in the + // [training_task_definition][google.cloud.aiplatform.v1.TrainingPipeline.training_task_definition], then it should be assumed that this field + // should not be filled and the training task either uploads the Model without + // a need of this information, or that training task does not support + // uploading a Model as part of the pipeline. + // When the Pipeline's state becomes `PIPELINE_STATE_SUCCEEDED` and + // the trained Model had been uploaded into Vertex AI, then the + // model_to_upload's resource [name][google.cloud.aiplatform.v1.Model.name] is populated. The Model + // is always uploaded into the Project and Location in which this pipeline + // is. + Model model_to_upload = 7; + + // Output only. The detailed state of the pipeline. + PipelineState state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Only populated when the pipeline's state is `PIPELINE_STATE_FAILED` or + // `PIPELINE_STATE_CANCELLED`. + google.rpc.Status error = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the TrainingPipeline was created. + google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the TrainingPipeline for the first time entered the + // `PIPELINE_STATE_RUNNING` state. + google.protobuf.Timestamp start_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the TrainingPipeline entered any of the following states: + // `PIPELINE_STATE_SUCCEEDED`, `PIPELINE_STATE_FAILED`, + // `PIPELINE_STATE_CANCELLED`. + google.protobuf.Timestamp end_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the TrainingPipeline was most recently updated. + google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize TrainingPipelines. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 15; + + // Customer-managed encryption key spec for a TrainingPipeline. If set, this + // TrainingPipeline will be secured by this key. + // + // Note: Model trained by this TrainingPipeline is also secured by this key if + // [model_to_upload][google.cloud.aiplatform.v1.TrainingPipeline.encryption_spec] is not set separately. + EncryptionSpec encryption_spec = 18; +} + +// Specifies Vertex AI owned input data to be used for training, and +// possibly evaluating, the Model. +message InputDataConfig { + // The instructions how the input data should be split between the + // training, validation and test sets. + // If no split type is provided, the [fraction_split][google.cloud.aiplatform.v1.InputDataConfig.fraction_split] is used by default. + oneof split { + // Split based on fractions defining the size of each set. + FractionSplit fraction_split = 2; + + // Split based on the provided filters for each set. + FilterSplit filter_split = 3; + + // Supported only for tabular Datasets. + // + // Split based on a predefined key. + PredefinedSplit predefined_split = 4; + + // Supported only for tabular Datasets. + // + // Split based on the timestamp of the input data pieces. + TimestampSplit timestamp_split = 5; + + // Supported only for tabular Datasets. + // + // Split based on the distribution of the specified column. + StratifiedSplit stratified_split = 12; + } + + // Only applicable to Custom and Hyperparameter Tuning TrainingPipelines. + // + // The destination of the training data to be written to. + // + // Supported destination file formats: + // * For non-tabular data: "jsonl". + // * For tabular data: "csv" and "bigquery". + // + // The following Vertex AI environment variables are passed to containers + // or python modules of the training task when this field is set: + // + // * AIP_DATA_FORMAT : Exported data format. + // * AIP_TRAINING_DATA_URI : Sharded exported training data uris. + // * AIP_VALIDATION_DATA_URI : Sharded exported validation data uris. + // * AIP_TEST_DATA_URI : Sharded exported test data uris. + oneof destination { + // The Cloud Storage location where the training data is to be + // written to. In the given directory a new directory is created with + // name: + // `dataset---` + // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. + // All training input data is written into that directory. + // + // The Vertex AI environment variables representing Cloud Storage + // data URIs are represented in the Cloud Storage wildcard + // format to support sharded data. e.g.: "gs://.../training-*.jsonl" + // + // * AIP_DATA_FORMAT = "jsonl" for non-tabular data, "csv" for tabular data + // * AIP_TRAINING_DATA_URI = + // "gcs_destination/dataset--- + * region_tag:aiplatform_v1_generated_DatasetService_GetDataset_async + */ + getDataset( + request?: protos.google.cloud.aiplatform.v1.IGetDatasetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IDataset, + protos.google.cloud.aiplatform.v1.IGetDatasetRequest|undefined, {}|undefined + ]>; + getDataset( + request: protos.google.cloud.aiplatform.v1.IGetDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IDataset, + protos.google.cloud.aiplatform.v1.IGetDatasetRequest|null|undefined, + {}|null|undefined>): void; + getDataset( + request: protos.google.cloud.aiplatform.v1.IGetDatasetRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IDataset, + protos.google.cloud.aiplatform.v1.IGetDatasetRequest|null|undefined, + {}|null|undefined>): void; + getDataset( + request?: protos.google.cloud.aiplatform.v1.IGetDatasetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IDataset, + protos.google.cloud.aiplatform.v1.IGetDatasetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IDataset, + protos.google.cloud.aiplatform.v1.IGetDatasetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IDataset, + protos.google.cloud.aiplatform.v1.IGetDatasetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getDataset(request, options, callback); + } +/** + * Updates a Dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.Dataset} request.dataset + * Required. The Dataset which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. + * Updatable fields: + * + * * `display_name` + * * `description` + * * `labels` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Dataset]{@link google.cloud.aiplatform.v1.Dataset}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_DatasetService_UpdateDataset_async + */ + updateDataset( + request?: protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IDataset, + protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest|undefined, {}|undefined + ]>; + updateDataset( + request: protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IDataset, + protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest|null|undefined, + {}|null|undefined>): void; + updateDataset( + request: protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IDataset, + protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest|null|undefined, + {}|null|undefined>): void; + updateDataset( + request?: protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IDataset, + protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IDataset, + protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IDataset, + protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'dataset.name': request.dataset!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateDataset(request, options, callback); + } +/** + * Gets an AnnotationSpec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the AnnotationSpec resource. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnnotationSpec]{@link google.cloud.aiplatform.v1.AnnotationSpec}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_DatasetService_GetAnnotationSpec_async + */ + getAnnotationSpec( + request?: protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IAnnotationSpec, + protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest|undefined, {}|undefined + ]>; + getAnnotationSpec( + request: protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IAnnotationSpec, + protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest|null|undefined, + {}|null|undefined>): void; + getAnnotationSpec( + request: protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IAnnotationSpec, + protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest|null|undefined, + {}|null|undefined>): void; + getAnnotationSpec( + request?: protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IAnnotationSpec, + protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IAnnotationSpec, + protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IAnnotationSpec, + protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getAnnotationSpec(request, options, callback); + } + +/** + * Creates a Dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the Dataset in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1.Dataset} request.dataset + * Required. The Dataset to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_DatasetService_CreateDataset_async + */ + createDataset( + request?: protos.google.cloud.aiplatform.v1.ICreateDatasetRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createDataset( + request: protos.google.cloud.aiplatform.v1.ICreateDatasetRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createDataset( + request: protos.google.cloud.aiplatform.v1.ICreateDatasetRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createDataset( + request?: protos.google.cloud.aiplatform.v1.ICreateDatasetRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createDataset(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createDataset()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_DatasetService_CreateDataset_async + */ + async checkCreateDatasetProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createDataset, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a Dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Dataset to delete. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_DatasetService_DeleteDataset_async + */ + deleteDataset( + request?: protos.google.cloud.aiplatform.v1.IDeleteDatasetRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteDataset( + request: protos.google.cloud.aiplatform.v1.IDeleteDatasetRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteDataset( + request: protos.google.cloud.aiplatform.v1.IDeleteDatasetRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteDataset( + request?: protos.google.cloud.aiplatform.v1.IDeleteDatasetRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteDataset(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteDataset()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_DatasetService_DeleteDataset_async + */ + async checkDeleteDatasetProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteDataset, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Imports data into a Dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Dataset resource. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}` + * @param {number[]} request.importConfigs + * Required. The desired input locations. The contents of all input locations will be + * imported in one batch. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_DatasetService_ImportData_async + */ + importData( + request?: protos.google.cloud.aiplatform.v1.IImportDataRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + importData( + request: protos.google.cloud.aiplatform.v1.IImportDataRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importData( + request: protos.google.cloud.aiplatform.v1.IImportDataRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importData( + request?: protos.google.cloud.aiplatform.v1.IImportDataRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.importData(request, options, callback); + } +/** + * Check the status of the long running operation returned by `importData()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_DatasetService_ImportData_async + */ + async checkImportDataProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.importData, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Exports data from a Dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Dataset resource. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}` + * @param {google.cloud.aiplatform.v1.ExportDataConfig} request.exportConfig + * Required. The desired output location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_DatasetService_ExportData_async + */ + exportData( + request?: protos.google.cloud.aiplatform.v1.IExportDataRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + exportData( + request: protos.google.cloud.aiplatform.v1.IExportDataRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportData( + request: protos.google.cloud.aiplatform.v1.IExportDataRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportData( + request?: protos.google.cloud.aiplatform.v1.IExportDataRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.exportData(request, options, callback); + } +/** + * Check the status of the long running operation returned by `exportData()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_DatasetService_ExportData_async + */ + async checkExportDataProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.exportData, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Datasets in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the Dataset's parent resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `display_name`: supports = and != + * * `metadata_schema_uri`: supports = and != + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `displayName="myDisplayName"` + * * `labels.myKey="myValue"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * * `display_name` + * * `create_time` + * * `update_time` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Dataset]{@link google.cloud.aiplatform.v1.Dataset}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDatasetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDatasets( + request?: protos.google.cloud.aiplatform.v1.IListDatasetsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IDataset[], + protos.google.cloud.aiplatform.v1.IListDatasetsRequest|null, + protos.google.cloud.aiplatform.v1.IListDatasetsResponse + ]>; + listDatasets( + request: protos.google.cloud.aiplatform.v1.IListDatasetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListDatasetsRequest, + protos.google.cloud.aiplatform.v1.IListDatasetsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IDataset>): void; + listDatasets( + request: protos.google.cloud.aiplatform.v1.IListDatasetsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListDatasetsRequest, + protos.google.cloud.aiplatform.v1.IListDatasetsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IDataset>): void; + listDatasets( + request?: protos.google.cloud.aiplatform.v1.IListDatasetsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListDatasetsRequest, + protos.google.cloud.aiplatform.v1.IListDatasetsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IDataset>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListDatasetsRequest, + protos.google.cloud.aiplatform.v1.IListDatasetsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IDataset>): + Promise<[ + protos.google.cloud.aiplatform.v1.IDataset[], + protos.google.cloud.aiplatform.v1.IListDatasetsRequest|null, + protos.google.cloud.aiplatform.v1.IListDatasetsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listDatasets(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the Dataset's parent resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `display_name`: supports = and != + * * `metadata_schema_uri`: supports = and != + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `displayName="myDisplayName"` + * * `labels.myKey="myValue"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * * `display_name` + * * `create_time` + * * `update_time` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Dataset]{@link google.cloud.aiplatform.v1.Dataset} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDatasetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDatasetsStream( + request?: protos.google.cloud.aiplatform.v1.IListDatasetsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDatasets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDatasets.createStream( + this.innerApiCalls.listDatasets as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDatasets`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the Dataset's parent resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `display_name`: supports = and != + * * `metadata_schema_uri`: supports = and != + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `displayName="myDisplayName"` + * * `labels.myKey="myValue"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * * `display_name` + * * `create_time` + * * `update_time` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Dataset]{@link google.cloud.aiplatform.v1.Dataset}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_DatasetService_ListDatasets_async + */ + listDatasetsAsync( + request?: protos.google.cloud.aiplatform.v1.IListDatasetsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDatasets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDatasets.asyncIterate( + this.innerApiCalls['listDatasets'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists DataItems in a Dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Dataset to list DataItems from. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [DataItem]{@link google.cloud.aiplatform.v1.DataItem}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDataItemsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDataItems( + request?: protos.google.cloud.aiplatform.v1.IListDataItemsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IDataItem[], + protos.google.cloud.aiplatform.v1.IListDataItemsRequest|null, + protos.google.cloud.aiplatform.v1.IListDataItemsResponse + ]>; + listDataItems( + request: protos.google.cloud.aiplatform.v1.IListDataItemsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListDataItemsRequest, + protos.google.cloud.aiplatform.v1.IListDataItemsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IDataItem>): void; + listDataItems( + request: protos.google.cloud.aiplatform.v1.IListDataItemsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListDataItemsRequest, + protos.google.cloud.aiplatform.v1.IListDataItemsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IDataItem>): void; + listDataItems( + request?: protos.google.cloud.aiplatform.v1.IListDataItemsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListDataItemsRequest, + protos.google.cloud.aiplatform.v1.IListDataItemsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IDataItem>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListDataItemsRequest, + protos.google.cloud.aiplatform.v1.IListDataItemsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IDataItem>): + Promise<[ + protos.google.cloud.aiplatform.v1.IDataItem[], + protos.google.cloud.aiplatform.v1.IListDataItemsRequest|null, + protos.google.cloud.aiplatform.v1.IListDataItemsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listDataItems(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Dataset to list DataItems from. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [DataItem]{@link google.cloud.aiplatform.v1.DataItem} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDataItemsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDataItemsStream( + request?: protos.google.cloud.aiplatform.v1.IListDataItemsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDataItems']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataItems.createStream( + this.innerApiCalls.listDataItems as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDataItems`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Dataset to list DataItems from. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [DataItem]{@link google.cloud.aiplatform.v1.DataItem}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_DatasetService_ListDataItems_async + */ + listDataItemsAsync( + request?: protos.google.cloud.aiplatform.v1.IListDataItemsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDataItems']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataItems.asyncIterate( + this.innerApiCalls['listDataItems'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists Annotations belongs to a dataitem + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the DataItem to list Annotations from. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Annotation]{@link google.cloud.aiplatform.v1.Annotation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAnnotationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAnnotations( + request?: protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IAnnotation[], + protos.google.cloud.aiplatform.v1.IListAnnotationsRequest|null, + protos.google.cloud.aiplatform.v1.IListAnnotationsResponse + ]>; + listAnnotations( + request: protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, + protos.google.cloud.aiplatform.v1.IListAnnotationsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IAnnotation>): void; + listAnnotations( + request: protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, + protos.google.cloud.aiplatform.v1.IListAnnotationsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IAnnotation>): void; + listAnnotations( + request?: protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, + protos.google.cloud.aiplatform.v1.IListAnnotationsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IAnnotation>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, + protos.google.cloud.aiplatform.v1.IListAnnotationsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IAnnotation>): + Promise<[ + protos.google.cloud.aiplatform.v1.IAnnotation[], + protos.google.cloud.aiplatform.v1.IListAnnotationsRequest|null, + protos.google.cloud.aiplatform.v1.IListAnnotationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listAnnotations(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the DataItem to list Annotations from. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Annotation]{@link google.cloud.aiplatform.v1.Annotation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAnnotationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAnnotationsStream( + request?: protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listAnnotations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAnnotations.createStream( + this.innerApiCalls.listAnnotations as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAnnotations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the DataItem to list Annotations from. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Annotation]{@link google.cloud.aiplatform.v1.Annotation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_DatasetService_ListAnnotations_async + */ + listAnnotationsAsync( + request?: protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listAnnotations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAnnotations.asyncIterate( + this.innerApiCalls['listAnnotations'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.datasetServiceStub && !this._terminated) { + return this.datasetServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/dataset_service_client_config.json b/owl-bot-staging/v1/src/v1/dataset_service_client_config.json new file mode 100644 index 00000000..2b8e5d85 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/dataset_service_client_config.json @@ -0,0 +1,66 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.DatasetService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateDataset": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDataset": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateDataset": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDatasets": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDataset": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ImportData": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportData": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDataItems": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAnnotationSpec": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAnnotations": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/dataset_service_proto_list.json b/owl-bot-staging/v1/src/v1/dataset_service_proto_list.json new file mode 100644 index 00000000..581a7346 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/dataset_service_proto_list.json @@ -0,0 +1,110 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1/src/v1/endpoint_service_client.ts b/owl-bot-staging/v1/src/v1/endpoint_service_client.ts new file mode 100644 index 00000000..4d7c1cb7 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/endpoint_service_client.ts @@ -0,0 +1,3161 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/endpoint_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './endpoint_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * A service for managing Vertex AI's Endpoints. + * @class + * @memberof v1 + */ +export class EndpointServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + endpointServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of EndpointServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof EndpointServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listEndpoints: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'endpoints') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const createEndpointResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.Endpoint') as gax.protobuf.Type; + const createEndpointMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.CreateEndpointOperationMetadata') as gax.protobuf.Type; + const deleteEndpointResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteEndpointMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + const deployModelResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeployModelResponse') as gax.protobuf.Type; + const deployModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeployModelOperationMetadata') as gax.protobuf.Type; + const undeployModelResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.UndeployModelResponse') as gax.protobuf.Type; + const undeployModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.UndeployModelOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createEndpoint: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createEndpointResponse.decode.bind(createEndpointResponse), + createEndpointMetadata.decode.bind(createEndpointMetadata)), + deleteEndpoint: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteEndpointResponse.decode.bind(deleteEndpointResponse), + deleteEndpointMetadata.decode.bind(deleteEndpointMetadata)), + deployModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deployModelResponse.decode.bind(deployModelResponse), + deployModelMetadata.decode.bind(deployModelMetadata)), + undeployModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeployModelResponse.decode.bind(undeployModelResponse), + undeployModelMetadata.decode.bind(undeployModelMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.EndpointService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.endpointServiceStub) { + return this.endpointServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.EndpointService. + this.endpointServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.EndpointService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.EndpointService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const endpointServiceStubMethods = + ['createEndpoint', 'getEndpoint', 'listEndpoints', 'updateEndpoint', 'deleteEndpoint', 'deployModel', 'undeployModel']; + for (const methodName of endpointServiceStubMethods) { + const callPromise = this.endpointServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.endpointServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets an Endpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Endpoint resource. + * Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Endpoint]{@link google.cloud.aiplatform.v1.Endpoint}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_EndpointService_GetEndpoint_async + */ + getEndpoint( + request?: protos.google.cloud.aiplatform.v1.IGetEndpointRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IEndpoint, + protos.google.cloud.aiplatform.v1.IGetEndpointRequest|undefined, {}|undefined + ]>; + getEndpoint( + request: protos.google.cloud.aiplatform.v1.IGetEndpointRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IEndpoint, + protos.google.cloud.aiplatform.v1.IGetEndpointRequest|null|undefined, + {}|null|undefined>): void; + getEndpoint( + request: protos.google.cloud.aiplatform.v1.IGetEndpointRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IEndpoint, + protos.google.cloud.aiplatform.v1.IGetEndpointRequest|null|undefined, + {}|null|undefined>): void; + getEndpoint( + request?: protos.google.cloud.aiplatform.v1.IGetEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IEndpoint, + protos.google.cloud.aiplatform.v1.IGetEndpointRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IEndpoint, + protos.google.cloud.aiplatform.v1.IGetEndpointRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IEndpoint, + protos.google.cloud.aiplatform.v1.IGetEndpointRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getEndpoint(request, options, callback); + } +/** + * Updates an Endpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.Endpoint} request.endpoint + * Required. The Endpoint which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. See {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Endpoint]{@link google.cloud.aiplatform.v1.Endpoint}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_EndpointService_UpdateEndpoint_async + */ + updateEndpoint( + request?: protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IEndpoint, + protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest|undefined, {}|undefined + ]>; + updateEndpoint( + request: protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IEndpoint, + protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest|null|undefined, + {}|null|undefined>): void; + updateEndpoint( + request: protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IEndpoint, + protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest|null|undefined, + {}|null|undefined>): void; + updateEndpoint( + request?: protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IEndpoint, + protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IEndpoint, + protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IEndpoint, + protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'endpoint.name': request.endpoint!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateEndpoint(request, options, callback); + } + +/** + * Creates an Endpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the Endpoint in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1.Endpoint} request.endpoint + * Required. The Endpoint to create. + * @param {string} request.endpointId + * Immutable. The ID to use for endpoint, which will become the final + * component of the endpoint resource name. + * If not provided, Vertex AI will generate a value for this ID. + * + * This value should be 1-10 characters, and valid characters are /[0-9]/. + * When using HTTP/JSON, this field is populated based on a query string + * argument, such as `?endpoint_id=12345`. This is the fallback for fields + * that are not included in either the URI or the body. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_EndpointService_CreateEndpoint_async + */ + createEndpoint( + request?: protos.google.cloud.aiplatform.v1.ICreateEndpointRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createEndpoint( + request: protos.google.cloud.aiplatform.v1.ICreateEndpointRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createEndpoint( + request: protos.google.cloud.aiplatform.v1.ICreateEndpointRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createEndpoint( + request?: protos.google.cloud.aiplatform.v1.ICreateEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createEndpoint(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createEndpoint()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_EndpointService_CreateEndpoint_async + */ + async checkCreateEndpointProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createEndpoint, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes an Endpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Endpoint resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_EndpointService_DeleteEndpoint_async + */ + deleteEndpoint( + request?: protos.google.cloud.aiplatform.v1.IDeleteEndpointRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteEndpoint( + request: protos.google.cloud.aiplatform.v1.IDeleteEndpointRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteEndpoint( + request: protos.google.cloud.aiplatform.v1.IDeleteEndpointRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteEndpoint( + request?: protos.google.cloud.aiplatform.v1.IDeleteEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteEndpoint(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteEndpoint()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_EndpointService_DeleteEndpoint_async + */ + async checkDeleteEndpointProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteEndpoint, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deploys a Model into this Endpoint, creating a DeployedModel within it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.endpoint + * Required. The name of the Endpoint resource into which to deploy a Model. + * Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {google.cloud.aiplatform.v1.DeployedModel} request.deployedModel + * Required. The DeployedModel to be created within the Endpoint. Note that + * {@link google.cloud.aiplatform.v1.Endpoint.traffic_split|Endpoint.traffic_split} must be updated for the DeployedModel to start + * receiving traffic, either as part of this call, or via + * {@link google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint|EndpointService.UpdateEndpoint}. + * @param {number[]} request.trafficSplit + * A map from a DeployedModel's ID to the percentage of this Endpoint's + * traffic that should be forwarded to that DeployedModel. + * + * If this field is non-empty, then the Endpoint's + * {@link google.cloud.aiplatform.v1.Endpoint.traffic_split|traffic_split} will be overwritten with it. + * To refer to the ID of the just being deployed Model, a "0" should be used, + * and the actual ID of the new DeployedModel will be filled in its place by + * this method. The traffic percentage values must add up to 100. + * + * If this field is empty, then the Endpoint's + * {@link google.cloud.aiplatform.v1.Endpoint.traffic_split|traffic_split} is not updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_EndpointService_DeployModel_async + */ + deployModel( + request?: protos.google.cloud.aiplatform.v1.IDeployModelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deployModel( + request: protos.google.cloud.aiplatform.v1.IDeployModelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deployModel( + request: protos.google.cloud.aiplatform.v1.IDeployModelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deployModel( + request?: protos.google.cloud.aiplatform.v1.IDeployModelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'endpoint': request.endpoint || '', + }); + this.initialize(); + return this.innerApiCalls.deployModel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deployModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_EndpointService_DeployModel_async + */ + async checkDeployModelProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deployModel, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Undeploys a Model from an Endpoint, removing a DeployedModel from it, and + * freeing all resources it's using. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.endpoint + * Required. The name of the Endpoint resource from which to undeploy a Model. + * Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {string} request.deployedModelId + * Required. The ID of the DeployedModel to be undeployed from the Endpoint. + * @param {number[]} request.trafficSplit + * If this field is provided, then the Endpoint's + * {@link google.cloud.aiplatform.v1.Endpoint.traffic_split|traffic_split} will be overwritten with it. If + * last DeployedModel is being undeployed from the Endpoint, the + * [Endpoint.traffic_split] will always end up empty when this call returns. + * A DeployedModel will be successfully undeployed only if it doesn't have + * any traffic assigned to it when this method executes, or if this field + * unassigns any traffic to it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_EndpointService_UndeployModel_async + */ + undeployModel( + request?: protos.google.cloud.aiplatform.v1.IUndeployModelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + undeployModel( + request: protos.google.cloud.aiplatform.v1.IUndeployModelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeployModel( + request: protos.google.cloud.aiplatform.v1.IUndeployModelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeployModel( + request?: protos.google.cloud.aiplatform.v1.IUndeployModelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'endpoint': request.endpoint || '', + }); + this.initialize(); + return this.innerApiCalls.undeployModel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `undeployModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_EndpointService_UndeployModel_async + */ + async checkUndeployModelProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.undeployModel, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Endpoints in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the Endpoints. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID, + * i.e. the last segment of the Endpoint's {@link google.cloud.aiplatform.v1.Endpoint.name|resource name}. + * * `display_name` supports = and, != + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `endpoint=1` + * * `displayName="myDisplayName"` + * * `labels.myKey="myValue"` + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListEndpointsResponse.next_page_token|ListEndpointsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.EndpointService.ListEndpoints|EndpointService.ListEndpoints} call. + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * * `display_name` + * * `create_time` + * * `update_time` + * + * Example: `display_name, create_time desc`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Endpoint]{@link google.cloud.aiplatform.v1.Endpoint}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listEndpointsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listEndpoints( + request?: protos.google.cloud.aiplatform.v1.IListEndpointsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IEndpoint[], + protos.google.cloud.aiplatform.v1.IListEndpointsRequest|null, + protos.google.cloud.aiplatform.v1.IListEndpointsResponse + ]>; + listEndpoints( + request: protos.google.cloud.aiplatform.v1.IListEndpointsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListEndpointsRequest, + protos.google.cloud.aiplatform.v1.IListEndpointsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IEndpoint>): void; + listEndpoints( + request: protos.google.cloud.aiplatform.v1.IListEndpointsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListEndpointsRequest, + protos.google.cloud.aiplatform.v1.IListEndpointsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IEndpoint>): void; + listEndpoints( + request?: protos.google.cloud.aiplatform.v1.IListEndpointsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListEndpointsRequest, + protos.google.cloud.aiplatform.v1.IListEndpointsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IEndpoint>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListEndpointsRequest, + protos.google.cloud.aiplatform.v1.IListEndpointsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IEndpoint>): + Promise<[ + protos.google.cloud.aiplatform.v1.IEndpoint[], + protos.google.cloud.aiplatform.v1.IListEndpointsRequest|null, + protos.google.cloud.aiplatform.v1.IListEndpointsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listEndpoints(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the Endpoints. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID, + * i.e. the last segment of the Endpoint's {@link google.cloud.aiplatform.v1.Endpoint.name|resource name}. + * * `display_name` supports = and, != + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `endpoint=1` + * * `displayName="myDisplayName"` + * * `labels.myKey="myValue"` + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListEndpointsResponse.next_page_token|ListEndpointsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.EndpointService.ListEndpoints|EndpointService.ListEndpoints} call. + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * * `display_name` + * * `create_time` + * * `update_time` + * + * Example: `display_name, create_time desc`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Endpoint]{@link google.cloud.aiplatform.v1.Endpoint} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listEndpointsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listEndpointsStream( + request?: protos.google.cloud.aiplatform.v1.IListEndpointsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listEndpoints']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEndpoints.createStream( + this.innerApiCalls.listEndpoints as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listEndpoints`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the Endpoints. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID, + * i.e. the last segment of the Endpoint's {@link google.cloud.aiplatform.v1.Endpoint.name|resource name}. + * * `display_name` supports = and, != + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `endpoint=1` + * * `displayName="myDisplayName"` + * * `labels.myKey="myValue"` + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListEndpointsResponse.next_page_token|ListEndpointsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.EndpointService.ListEndpoints|EndpointService.ListEndpoints} call. + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * * `display_name` + * * `create_time` + * * `update_time` + * + * Example: `display_name, create_time desc`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Endpoint]{@link google.cloud.aiplatform.v1.Endpoint}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_EndpointService_ListEndpoints_async + */ + listEndpointsAsync( + request?: protos.google.cloud.aiplatform.v1.IListEndpointsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listEndpoints']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEndpoints.asyncIterate( + this.innerApiCalls['listEndpoints'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.endpointServiceStub && !this._terminated) { + return this.endpointServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/endpoint_service_client_config.json b/owl-bot-staging/v1/src/v1/endpoint_service_client_config.json new file mode 100644 index 00000000..0c101562 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/endpoint_service_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.EndpointService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateEndpoint": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetEndpoint": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListEndpoints": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateEndpoint": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteEndpoint": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeployModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeployModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/endpoint_service_proto_list.json b/owl-bot-staging/v1/src/v1/endpoint_service_proto_list.json new file mode 100644 index 00000000..581a7346 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/endpoint_service_proto_list.json @@ -0,0 +1,110 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_client.ts b/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_client.ts new file mode 100644 index 00000000..cf3b0b9c --- /dev/null +++ b/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_client.ts @@ -0,0 +1,2386 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, GoogleError} from 'google-gax'; + +import { PassThrough } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/featurestore_online_serving_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './featurestore_online_serving_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * A service for serving online feature values. + * @class + * @memberof v1 + */ +export class FeaturestoreOnlineServingServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + featurestoreOnlineServingServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of FeaturestoreOnlineServingServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof FeaturestoreOnlineServingServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + streamingReadFeatureValues: new this._gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.FeaturestoreOnlineServingService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.featurestoreOnlineServingServiceStub) { + return this.featurestoreOnlineServingServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.FeaturestoreOnlineServingService. + this.featurestoreOnlineServingServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.FeaturestoreOnlineServingService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.FeaturestoreOnlineServingService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const featurestoreOnlineServingServiceStubMethods = + ['readFeatureValues', 'streamingReadFeatureValues']; + for (const methodName of featurestoreOnlineServingServiceStubMethods) { + const callPromise = this.featurestoreOnlineServingServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough(); + setImmediate(() => { + stream.emit('error', new GoogleError('The client has already been closed.')); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.stream[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.featurestoreOnlineServingServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Reads Feature values of a specific entity of an EntityType. For reading + * feature values of multiple entities of an EntityType, please use + * StreamingReadFeatureValues. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.entityType + * Required. The resource name of the EntityType for the entity being read. + * 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`. + * @param {string} request.entityId + * Required. ID for a specific entity. For example, + * for a machine learning model predicting user clicks on a website, an entity + * ID could be `user_123`. + * @param {google.cloud.aiplatform.v1.FeatureSelector} request.featureSelector + * Required. Selector choosing Features of the target EntityType. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ReadFeatureValuesResponse]{@link google.cloud.aiplatform.v1.ReadFeatureValuesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreOnlineServingService_ReadFeatureValues_async + */ + readFeatureValues( + request?: protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IReadFeatureValuesResponse, + protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest|undefined, {}|undefined + ]>; + readFeatureValues( + request: protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IReadFeatureValuesResponse, + protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest|null|undefined, + {}|null|undefined>): void; + readFeatureValues( + request: protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IReadFeatureValuesResponse, + protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest|null|undefined, + {}|null|undefined>): void; + readFeatureValues( + request?: protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IReadFeatureValuesResponse, + protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IReadFeatureValuesResponse, + protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IReadFeatureValuesResponse, + protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'entity_type': request.entityType || '', + }); + this.initialize(); + return this.innerApiCalls.readFeatureValues(request, options, callback); + } + +/** + * Reads Feature values for multiple entities. Depending on their size, data + * for different entities may be broken + * up across multiple responses. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.entityType + * Required. The resource name of the entities' type. + * 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`. + * @param {string[]} request.entityIds + * Required. IDs of entities to read Feature values of. The maximum number of IDs is + * 100. For example, for a machine learning model predicting user clicks on a + * website, an entity ID could be `user_123`. + * @param {google.cloud.aiplatform.v1.FeatureSelector} request.featureSelector + * Required. Selector choosing Features of the target EntityType. Feature IDs will be + * deduplicated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits [ReadFeatureValuesResponse]{@link google.cloud.aiplatform.v1.ReadFeatureValuesResponse} on 'data' event. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreOnlineServingService_StreamingReadFeatureValues_async + */ + streamingReadFeatureValues( + request?: protos.google.cloud.aiplatform.v1.IStreamingReadFeatureValuesRequest, + options?: CallOptions): + gax.CancellableStream{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'entity_type': request.entityType || '', + }); + this.initialize(); + return this.innerApiCalls.streamingReadFeatureValues(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.featurestoreOnlineServingServiceStub && !this._terminated) { + return this.featurestoreOnlineServingServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_client_config.json b/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_client_config.json new file mode 100644 index 00000000..c60b6292 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_client_config.json @@ -0,0 +1,34 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.FeaturestoreOnlineServingService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ReadFeatureValues": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StreamingReadFeatureValues": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_proto_list.json b/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_proto_list.json new file mode 100644 index 00000000..581a7346 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_proto_list.json @@ -0,0 +1,110 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1/src/v1/featurestore_service_client.ts b/owl-bot-staging/v1/src/v1/featurestore_service_client.ts new file mode 100644 index 00000000..60fd3c74 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/featurestore_service_client.ts @@ -0,0 +1,5310 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/featurestore_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './featurestore_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * The service that handles CRUD and List for resources for Featurestore. + * @class + * @memberof v1 + */ +export class FeaturestoreServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + featurestoreServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of FeaturestoreServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof FeaturestoreServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listFeaturestores: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'featurestores'), + listEntityTypes: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'entityTypes'), + listFeatures: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'features'), + searchFeatures: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'features') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const createFeaturestoreResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.Featurestore') as gax.protobuf.Type; + const createFeaturestoreMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.CreateFeaturestoreOperationMetadata') as gax.protobuf.Type; + const updateFeaturestoreResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.Featurestore') as gax.protobuf.Type; + const updateFeaturestoreMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.UpdateFeaturestoreOperationMetadata') as gax.protobuf.Type; + const deleteFeaturestoreResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteFeaturestoreMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + const createEntityTypeResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.EntityType') as gax.protobuf.Type; + const createEntityTypeMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.CreateEntityTypeOperationMetadata') as gax.protobuf.Type; + const deleteEntityTypeResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteEntityTypeMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + const createFeatureResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.Feature') as gax.protobuf.Type; + const createFeatureMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.CreateFeatureOperationMetadata') as gax.protobuf.Type; + const batchCreateFeaturesResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.BatchCreateFeaturesResponse') as gax.protobuf.Type; + const batchCreateFeaturesMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.BatchCreateFeaturesOperationMetadata') as gax.protobuf.Type; + const deleteFeatureResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteFeatureMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + const importFeatureValuesResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.ImportFeatureValuesResponse') as gax.protobuf.Type; + const importFeatureValuesMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.ImportFeatureValuesOperationMetadata') as gax.protobuf.Type; + const batchReadFeatureValuesResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.BatchReadFeatureValuesResponse') as gax.protobuf.Type; + const batchReadFeatureValuesMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.BatchReadFeatureValuesOperationMetadata') as gax.protobuf.Type; + const exportFeatureValuesResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.ExportFeatureValuesResponse') as gax.protobuf.Type; + const exportFeatureValuesMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.ExportFeatureValuesOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createFeaturestore: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createFeaturestoreResponse.decode.bind(createFeaturestoreResponse), + createFeaturestoreMetadata.decode.bind(createFeaturestoreMetadata)), + updateFeaturestore: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateFeaturestoreResponse.decode.bind(updateFeaturestoreResponse), + updateFeaturestoreMetadata.decode.bind(updateFeaturestoreMetadata)), + deleteFeaturestore: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteFeaturestoreResponse.decode.bind(deleteFeaturestoreResponse), + deleteFeaturestoreMetadata.decode.bind(deleteFeaturestoreMetadata)), + createEntityType: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createEntityTypeResponse.decode.bind(createEntityTypeResponse), + createEntityTypeMetadata.decode.bind(createEntityTypeMetadata)), + deleteEntityType: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteEntityTypeResponse.decode.bind(deleteEntityTypeResponse), + deleteEntityTypeMetadata.decode.bind(deleteEntityTypeMetadata)), + createFeature: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createFeatureResponse.decode.bind(createFeatureResponse), + createFeatureMetadata.decode.bind(createFeatureMetadata)), + batchCreateFeatures: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchCreateFeaturesResponse.decode.bind(batchCreateFeaturesResponse), + batchCreateFeaturesMetadata.decode.bind(batchCreateFeaturesMetadata)), + deleteFeature: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteFeatureResponse.decode.bind(deleteFeatureResponse), + deleteFeatureMetadata.decode.bind(deleteFeatureMetadata)), + importFeatureValues: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importFeatureValuesResponse.decode.bind(importFeatureValuesResponse), + importFeatureValuesMetadata.decode.bind(importFeatureValuesMetadata)), + batchReadFeatureValues: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchReadFeatureValuesResponse.decode.bind(batchReadFeatureValuesResponse), + batchReadFeatureValuesMetadata.decode.bind(batchReadFeatureValuesMetadata)), + exportFeatureValues: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportFeatureValuesResponse.decode.bind(exportFeatureValuesResponse), + exportFeatureValuesMetadata.decode.bind(exportFeatureValuesMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.FeaturestoreService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.featurestoreServiceStub) { + return this.featurestoreServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.FeaturestoreService. + this.featurestoreServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.FeaturestoreService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.FeaturestoreService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const featurestoreServiceStubMethods = + ['createFeaturestore', 'getFeaturestore', 'listFeaturestores', 'updateFeaturestore', 'deleteFeaturestore', 'createEntityType', 'getEntityType', 'listEntityTypes', 'updateEntityType', 'deleteEntityType', 'createFeature', 'batchCreateFeatures', 'getFeature', 'listFeatures', 'updateFeature', 'deleteFeature', 'importFeatureValues', 'batchReadFeatureValues', 'exportFeatureValues', 'searchFeatures']; + for (const methodName of featurestoreServiceStubMethods) { + const callPromise = this.featurestoreServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.featurestoreServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets details of a single Featurestore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Featurestore resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Featurestore]{@link google.cloud.aiplatform.v1.Featurestore}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_GetFeaturestore_async + */ + getFeaturestore( + request?: protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IFeaturestore, + protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest|undefined, {}|undefined + ]>; + getFeaturestore( + request: protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IFeaturestore, + protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest|null|undefined, + {}|null|undefined>): void; + getFeaturestore( + request: protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IFeaturestore, + protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest|null|undefined, + {}|null|undefined>): void; + getFeaturestore( + request?: protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IFeaturestore, + protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IFeaturestore, + protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IFeaturestore, + protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getFeaturestore(request, options, callback); + } +/** + * Gets details of a single EntityType. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the EntityType resource. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [EntityType]{@link google.cloud.aiplatform.v1.EntityType}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_GetEntityType_async + */ + getEntityType( + request?: protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IEntityType, + protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest|undefined, {}|undefined + ]>; + getEntityType( + request: protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IEntityType, + protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest|null|undefined, + {}|null|undefined>): void; + getEntityType( + request: protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IEntityType, + protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest|null|undefined, + {}|null|undefined>): void; + getEntityType( + request?: protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IEntityType, + protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IEntityType, + protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IEntityType, + protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getEntityType(request, options, callback); + } +/** + * Updates the parameters of a single EntityType. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.EntityType} request.entityType + * Required. The EntityType's `name` field is used to identify the EntityType to be + * updated. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields to be overwritten in the + * EntityType resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then only the non-empty fields present in the + * request will be overwritten. Set the update_mask to `*` to override all + * fields. + * + * Updatable fields: + * + * * `description` + * * `labels` + * * `monitoring_config.snapshot_analysis.disabled` + * * `monitoring_config.snapshot_analysis.monitoring_interval_days` + * * `monitoring_config.snapshot_analysis.staleness_days` + * * `monitoring_config.import_features_analysis.state` + * * `monitoring_config.import_features_analysis.anomaly_detection_baseline` + * * `monitoring_config.numerical_threshold_config.value` + * * `monitoring_config.categorical_threshold_config.value` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [EntityType]{@link google.cloud.aiplatform.v1.EntityType}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_UpdateEntityType_async + */ + updateEntityType( + request?: protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IEntityType, + protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest|undefined, {}|undefined + ]>; + updateEntityType( + request: protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IEntityType, + protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest|null|undefined, + {}|null|undefined>): void; + updateEntityType( + request: protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IEntityType, + protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest|null|undefined, + {}|null|undefined>): void; + updateEntityType( + request?: protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IEntityType, + protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IEntityType, + protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IEntityType, + protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'entity_type.name': request.entityType!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateEntityType(request, options, callback); + } +/** + * Gets details of a single Feature. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Feature resource. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Feature]{@link google.cloud.aiplatform.v1.Feature}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_GetFeature_async + */ + getFeature( + request?: protos.google.cloud.aiplatform.v1.IGetFeatureRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IFeature, + protos.google.cloud.aiplatform.v1.IGetFeatureRequest|undefined, {}|undefined + ]>; + getFeature( + request: protos.google.cloud.aiplatform.v1.IGetFeatureRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IFeature, + protos.google.cloud.aiplatform.v1.IGetFeatureRequest|null|undefined, + {}|null|undefined>): void; + getFeature( + request: protos.google.cloud.aiplatform.v1.IGetFeatureRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IFeature, + protos.google.cloud.aiplatform.v1.IGetFeatureRequest|null|undefined, + {}|null|undefined>): void; + getFeature( + request?: protos.google.cloud.aiplatform.v1.IGetFeatureRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IFeature, + protos.google.cloud.aiplatform.v1.IGetFeatureRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IFeature, + protos.google.cloud.aiplatform.v1.IGetFeatureRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IFeature, + protos.google.cloud.aiplatform.v1.IGetFeatureRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getFeature(request, options, callback); + } +/** + * Updates the parameters of a single Feature. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.Feature} request.feature + * Required. The Feature's `name` field is used to identify the Feature to be + * updated. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields to be overwritten in the + * Features resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then only the non-empty fields present in the + * request will be overwritten. Set the update_mask to `*` to override all + * fields. + * + * Updatable fields: + * + * * `description` + * * `labels` + * * `disable_monitoring` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Feature]{@link google.cloud.aiplatform.v1.Feature}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_UpdateFeature_async + */ + updateFeature( + request?: protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IFeature, + protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest|undefined, {}|undefined + ]>; + updateFeature( + request: protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IFeature, + protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest|null|undefined, + {}|null|undefined>): void; + updateFeature( + request: protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IFeature, + protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest|null|undefined, + {}|null|undefined>): void; + updateFeature( + request?: protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IFeature, + protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IFeature, + protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IFeature, + protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'feature.name': request.feature!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateFeature(request, options, callback); + } + +/** + * Creates a new Featurestore in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create Featurestores. + * Format: + * `projects/{project}/locations/{location}'` + * @param {google.cloud.aiplatform.v1.Featurestore} request.featurestore + * Required. The Featurestore to create. + * @param {string} request.featurestoreId + * Required. The ID to use for this Featurestore, which will become the final component + * of the Featurestore's resource name. + * + * This value may be up to 60 characters, and valid characters are + * `[a-z0-9_]`. The first character cannot be a number. + * + * The value must be unique within the project and location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_CreateFeaturestore_async + */ + createFeaturestore( + request?: protos.google.cloud.aiplatform.v1.ICreateFeaturestoreRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createFeaturestore( + request: protos.google.cloud.aiplatform.v1.ICreateFeaturestoreRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createFeaturestore( + request: protos.google.cloud.aiplatform.v1.ICreateFeaturestoreRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createFeaturestore( + request?: protos.google.cloud.aiplatform.v1.ICreateFeaturestoreRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createFeaturestore(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createFeaturestore()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_CreateFeaturestore_async + */ + async checkCreateFeaturestoreProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createFeaturestore, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single Featurestore. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.Featurestore} request.featurestore + * Required. The Featurestore's `name` field is used to identify the Featurestore to be + * updated. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}` + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields to be overwritten in the + * Featurestore resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then only the non-empty fields present in the + * request will be overwritten. Set the update_mask to `*` to override all + * fields. + * + * Updatable fields: + * + * * `labels` + * * `online_serving_config.fixed_node_count` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_UpdateFeaturestore_async + */ + updateFeaturestore( + request?: protos.google.cloud.aiplatform.v1.IUpdateFeaturestoreRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateFeaturestore( + request: protos.google.cloud.aiplatform.v1.IUpdateFeaturestoreRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateFeaturestore( + request: protos.google.cloud.aiplatform.v1.IUpdateFeaturestoreRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateFeaturestore( + request?: protos.google.cloud.aiplatform.v1.IUpdateFeaturestoreRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'featurestore.name': request.featurestore!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateFeaturestore(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateFeaturestore()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_UpdateFeaturestore_async + */ + async checkUpdateFeaturestoreProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateFeaturestore, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single Featurestore. The Featurestore must not contain any + * EntityTypes or `force` must be set to true for the request to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Featurestore to be deleted. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}` + * @param {boolean} request.force + * If set to true, any EntityTypes and Features for this Featurestore will + * also be deleted. (Otherwise, the request will only work if the Featurestore + * has no EntityTypes.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_DeleteFeaturestore_async + */ + deleteFeaturestore( + request?: protos.google.cloud.aiplatform.v1.IDeleteFeaturestoreRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteFeaturestore( + request: protos.google.cloud.aiplatform.v1.IDeleteFeaturestoreRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteFeaturestore( + request: protos.google.cloud.aiplatform.v1.IDeleteFeaturestoreRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteFeaturestore( + request?: protos.google.cloud.aiplatform.v1.IDeleteFeaturestoreRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteFeaturestore(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteFeaturestore()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_DeleteFeaturestore_async + */ + async checkDeleteFeaturestoreProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteFeaturestore, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new EntityType in a given Featurestore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Featurestore to create EntityTypes. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}` + * @param {google.cloud.aiplatform.v1.EntityType} request.entityType + * The EntityType to create. + * @param {string} request.entityTypeId + * Required. The ID to use for the EntityType, which will become the final component of + * the EntityType's resource name. + * + * This value may be up to 60 characters, and valid characters are + * `[a-z0-9_]`. The first character cannot be a number. + * + * The value must be unique within a featurestore. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_CreateEntityType_async + */ + createEntityType( + request?: protos.google.cloud.aiplatform.v1.ICreateEntityTypeRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createEntityType( + request: protos.google.cloud.aiplatform.v1.ICreateEntityTypeRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createEntityType( + request: protos.google.cloud.aiplatform.v1.ICreateEntityTypeRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createEntityType( + request?: protos.google.cloud.aiplatform.v1.ICreateEntityTypeRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createEntityType(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createEntityType()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_CreateEntityType_async + */ + async checkCreateEntityTypeProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createEntityType, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single EntityType. The EntityType must not have any Features + * or `force` must be set to true for the request to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the EntityType to be deleted. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {boolean} request.force + * If set to true, any Features for this EntityType will also be deleted. + * (Otherwise, the request will only work if the EntityType has no Features.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_DeleteEntityType_async + */ + deleteEntityType( + request?: protos.google.cloud.aiplatform.v1.IDeleteEntityTypeRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteEntityType( + request: protos.google.cloud.aiplatform.v1.IDeleteEntityTypeRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteEntityType( + request: protos.google.cloud.aiplatform.v1.IDeleteEntityTypeRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteEntityType( + request?: protos.google.cloud.aiplatform.v1.IDeleteEntityTypeRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteEntityType(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteEntityType()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_DeleteEntityType_async + */ + async checkDeleteEntityTypeProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteEntityType, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new Feature in a given EntityType. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the EntityType to create a Feature. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {google.cloud.aiplatform.v1.Feature} request.feature + * Required. The Feature to create. + * @param {string} request.featureId + * Required. The ID to use for the Feature, which will become the final component of + * the Feature's resource name. + * + * This value may be up to 60 characters, and valid characters are + * `[a-z0-9_]`. The first character cannot be a number. + * + * The value must be unique within an EntityType. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_CreateFeature_async + */ + createFeature( + request?: protos.google.cloud.aiplatform.v1.ICreateFeatureRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createFeature( + request: protos.google.cloud.aiplatform.v1.ICreateFeatureRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createFeature( + request: protos.google.cloud.aiplatform.v1.ICreateFeatureRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createFeature( + request?: protos.google.cloud.aiplatform.v1.ICreateFeatureRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createFeature(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createFeature()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_CreateFeature_async + */ + async checkCreateFeatureProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createFeature, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a batch of Features in a given EntityType. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the EntityType to create the batch of Features under. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {number[]} request.requests + * Required. The request message specifying the Features to create. All Features must be + * created under the same parent EntityType. The `parent` field in each child + * request message can be omitted. If `parent` is set in a child request, then + * the value must match the `parent` value in this request message. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_BatchCreateFeatures_async + */ + batchCreateFeatures( + request?: protos.google.cloud.aiplatform.v1.IBatchCreateFeaturesRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + batchCreateFeatures( + request: protos.google.cloud.aiplatform.v1.IBatchCreateFeaturesRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchCreateFeatures( + request: protos.google.cloud.aiplatform.v1.IBatchCreateFeaturesRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchCreateFeatures( + request?: protos.google.cloud.aiplatform.v1.IBatchCreateFeaturesRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.batchCreateFeatures(request, options, callback); + } +/** + * Check the status of the long running operation returned by `batchCreateFeatures()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_BatchCreateFeatures_async + */ + async checkBatchCreateFeaturesProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.batchCreateFeatures, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single Feature. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Features to be deleted. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_DeleteFeature_async + */ + deleteFeature( + request?: protos.google.cloud.aiplatform.v1.IDeleteFeatureRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteFeature( + request: protos.google.cloud.aiplatform.v1.IDeleteFeatureRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteFeature( + request: protos.google.cloud.aiplatform.v1.IDeleteFeatureRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteFeature( + request?: protos.google.cloud.aiplatform.v1.IDeleteFeatureRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteFeature(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteFeature()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_DeleteFeature_async + */ + async checkDeleteFeatureProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteFeature, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Imports Feature values into the Featurestore from a source storage. + * + * The progress of the import is tracked by the returned operation. The + * imported features are guaranteed to be visible to subsequent read + * operations after the operation is marked as successfully done. + * + * If an import operation fails, the Feature values returned from + * reads and exports may be inconsistent. If consistency is + * required, the caller must retry the same import request again and wait till + * the new operation returned is marked as successfully done. + * + * There are also scenarios where the caller can cause inconsistency. + * + * - Source data for import contains multiple distinct Feature values for + * the same entity ID and timestamp. + * - Source is modified during an import. This includes adding, updating, or + * removing source data and/or metadata. Examples of updating metadata + * include but are not limited to changing storage location, storage class, + * or retention policy. + * - Online serving cluster is under-provisioned. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.AvroSource} request.avroSource + * @param {google.cloud.aiplatform.v1.BigQuerySource} request.bigquerySource + * @param {google.cloud.aiplatform.v1.CsvSource} request.csvSource + * @param {string} request.featureTimeField + * Source column that holds the Feature timestamp for all Feature + * values in each entity. + * @param {google.protobuf.Timestamp} request.featureTime + * Single Feature timestamp for all entities being imported. The + * timestamp must not have higher than millisecond precision. + * @param {string} request.entityType + * Required. The resource name of the EntityType grouping the Features for which values + * are being imported. Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}` + * @param {string} request.entityIdField + * Source column that holds entity IDs. If not provided, entity IDs are + * extracted from the column named `entity_id`. + * @param {number[]} request.featureSpecs + * Required. Specifications defining which Feature values to import from the entity. The + * request fails if no feature_specs are provided, and having multiple + * feature_specs for one Feature is not allowed. + * @param {boolean} request.disableOnlineServing + * If set, data will not be imported for online serving. This + * is typically used for backfilling, where Feature generation timestamps are + * not in the timestamp range needed for online serving. + * @param {number} request.workerCount + * Specifies the number of workers that are used to write data to the + * Featurestore. Consider the online serving capacity that you require to + * achieve the desired import throughput without interfering with online + * serving. The value must be positive, and less than or equal to 100. + * If not set, defaults to using 1 worker. The low count ensures minimal + * impact on online serving performance. + * @param {boolean} request.disableIngestionAnalysis + * If true, API doesn't start ingestion analysis pipeline. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_ImportFeatureValues_async + */ + importFeatureValues( + request?: protos.google.cloud.aiplatform.v1.IImportFeatureValuesRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + importFeatureValues( + request: protos.google.cloud.aiplatform.v1.IImportFeatureValuesRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importFeatureValues( + request: protos.google.cloud.aiplatform.v1.IImportFeatureValuesRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importFeatureValues( + request?: protos.google.cloud.aiplatform.v1.IImportFeatureValuesRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'entity_type': request.entityType || '', + }); + this.initialize(); + return this.innerApiCalls.importFeatureValues(request, options, callback); + } +/** + * Check the status of the long running operation returned by `importFeatureValues()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_ImportFeatureValues_async + */ + async checkImportFeatureValuesProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.importFeatureValues, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Batch reads Feature values from a Featurestore. + * + * This API enables batch reading Feature values, where each read + * instance in the batch may read Feature values of entities from one or + * more EntityTypes. Point-in-time correctness is guaranteed for Feature + * values of each read instance as of each instance's read timestamp. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.CsvSource} request.csvReadInstances + * Each read instance consists of exactly one read timestamp and one or more + * entity IDs identifying entities of the corresponding EntityTypes whose + * Features are requested. + * + * Each output instance contains Feature values of requested entities + * concatenated together as of the read time. + * + * An example read instance may be `foo_entity_id, bar_entity_id, + * 2020-01-01T10:00:00.123Z`. + * + * An example output instance may be `foo_entity_id, bar_entity_id, + * 2020-01-01T10:00:00.123Z, foo_entity_feature1_value, + * bar_entity_feature2_value`. + * + * Timestamp in each read instance must be millisecond-aligned. + * + * `csv_read_instances` are read instances stored in a plain-text CSV file. + * The header should be: + * [ENTITY_TYPE_ID1], [ENTITY_TYPE_ID2], ..., timestamp + * + * The columns can be in any order. + * + * Values in the timestamp column must use the RFC 3339 format, e.g. + * `2012-07-30T10:43:17.123Z`. + * @param {google.cloud.aiplatform.v1.BigQuerySource} request.bigqueryReadInstances + * Similar to csv_read_instances, but from BigQuery source. + * @param {string} request.featurestore + * Required. The resource name of the Featurestore from which to query Feature values. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}` + * @param {google.cloud.aiplatform.v1.FeatureValueDestination} request.destination + * Required. Specifies output location and format. + * @param {number[]} request.passThroughFields + * When not empty, the specified fields in the *_read_instances source will be + * joined as-is in the output, in addition to those fields from the + * Featurestore Entity. + * + * For BigQuery source, the type of the pass-through values will be + * automatically inferred. For CSV source, the pass-through values will be + * passed as opaque bytes. + * @param {number[]} request.entityTypeSpecs + * Required. Specifies EntityType grouping Features to read values of and settings. + * Each EntityType referenced in + * [BatchReadFeatureValuesRequest.entity_type_specs] must have a column + * specifying entity IDs in the EntityType in + * {@link |BatchReadFeatureValuesRequest.request} . + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_BatchReadFeatureValues_async + */ + batchReadFeatureValues( + request?: protos.google.cloud.aiplatform.v1.IBatchReadFeatureValuesRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + batchReadFeatureValues( + request: protos.google.cloud.aiplatform.v1.IBatchReadFeatureValuesRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchReadFeatureValues( + request: protos.google.cloud.aiplatform.v1.IBatchReadFeatureValuesRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchReadFeatureValues( + request?: protos.google.cloud.aiplatform.v1.IBatchReadFeatureValuesRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'featurestore': request.featurestore || '', + }); + this.initialize(); + return this.innerApiCalls.batchReadFeatureValues(request, options, callback); + } +/** + * Check the status of the long running operation returned by `batchReadFeatureValues()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_BatchReadFeatureValues_async + */ + async checkBatchReadFeatureValuesProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.batchReadFeatureValues, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Exports Feature values from all the entities of a target EntityType. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.ExportFeatureValuesRequest.SnapshotExport} request.snapshotExport + * Exports the latest Feature values of all entities of the EntityType + * within a time range. + * @param {google.cloud.aiplatform.v1.ExportFeatureValuesRequest.FullExport} request.fullExport + * Exports all historical values of all entities of the EntityType within a + * time range + * @param {string} request.entityType + * Required. The resource name of the EntityType from which to export Feature values. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {google.cloud.aiplatform.v1.FeatureValueDestination} request.destination + * Required. Specifies destination location and format. + * @param {google.cloud.aiplatform.v1.FeatureSelector} request.featureSelector + * Required. Selects Features to export values of. + * @param {number[]} request.settings + * Per-Feature export settings. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_ExportFeatureValues_async + */ + exportFeatureValues( + request?: protos.google.cloud.aiplatform.v1.IExportFeatureValuesRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + exportFeatureValues( + request: protos.google.cloud.aiplatform.v1.IExportFeatureValuesRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportFeatureValues( + request: protos.google.cloud.aiplatform.v1.IExportFeatureValuesRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportFeatureValues( + request?: protos.google.cloud.aiplatform.v1.IExportFeatureValuesRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'entity_type': request.entityType || '', + }); + this.initialize(); + return this.innerApiCalls.exportFeatureValues(request, options, callback); + } +/** + * Check the status of the long running operation returned by `exportFeatureValues()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_ExportFeatureValues_async + */ + async checkExportFeatureValuesProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.exportFeatureValues, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Featurestores in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list Featurestores. + * Format: + * `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the featurestores that match the filter expression. The following + * fields are supported: + * + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be + * in RFC 3339 format. + * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be + * in RFC 3339 format. + * * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, + * `<=`, and `>=` comparisons. + * * `labels`: Supports key-value equality and key presence. + * + * Examples: + * + * * `create_time > "2020-01-01" OR update_time > "2020-01-01"` + * Featurestores created or updated after 2020-01-01. + * * `labels.env = "prod"` + * Featurestores with label "env" set to "prod". + * @param {number} request.pageSize + * The maximum number of Featurestores to return. The service may return fewer + * than this value. If unspecified, at most 100 Featurestores will be + * returned. The maximum value is 100; any value greater than 100 will be + * coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} must + * match the call that provided the page token. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported Fields: + * + * * `create_time` + * * `update_time` + * * `online_serving_config.fixed_node_count` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Featurestore]{@link google.cloud.aiplatform.v1.Featurestore}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listFeaturestoresAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listFeaturestores( + request?: protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IFeaturestore[], + protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest|null, + protos.google.cloud.aiplatform.v1.IListFeaturestoresResponse + ]>; + listFeaturestores( + request: protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, + protos.google.cloud.aiplatform.v1.IListFeaturestoresResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IFeaturestore>): void; + listFeaturestores( + request: protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, + protos.google.cloud.aiplatform.v1.IListFeaturestoresResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IFeaturestore>): void; + listFeaturestores( + request?: protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, + protos.google.cloud.aiplatform.v1.IListFeaturestoresResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IFeaturestore>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, + protos.google.cloud.aiplatform.v1.IListFeaturestoresResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IFeaturestore>): + Promise<[ + protos.google.cloud.aiplatform.v1.IFeaturestore[], + protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest|null, + protos.google.cloud.aiplatform.v1.IListFeaturestoresResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listFeaturestores(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list Featurestores. + * Format: + * `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the featurestores that match the filter expression. The following + * fields are supported: + * + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be + * in RFC 3339 format. + * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be + * in RFC 3339 format. + * * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, + * `<=`, and `>=` comparisons. + * * `labels`: Supports key-value equality and key presence. + * + * Examples: + * + * * `create_time > "2020-01-01" OR update_time > "2020-01-01"` + * Featurestores created or updated after 2020-01-01. + * * `labels.env = "prod"` + * Featurestores with label "env" set to "prod". + * @param {number} request.pageSize + * The maximum number of Featurestores to return. The service may return fewer + * than this value. If unspecified, at most 100 Featurestores will be + * returned. The maximum value is 100; any value greater than 100 will be + * coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} must + * match the call that provided the page token. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported Fields: + * + * * `create_time` + * * `update_time` + * * `online_serving_config.fixed_node_count` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Featurestore]{@link google.cloud.aiplatform.v1.Featurestore} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listFeaturestoresAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listFeaturestoresStream( + request?: protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listFeaturestores']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listFeaturestores.createStream( + this.innerApiCalls.listFeaturestores as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listFeaturestores`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list Featurestores. + * Format: + * `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the featurestores that match the filter expression. The following + * fields are supported: + * + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be + * in RFC 3339 format. + * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be + * in RFC 3339 format. + * * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, + * `<=`, and `>=` comparisons. + * * `labels`: Supports key-value equality and key presence. + * + * Examples: + * + * * `create_time > "2020-01-01" OR update_time > "2020-01-01"` + * Featurestores created or updated after 2020-01-01. + * * `labels.env = "prod"` + * Featurestores with label "env" set to "prod". + * @param {number} request.pageSize + * The maximum number of Featurestores to return. The service may return fewer + * than this value. If unspecified, at most 100 Featurestores will be + * returned. The maximum value is 100; any value greater than 100 will be + * coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} must + * match the call that provided the page token. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported Fields: + * + * * `create_time` + * * `update_time` + * * `online_serving_config.fixed_node_count` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Featurestore]{@link google.cloud.aiplatform.v1.Featurestore}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_ListFeaturestores_async + */ + listFeaturestoresAsync( + request?: protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listFeaturestores']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listFeaturestores.asyncIterate( + this.innerApiCalls['listFeaturestores'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists EntityTypes in a given Featurestore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Featurestore to list EntityTypes. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}` + * @param {string} request.filter + * Lists the EntityTypes that match the filter expression. The following + * filters are supported: + * + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + * Values must be in RFC 3339 format. + * * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + * Values must be in RFC 3339 format. + * * `labels`: Supports key-value equality as well as key presence. + * + * Examples: + * + * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + * or updated after 2020-01-31T15:30:00.000000Z. + * * `labels.active = yes AND labels.env = prod` --> EntityTypes having both + * (active: yes) and (env: prod) labels. + * * `labels.env: *` --> Any EntityType which has a label with 'env' as the + * key. + * @param {number} request.pageSize + * The maximum number of EntityTypes to return. The service may return fewer + * than this value. If unspecified, at most 1000 EntityTypes will be returned. + * The maximum value is 1000; any value greater than 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} must + * match the call that provided the page token. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * + * Supported fields: + * + * * `entity_type_id` + * * `create_time` + * * `update_time` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [EntityType]{@link google.cloud.aiplatform.v1.EntityType}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listEntityTypesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listEntityTypes( + request?: protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IEntityType[], + protos.google.cloud.aiplatform.v1.IListEntityTypesRequest|null, + protos.google.cloud.aiplatform.v1.IListEntityTypesResponse + ]>; + listEntityTypes( + request: protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, + protos.google.cloud.aiplatform.v1.IListEntityTypesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IEntityType>): void; + listEntityTypes( + request: protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, + protos.google.cloud.aiplatform.v1.IListEntityTypesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IEntityType>): void; + listEntityTypes( + request?: protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, + protos.google.cloud.aiplatform.v1.IListEntityTypesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IEntityType>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, + protos.google.cloud.aiplatform.v1.IListEntityTypesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IEntityType>): + Promise<[ + protos.google.cloud.aiplatform.v1.IEntityType[], + protos.google.cloud.aiplatform.v1.IListEntityTypesRequest|null, + protos.google.cloud.aiplatform.v1.IListEntityTypesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listEntityTypes(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Featurestore to list EntityTypes. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}` + * @param {string} request.filter + * Lists the EntityTypes that match the filter expression. The following + * filters are supported: + * + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + * Values must be in RFC 3339 format. + * * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + * Values must be in RFC 3339 format. + * * `labels`: Supports key-value equality as well as key presence. + * + * Examples: + * + * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + * or updated after 2020-01-31T15:30:00.000000Z. + * * `labels.active = yes AND labels.env = prod` --> EntityTypes having both + * (active: yes) and (env: prod) labels. + * * `labels.env: *` --> Any EntityType which has a label with 'env' as the + * key. + * @param {number} request.pageSize + * The maximum number of EntityTypes to return. The service may return fewer + * than this value. If unspecified, at most 1000 EntityTypes will be returned. + * The maximum value is 1000; any value greater than 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} must + * match the call that provided the page token. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * + * Supported fields: + * + * * `entity_type_id` + * * `create_time` + * * `update_time` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [EntityType]{@link google.cloud.aiplatform.v1.EntityType} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listEntityTypesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listEntityTypesStream( + request?: protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listEntityTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEntityTypes.createStream( + this.innerApiCalls.listEntityTypes as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listEntityTypes`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Featurestore to list EntityTypes. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}` + * @param {string} request.filter + * Lists the EntityTypes that match the filter expression. The following + * filters are supported: + * + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + * Values must be in RFC 3339 format. + * * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + * Values must be in RFC 3339 format. + * * `labels`: Supports key-value equality as well as key presence. + * + * Examples: + * + * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + * or updated after 2020-01-31T15:30:00.000000Z. + * * `labels.active = yes AND labels.env = prod` --> EntityTypes having both + * (active: yes) and (env: prod) labels. + * * `labels.env: *` --> Any EntityType which has a label with 'env' as the + * key. + * @param {number} request.pageSize + * The maximum number of EntityTypes to return. The service may return fewer + * than this value. If unspecified, at most 1000 EntityTypes will be returned. + * The maximum value is 1000; any value greater than 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} must + * match the call that provided the page token. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * + * Supported fields: + * + * * `entity_type_id` + * * `create_time` + * * `update_time` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [EntityType]{@link google.cloud.aiplatform.v1.EntityType}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_ListEntityTypes_async + */ + listEntityTypesAsync( + request?: protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listEntityTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEntityTypes.asyncIterate( + this.innerApiCalls['listEntityTypes'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists Features in a given EntityType. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list Features. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {string} request.filter + * Lists the Features that match the filter expression. The following + * filters are supported: + * + * * `value_type`: Supports = and != comparisons. + * * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + * be in RFC 3339 format. + * * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + * be in RFC 3339 format. + * * `labels`: Supports key-value equality as well as key presence. + * + * Examples: + * + * * `value_type = DOUBLE` --> Features whose type is DOUBLE. + * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + * or updated after 2020-01-31T15:30:00.000000Z. + * * `labels.active = yes AND labels.env = prod` --> Features having both + * (active: yes) and (env: prod) labels. + * * `labels.env: *` --> Any Feature which has a label with 'env' as the + * key. + * @param {number} request.pageSize + * The maximum number of Features to return. The service may return fewer + * than this value. If unspecified, at most 1000 Features will be returned. + * The maximum value is 1000; any value greater than 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} must + * match the call that provided the page token. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * + * * `feature_id` + * * `value_type` + * * `create_time` + * * `update_time` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {number} request.latestStatsCount + * If set, return the most recent {@link google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count} + * of stats for each Feature in response. Valid value is [0, 10]. If number of + * stats exists < {@link google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count}, return all + * existing stats. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Feature]{@link google.cloud.aiplatform.v1.Feature}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listFeaturesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listFeatures( + request?: protos.google.cloud.aiplatform.v1.IListFeaturesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IFeature[], + protos.google.cloud.aiplatform.v1.IListFeaturesRequest|null, + protos.google.cloud.aiplatform.v1.IListFeaturesResponse + ]>; + listFeatures( + request: protos.google.cloud.aiplatform.v1.IListFeaturesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListFeaturesRequest, + protos.google.cloud.aiplatform.v1.IListFeaturesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IFeature>): void; + listFeatures( + request: protos.google.cloud.aiplatform.v1.IListFeaturesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListFeaturesRequest, + protos.google.cloud.aiplatform.v1.IListFeaturesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IFeature>): void; + listFeatures( + request?: protos.google.cloud.aiplatform.v1.IListFeaturesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListFeaturesRequest, + protos.google.cloud.aiplatform.v1.IListFeaturesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IFeature>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListFeaturesRequest, + protos.google.cloud.aiplatform.v1.IListFeaturesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IFeature>): + Promise<[ + protos.google.cloud.aiplatform.v1.IFeature[], + protos.google.cloud.aiplatform.v1.IListFeaturesRequest|null, + protos.google.cloud.aiplatform.v1.IListFeaturesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listFeatures(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list Features. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {string} request.filter + * Lists the Features that match the filter expression. The following + * filters are supported: + * + * * `value_type`: Supports = and != comparisons. + * * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + * be in RFC 3339 format. + * * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + * be in RFC 3339 format. + * * `labels`: Supports key-value equality as well as key presence. + * + * Examples: + * + * * `value_type = DOUBLE` --> Features whose type is DOUBLE. + * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + * or updated after 2020-01-31T15:30:00.000000Z. + * * `labels.active = yes AND labels.env = prod` --> Features having both + * (active: yes) and (env: prod) labels. + * * `labels.env: *` --> Any Feature which has a label with 'env' as the + * key. + * @param {number} request.pageSize + * The maximum number of Features to return. The service may return fewer + * than this value. If unspecified, at most 1000 Features will be returned. + * The maximum value is 1000; any value greater than 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} must + * match the call that provided the page token. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * + * * `feature_id` + * * `value_type` + * * `create_time` + * * `update_time` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {number} request.latestStatsCount + * If set, return the most recent {@link google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count} + * of stats for each Feature in response. Valid value is [0, 10]. If number of + * stats exists < {@link google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count}, return all + * existing stats. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Feature]{@link google.cloud.aiplatform.v1.Feature} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listFeaturesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listFeaturesStream( + request?: protos.google.cloud.aiplatform.v1.IListFeaturesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listFeatures']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listFeatures.createStream( + this.innerApiCalls.listFeatures as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listFeatures`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list Features. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {string} request.filter + * Lists the Features that match the filter expression. The following + * filters are supported: + * + * * `value_type`: Supports = and != comparisons. + * * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + * be in RFC 3339 format. + * * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + * be in RFC 3339 format. + * * `labels`: Supports key-value equality as well as key presence. + * + * Examples: + * + * * `value_type = DOUBLE` --> Features whose type is DOUBLE. + * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + * or updated after 2020-01-31T15:30:00.000000Z. + * * `labels.active = yes AND labels.env = prod` --> Features having both + * (active: yes) and (env: prod) labels. + * * `labels.env: *` --> Any Feature which has a label with 'env' as the + * key. + * @param {number} request.pageSize + * The maximum number of Features to return. The service may return fewer + * than this value. If unspecified, at most 1000 Features will be returned. + * The maximum value is 1000; any value greater than 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} must + * match the call that provided the page token. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * + * * `feature_id` + * * `value_type` + * * `create_time` + * * `update_time` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {number} request.latestStatsCount + * If set, return the most recent {@link google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count} + * of stats for each Feature in response. Valid value is [0, 10]. If number of + * stats exists < {@link google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count}, return all + * existing stats. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Feature]{@link google.cloud.aiplatform.v1.Feature}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_ListFeatures_async + */ + listFeaturesAsync( + request?: protos.google.cloud.aiplatform.v1.IListFeaturesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listFeatures']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listFeatures.asyncIterate( + this.innerApiCalls['listFeatures'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Searches Features matching a query in a given project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.location + * Required. The resource name of the Location to search Features. + * Format: + * `projects/{project}/locations/{location}` + * @param {string} request.query + * Query string that is a conjunction of field-restricted queries and/or + * field-restricted filters. Field-restricted queries and filters can be + * combined using `AND` to form a conjunction. + * + * A field query is in the form FIELD:QUERY. This implicitly checks if QUERY + * exists as a substring within Feature's FIELD. The QUERY + * and the FIELD are converted to a sequence of words (i.e. tokens) for + * comparison. This is done by: + * + * * Removing leading/trailing whitespace and tokenizing the search value. + * Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore + * `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated + * as a wildcard that matches characters within a token. + * * Ignoring case. + * * Prepending an asterisk to the first and appending an asterisk to the + * last token in QUERY. + * + * A QUERY must be either a singular token or a phrase. A phrase is one or + * multiple words enclosed in double quotation marks ("). With phrases, the + * order of the words is important. Words in the phrase must be matching in + * order and consecutively. + * + * Supported FIELDs for field-restricted queries: + * + * * `feature_id` + * * `description` + * * `entity_type_id` + * + * Examples: + * + * * `feature_id: foo` --> Matches a Feature with ID containing the substring + * `foo` (eg. `foo`, `foofeature`, `barfoo`). + * * `feature_id: foo*feature` --> Matches a Feature with ID containing the + * substring `foo*feature` (eg. `foobarfeature`). + * * `feature_id: foo AND description: bar` --> Matches a Feature with ID + * containing the substring `foo` and description containing the substring + * `bar`. + * + * + * Besides field queries, the following exact-match filters are + * supported. The exact-match filters do not support wildcards. Unlike + * field-restricted queries, exact-match filters are case-sensitive. + * + * * `feature_id`: Supports = comparisons. + * * `description`: Supports = comparisons. Multi-token filters should be + * enclosed in quotes. + * * `entity_type_id`: Supports = comparisons. + * * `value_type`: Supports = and != comparisons. + * * `labels`: Supports key-value equality as well as key presence. + * * `featurestore_id`: Supports = comparisons. + * + * Examples: + * * `description = "foo bar"` --> Any Feature with description exactly equal + * to `foo bar` + * * `value_type = DOUBLE` --> Features whose type is DOUBLE. + * * `labels.active = yes AND labels.env = prod` --> Features having both + * (active: yes) and (env: prod) labels. + * * `labels.env: *` --> Any Feature which has a label with `env` as the + * key. + * @param {number} request.pageSize + * The maximum number of Features to return. The service may return fewer + * than this value. If unspecified, at most 100 Features will be returned. + * The maximum value is 100; any value greater than 100 will be coerced to + * 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures}, except `page_size`, must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Feature]{@link google.cloud.aiplatform.v1.Feature}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `searchFeaturesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchFeatures( + request?: protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IFeature[], + protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest|null, + protos.google.cloud.aiplatform.v1.ISearchFeaturesResponse + ]>; + searchFeatures( + request: protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, + protos.google.cloud.aiplatform.v1.ISearchFeaturesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IFeature>): void; + searchFeatures( + request: protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, + protos.google.cloud.aiplatform.v1.ISearchFeaturesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IFeature>): void; + searchFeatures( + request?: protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, + protos.google.cloud.aiplatform.v1.ISearchFeaturesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IFeature>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, + protos.google.cloud.aiplatform.v1.ISearchFeaturesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IFeature>): + Promise<[ + protos.google.cloud.aiplatform.v1.IFeature[], + protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest|null, + protos.google.cloud.aiplatform.v1.ISearchFeaturesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'location': request.location || '', + }); + this.initialize(); + return this.innerApiCalls.searchFeatures(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.location + * Required. The resource name of the Location to search Features. + * Format: + * `projects/{project}/locations/{location}` + * @param {string} request.query + * Query string that is a conjunction of field-restricted queries and/or + * field-restricted filters. Field-restricted queries and filters can be + * combined using `AND` to form a conjunction. + * + * A field query is in the form FIELD:QUERY. This implicitly checks if QUERY + * exists as a substring within Feature's FIELD. The QUERY + * and the FIELD are converted to a sequence of words (i.e. tokens) for + * comparison. This is done by: + * + * * Removing leading/trailing whitespace and tokenizing the search value. + * Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore + * `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated + * as a wildcard that matches characters within a token. + * * Ignoring case. + * * Prepending an asterisk to the first and appending an asterisk to the + * last token in QUERY. + * + * A QUERY must be either a singular token or a phrase. A phrase is one or + * multiple words enclosed in double quotation marks ("). With phrases, the + * order of the words is important. Words in the phrase must be matching in + * order and consecutively. + * + * Supported FIELDs for field-restricted queries: + * + * * `feature_id` + * * `description` + * * `entity_type_id` + * + * Examples: + * + * * `feature_id: foo` --> Matches a Feature with ID containing the substring + * `foo` (eg. `foo`, `foofeature`, `barfoo`). + * * `feature_id: foo*feature` --> Matches a Feature with ID containing the + * substring `foo*feature` (eg. `foobarfeature`). + * * `feature_id: foo AND description: bar` --> Matches a Feature with ID + * containing the substring `foo` and description containing the substring + * `bar`. + * + * + * Besides field queries, the following exact-match filters are + * supported. The exact-match filters do not support wildcards. Unlike + * field-restricted queries, exact-match filters are case-sensitive. + * + * * `feature_id`: Supports = comparisons. + * * `description`: Supports = comparisons. Multi-token filters should be + * enclosed in quotes. + * * `entity_type_id`: Supports = comparisons. + * * `value_type`: Supports = and != comparisons. + * * `labels`: Supports key-value equality as well as key presence. + * * `featurestore_id`: Supports = comparisons. + * + * Examples: + * * `description = "foo bar"` --> Any Feature with description exactly equal + * to `foo bar` + * * `value_type = DOUBLE` --> Features whose type is DOUBLE. + * * `labels.active = yes AND labels.env = prod` --> Features having both + * (active: yes) and (env: prod) labels. + * * `labels.env: *` --> Any Feature which has a label with `env` as the + * key. + * @param {number} request.pageSize + * The maximum number of Features to return. The service may return fewer + * than this value. If unspecified, at most 100 Features will be returned. + * The maximum value is 100; any value greater than 100 will be coerced to + * 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures}, except `page_size`, must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Feature]{@link google.cloud.aiplatform.v1.Feature} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `searchFeaturesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchFeaturesStream( + request?: protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'location': request.location || '', + }); + const defaultCallSettings = this._defaults['searchFeatures']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchFeatures.createStream( + this.innerApiCalls.searchFeatures as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchFeatures`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.location + * Required. The resource name of the Location to search Features. + * Format: + * `projects/{project}/locations/{location}` + * @param {string} request.query + * Query string that is a conjunction of field-restricted queries and/or + * field-restricted filters. Field-restricted queries and filters can be + * combined using `AND` to form a conjunction. + * + * A field query is in the form FIELD:QUERY. This implicitly checks if QUERY + * exists as a substring within Feature's FIELD. The QUERY + * and the FIELD are converted to a sequence of words (i.e. tokens) for + * comparison. This is done by: + * + * * Removing leading/trailing whitespace and tokenizing the search value. + * Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore + * `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated + * as a wildcard that matches characters within a token. + * * Ignoring case. + * * Prepending an asterisk to the first and appending an asterisk to the + * last token in QUERY. + * + * A QUERY must be either a singular token or a phrase. A phrase is one or + * multiple words enclosed in double quotation marks ("). With phrases, the + * order of the words is important. Words in the phrase must be matching in + * order and consecutively. + * + * Supported FIELDs for field-restricted queries: + * + * * `feature_id` + * * `description` + * * `entity_type_id` + * + * Examples: + * + * * `feature_id: foo` --> Matches a Feature with ID containing the substring + * `foo` (eg. `foo`, `foofeature`, `barfoo`). + * * `feature_id: foo*feature` --> Matches a Feature with ID containing the + * substring `foo*feature` (eg. `foobarfeature`). + * * `feature_id: foo AND description: bar` --> Matches a Feature with ID + * containing the substring `foo` and description containing the substring + * `bar`. + * + * + * Besides field queries, the following exact-match filters are + * supported. The exact-match filters do not support wildcards. Unlike + * field-restricted queries, exact-match filters are case-sensitive. + * + * * `feature_id`: Supports = comparisons. + * * `description`: Supports = comparisons. Multi-token filters should be + * enclosed in quotes. + * * `entity_type_id`: Supports = comparisons. + * * `value_type`: Supports = and != comparisons. + * * `labels`: Supports key-value equality as well as key presence. + * * `featurestore_id`: Supports = comparisons. + * + * Examples: + * * `description = "foo bar"` --> Any Feature with description exactly equal + * to `foo bar` + * * `value_type = DOUBLE` --> Features whose type is DOUBLE. + * * `labels.active = yes AND labels.env = prod` --> Features having both + * (active: yes) and (env: prod) labels. + * * `labels.env: *` --> Any Feature which has a label with `env` as the + * key. + * @param {number} request.pageSize + * The maximum number of Features to return. The service may return fewer + * than this value. If unspecified, at most 100 Features will be returned. + * The maximum value is 100; any value greater than 100 will be coerced to + * 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures}, except `page_size`, must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Feature]{@link google.cloud.aiplatform.v1.Feature}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_FeaturestoreService_SearchFeatures_async + */ + searchFeaturesAsync( + request?: protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'location': request.location || '', + }); + const defaultCallSettings = this._defaults['searchFeatures']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchFeatures.asyncIterate( + this.innerApiCalls['searchFeatures'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.featurestoreServiceStub && !this._terminated) { + return this.featurestoreServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/featurestore_service_client_config.json b/owl-bot-staging/v1/src/v1/featurestore_service_client_config.json new file mode 100644 index 00000000..c7fd6ba0 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/featurestore_service_client_config.json @@ -0,0 +1,106 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.FeaturestoreService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateFeaturestore": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetFeaturestore": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListFeaturestores": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateFeaturestore": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteFeaturestore": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateEntityType": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetEntityType": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListEntityTypes": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateEntityType": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteEntityType": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateFeature": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchCreateFeatures": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetFeature": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListFeatures": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateFeature": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteFeature": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ImportFeatureValues": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchReadFeatureValues": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportFeatureValues": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SearchFeatures": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/featurestore_service_proto_list.json b/owl-bot-staging/v1/src/v1/featurestore_service_proto_list.json new file mode 100644 index 00000000..581a7346 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/featurestore_service_proto_list.json @@ -0,0 +1,110 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1/src/v1/gapic_metadata.json b/owl-bot-staging/v1/src/v1/gapic_metadata.json new file mode 100644 index 00000000..8c7e4346 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/gapic_metadata.json @@ -0,0 +1,2199 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.aiplatform.v1", + "libraryPackage": "@google-cloud/aiplatform", + "services": { + "DatasetService": { + "clients": { + "grpc": { + "libraryClient": "DatasetServiceClient", + "rpcs": { + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + }, + "GetAnnotationSpec": { + "methods": [ + "getAnnotationSpec" + ] + }, + "CreateDataset": { + "methods": [ + "createDataset" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets", + "listDatasetsStream", + "listDatasetsAsync" + ] + }, + "ListDataItems": { + "methods": [ + "listDataItems", + "listDataItemsStream", + "listDataItemsAsync" + ] + }, + "ListAnnotations": { + "methods": [ + "listAnnotations", + "listAnnotationsStream", + "listAnnotationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DatasetServiceClient", + "rpcs": { + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + }, + "GetAnnotationSpec": { + "methods": [ + "getAnnotationSpec" + ] + }, + "CreateDataset": { + "methods": [ + "createDataset" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets", + "listDatasetsStream", + "listDatasetsAsync" + ] + }, + "ListDataItems": { + "methods": [ + "listDataItems", + "listDataItemsStream", + "listDataItemsAsync" + ] + }, + "ListAnnotations": { + "methods": [ + "listAnnotations", + "listAnnotationsStream", + "listAnnotationsAsync" + ] + } + } + } + } + }, + "EndpointService": { + "clients": { + "grpc": { + "libraryClient": "EndpointServiceClient", + "rpcs": { + "GetEndpoint": { + "methods": [ + "getEndpoint" + ] + }, + "UpdateEndpoint": { + "methods": [ + "updateEndpoint" + ] + }, + "CreateEndpoint": { + "methods": [ + "createEndpoint" + ] + }, + "DeleteEndpoint": { + "methods": [ + "deleteEndpoint" + ] + }, + "DeployModel": { + "methods": [ + "deployModel" + ] + }, + "UndeployModel": { + "methods": [ + "undeployModel" + ] + }, + "ListEndpoints": { + "methods": [ + "listEndpoints", + "listEndpointsStream", + "listEndpointsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "EndpointServiceClient", + "rpcs": { + "GetEndpoint": { + "methods": [ + "getEndpoint" + ] + }, + "UpdateEndpoint": { + "methods": [ + "updateEndpoint" + ] + }, + "CreateEndpoint": { + "methods": [ + "createEndpoint" + ] + }, + "DeleteEndpoint": { + "methods": [ + "deleteEndpoint" + ] + }, + "DeployModel": { + "methods": [ + "deployModel" + ] + }, + "UndeployModel": { + "methods": [ + "undeployModel" + ] + }, + "ListEndpoints": { + "methods": [ + "listEndpoints", + "listEndpointsStream", + "listEndpointsAsync" + ] + } + } + } + } + }, + "FeaturestoreOnlineServingService": { + "clients": { + "grpc": { + "libraryClient": "FeaturestoreOnlineServingServiceClient", + "rpcs": { + "ReadFeatureValues": { + "methods": [ + "readFeatureValues" + ] + }, + "StreamingReadFeatureValues": { + "methods": [ + "streamingReadFeatureValues" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "FeaturestoreOnlineServingServiceClient", + "rpcs": { + "ReadFeatureValues": { + "methods": [ + "readFeatureValues" + ] + } + } + } + } + }, + "FeaturestoreService": { + "clients": { + "grpc": { + "libraryClient": "FeaturestoreServiceClient", + "rpcs": { + "GetFeaturestore": { + "methods": [ + "getFeaturestore" + ] + }, + "GetEntityType": { + "methods": [ + "getEntityType" + ] + }, + "UpdateEntityType": { + "methods": [ + "updateEntityType" + ] + }, + "GetFeature": { + "methods": [ + "getFeature" + ] + }, + "UpdateFeature": { + "methods": [ + "updateFeature" + ] + }, + "CreateFeaturestore": { + "methods": [ + "createFeaturestore" + ] + }, + "UpdateFeaturestore": { + "methods": [ + "updateFeaturestore" + ] + }, + "DeleteFeaturestore": { + "methods": [ + "deleteFeaturestore" + ] + }, + "CreateEntityType": { + "methods": [ + "createEntityType" + ] + }, + "DeleteEntityType": { + "methods": [ + "deleteEntityType" + ] + }, + "CreateFeature": { + "methods": [ + "createFeature" + ] + }, + "BatchCreateFeatures": { + "methods": [ + "batchCreateFeatures" + ] + }, + "DeleteFeature": { + "methods": [ + "deleteFeature" + ] + }, + "ImportFeatureValues": { + "methods": [ + "importFeatureValues" + ] + }, + "BatchReadFeatureValues": { + "methods": [ + "batchReadFeatureValues" + ] + }, + "ExportFeatureValues": { + "methods": [ + "exportFeatureValues" + ] + }, + "ListFeaturestores": { + "methods": [ + "listFeaturestores", + "listFeaturestoresStream", + "listFeaturestoresAsync" + ] + }, + "ListEntityTypes": { + "methods": [ + "listEntityTypes", + "listEntityTypesStream", + "listEntityTypesAsync" + ] + }, + "ListFeatures": { + "methods": [ + "listFeatures", + "listFeaturesStream", + "listFeaturesAsync" + ] + }, + "SearchFeatures": { + "methods": [ + "searchFeatures", + "searchFeaturesStream", + "searchFeaturesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "FeaturestoreServiceClient", + "rpcs": { + "GetFeaturestore": { + "methods": [ + "getFeaturestore" + ] + }, + "GetEntityType": { + "methods": [ + "getEntityType" + ] + }, + "UpdateEntityType": { + "methods": [ + "updateEntityType" + ] + }, + "GetFeature": { + "methods": [ + "getFeature" + ] + }, + "UpdateFeature": { + "methods": [ + "updateFeature" + ] + }, + "CreateFeaturestore": { + "methods": [ + "createFeaturestore" + ] + }, + "UpdateFeaturestore": { + "methods": [ + "updateFeaturestore" + ] + }, + "DeleteFeaturestore": { + "methods": [ + "deleteFeaturestore" + ] + }, + "CreateEntityType": { + "methods": [ + "createEntityType" + ] + }, + "DeleteEntityType": { + "methods": [ + "deleteEntityType" + ] + }, + "CreateFeature": { + "methods": [ + "createFeature" + ] + }, + "BatchCreateFeatures": { + "methods": [ + "batchCreateFeatures" + ] + }, + "DeleteFeature": { + "methods": [ + "deleteFeature" + ] + }, + "ImportFeatureValues": { + "methods": [ + "importFeatureValues" + ] + }, + "BatchReadFeatureValues": { + "methods": [ + "batchReadFeatureValues" + ] + }, + "ExportFeatureValues": { + "methods": [ + "exportFeatureValues" + ] + }, + "ListFeaturestores": { + "methods": [ + "listFeaturestores", + "listFeaturestoresStream", + "listFeaturestoresAsync" + ] + }, + "ListEntityTypes": { + "methods": [ + "listEntityTypes", + "listEntityTypesStream", + "listEntityTypesAsync" + ] + }, + "ListFeatures": { + "methods": [ + "listFeatures", + "listFeaturesStream", + "listFeaturesAsync" + ] + }, + "SearchFeatures": { + "methods": [ + "searchFeatures", + "searchFeaturesStream", + "searchFeaturesAsync" + ] + } + } + } + } + }, + "IndexEndpointService": { + "clients": { + "grpc": { + "libraryClient": "IndexEndpointServiceClient", + "rpcs": { + "GetIndexEndpoint": { + "methods": [ + "getIndexEndpoint" + ] + }, + "UpdateIndexEndpoint": { + "methods": [ + "updateIndexEndpoint" + ] + }, + "CreateIndexEndpoint": { + "methods": [ + "createIndexEndpoint" + ] + }, + "DeleteIndexEndpoint": { + "methods": [ + "deleteIndexEndpoint" + ] + }, + "DeployIndex": { + "methods": [ + "deployIndex" + ] + }, + "UndeployIndex": { + "methods": [ + "undeployIndex" + ] + }, + "MutateDeployedIndex": { + "methods": [ + "mutateDeployedIndex" + ] + }, + "ListIndexEndpoints": { + "methods": [ + "listIndexEndpoints", + "listIndexEndpointsStream", + "listIndexEndpointsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "IndexEndpointServiceClient", + "rpcs": { + "GetIndexEndpoint": { + "methods": [ + "getIndexEndpoint" + ] + }, + "UpdateIndexEndpoint": { + "methods": [ + "updateIndexEndpoint" + ] + }, + "CreateIndexEndpoint": { + "methods": [ + "createIndexEndpoint" + ] + }, + "DeleteIndexEndpoint": { + "methods": [ + "deleteIndexEndpoint" + ] + }, + "DeployIndex": { + "methods": [ + "deployIndex" + ] + }, + "UndeployIndex": { + "methods": [ + "undeployIndex" + ] + }, + "MutateDeployedIndex": { + "methods": [ + "mutateDeployedIndex" + ] + }, + "ListIndexEndpoints": { + "methods": [ + "listIndexEndpoints", + "listIndexEndpointsStream", + "listIndexEndpointsAsync" + ] + } + } + } + } + }, + "IndexService": { + "clients": { + "grpc": { + "libraryClient": "IndexServiceClient", + "rpcs": { + "GetIndex": { + "methods": [ + "getIndex" + ] + }, + "CreateIndex": { + "methods": [ + "createIndex" + ] + }, + "UpdateIndex": { + "methods": [ + "updateIndex" + ] + }, + "DeleteIndex": { + "methods": [ + "deleteIndex" + ] + }, + "ListIndexes": { + "methods": [ + "listIndexes", + "listIndexesStream", + "listIndexesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "IndexServiceClient", + "rpcs": { + "GetIndex": { + "methods": [ + "getIndex" + ] + }, + "CreateIndex": { + "methods": [ + "createIndex" + ] + }, + "UpdateIndex": { + "methods": [ + "updateIndex" + ] + }, + "DeleteIndex": { + "methods": [ + "deleteIndex" + ] + }, + "ListIndexes": { + "methods": [ + "listIndexes", + "listIndexesStream", + "listIndexesAsync" + ] + } + } + } + } + }, + "JobService": { + "clients": { + "grpc": { + "libraryClient": "JobServiceClient", + "rpcs": { + "CreateCustomJob": { + "methods": [ + "createCustomJob" + ] + }, + "GetCustomJob": { + "methods": [ + "getCustomJob" + ] + }, + "CancelCustomJob": { + "methods": [ + "cancelCustomJob" + ] + }, + "CreateDataLabelingJob": { + "methods": [ + "createDataLabelingJob" + ] + }, + "GetDataLabelingJob": { + "methods": [ + "getDataLabelingJob" + ] + }, + "CancelDataLabelingJob": { + "methods": [ + "cancelDataLabelingJob" + ] + }, + "CreateHyperparameterTuningJob": { + "methods": [ + "createHyperparameterTuningJob" + ] + }, + "GetHyperparameterTuningJob": { + "methods": [ + "getHyperparameterTuningJob" + ] + }, + "CancelHyperparameterTuningJob": { + "methods": [ + "cancelHyperparameterTuningJob" + ] + }, + "CreateBatchPredictionJob": { + "methods": [ + "createBatchPredictionJob" + ] + }, + "GetBatchPredictionJob": { + "methods": [ + "getBatchPredictionJob" + ] + }, + "CancelBatchPredictionJob": { + "methods": [ + "cancelBatchPredictionJob" + ] + }, + "CreateModelDeploymentMonitoringJob": { + "methods": [ + "createModelDeploymentMonitoringJob" + ] + }, + "GetModelDeploymentMonitoringJob": { + "methods": [ + "getModelDeploymentMonitoringJob" + ] + }, + "PauseModelDeploymentMonitoringJob": { + "methods": [ + "pauseModelDeploymentMonitoringJob" + ] + }, + "ResumeModelDeploymentMonitoringJob": { + "methods": [ + "resumeModelDeploymentMonitoringJob" + ] + }, + "DeleteCustomJob": { + "methods": [ + "deleteCustomJob" + ] + }, + "DeleteDataLabelingJob": { + "methods": [ + "deleteDataLabelingJob" + ] + }, + "DeleteHyperparameterTuningJob": { + "methods": [ + "deleteHyperparameterTuningJob" + ] + }, + "DeleteBatchPredictionJob": { + "methods": [ + "deleteBatchPredictionJob" + ] + }, + "UpdateModelDeploymentMonitoringJob": { + "methods": [ + "updateModelDeploymentMonitoringJob" + ] + }, + "DeleteModelDeploymentMonitoringJob": { + "methods": [ + "deleteModelDeploymentMonitoringJob" + ] + }, + "ListCustomJobs": { + "methods": [ + "listCustomJobs", + "listCustomJobsStream", + "listCustomJobsAsync" + ] + }, + "ListDataLabelingJobs": { + "methods": [ + "listDataLabelingJobs", + "listDataLabelingJobsStream", + "listDataLabelingJobsAsync" + ] + }, + "ListHyperparameterTuningJobs": { + "methods": [ + "listHyperparameterTuningJobs", + "listHyperparameterTuningJobsStream", + "listHyperparameterTuningJobsAsync" + ] + }, + "ListBatchPredictionJobs": { + "methods": [ + "listBatchPredictionJobs", + "listBatchPredictionJobsStream", + "listBatchPredictionJobsAsync" + ] + }, + "SearchModelDeploymentMonitoringStatsAnomalies": { + "methods": [ + "searchModelDeploymentMonitoringStatsAnomalies", + "searchModelDeploymentMonitoringStatsAnomaliesStream", + "searchModelDeploymentMonitoringStatsAnomaliesAsync" + ] + }, + "ListModelDeploymentMonitoringJobs": { + "methods": [ + "listModelDeploymentMonitoringJobs", + "listModelDeploymentMonitoringJobsStream", + "listModelDeploymentMonitoringJobsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "JobServiceClient", + "rpcs": { + "CreateCustomJob": { + "methods": [ + "createCustomJob" + ] + }, + "GetCustomJob": { + "methods": [ + "getCustomJob" + ] + }, + "CancelCustomJob": { + "methods": [ + "cancelCustomJob" + ] + }, + "CreateDataLabelingJob": { + "methods": [ + "createDataLabelingJob" + ] + }, + "GetDataLabelingJob": { + "methods": [ + "getDataLabelingJob" + ] + }, + "CancelDataLabelingJob": { + "methods": [ + "cancelDataLabelingJob" + ] + }, + "CreateHyperparameterTuningJob": { + "methods": [ + "createHyperparameterTuningJob" + ] + }, + "GetHyperparameterTuningJob": { + "methods": [ + "getHyperparameterTuningJob" + ] + }, + "CancelHyperparameterTuningJob": { + "methods": [ + "cancelHyperparameterTuningJob" + ] + }, + "CreateBatchPredictionJob": { + "methods": [ + "createBatchPredictionJob" + ] + }, + "GetBatchPredictionJob": { + "methods": [ + "getBatchPredictionJob" + ] + }, + "CancelBatchPredictionJob": { + "methods": [ + "cancelBatchPredictionJob" + ] + }, + "CreateModelDeploymentMonitoringJob": { + "methods": [ + "createModelDeploymentMonitoringJob" + ] + }, + "GetModelDeploymentMonitoringJob": { + "methods": [ + "getModelDeploymentMonitoringJob" + ] + }, + "PauseModelDeploymentMonitoringJob": { + "methods": [ + "pauseModelDeploymentMonitoringJob" + ] + }, + "ResumeModelDeploymentMonitoringJob": { + "methods": [ + "resumeModelDeploymentMonitoringJob" + ] + }, + "DeleteCustomJob": { + "methods": [ + "deleteCustomJob" + ] + }, + "DeleteDataLabelingJob": { + "methods": [ + "deleteDataLabelingJob" + ] + }, + "DeleteHyperparameterTuningJob": { + "methods": [ + "deleteHyperparameterTuningJob" + ] + }, + "DeleteBatchPredictionJob": { + "methods": [ + "deleteBatchPredictionJob" + ] + }, + "UpdateModelDeploymentMonitoringJob": { + "methods": [ + "updateModelDeploymentMonitoringJob" + ] + }, + "DeleteModelDeploymentMonitoringJob": { + "methods": [ + "deleteModelDeploymentMonitoringJob" + ] + }, + "ListCustomJobs": { + "methods": [ + "listCustomJobs", + "listCustomJobsStream", + "listCustomJobsAsync" + ] + }, + "ListDataLabelingJobs": { + "methods": [ + "listDataLabelingJobs", + "listDataLabelingJobsStream", + "listDataLabelingJobsAsync" + ] + }, + "ListHyperparameterTuningJobs": { + "methods": [ + "listHyperparameterTuningJobs", + "listHyperparameterTuningJobsStream", + "listHyperparameterTuningJobsAsync" + ] + }, + "ListBatchPredictionJobs": { + "methods": [ + "listBatchPredictionJobs", + "listBatchPredictionJobsStream", + "listBatchPredictionJobsAsync" + ] + }, + "SearchModelDeploymentMonitoringStatsAnomalies": { + "methods": [ + "searchModelDeploymentMonitoringStatsAnomalies", + "searchModelDeploymentMonitoringStatsAnomaliesStream", + "searchModelDeploymentMonitoringStatsAnomaliesAsync" + ] + }, + "ListModelDeploymentMonitoringJobs": { + "methods": [ + "listModelDeploymentMonitoringJobs", + "listModelDeploymentMonitoringJobsStream", + "listModelDeploymentMonitoringJobsAsync" + ] + } + } + } + } + }, + "MetadataService": { + "clients": { + "grpc": { + "libraryClient": "MetadataServiceClient", + "rpcs": { + "GetMetadataStore": { + "methods": [ + "getMetadataStore" + ] + }, + "CreateArtifact": { + "methods": [ + "createArtifact" + ] + }, + "GetArtifact": { + "methods": [ + "getArtifact" + ] + }, + "UpdateArtifact": { + "methods": [ + "updateArtifact" + ] + }, + "CreateContext": { + "methods": [ + "createContext" + ] + }, + "GetContext": { + "methods": [ + "getContext" + ] + }, + "UpdateContext": { + "methods": [ + "updateContext" + ] + }, + "AddContextArtifactsAndExecutions": { + "methods": [ + "addContextArtifactsAndExecutions" + ] + }, + "AddContextChildren": { + "methods": [ + "addContextChildren" + ] + }, + "QueryContextLineageSubgraph": { + "methods": [ + "queryContextLineageSubgraph" + ] + }, + "CreateExecution": { + "methods": [ + "createExecution" + ] + }, + "GetExecution": { + "methods": [ + "getExecution" + ] + }, + "UpdateExecution": { + "methods": [ + "updateExecution" + ] + }, + "AddExecutionEvents": { + "methods": [ + "addExecutionEvents" + ] + }, + "QueryExecutionInputsAndOutputs": { + "methods": [ + "queryExecutionInputsAndOutputs" + ] + }, + "CreateMetadataSchema": { + "methods": [ + "createMetadataSchema" + ] + }, + "GetMetadataSchema": { + "methods": [ + "getMetadataSchema" + ] + }, + "QueryArtifactLineageSubgraph": { + "methods": [ + "queryArtifactLineageSubgraph" + ] + }, + "CreateMetadataStore": { + "methods": [ + "createMetadataStore" + ] + }, + "DeleteMetadataStore": { + "methods": [ + "deleteMetadataStore" + ] + }, + "DeleteArtifact": { + "methods": [ + "deleteArtifact" + ] + }, + "PurgeArtifacts": { + "methods": [ + "purgeArtifacts" + ] + }, + "DeleteContext": { + "methods": [ + "deleteContext" + ] + }, + "PurgeContexts": { + "methods": [ + "purgeContexts" + ] + }, + "DeleteExecution": { + "methods": [ + "deleteExecution" + ] + }, + "PurgeExecutions": { + "methods": [ + "purgeExecutions" + ] + }, + "ListMetadataStores": { + "methods": [ + "listMetadataStores", + "listMetadataStoresStream", + "listMetadataStoresAsync" + ] + }, + "ListArtifacts": { + "methods": [ + "listArtifacts", + "listArtifactsStream", + "listArtifactsAsync" + ] + }, + "ListContexts": { + "methods": [ + "listContexts", + "listContextsStream", + "listContextsAsync" + ] + }, + "ListExecutions": { + "methods": [ + "listExecutions", + "listExecutionsStream", + "listExecutionsAsync" + ] + }, + "ListMetadataSchemas": { + "methods": [ + "listMetadataSchemas", + "listMetadataSchemasStream", + "listMetadataSchemasAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "MetadataServiceClient", + "rpcs": { + "GetMetadataStore": { + "methods": [ + "getMetadataStore" + ] + }, + "CreateArtifact": { + "methods": [ + "createArtifact" + ] + }, + "GetArtifact": { + "methods": [ + "getArtifact" + ] + }, + "UpdateArtifact": { + "methods": [ + "updateArtifact" + ] + }, + "CreateContext": { + "methods": [ + "createContext" + ] + }, + "GetContext": { + "methods": [ + "getContext" + ] + }, + "UpdateContext": { + "methods": [ + "updateContext" + ] + }, + "AddContextArtifactsAndExecutions": { + "methods": [ + "addContextArtifactsAndExecutions" + ] + }, + "AddContextChildren": { + "methods": [ + "addContextChildren" + ] + }, + "QueryContextLineageSubgraph": { + "methods": [ + "queryContextLineageSubgraph" + ] + }, + "CreateExecution": { + "methods": [ + "createExecution" + ] + }, + "GetExecution": { + "methods": [ + "getExecution" + ] + }, + "UpdateExecution": { + "methods": [ + "updateExecution" + ] + }, + "AddExecutionEvents": { + "methods": [ + "addExecutionEvents" + ] + }, + "QueryExecutionInputsAndOutputs": { + "methods": [ + "queryExecutionInputsAndOutputs" + ] + }, + "CreateMetadataSchema": { + "methods": [ + "createMetadataSchema" + ] + }, + "GetMetadataSchema": { + "methods": [ + "getMetadataSchema" + ] + }, + "QueryArtifactLineageSubgraph": { + "methods": [ + "queryArtifactLineageSubgraph" + ] + }, + "CreateMetadataStore": { + "methods": [ + "createMetadataStore" + ] + }, + "DeleteMetadataStore": { + "methods": [ + "deleteMetadataStore" + ] + }, + "DeleteArtifact": { + "methods": [ + "deleteArtifact" + ] + }, + "PurgeArtifacts": { + "methods": [ + "purgeArtifacts" + ] + }, + "DeleteContext": { + "methods": [ + "deleteContext" + ] + }, + "PurgeContexts": { + "methods": [ + "purgeContexts" + ] + }, + "DeleteExecution": { + "methods": [ + "deleteExecution" + ] + }, + "PurgeExecutions": { + "methods": [ + "purgeExecutions" + ] + }, + "ListMetadataStores": { + "methods": [ + "listMetadataStores", + "listMetadataStoresStream", + "listMetadataStoresAsync" + ] + }, + "ListArtifacts": { + "methods": [ + "listArtifacts", + "listArtifactsStream", + "listArtifactsAsync" + ] + }, + "ListContexts": { + "methods": [ + "listContexts", + "listContextsStream", + "listContextsAsync" + ] + }, + "ListExecutions": { + "methods": [ + "listExecutions", + "listExecutionsStream", + "listExecutionsAsync" + ] + }, + "ListMetadataSchemas": { + "methods": [ + "listMetadataSchemas", + "listMetadataSchemasStream", + "listMetadataSchemasAsync" + ] + } + } + } + } + }, + "MigrationService": { + "clients": { + "grpc": { + "libraryClient": "MigrationServiceClient", + "rpcs": { + "BatchMigrateResources": { + "methods": [ + "batchMigrateResources" + ] + }, + "SearchMigratableResources": { + "methods": [ + "searchMigratableResources", + "searchMigratableResourcesStream", + "searchMigratableResourcesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "MigrationServiceClient", + "rpcs": { + "BatchMigrateResources": { + "methods": [ + "batchMigrateResources" + ] + }, + "SearchMigratableResources": { + "methods": [ + "searchMigratableResources", + "searchMigratableResourcesStream", + "searchMigratableResourcesAsync" + ] + } + } + } + } + }, + "ModelService": { + "clients": { + "grpc": { + "libraryClient": "ModelServiceClient", + "rpcs": { + "GetModel": { + "methods": [ + "getModel" + ] + }, + "UpdateModel": { + "methods": [ + "updateModel" + ] + }, + "ImportModelEvaluation": { + "methods": [ + "importModelEvaluation" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "GetModelEvaluationSlice": { + "methods": [ + "getModelEvaluationSlice" + ] + }, + "UploadModel": { + "methods": [ + "uploadModel" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "ExportModel": { + "methods": [ + "exportModel" + ] + }, + "ListModels": { + "methods": [ + "listModels", + "listModelsStream", + "listModelsAsync" + ] + }, + "ListModelEvaluations": { + "methods": [ + "listModelEvaluations", + "listModelEvaluationsStream", + "listModelEvaluationsAsync" + ] + }, + "ListModelEvaluationSlices": { + "methods": [ + "listModelEvaluationSlices", + "listModelEvaluationSlicesStream", + "listModelEvaluationSlicesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ModelServiceClient", + "rpcs": { + "GetModel": { + "methods": [ + "getModel" + ] + }, + "UpdateModel": { + "methods": [ + "updateModel" + ] + }, + "ImportModelEvaluation": { + "methods": [ + "importModelEvaluation" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "GetModelEvaluationSlice": { + "methods": [ + "getModelEvaluationSlice" + ] + }, + "UploadModel": { + "methods": [ + "uploadModel" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "ExportModel": { + "methods": [ + "exportModel" + ] + }, + "ListModels": { + "methods": [ + "listModels", + "listModelsStream", + "listModelsAsync" + ] + }, + "ListModelEvaluations": { + "methods": [ + "listModelEvaluations", + "listModelEvaluationsStream", + "listModelEvaluationsAsync" + ] + }, + "ListModelEvaluationSlices": { + "methods": [ + "listModelEvaluationSlices", + "listModelEvaluationSlicesStream", + "listModelEvaluationSlicesAsync" + ] + } + } + } + } + }, + "PipelineService": { + "clients": { + "grpc": { + "libraryClient": "PipelineServiceClient", + "rpcs": { + "CreateTrainingPipeline": { + "methods": [ + "createTrainingPipeline" + ] + }, + "GetTrainingPipeline": { + "methods": [ + "getTrainingPipeline" + ] + }, + "CancelTrainingPipeline": { + "methods": [ + "cancelTrainingPipeline" + ] + }, + "CreatePipelineJob": { + "methods": [ + "createPipelineJob" + ] + }, + "GetPipelineJob": { + "methods": [ + "getPipelineJob" + ] + }, + "CancelPipelineJob": { + "methods": [ + "cancelPipelineJob" + ] + }, + "DeleteTrainingPipeline": { + "methods": [ + "deleteTrainingPipeline" + ] + }, + "DeletePipelineJob": { + "methods": [ + "deletePipelineJob" + ] + }, + "ListTrainingPipelines": { + "methods": [ + "listTrainingPipelines", + "listTrainingPipelinesStream", + "listTrainingPipelinesAsync" + ] + }, + "ListPipelineJobs": { + "methods": [ + "listPipelineJobs", + "listPipelineJobsStream", + "listPipelineJobsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PipelineServiceClient", + "rpcs": { + "CreateTrainingPipeline": { + "methods": [ + "createTrainingPipeline" + ] + }, + "GetTrainingPipeline": { + "methods": [ + "getTrainingPipeline" + ] + }, + "CancelTrainingPipeline": { + "methods": [ + "cancelTrainingPipeline" + ] + }, + "CreatePipelineJob": { + "methods": [ + "createPipelineJob" + ] + }, + "GetPipelineJob": { + "methods": [ + "getPipelineJob" + ] + }, + "CancelPipelineJob": { + "methods": [ + "cancelPipelineJob" + ] + }, + "DeleteTrainingPipeline": { + "methods": [ + "deleteTrainingPipeline" + ] + }, + "DeletePipelineJob": { + "methods": [ + "deletePipelineJob" + ] + }, + "ListTrainingPipelines": { + "methods": [ + "listTrainingPipelines", + "listTrainingPipelinesStream", + "listTrainingPipelinesAsync" + ] + }, + "ListPipelineJobs": { + "methods": [ + "listPipelineJobs", + "listPipelineJobsStream", + "listPipelineJobsAsync" + ] + } + } + } + } + }, + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionServiceClient", + "rpcs": { + "Predict": { + "methods": [ + "predict" + ] + }, + "RawPredict": { + "methods": [ + "rawPredict" + ] + }, + "Explain": { + "methods": [ + "explain" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PredictionServiceClient", + "rpcs": { + "Predict": { + "methods": [ + "predict" + ] + }, + "RawPredict": { + "methods": [ + "rawPredict" + ] + }, + "Explain": { + "methods": [ + "explain" + ] + } + } + } + } + }, + "SpecialistPoolService": { + "clients": { + "grpc": { + "libraryClient": "SpecialistPoolServiceClient", + "rpcs": { + "GetSpecialistPool": { + "methods": [ + "getSpecialistPool" + ] + }, + "CreateSpecialistPool": { + "methods": [ + "createSpecialistPool" + ] + }, + "DeleteSpecialistPool": { + "methods": [ + "deleteSpecialistPool" + ] + }, + "UpdateSpecialistPool": { + "methods": [ + "updateSpecialistPool" + ] + }, + "ListSpecialistPools": { + "methods": [ + "listSpecialistPools", + "listSpecialistPoolsStream", + "listSpecialistPoolsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SpecialistPoolServiceClient", + "rpcs": { + "GetSpecialistPool": { + "methods": [ + "getSpecialistPool" + ] + }, + "CreateSpecialistPool": { + "methods": [ + "createSpecialistPool" + ] + }, + "DeleteSpecialistPool": { + "methods": [ + "deleteSpecialistPool" + ] + }, + "UpdateSpecialistPool": { + "methods": [ + "updateSpecialistPool" + ] + }, + "ListSpecialistPools": { + "methods": [ + "listSpecialistPools", + "listSpecialistPoolsStream", + "listSpecialistPoolsAsync" + ] + } + } + } + } + }, + "TensorboardService": { + "clients": { + "grpc": { + "libraryClient": "TensorboardServiceClient", + "rpcs": { + "GetTensorboard": { + "methods": [ + "getTensorboard" + ] + }, + "CreateTensorboardExperiment": { + "methods": [ + "createTensorboardExperiment" + ] + }, + "GetTensorboardExperiment": { + "methods": [ + "getTensorboardExperiment" + ] + }, + "UpdateTensorboardExperiment": { + "methods": [ + "updateTensorboardExperiment" + ] + }, + "CreateTensorboardRun": { + "methods": [ + "createTensorboardRun" + ] + }, + "BatchCreateTensorboardRuns": { + "methods": [ + "batchCreateTensorboardRuns" + ] + }, + "GetTensorboardRun": { + "methods": [ + "getTensorboardRun" + ] + }, + "UpdateTensorboardRun": { + "methods": [ + "updateTensorboardRun" + ] + }, + "BatchCreateTensorboardTimeSeries": { + "methods": [ + "batchCreateTensorboardTimeSeries" + ] + }, + "CreateTensorboardTimeSeries": { + "methods": [ + "createTensorboardTimeSeries" + ] + }, + "GetTensorboardTimeSeries": { + "methods": [ + "getTensorboardTimeSeries" + ] + }, + "UpdateTensorboardTimeSeries": { + "methods": [ + "updateTensorboardTimeSeries" + ] + }, + "BatchReadTensorboardTimeSeriesData": { + "methods": [ + "batchReadTensorboardTimeSeriesData" + ] + }, + "ReadTensorboardTimeSeriesData": { + "methods": [ + "readTensorboardTimeSeriesData" + ] + }, + "WriteTensorboardExperimentData": { + "methods": [ + "writeTensorboardExperimentData" + ] + }, + "WriteTensorboardRunData": { + "methods": [ + "writeTensorboardRunData" + ] + }, + "ReadTensorboardBlobData": { + "methods": [ + "readTensorboardBlobData" + ] + }, + "CreateTensorboard": { + "methods": [ + "createTensorboard" + ] + }, + "UpdateTensorboard": { + "methods": [ + "updateTensorboard" + ] + }, + "DeleteTensorboard": { + "methods": [ + "deleteTensorboard" + ] + }, + "DeleteTensorboardExperiment": { + "methods": [ + "deleteTensorboardExperiment" + ] + }, + "DeleteTensorboardRun": { + "methods": [ + "deleteTensorboardRun" + ] + }, + "DeleteTensorboardTimeSeries": { + "methods": [ + "deleteTensorboardTimeSeries" + ] + }, + "ListTensorboards": { + "methods": [ + "listTensorboards", + "listTensorboardsStream", + "listTensorboardsAsync" + ] + }, + "ListTensorboardExperiments": { + "methods": [ + "listTensorboardExperiments", + "listTensorboardExperimentsStream", + "listTensorboardExperimentsAsync" + ] + }, + "ListTensorboardRuns": { + "methods": [ + "listTensorboardRuns", + "listTensorboardRunsStream", + "listTensorboardRunsAsync" + ] + }, + "ListTensorboardTimeSeries": { + "methods": [ + "listTensorboardTimeSeries", + "listTensorboardTimeSeriesStream", + "listTensorboardTimeSeriesAsync" + ] + }, + "ExportTensorboardTimeSeriesData": { + "methods": [ + "exportTensorboardTimeSeriesData", + "exportTensorboardTimeSeriesDataStream", + "exportTensorboardTimeSeriesDataAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TensorboardServiceClient", + "rpcs": { + "GetTensorboard": { + "methods": [ + "getTensorboard" + ] + }, + "CreateTensorboardExperiment": { + "methods": [ + "createTensorboardExperiment" + ] + }, + "GetTensorboardExperiment": { + "methods": [ + "getTensorboardExperiment" + ] + }, + "UpdateTensorboardExperiment": { + "methods": [ + "updateTensorboardExperiment" + ] + }, + "CreateTensorboardRun": { + "methods": [ + "createTensorboardRun" + ] + }, + "BatchCreateTensorboardRuns": { + "methods": [ + "batchCreateTensorboardRuns" + ] + }, + "GetTensorboardRun": { + "methods": [ + "getTensorboardRun" + ] + }, + "UpdateTensorboardRun": { + "methods": [ + "updateTensorboardRun" + ] + }, + "BatchCreateTensorboardTimeSeries": { + "methods": [ + "batchCreateTensorboardTimeSeries" + ] + }, + "CreateTensorboardTimeSeries": { + "methods": [ + "createTensorboardTimeSeries" + ] + }, + "GetTensorboardTimeSeries": { + "methods": [ + "getTensorboardTimeSeries" + ] + }, + "UpdateTensorboardTimeSeries": { + "methods": [ + "updateTensorboardTimeSeries" + ] + }, + "BatchReadTensorboardTimeSeriesData": { + "methods": [ + "batchReadTensorboardTimeSeriesData" + ] + }, + "ReadTensorboardTimeSeriesData": { + "methods": [ + "readTensorboardTimeSeriesData" + ] + }, + "WriteTensorboardExperimentData": { + "methods": [ + "writeTensorboardExperimentData" + ] + }, + "WriteTensorboardRunData": { + "methods": [ + "writeTensorboardRunData" + ] + }, + "CreateTensorboard": { + "methods": [ + "createTensorboard" + ] + }, + "UpdateTensorboard": { + "methods": [ + "updateTensorboard" + ] + }, + "DeleteTensorboard": { + "methods": [ + "deleteTensorboard" + ] + }, + "DeleteTensorboardExperiment": { + "methods": [ + "deleteTensorboardExperiment" + ] + }, + "DeleteTensorboardRun": { + "methods": [ + "deleteTensorboardRun" + ] + }, + "DeleteTensorboardTimeSeries": { + "methods": [ + "deleteTensorboardTimeSeries" + ] + }, + "ListTensorboards": { + "methods": [ + "listTensorboards", + "listTensorboardsStream", + "listTensorboardsAsync" + ] + }, + "ListTensorboardExperiments": { + "methods": [ + "listTensorboardExperiments", + "listTensorboardExperimentsStream", + "listTensorboardExperimentsAsync" + ] + }, + "ListTensorboardRuns": { + "methods": [ + "listTensorboardRuns", + "listTensorboardRunsStream", + "listTensorboardRunsAsync" + ] + }, + "ListTensorboardTimeSeries": { + "methods": [ + "listTensorboardTimeSeries", + "listTensorboardTimeSeriesStream", + "listTensorboardTimeSeriesAsync" + ] + }, + "ExportTensorboardTimeSeriesData": { + "methods": [ + "exportTensorboardTimeSeriesData", + "exportTensorboardTimeSeriesDataStream", + "exportTensorboardTimeSeriesDataAsync" + ] + } + } + } + } + }, + "VizierService": { + "clients": { + "grpc": { + "libraryClient": "VizierServiceClient", + "rpcs": { + "CreateStudy": { + "methods": [ + "createStudy" + ] + }, + "GetStudy": { + "methods": [ + "getStudy" + ] + }, + "DeleteStudy": { + "methods": [ + "deleteStudy" + ] + }, + "LookupStudy": { + "methods": [ + "lookupStudy" + ] + }, + "CreateTrial": { + "methods": [ + "createTrial" + ] + }, + "GetTrial": { + "methods": [ + "getTrial" + ] + }, + "AddTrialMeasurement": { + "methods": [ + "addTrialMeasurement" + ] + }, + "CompleteTrial": { + "methods": [ + "completeTrial" + ] + }, + "DeleteTrial": { + "methods": [ + "deleteTrial" + ] + }, + "StopTrial": { + "methods": [ + "stopTrial" + ] + }, + "ListOptimalTrials": { + "methods": [ + "listOptimalTrials" + ] + }, + "SuggestTrials": { + "methods": [ + "suggestTrials" + ] + }, + "CheckTrialEarlyStoppingState": { + "methods": [ + "checkTrialEarlyStoppingState" + ] + }, + "ListStudies": { + "methods": [ + "listStudies", + "listStudiesStream", + "listStudiesAsync" + ] + }, + "ListTrials": { + "methods": [ + "listTrials", + "listTrialsStream", + "listTrialsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "VizierServiceClient", + "rpcs": { + "CreateStudy": { + "methods": [ + "createStudy" + ] + }, + "GetStudy": { + "methods": [ + "getStudy" + ] + }, + "DeleteStudy": { + "methods": [ + "deleteStudy" + ] + }, + "LookupStudy": { + "methods": [ + "lookupStudy" + ] + }, + "CreateTrial": { + "methods": [ + "createTrial" + ] + }, + "GetTrial": { + "methods": [ + "getTrial" + ] + }, + "AddTrialMeasurement": { + "methods": [ + "addTrialMeasurement" + ] + }, + "CompleteTrial": { + "methods": [ + "completeTrial" + ] + }, + "DeleteTrial": { + "methods": [ + "deleteTrial" + ] + }, + "StopTrial": { + "methods": [ + "stopTrial" + ] + }, + "ListOptimalTrials": { + "methods": [ + "listOptimalTrials" + ] + }, + "SuggestTrials": { + "methods": [ + "suggestTrials" + ] + }, + "CheckTrialEarlyStoppingState": { + "methods": [ + "checkTrialEarlyStoppingState" + ] + }, + "ListStudies": { + "methods": [ + "listStudies", + "listStudiesStream", + "listStudiesAsync" + ] + }, + "ListTrials": { + "methods": [ + "listTrials", + "listTrialsStream", + "listTrialsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/index.ts b/owl-bot-staging/v1/src/v1/index.ts new file mode 100644 index 00000000..e88d60a9 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/index.ts @@ -0,0 +1,33 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {DatasetServiceClient} from './dataset_service_client'; +export {EndpointServiceClient} from './endpoint_service_client'; +export {FeaturestoreOnlineServingServiceClient} from './featurestore_online_serving_service_client'; +export {FeaturestoreServiceClient} from './featurestore_service_client'; +export {IndexEndpointServiceClient} from './index_endpoint_service_client'; +export {IndexServiceClient} from './index_service_client'; +export {JobServiceClient} from './job_service_client'; +export {MetadataServiceClient} from './metadata_service_client'; +export {MigrationServiceClient} from './migration_service_client'; +export {ModelServiceClient} from './model_service_client'; +export {PipelineServiceClient} from './pipeline_service_client'; +export {PredictionServiceClient} from './prediction_service_client'; +export {SpecialistPoolServiceClient} from './specialist_pool_service_client'; +export {TensorboardServiceClient} from './tensorboard_service_client'; +export {VizierServiceClient} from './vizier_service_client'; diff --git a/owl-bot-staging/v1/src/v1/index_endpoint_service_client.ts b/owl-bot-staging/v1/src/v1/index_endpoint_service_client.ts new file mode 100644 index 00000000..a1412836 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/index_endpoint_service_client.ts @@ -0,0 +1,3218 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/index_endpoint_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './index_endpoint_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * A service for managing Vertex AI's IndexEndpoints. + * @class + * @memberof v1 + */ +export class IndexEndpointServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + indexEndpointServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of IndexEndpointServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof IndexEndpointServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listIndexEndpoints: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'indexEndpoints') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const createIndexEndpointResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.IndexEndpoint') as gax.protobuf.Type; + const createIndexEndpointMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.CreateIndexEndpointOperationMetadata') as gax.protobuf.Type; + const deleteIndexEndpointResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteIndexEndpointMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + const deployIndexResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeployIndexResponse') as gax.protobuf.Type; + const deployIndexMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeployIndexOperationMetadata') as gax.protobuf.Type; + const undeployIndexResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.UndeployIndexResponse') as gax.protobuf.Type; + const undeployIndexMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.UndeployIndexOperationMetadata') as gax.protobuf.Type; + const mutateDeployedIndexResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.MutateDeployedIndexResponse') as gax.protobuf.Type; + const mutateDeployedIndexMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.MutateDeployedIndexOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createIndexEndpoint: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createIndexEndpointResponse.decode.bind(createIndexEndpointResponse), + createIndexEndpointMetadata.decode.bind(createIndexEndpointMetadata)), + deleteIndexEndpoint: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteIndexEndpointResponse.decode.bind(deleteIndexEndpointResponse), + deleteIndexEndpointMetadata.decode.bind(deleteIndexEndpointMetadata)), + deployIndex: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deployIndexResponse.decode.bind(deployIndexResponse), + deployIndexMetadata.decode.bind(deployIndexMetadata)), + undeployIndex: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeployIndexResponse.decode.bind(undeployIndexResponse), + undeployIndexMetadata.decode.bind(undeployIndexMetadata)), + mutateDeployedIndex: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + mutateDeployedIndexResponse.decode.bind(mutateDeployedIndexResponse), + mutateDeployedIndexMetadata.decode.bind(mutateDeployedIndexMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.IndexEndpointService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.indexEndpointServiceStub) { + return this.indexEndpointServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.IndexEndpointService. + this.indexEndpointServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.IndexEndpointService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.IndexEndpointService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const indexEndpointServiceStubMethods = + ['createIndexEndpoint', 'getIndexEndpoint', 'listIndexEndpoints', 'updateIndexEndpoint', 'deleteIndexEndpoint', 'deployIndex', 'undeployIndex', 'mutateDeployedIndex']; + for (const methodName of indexEndpointServiceStubMethods) { + const callPromise = this.indexEndpointServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.indexEndpointServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets an IndexEndpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the IndexEndpoint resource. + * Format: + * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [IndexEndpoint]{@link google.cloud.aiplatform.v1.IndexEndpoint}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexEndpointService_GetIndexEndpoint_async + */ + getIndexEndpoint( + request?: protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest|undefined, {}|undefined + ]>; + getIndexEndpoint( + request: protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest|null|undefined, + {}|null|undefined>): void; + getIndexEndpoint( + request: protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest|null|undefined, + {}|null|undefined>): void; + getIndexEndpoint( + request?: protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getIndexEndpoint(request, options, callback); + } +/** + * Updates an IndexEndpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.IndexEndpoint} request.indexEndpoint + * Required. The IndexEndpoint which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. See {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [IndexEndpoint]{@link google.cloud.aiplatform.v1.IndexEndpoint}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexEndpointService_UpdateIndexEndpoint_async + */ + updateIndexEndpoint( + request?: protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest|undefined, {}|undefined + ]>; + updateIndexEndpoint( + request: protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest|null|undefined, + {}|null|undefined>): void; + updateIndexEndpoint( + request: protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest|null|undefined, + {}|null|undefined>): void; + updateIndexEndpoint( + request?: protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'index_endpoint.name': request.indexEndpoint!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateIndexEndpoint(request, options, callback); + } + +/** + * Creates an IndexEndpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the IndexEndpoint in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1.IndexEndpoint} request.indexEndpoint + * Required. The IndexEndpoint to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexEndpointService_CreateIndexEndpoint_async + */ + createIndexEndpoint( + request?: protos.google.cloud.aiplatform.v1.ICreateIndexEndpointRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createIndexEndpoint( + request: protos.google.cloud.aiplatform.v1.ICreateIndexEndpointRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createIndexEndpoint( + request: protos.google.cloud.aiplatform.v1.ICreateIndexEndpointRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createIndexEndpoint( + request?: protos.google.cloud.aiplatform.v1.ICreateIndexEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createIndexEndpoint(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createIndexEndpoint()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexEndpointService_CreateIndexEndpoint_async + */ + async checkCreateIndexEndpointProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createIndexEndpoint, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes an IndexEndpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the IndexEndpoint resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexEndpointService_DeleteIndexEndpoint_async + */ + deleteIndexEndpoint( + request?: protos.google.cloud.aiplatform.v1.IDeleteIndexEndpointRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteIndexEndpoint( + request: protos.google.cloud.aiplatform.v1.IDeleteIndexEndpointRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteIndexEndpoint( + request: protos.google.cloud.aiplatform.v1.IDeleteIndexEndpointRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteIndexEndpoint( + request?: protos.google.cloud.aiplatform.v1.IDeleteIndexEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteIndexEndpoint(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteIndexEndpoint()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexEndpointService_DeleteIndexEndpoint_async + */ + async checkDeleteIndexEndpointProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteIndexEndpoint, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deploys an Index into this IndexEndpoint, creating a DeployedIndex within + * it. + * Only non-empty Indexes can be deployed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.indexEndpoint + * Required. The name of the IndexEndpoint resource into which to deploy an Index. + * Format: + * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + * @param {google.cloud.aiplatform.v1.DeployedIndex} request.deployedIndex + * Required. The DeployedIndex to be created within the IndexEndpoint. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexEndpointService_DeployIndex_async + */ + deployIndex( + request?: protos.google.cloud.aiplatform.v1.IDeployIndexRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deployIndex( + request: protos.google.cloud.aiplatform.v1.IDeployIndexRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deployIndex( + request: protos.google.cloud.aiplatform.v1.IDeployIndexRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deployIndex( + request?: protos.google.cloud.aiplatform.v1.IDeployIndexRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'index_endpoint': request.indexEndpoint || '', + }); + this.initialize(); + return this.innerApiCalls.deployIndex(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deployIndex()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexEndpointService_DeployIndex_async + */ + async checkDeployIndexProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deployIndex, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Undeploys an Index from an IndexEndpoint, removing a DeployedIndex from it, + * and freeing all resources it's using. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.indexEndpoint + * Required. The name of the IndexEndpoint resource from which to undeploy an Index. + * Format: + * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + * @param {string} request.deployedIndexId + * Required. The ID of the DeployedIndex to be undeployed from the IndexEndpoint. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexEndpointService_UndeployIndex_async + */ + undeployIndex( + request?: protos.google.cloud.aiplatform.v1.IUndeployIndexRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + undeployIndex( + request: protos.google.cloud.aiplatform.v1.IUndeployIndexRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeployIndex( + request: protos.google.cloud.aiplatform.v1.IUndeployIndexRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeployIndex( + request?: protos.google.cloud.aiplatform.v1.IUndeployIndexRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'index_endpoint': request.indexEndpoint || '', + }); + this.initialize(); + return this.innerApiCalls.undeployIndex(request, options, callback); + } +/** + * Check the status of the long running operation returned by `undeployIndex()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexEndpointService_UndeployIndex_async + */ + async checkUndeployIndexProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.undeployIndex, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Update an existing DeployedIndex under an IndexEndpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.indexEndpoint + * Required. The name of the IndexEndpoint resource into which to deploy an Index. + * Format: + * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + * @param {google.cloud.aiplatform.v1.DeployedIndex} request.deployedIndex + * Required. The DeployedIndex to be updated within the IndexEndpoint. + * Currently, the updatable fields are {@link automatic_resources|DeployedIndex} + * and {@link dedicated_resources|DeployedIndex} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexEndpointService_MutateDeployedIndex_async + */ + mutateDeployedIndex( + request?: protos.google.cloud.aiplatform.v1.IMutateDeployedIndexRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + mutateDeployedIndex( + request: protos.google.cloud.aiplatform.v1.IMutateDeployedIndexRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + mutateDeployedIndex( + request: protos.google.cloud.aiplatform.v1.IMutateDeployedIndexRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + mutateDeployedIndex( + request?: protos.google.cloud.aiplatform.v1.IMutateDeployedIndexRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'index_endpoint': request.indexEndpoint || '', + }); + this.initialize(); + return this.innerApiCalls.mutateDeployedIndex(request, options, callback); + } +/** + * Check the status of the long running operation returned by `mutateDeployedIndex()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexEndpointService_MutateDeployedIndex_async + */ + async checkMutateDeployedIndexProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.mutateDeployedIndex, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists IndexEndpoints in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the IndexEndpoints. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `index_endpoint` supports = and !=. `index_endpoint` represents the + * IndexEndpoint ID, ie. the last segment of the IndexEndpoint's + * {@link google.cloud.aiplatform.v1.IndexEndpoint.name|resourcename}. + * * `display_name` supports =, != and regex() + * (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* or labels:key - key existence + * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `index_endpoint="1"` + * * `display_name="myDisplayName"` + * * `regex(display_name, "^A") -> The display name starts with an A. + * * `labels.myKey="myValue"` + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListIndexEndpointsResponse.next_page_token|ListIndexEndpointsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.IndexEndpointService.ListIndexEndpoints|IndexEndpointService.ListIndexEndpoints} call. + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [IndexEndpoint]{@link google.cloud.aiplatform.v1.IndexEndpoint}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listIndexEndpointsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listIndexEndpoints( + request?: protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IIndexEndpoint[], + protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest|null, + protos.google.cloud.aiplatform.v1.IListIndexEndpointsResponse + ]>; + listIndexEndpoints( + request: protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, + protos.google.cloud.aiplatform.v1.IListIndexEndpointsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IIndexEndpoint>): void; + listIndexEndpoints( + request: protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, + protos.google.cloud.aiplatform.v1.IListIndexEndpointsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IIndexEndpoint>): void; + listIndexEndpoints( + request?: protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, + protos.google.cloud.aiplatform.v1.IListIndexEndpointsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IIndexEndpoint>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, + protos.google.cloud.aiplatform.v1.IListIndexEndpointsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IIndexEndpoint>): + Promise<[ + protos.google.cloud.aiplatform.v1.IIndexEndpoint[], + protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest|null, + protos.google.cloud.aiplatform.v1.IListIndexEndpointsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listIndexEndpoints(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the IndexEndpoints. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `index_endpoint` supports = and !=. `index_endpoint` represents the + * IndexEndpoint ID, ie. the last segment of the IndexEndpoint's + * {@link google.cloud.aiplatform.v1.IndexEndpoint.name|resourcename}. + * * `display_name` supports =, != and regex() + * (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* or labels:key - key existence + * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `index_endpoint="1"` + * * `display_name="myDisplayName"` + * * `regex(display_name, "^A") -> The display name starts with an A. + * * `labels.myKey="myValue"` + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListIndexEndpointsResponse.next_page_token|ListIndexEndpointsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.IndexEndpointService.ListIndexEndpoints|IndexEndpointService.ListIndexEndpoints} call. + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [IndexEndpoint]{@link google.cloud.aiplatform.v1.IndexEndpoint} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listIndexEndpointsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listIndexEndpointsStream( + request?: protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listIndexEndpoints']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listIndexEndpoints.createStream( + this.innerApiCalls.listIndexEndpoints as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listIndexEndpoints`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the IndexEndpoints. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `index_endpoint` supports = and !=. `index_endpoint` represents the + * IndexEndpoint ID, ie. the last segment of the IndexEndpoint's + * {@link google.cloud.aiplatform.v1.IndexEndpoint.name|resourcename}. + * * `display_name` supports =, != and regex() + * (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* or labels:key - key existence + * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `index_endpoint="1"` + * * `display_name="myDisplayName"` + * * `regex(display_name, "^A") -> The display name starts with an A. + * * `labels.myKey="myValue"` + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListIndexEndpointsResponse.next_page_token|ListIndexEndpointsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.IndexEndpointService.ListIndexEndpoints|IndexEndpointService.ListIndexEndpoints} call. + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [IndexEndpoint]{@link google.cloud.aiplatform.v1.IndexEndpoint}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexEndpointService_ListIndexEndpoints_async + */ + listIndexEndpointsAsync( + request?: protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listIndexEndpoints']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listIndexEndpoints.asyncIterate( + this.innerApiCalls['listIndexEndpoints'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.indexEndpointServiceStub && !this._terminated) { + return this.indexEndpointServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/index_endpoint_service_client_config.json b/owl-bot-staging/v1/src/v1/index_endpoint_service_client_config.json new file mode 100644 index 00000000..2a6743ff --- /dev/null +++ b/owl-bot-staging/v1/src/v1/index_endpoint_service_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.IndexEndpointService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateIndexEndpoint": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIndexEndpoint": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListIndexEndpoints": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateIndexEndpoint": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteIndexEndpoint": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeployIndex": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeployIndex": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MutateDeployedIndex": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/index_endpoint_service_proto_list.json b/owl-bot-staging/v1/src/v1/index_endpoint_service_proto_list.json new file mode 100644 index 00000000..581a7346 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/index_endpoint_service_proto_list.json @@ -0,0 +1,110 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1/src/v1/index_service_client.ts b/owl-bot-staging/v1/src/v1/index_service_client.ts new file mode 100644 index 00000000..40090f19 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/index_service_client.ts @@ -0,0 +1,2884 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/index_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './index_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * A service for creating and managing Vertex AI's Index resources. + * @class + * @memberof v1 + */ +export class IndexServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + indexServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of IndexServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof IndexServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listIndexes: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'indexes') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const createIndexResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.Index') as gax.protobuf.Type; + const createIndexMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.CreateIndexOperationMetadata') as gax.protobuf.Type; + const updateIndexResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.Index') as gax.protobuf.Type; + const updateIndexMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.UpdateIndexOperationMetadata') as gax.protobuf.Type; + const deleteIndexResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteIndexMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createIndex: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createIndexResponse.decode.bind(createIndexResponse), + createIndexMetadata.decode.bind(createIndexMetadata)), + updateIndex: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateIndexResponse.decode.bind(updateIndexResponse), + updateIndexMetadata.decode.bind(updateIndexMetadata)), + deleteIndex: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteIndexResponse.decode.bind(deleteIndexResponse), + deleteIndexMetadata.decode.bind(deleteIndexMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.IndexService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.indexServiceStub) { + return this.indexServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.IndexService. + this.indexServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.IndexService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.IndexService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const indexServiceStubMethods = + ['createIndex', 'getIndex', 'listIndexes', 'updateIndex', 'deleteIndex']; + for (const methodName of indexServiceStubMethods) { + const callPromise = this.indexServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.indexServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets an Index. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Index resource. + * Format: + * `projects/{project}/locations/{location}/indexes/{index}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Index]{@link google.cloud.aiplatform.v1.Index}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexService_GetIndex_async + */ + getIndex( + request?: protos.google.cloud.aiplatform.v1.IGetIndexRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IIndex, + protos.google.cloud.aiplatform.v1.IGetIndexRequest|undefined, {}|undefined + ]>; + getIndex( + request: protos.google.cloud.aiplatform.v1.IGetIndexRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IIndex, + protos.google.cloud.aiplatform.v1.IGetIndexRequest|null|undefined, + {}|null|undefined>): void; + getIndex( + request: protos.google.cloud.aiplatform.v1.IGetIndexRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IIndex, + protos.google.cloud.aiplatform.v1.IGetIndexRequest|null|undefined, + {}|null|undefined>): void; + getIndex( + request?: protos.google.cloud.aiplatform.v1.IGetIndexRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IIndex, + protos.google.cloud.aiplatform.v1.IGetIndexRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IIndex, + protos.google.cloud.aiplatform.v1.IGetIndexRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IIndex, + protos.google.cloud.aiplatform.v1.IGetIndexRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getIndex(request, options, callback); + } + +/** + * Creates an Index. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the Index in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1.Index} request.index + * Required. The Index to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexService_CreateIndex_async + */ + createIndex( + request?: protos.google.cloud.aiplatform.v1.ICreateIndexRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createIndex( + request: protos.google.cloud.aiplatform.v1.ICreateIndexRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createIndex( + request: protos.google.cloud.aiplatform.v1.ICreateIndexRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createIndex( + request?: protos.google.cloud.aiplatform.v1.ICreateIndexRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createIndex(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createIndex()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexService_CreateIndex_async + */ + async checkCreateIndexProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createIndex, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates an Index. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.Index} request.index + * Required. The Index which updates the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * The update mask applies to the resource. + * For the `FieldMask` definition, see {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexService_UpdateIndex_async + */ + updateIndex( + request?: protos.google.cloud.aiplatform.v1.IUpdateIndexRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateIndex( + request: protos.google.cloud.aiplatform.v1.IUpdateIndexRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateIndex( + request: protos.google.cloud.aiplatform.v1.IUpdateIndexRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateIndex( + request?: protos.google.cloud.aiplatform.v1.IUpdateIndexRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'index.name': request.index!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateIndex(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateIndex()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexService_UpdateIndex_async + */ + async checkUpdateIndexProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateIndex, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes an Index. + * An Index can only be deleted when all its + * {@link google.cloud.aiplatform.v1.Index.deployed_indexes|DeployedIndexes} had been undeployed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Index resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/indexes/{index}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexService_DeleteIndex_async + */ + deleteIndex( + request?: protos.google.cloud.aiplatform.v1.IDeleteIndexRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteIndex( + request: protos.google.cloud.aiplatform.v1.IDeleteIndexRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteIndex( + request: protos.google.cloud.aiplatform.v1.IDeleteIndexRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteIndex( + request?: protos.google.cloud.aiplatform.v1.IDeleteIndexRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteIndex(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteIndex()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexService_DeleteIndex_async + */ + async checkDeleteIndexProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteIndex, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Indexes in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the Indexes. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListIndexesResponse.next_page_token|ListIndexesResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.IndexService.ListIndexes|IndexService.ListIndexes} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Index]{@link google.cloud.aiplatform.v1.Index}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listIndexesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listIndexes( + request?: protos.google.cloud.aiplatform.v1.IListIndexesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IIndex[], + protos.google.cloud.aiplatform.v1.IListIndexesRequest|null, + protos.google.cloud.aiplatform.v1.IListIndexesResponse + ]>; + listIndexes( + request: protos.google.cloud.aiplatform.v1.IListIndexesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListIndexesRequest, + protos.google.cloud.aiplatform.v1.IListIndexesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IIndex>): void; + listIndexes( + request: protos.google.cloud.aiplatform.v1.IListIndexesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListIndexesRequest, + protos.google.cloud.aiplatform.v1.IListIndexesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IIndex>): void; + listIndexes( + request?: protos.google.cloud.aiplatform.v1.IListIndexesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListIndexesRequest, + protos.google.cloud.aiplatform.v1.IListIndexesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IIndex>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListIndexesRequest, + protos.google.cloud.aiplatform.v1.IListIndexesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IIndex>): + Promise<[ + protos.google.cloud.aiplatform.v1.IIndex[], + protos.google.cloud.aiplatform.v1.IListIndexesRequest|null, + protos.google.cloud.aiplatform.v1.IListIndexesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listIndexes(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the Indexes. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListIndexesResponse.next_page_token|ListIndexesResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.IndexService.ListIndexes|IndexService.ListIndexes} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Index]{@link google.cloud.aiplatform.v1.Index} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listIndexesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listIndexesStream( + request?: protos.google.cloud.aiplatform.v1.IListIndexesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listIndexes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listIndexes.createStream( + this.innerApiCalls.listIndexes as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listIndexes`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the Indexes. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListIndexesResponse.next_page_token|ListIndexesResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.IndexService.ListIndexes|IndexService.ListIndexes} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Index]{@link google.cloud.aiplatform.v1.Index}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_IndexService_ListIndexes_async + */ + listIndexesAsync( + request?: protos.google.cloud.aiplatform.v1.IListIndexesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listIndexes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listIndexes.asyncIterate( + this.innerApiCalls['listIndexes'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.indexServiceStub && !this._terminated) { + return this.indexServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/index_service_client_config.json b/owl-bot-staging/v1/src/v1/index_service_client_config.json new file mode 100644 index 00000000..dcabf5f8 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/index_service_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.IndexService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateIndex": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIndex": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListIndexes": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateIndex": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteIndex": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/index_service_proto_list.json b/owl-bot-staging/v1/src/v1/index_service_proto_list.json new file mode 100644 index 00000000..581a7346 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/index_service_proto_list.json @@ -0,0 +1,110 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1/src/v1/job_service_client.ts b/owl-bot-staging/v1/src/v1/job_service_client.ts new file mode 100644 index 00000000..22f3670d --- /dev/null +++ b/owl-bot-staging/v1/src/v1/job_service_client.ts @@ -0,0 +1,5577 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/job_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './job_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * A service for creating and managing Vertex AI's jobs. + * @class + * @memberof v1 + */ +export class JobServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + jobServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of JobServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof JobServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listCustomJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customJobs'), + listDataLabelingJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dataLabelingJobs'), + listHyperparameterTuningJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'hyperparameterTuningJobs'), + listBatchPredictionJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'batchPredictionJobs'), + searchModelDeploymentMonitoringStatsAnomalies: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'monitoringStats'), + listModelDeploymentMonitoringJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'modelDeploymentMonitoringJobs') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const deleteCustomJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteCustomJobMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + const deleteDataLabelingJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteDataLabelingJobMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + const deleteHyperparameterTuningJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteHyperparameterTuningJobMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + const deleteBatchPredictionJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteBatchPredictionJobMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + const updateModelDeploymentMonitoringJobResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob') as gax.protobuf.Type; + const updateModelDeploymentMonitoringJobMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.UpdateModelDeploymentMonitoringJobOperationMetadata') as gax.protobuf.Type; + const deleteModelDeploymentMonitoringJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteModelDeploymentMonitoringJobMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + deleteCustomJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteCustomJobResponse.decode.bind(deleteCustomJobResponse), + deleteCustomJobMetadata.decode.bind(deleteCustomJobMetadata)), + deleteDataLabelingJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteDataLabelingJobResponse.decode.bind(deleteDataLabelingJobResponse), + deleteDataLabelingJobMetadata.decode.bind(deleteDataLabelingJobMetadata)), + deleteHyperparameterTuningJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteHyperparameterTuningJobResponse.decode.bind(deleteHyperparameterTuningJobResponse), + deleteHyperparameterTuningJobMetadata.decode.bind(deleteHyperparameterTuningJobMetadata)), + deleteBatchPredictionJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBatchPredictionJobResponse.decode.bind(deleteBatchPredictionJobResponse), + deleteBatchPredictionJobMetadata.decode.bind(deleteBatchPredictionJobMetadata)), + updateModelDeploymentMonitoringJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateModelDeploymentMonitoringJobResponse.decode.bind(updateModelDeploymentMonitoringJobResponse), + updateModelDeploymentMonitoringJobMetadata.decode.bind(updateModelDeploymentMonitoringJobMetadata)), + deleteModelDeploymentMonitoringJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteModelDeploymentMonitoringJobResponse.decode.bind(deleteModelDeploymentMonitoringJobResponse), + deleteModelDeploymentMonitoringJobMetadata.decode.bind(deleteModelDeploymentMonitoringJobMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.JobService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.jobServiceStub) { + return this.jobServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.JobService. + this.jobServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.JobService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.JobService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const jobServiceStubMethods = + ['createCustomJob', 'getCustomJob', 'listCustomJobs', 'deleteCustomJob', 'cancelCustomJob', 'createDataLabelingJob', 'getDataLabelingJob', 'listDataLabelingJobs', 'deleteDataLabelingJob', 'cancelDataLabelingJob', 'createHyperparameterTuningJob', 'getHyperparameterTuningJob', 'listHyperparameterTuningJobs', 'deleteHyperparameterTuningJob', 'cancelHyperparameterTuningJob', 'createBatchPredictionJob', 'getBatchPredictionJob', 'listBatchPredictionJobs', 'deleteBatchPredictionJob', 'cancelBatchPredictionJob', 'createModelDeploymentMonitoringJob', 'searchModelDeploymentMonitoringStatsAnomalies', 'getModelDeploymentMonitoringJob', 'listModelDeploymentMonitoringJobs', 'updateModelDeploymentMonitoringJob', 'deleteModelDeploymentMonitoringJob', 'pauseModelDeploymentMonitoringJob', 'resumeModelDeploymentMonitoringJob']; + for (const methodName of jobServiceStubMethods) { + const callPromise = this.jobServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.jobServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Creates a CustomJob. A created CustomJob right away + * will be attempted to be run. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the CustomJob in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1.CustomJob} request.customJob + * Required. The CustomJob to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CustomJob]{@link google.cloud.aiplatform.v1.CustomJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_CreateCustomJob_async + */ + createCustomJob( + request?: protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ICustomJob, + protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest|undefined, {}|undefined + ]>; + createCustomJob( + request: protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ICustomJob, + protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest|null|undefined, + {}|null|undefined>): void; + createCustomJob( + request: protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ICustomJob, + protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest|null|undefined, + {}|null|undefined>): void; + createCustomJob( + request?: protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ICustomJob, + protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ICustomJob, + protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ICustomJob, + protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createCustomJob(request, options, callback); + } +/** + * Gets a CustomJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CustomJob resource. + * Format: + * `projects/{project}/locations/{location}/customJobs/{custom_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CustomJob]{@link google.cloud.aiplatform.v1.CustomJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_GetCustomJob_async + */ + getCustomJob( + request?: protos.google.cloud.aiplatform.v1.IGetCustomJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ICustomJob, + protos.google.cloud.aiplatform.v1.IGetCustomJobRequest|undefined, {}|undefined + ]>; + getCustomJob( + request: protos.google.cloud.aiplatform.v1.IGetCustomJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ICustomJob, + protos.google.cloud.aiplatform.v1.IGetCustomJobRequest|null|undefined, + {}|null|undefined>): void; + getCustomJob( + request: protos.google.cloud.aiplatform.v1.IGetCustomJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ICustomJob, + protos.google.cloud.aiplatform.v1.IGetCustomJobRequest|null|undefined, + {}|null|undefined>): void; + getCustomJob( + request?: protos.google.cloud.aiplatform.v1.IGetCustomJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ICustomJob, + protos.google.cloud.aiplatform.v1.IGetCustomJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ICustomJob, + protos.google.cloud.aiplatform.v1.IGetCustomJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ICustomJob, + protos.google.cloud.aiplatform.v1.IGetCustomJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getCustomJob(request, options, callback); + } +/** + * Cancels a CustomJob. + * Starts asynchronous cancellation on the CustomJob. The server + * makes a best effort to cancel the job, but success is not + * guaranteed. Clients can use {@link google.cloud.aiplatform.v1.JobService.GetCustomJob|JobService.GetCustomJob} or + * other methods to check whether the cancellation succeeded or whether the + * job completed despite cancellation. On successful cancellation, + * the CustomJob is not deleted; instead it becomes a job with + * a {@link google.cloud.aiplatform.v1.CustomJob.error|CustomJob.error} value with a {@link google.rpc.Status.code|google.rpc.Status.code} of 1, + * corresponding to `Code.CANCELLED`, and {@link google.cloud.aiplatform.v1.CustomJob.state|CustomJob.state} is set to + * `CANCELLED`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CustomJob to cancel. + * Format: + * `projects/{project}/locations/{location}/customJobs/{custom_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_CancelCustomJob_async + */ + cancelCustomJob( + request?: protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest|undefined, {}|undefined + ]>; + cancelCustomJob( + request: protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest|null|undefined, + {}|null|undefined>): void; + cancelCustomJob( + request: protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest|null|undefined, + {}|null|undefined>): void; + cancelCustomJob( + request?: protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.cancelCustomJob(request, options, callback); + } +/** + * Creates a DataLabelingJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the DataLabelingJob. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1.DataLabelingJob} request.dataLabelingJob + * Required. The DataLabelingJob to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DataLabelingJob]{@link google.cloud.aiplatform.v1.DataLabelingJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_CreateDataLabelingJob_async + */ + createDataLabelingJob( + request?: protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest|undefined, {}|undefined + ]>; + createDataLabelingJob( + request: protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest|null|undefined, + {}|null|undefined>): void; + createDataLabelingJob( + request: protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest|null|undefined, + {}|null|undefined>): void; + createDataLabelingJob( + request?: protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createDataLabelingJob(request, options, callback); + } +/** + * Gets a DataLabelingJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DataLabelingJob. + * Format: + * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DataLabelingJob]{@link google.cloud.aiplatform.v1.DataLabelingJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_GetDataLabelingJob_async + */ + getDataLabelingJob( + request?: protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest|undefined, {}|undefined + ]>; + getDataLabelingJob( + request: protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest|null|undefined, + {}|null|undefined>): void; + getDataLabelingJob( + request: protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest|null|undefined, + {}|null|undefined>): void; + getDataLabelingJob( + request?: protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getDataLabelingJob(request, options, callback); + } +/** + * Cancels a DataLabelingJob. Success of cancellation is not guaranteed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DataLabelingJob. + * Format: + * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_CancelDataLabelingJob_async + */ + cancelDataLabelingJob( + request?: protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest|undefined, {}|undefined + ]>; + cancelDataLabelingJob( + request: protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest|null|undefined, + {}|null|undefined>): void; + cancelDataLabelingJob( + request: protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest|null|undefined, + {}|null|undefined>): void; + cancelDataLabelingJob( + request?: protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.cancelDataLabelingJob(request, options, callback); + } +/** + * Creates a HyperparameterTuningJob + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the HyperparameterTuningJob in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1.HyperparameterTuningJob} request.hyperparameterTuningJob + * Required. The HyperparameterTuningJob to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1.HyperparameterTuningJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_CreateHyperparameterTuningJob_async + */ + createHyperparameterTuningJob( + request?: protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest|undefined, {}|undefined + ]>; + createHyperparameterTuningJob( + request: protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>): void; + createHyperparameterTuningJob( + request: protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>): void; + createHyperparameterTuningJob( + request?: protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createHyperparameterTuningJob(request, options, callback); + } +/** + * Gets a HyperparameterTuningJob + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the HyperparameterTuningJob resource. + * Format: + * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1.HyperparameterTuningJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_GetHyperparameterTuningJob_async + */ + getHyperparameterTuningJob( + request?: protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest|undefined, {}|undefined + ]>; + getHyperparameterTuningJob( + request: protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>): void; + getHyperparameterTuningJob( + request: protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>): void; + getHyperparameterTuningJob( + request?: protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getHyperparameterTuningJob(request, options, callback); + } +/** + * Cancels a HyperparameterTuningJob. + * Starts asynchronous cancellation on the HyperparameterTuningJob. The server + * makes a best effort to cancel the job, but success is not + * guaranteed. Clients can use {@link google.cloud.aiplatform.v1.JobService.GetHyperparameterTuningJob|JobService.GetHyperparameterTuningJob} or + * other methods to check whether the cancellation succeeded or whether the + * job completed despite cancellation. On successful cancellation, + * the HyperparameterTuningJob is not deleted; instead it becomes a job with + * a {@link google.cloud.aiplatform.v1.HyperparameterTuningJob.error|HyperparameterTuningJob.error} value with a {@link google.rpc.Status.code|google.rpc.Status.code} + * of 1, corresponding to `Code.CANCELLED`, and + * {@link google.cloud.aiplatform.v1.HyperparameterTuningJob.state|HyperparameterTuningJob.state} is set to `CANCELLED`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the HyperparameterTuningJob to cancel. + * Format: + * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_CancelHyperparameterTuningJob_async + */ + cancelHyperparameterTuningJob( + request?: protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest|undefined, {}|undefined + ]>; + cancelHyperparameterTuningJob( + request: protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>): void; + cancelHyperparameterTuningJob( + request: protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>): void; + cancelHyperparameterTuningJob( + request?: protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.cancelHyperparameterTuningJob(request, options, callback); + } +/** + * Creates a BatchPredictionJob. A BatchPredictionJob once created will + * right away be attempted to start. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the BatchPredictionJob in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1.BatchPredictionJob} request.batchPredictionJob + * Required. The BatchPredictionJob to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchPredictionJob]{@link google.cloud.aiplatform.v1.BatchPredictionJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_CreateBatchPredictionJob_async + */ + createBatchPredictionJob( + request?: protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest|undefined, {}|undefined + ]>; + createBatchPredictionJob( + request: protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest|null|undefined, + {}|null|undefined>): void; + createBatchPredictionJob( + request: protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest|null|undefined, + {}|null|undefined>): void; + createBatchPredictionJob( + request?: protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createBatchPredictionJob(request, options, callback); + } +/** + * Gets a BatchPredictionJob + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the BatchPredictionJob resource. + * Format: + * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchPredictionJob]{@link google.cloud.aiplatform.v1.BatchPredictionJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_GetBatchPredictionJob_async + */ + getBatchPredictionJob( + request?: protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest|undefined, {}|undefined + ]>; + getBatchPredictionJob( + request: protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest|null|undefined, + {}|null|undefined>): void; + getBatchPredictionJob( + request: protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest|null|undefined, + {}|null|undefined>): void; + getBatchPredictionJob( + request?: protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getBatchPredictionJob(request, options, callback); + } +/** + * Cancels a BatchPredictionJob. + * + * Starts asynchronous cancellation on the BatchPredictionJob. The server + * makes the best effort to cancel the job, but success is not + * guaranteed. Clients can use {@link google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob|JobService.GetBatchPredictionJob} or + * other methods to check whether the cancellation succeeded or whether the + * job completed despite cancellation. On a successful cancellation, + * the BatchPredictionJob is not deleted;instead its + * {@link google.cloud.aiplatform.v1.BatchPredictionJob.state|BatchPredictionJob.state} is set to `CANCELLED`. Any files already + * outputted by the job are not deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the BatchPredictionJob to cancel. + * Format: + * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_CancelBatchPredictionJob_async + */ + cancelBatchPredictionJob( + request?: protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest|undefined, {}|undefined + ]>; + cancelBatchPredictionJob( + request: protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest|null|undefined, + {}|null|undefined>): void; + cancelBatchPredictionJob( + request: protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest|null|undefined, + {}|null|undefined>): void; + cancelBatchPredictionJob( + request?: protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.cancelBatchPredictionJob(request, options, callback); + } +/** + * Creates a ModelDeploymentMonitoringJob. It will run periodically on a + * configured interval. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the ModelDeploymentMonitoringJob. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob} request.modelDeploymentMonitoringJob + * Required. The ModelDeploymentMonitoringJob to create + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_CreateModelDeploymentMonitoringJob_async + */ + createModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest|undefined, {}|undefined + ]>; + createModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): void; + createModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): void; + createModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createModelDeploymentMonitoringJob(request, options, callback); + } +/** + * Gets a ModelDeploymentMonitoringJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ModelDeploymentMonitoringJob. + * Format: + * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_GetModelDeploymentMonitoringJob_async + */ + getModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest|undefined, {}|undefined + ]>; + getModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): void; + getModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): void; + getModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getModelDeploymentMonitoringJob(request, options, callback); + } +/** + * Pauses a ModelDeploymentMonitoringJob. If the job is running, the server + * makes a best effort to cancel the job. Will mark + * {@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.state|ModelDeploymentMonitoringJob.state} to 'PAUSED'. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ModelDeploymentMonitoringJob to pause. + * Format: + * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_PauseModelDeploymentMonitoringJob_async + */ + pauseModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest|undefined, {}|undefined + ]>; + pauseModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): void; + pauseModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): void; + pauseModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.pauseModelDeploymentMonitoringJob(request, options, callback); + } +/** + * Resumes a paused ModelDeploymentMonitoringJob. It will start to run from + * next scheduled time. A deleted ModelDeploymentMonitoringJob can't be + * resumed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ModelDeploymentMonitoringJob to resume. + * Format: + * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_ResumeModelDeploymentMonitoringJob_async + */ + resumeModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest|undefined, {}|undefined + ]>; + resumeModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): void; + resumeModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): void; + resumeModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.resumeModelDeploymentMonitoringJob(request, options, callback); + } + +/** + * Deletes a CustomJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CustomJob resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/customJobs/{custom_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_DeleteCustomJob_async + */ + deleteCustomJob( + request?: protos.google.cloud.aiplatform.v1.IDeleteCustomJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteCustomJob( + request: protos.google.cloud.aiplatform.v1.IDeleteCustomJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteCustomJob( + request: protos.google.cloud.aiplatform.v1.IDeleteCustomJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteCustomJob( + request?: protos.google.cloud.aiplatform.v1.IDeleteCustomJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteCustomJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteCustomJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_DeleteCustomJob_async + */ + async checkDeleteCustomJobProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteCustomJob, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a DataLabelingJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DataLabelingJob to be deleted. + * Format: + * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_DeleteDataLabelingJob_async + */ + deleteDataLabelingJob( + request?: protos.google.cloud.aiplatform.v1.IDeleteDataLabelingJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteDataLabelingJob( + request: protos.google.cloud.aiplatform.v1.IDeleteDataLabelingJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteDataLabelingJob( + request: protos.google.cloud.aiplatform.v1.IDeleteDataLabelingJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteDataLabelingJob( + request?: protos.google.cloud.aiplatform.v1.IDeleteDataLabelingJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteDataLabelingJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteDataLabelingJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_DeleteDataLabelingJob_async + */ + async checkDeleteDataLabelingJobProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteDataLabelingJob, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a HyperparameterTuningJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the HyperparameterTuningJob resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_DeleteHyperparameterTuningJob_async + */ + deleteHyperparameterTuningJob( + request?: protos.google.cloud.aiplatform.v1.IDeleteHyperparameterTuningJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteHyperparameterTuningJob( + request: protos.google.cloud.aiplatform.v1.IDeleteHyperparameterTuningJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteHyperparameterTuningJob( + request: protos.google.cloud.aiplatform.v1.IDeleteHyperparameterTuningJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteHyperparameterTuningJob( + request?: protos.google.cloud.aiplatform.v1.IDeleteHyperparameterTuningJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteHyperparameterTuningJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteHyperparameterTuningJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_DeleteHyperparameterTuningJob_async + */ + async checkDeleteHyperparameterTuningJobProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteHyperparameterTuningJob, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a BatchPredictionJob. Can only be called on jobs that already + * finished. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the BatchPredictionJob resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_DeleteBatchPredictionJob_async + */ + deleteBatchPredictionJob( + request?: protos.google.cloud.aiplatform.v1.IDeleteBatchPredictionJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteBatchPredictionJob( + request: protos.google.cloud.aiplatform.v1.IDeleteBatchPredictionJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBatchPredictionJob( + request: protos.google.cloud.aiplatform.v1.IDeleteBatchPredictionJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBatchPredictionJob( + request?: protos.google.cloud.aiplatform.v1.IDeleteBatchPredictionJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteBatchPredictionJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteBatchPredictionJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_DeleteBatchPredictionJob_async + */ + async checkDeleteBatchPredictionJobProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteBatchPredictionJob, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates a ModelDeploymentMonitoringJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob} request.modelDeploymentMonitoringJob + * Required. The model monitoring configuration which replaces the resource on the + * server. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask is used to specify the fields to be overwritten in the + * ModelDeploymentMonitoringJob resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then only the non-empty fields present in the + * request will be overwritten. Set the update_mask to `*` to override all + * fields. + * For the objective config, the user can either provide the update mask for + * model_deployment_monitoring_objective_configs or any combination of its + * nested fields, such as: + * model_deployment_monitoring_objective_configs.objective_config.training_dataset. + * + * Updatable fields: + * + * * `display_name` + * * `model_deployment_monitoring_schedule_config` + * * `model_monitoring_alert_config` + * * `logging_sampling_strategy` + * * `labels` + * * `log_ttl` + * * `enable_monitoring_pipeline_logs` + * . and + * * `model_deployment_monitoring_objective_configs` + * . or + * * `model_deployment_monitoring_objective_configs.objective_config.training_dataset` + * * `model_deployment_monitoring_objective_configs.objective_config.training_prediction_skew_detection_config` + * * `model_deployment_monitoring_objective_configs.objective_config.prediction_drift_detection_config` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_UpdateModelDeploymentMonitoringJob_async + */ + updateModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1.IUpdateModelDeploymentMonitoringJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1.IUpdateModelDeploymentMonitoringJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1.IUpdateModelDeploymentMonitoringJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1.IUpdateModelDeploymentMonitoringJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'model_deployment_monitoring_job.name': request.modelDeploymentMonitoringJob!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateModelDeploymentMonitoringJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateModelDeploymentMonitoringJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_UpdateModelDeploymentMonitoringJob_async + */ + async checkUpdateModelDeploymentMonitoringJobProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateModelDeploymentMonitoringJob, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a ModelDeploymentMonitoringJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the model monitoring job to delete. + * Format: + * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_DeleteModelDeploymentMonitoringJob_async + */ + deleteModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1.IDeleteModelDeploymentMonitoringJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1.IDeleteModelDeploymentMonitoringJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1.IDeleteModelDeploymentMonitoringJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1.IDeleteModelDeploymentMonitoringJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteModelDeploymentMonitoringJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteModelDeploymentMonitoringJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_DeleteModelDeploymentMonitoringJob_async + */ + async checkDeleteModelDeploymentMonitoringJobProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteModelDeploymentMonitoringJob, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists CustomJobs in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the CustomJobs from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListCustomJobsResponse.next_page_token|ListCustomJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.JobService.ListCustomJobs|JobService.ListCustomJobs} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [CustomJob]{@link google.cloud.aiplatform.v1.CustomJob}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCustomJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCustomJobs( + request?: protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ICustomJob[], + protos.google.cloud.aiplatform.v1.IListCustomJobsRequest|null, + protos.google.cloud.aiplatform.v1.IListCustomJobsResponse + ]>; + listCustomJobs( + request: protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, + protos.google.cloud.aiplatform.v1.IListCustomJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ICustomJob>): void; + listCustomJobs( + request: protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, + protos.google.cloud.aiplatform.v1.IListCustomJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ICustomJob>): void; + listCustomJobs( + request?: protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, + protos.google.cloud.aiplatform.v1.IListCustomJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ICustomJob>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, + protos.google.cloud.aiplatform.v1.IListCustomJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ICustomJob>): + Promise<[ + protos.google.cloud.aiplatform.v1.ICustomJob[], + protos.google.cloud.aiplatform.v1.IListCustomJobsRequest|null, + protos.google.cloud.aiplatform.v1.IListCustomJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listCustomJobs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the CustomJobs from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListCustomJobsResponse.next_page_token|ListCustomJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.JobService.ListCustomJobs|JobService.ListCustomJobs} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [CustomJob]{@link google.cloud.aiplatform.v1.CustomJob} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCustomJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCustomJobsStream( + request?: protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listCustomJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCustomJobs.createStream( + this.innerApiCalls.listCustomJobs as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listCustomJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the CustomJobs from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListCustomJobsResponse.next_page_token|ListCustomJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.JobService.ListCustomJobs|JobService.ListCustomJobs} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [CustomJob]{@link google.cloud.aiplatform.v1.CustomJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_ListCustomJobs_async + */ + listCustomJobsAsync( + request?: protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listCustomJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCustomJobs.asyncIterate( + this.innerApiCalls['listCustomJobs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists DataLabelingJobs in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the DataLabelingJob. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. FieldMask represents a set of + * symbolic field paths. For example, the mask can be `paths: "name"`. The + * "name" here is a field in DataLabelingJob. + * If this field is not set, all fields of the DataLabelingJob are returned. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order by + * default. + * Use `desc` after a field name for descending. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [DataLabelingJob]{@link google.cloud.aiplatform.v1.DataLabelingJob}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDataLabelingJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDataLabelingJobs( + request?: protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IDataLabelingJob[], + protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest|null, + protos.google.cloud.aiplatform.v1.IListDataLabelingJobsResponse + ]>; + listDataLabelingJobs( + request: protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, + protos.google.cloud.aiplatform.v1.IListDataLabelingJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IDataLabelingJob>): void; + listDataLabelingJobs( + request: protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, + protos.google.cloud.aiplatform.v1.IListDataLabelingJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IDataLabelingJob>): void; + listDataLabelingJobs( + request?: protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, + protos.google.cloud.aiplatform.v1.IListDataLabelingJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IDataLabelingJob>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, + protos.google.cloud.aiplatform.v1.IListDataLabelingJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IDataLabelingJob>): + Promise<[ + protos.google.cloud.aiplatform.v1.IDataLabelingJob[], + protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest|null, + protos.google.cloud.aiplatform.v1.IListDataLabelingJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listDataLabelingJobs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the DataLabelingJob. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. FieldMask represents a set of + * symbolic field paths. For example, the mask can be `paths: "name"`. The + * "name" here is a field in DataLabelingJob. + * If this field is not set, all fields of the DataLabelingJob are returned. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order by + * default. + * Use `desc` after a field name for descending. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [DataLabelingJob]{@link google.cloud.aiplatform.v1.DataLabelingJob} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDataLabelingJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDataLabelingJobsStream( + request?: protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDataLabelingJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataLabelingJobs.createStream( + this.innerApiCalls.listDataLabelingJobs as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDataLabelingJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the DataLabelingJob. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. FieldMask represents a set of + * symbolic field paths. For example, the mask can be `paths: "name"`. The + * "name" here is a field in DataLabelingJob. + * If this field is not set, all fields of the DataLabelingJob are returned. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order by + * default. + * Use `desc` after a field name for descending. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [DataLabelingJob]{@link google.cloud.aiplatform.v1.DataLabelingJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_ListDataLabelingJobs_async + */ + listDataLabelingJobsAsync( + request?: protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDataLabelingJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataLabelingJobs.asyncIterate( + this.innerApiCalls['listDataLabelingJobs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists HyperparameterTuningJobs in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the HyperparameterTuningJobs + * from. Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListHyperparameterTuningJobsResponse.next_page_token|ListHyperparameterTuningJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.JobService.ListHyperparameterTuningJobs|JobService.ListHyperparameterTuningJobs} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1.HyperparameterTuningJob}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listHyperparameterTuningJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listHyperparameterTuningJobs( + request?: protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob[], + protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest|null, + protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsResponse + ]>; + listHyperparameterTuningJobs( + request: protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, + protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob>): void; + listHyperparameterTuningJobs( + request: protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, + protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob>): void; + listHyperparameterTuningJobs( + request?: protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, + protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, + protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob>): + Promise<[ + protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob[], + protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest|null, + protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listHyperparameterTuningJobs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the HyperparameterTuningJobs + * from. Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListHyperparameterTuningJobsResponse.next_page_token|ListHyperparameterTuningJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.JobService.ListHyperparameterTuningJobs|JobService.ListHyperparameterTuningJobs} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1.HyperparameterTuningJob} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listHyperparameterTuningJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listHyperparameterTuningJobsStream( + request?: protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listHyperparameterTuningJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listHyperparameterTuningJobs.createStream( + this.innerApiCalls.listHyperparameterTuningJobs as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listHyperparameterTuningJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the HyperparameterTuningJobs + * from. Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListHyperparameterTuningJobsResponse.next_page_token|ListHyperparameterTuningJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.JobService.ListHyperparameterTuningJobs|JobService.ListHyperparameterTuningJobs} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1.HyperparameterTuningJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_ListHyperparameterTuningJobs_async + */ + listHyperparameterTuningJobsAsync( + request?: protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listHyperparameterTuningJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listHyperparameterTuningJobs.asyncIterate( + this.innerApiCalls['listHyperparameterTuningJobs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists BatchPredictionJobs in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the BatchPredictionJobs + * from. Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * * `model_display_name` supports = and != + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListBatchPredictionJobsResponse.next_page_token|ListBatchPredictionJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.JobService.ListBatchPredictionJobs|JobService.ListBatchPredictionJobs} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [BatchPredictionJob]{@link google.cloud.aiplatform.v1.BatchPredictionJob}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listBatchPredictionJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listBatchPredictionJobs( + request?: protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IBatchPredictionJob[], + protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest|null, + protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsResponse + ]>; + listBatchPredictionJobs( + request: protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, + protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IBatchPredictionJob>): void; + listBatchPredictionJobs( + request: protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, + protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IBatchPredictionJob>): void; + listBatchPredictionJobs( + request?: protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, + protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IBatchPredictionJob>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, + protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IBatchPredictionJob>): + Promise<[ + protos.google.cloud.aiplatform.v1.IBatchPredictionJob[], + protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest|null, + protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listBatchPredictionJobs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the BatchPredictionJobs + * from. Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * * `model_display_name` supports = and != + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListBatchPredictionJobsResponse.next_page_token|ListBatchPredictionJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.JobService.ListBatchPredictionJobs|JobService.ListBatchPredictionJobs} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [BatchPredictionJob]{@link google.cloud.aiplatform.v1.BatchPredictionJob} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listBatchPredictionJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listBatchPredictionJobsStream( + request?: protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listBatchPredictionJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBatchPredictionJobs.createStream( + this.innerApiCalls.listBatchPredictionJobs as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listBatchPredictionJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the BatchPredictionJobs + * from. Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * * `model_display_name` supports = and != + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListBatchPredictionJobsResponse.next_page_token|ListBatchPredictionJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.JobService.ListBatchPredictionJobs|JobService.ListBatchPredictionJobs} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [BatchPredictionJob]{@link google.cloud.aiplatform.v1.BatchPredictionJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_ListBatchPredictionJobs_async + */ + listBatchPredictionJobsAsync( + request?: protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listBatchPredictionJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBatchPredictionJobs.asyncIterate( + this.innerApiCalls['listBatchPredictionJobs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Searches Model Monitoring Statistics generated within a given time window. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.modelDeploymentMonitoringJob + * Required. ModelDeploymentMonitoring Job resource name. + * Format: + * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + * @param {string} request.deployedModelId + * Required. The DeployedModel ID of the + * [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. + * @param {string} request.featureDisplayName + * The feature display name. If specified, only return the stats belonging to + * this feature. Format: + * {@link google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name|ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name}, + * example: "user_destination". + * @param {number[]} request.objectives + * Required. Objectives of the stats to retrieve. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * A page token received from a previous + * {@link google.cloud.aiplatform.v1.JobService.SearchModelDeploymentMonitoringStatsAnomalies|JobService.SearchModelDeploymentMonitoringStatsAnomalies} + * call. + * @param {google.protobuf.Timestamp} request.startTime + * The earliest timestamp of stats being generated. + * If not set, indicates fetching stats till the earliest possible one. + * @param {google.protobuf.Timestamp} request.endTime + * The latest timestamp of stats being generated. + * If not set, indicates feching stats till the latest possible one. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ModelMonitoringStatsAnomalies]{@link google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `searchModelDeploymentMonitoringStatsAnomaliesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchModelDeploymentMonitoringStatsAnomalies( + request?: protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IModelMonitoringStatsAnomalies[], + protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest|null, + protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse + ]>; + searchModelDeploymentMonitoringStatsAnomalies( + request: protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModelMonitoringStatsAnomalies>): void; + searchModelDeploymentMonitoringStatsAnomalies( + request: protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModelMonitoringStatsAnomalies>): void; + searchModelDeploymentMonitoringStatsAnomalies( + request?: protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModelMonitoringStatsAnomalies>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModelMonitoringStatsAnomalies>): + Promise<[ + protos.google.cloud.aiplatform.v1.IModelMonitoringStatsAnomalies[], + protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest|null, + protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'model_deployment_monitoring_job': request.modelDeploymentMonitoringJob || '', + }); + this.initialize(); + return this.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.modelDeploymentMonitoringJob + * Required. ModelDeploymentMonitoring Job resource name. + * Format: + * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + * @param {string} request.deployedModelId + * Required. The DeployedModel ID of the + * [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. + * @param {string} request.featureDisplayName + * The feature display name. If specified, only return the stats belonging to + * this feature. Format: + * {@link google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name|ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name}, + * example: "user_destination". + * @param {number[]} request.objectives + * Required. Objectives of the stats to retrieve. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * A page token received from a previous + * {@link google.cloud.aiplatform.v1.JobService.SearchModelDeploymentMonitoringStatsAnomalies|JobService.SearchModelDeploymentMonitoringStatsAnomalies} + * call. + * @param {google.protobuf.Timestamp} request.startTime + * The earliest timestamp of stats being generated. + * If not set, indicates fetching stats till the earliest possible one. + * @param {google.protobuf.Timestamp} request.endTime + * The latest timestamp of stats being generated. + * If not set, indicates feching stats till the latest possible one. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ModelMonitoringStatsAnomalies]{@link google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `searchModelDeploymentMonitoringStatsAnomaliesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchModelDeploymentMonitoringStatsAnomaliesStream( + request?: protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'model_deployment_monitoring_job': request.modelDeploymentMonitoringJob || '', + }); + const defaultCallSettings = this._defaults['searchModelDeploymentMonitoringStatsAnomalies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream( + this.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchModelDeploymentMonitoringStatsAnomalies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.modelDeploymentMonitoringJob + * Required. ModelDeploymentMonitoring Job resource name. + * Format: + * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + * @param {string} request.deployedModelId + * Required. The DeployedModel ID of the + * [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. + * @param {string} request.featureDisplayName + * The feature display name. If specified, only return the stats belonging to + * this feature. Format: + * {@link google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name|ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name}, + * example: "user_destination". + * @param {number[]} request.objectives + * Required. Objectives of the stats to retrieve. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * A page token received from a previous + * {@link google.cloud.aiplatform.v1.JobService.SearchModelDeploymentMonitoringStatsAnomalies|JobService.SearchModelDeploymentMonitoringStatsAnomalies} + * call. + * @param {google.protobuf.Timestamp} request.startTime + * The earliest timestamp of stats being generated. + * If not set, indicates fetching stats till the earliest possible one. + * @param {google.protobuf.Timestamp} request.endTime + * The latest timestamp of stats being generated. + * If not set, indicates feching stats till the latest possible one. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ModelMonitoringStatsAnomalies]{@link google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_SearchModelDeploymentMonitoringStatsAnomalies_async + */ + searchModelDeploymentMonitoringStatsAnomaliesAsync( + request?: protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'model_deployment_monitoring_job': request.modelDeploymentMonitoringJob || '', + }); + const defaultCallSettings = this._defaults['searchModelDeploymentMonitoringStatsAnomalies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate( + this.innerApiCalls['searchModelDeploymentMonitoringStatsAnomalies'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists ModelDeploymentMonitoringJobs in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the ModelDeploymentMonitoringJob. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listModelDeploymentMonitoringJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listModelDeploymentMonitoringJobs( + request?: protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob[], + protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest|null, + protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsResponse + ]>; + listModelDeploymentMonitoringJobs( + request: protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, + protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob>): void; + listModelDeploymentMonitoringJobs( + request: protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, + protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob>): void; + listModelDeploymentMonitoringJobs( + request?: protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, + protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, + protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob>): + Promise<[ + protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob[], + protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest|null, + protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listModelDeploymentMonitoringJobs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the ModelDeploymentMonitoringJob. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listModelDeploymentMonitoringJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listModelDeploymentMonitoringJobsStream( + request?: protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listModelDeploymentMonitoringJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelDeploymentMonitoringJobs.createStream( + this.innerApiCalls.listModelDeploymentMonitoringJobs as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listModelDeploymentMonitoringJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the ModelDeploymentMonitoringJob. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_JobService_ListModelDeploymentMonitoringJobs_async + */ + listModelDeploymentMonitoringJobsAsync( + request?: protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listModelDeploymentMonitoringJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate( + this.innerApiCalls['listModelDeploymentMonitoringJobs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.jobServiceStub && !this._terminated) { + return this.jobServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/job_service_client_config.json b/owl-bot-staging/v1/src/v1/job_service_client_config.json new file mode 100644 index 00000000..0d72482c --- /dev/null +++ b/owl-bot-staging/v1/src/v1/job_service_client_config.json @@ -0,0 +1,138 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.JobService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateCustomJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetCustomJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListCustomJobs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCustomJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelCustomJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateDataLabelingJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDataLabelingJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDataLabelingJobs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDataLabelingJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelDataLabelingJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateHyperparameterTuningJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetHyperparameterTuningJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListHyperparameterTuningJobs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteHyperparameterTuningJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelHyperparameterTuningJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBatchPredictionJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBatchPredictionJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBatchPredictionJobs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBatchPredictionJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelBatchPredictionJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateModelDeploymentMonitoringJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SearchModelDeploymentMonitoringStatsAnomalies": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetModelDeploymentMonitoringJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListModelDeploymentMonitoringJobs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateModelDeploymentMonitoringJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteModelDeploymentMonitoringJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PauseModelDeploymentMonitoringJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ResumeModelDeploymentMonitoringJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/job_service_proto_list.json b/owl-bot-staging/v1/src/v1/job_service_proto_list.json new file mode 100644 index 00000000..581a7346 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/job_service_proto_list.json @@ -0,0 +1,110 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1/src/v1/metadata_service_client.ts b/owl-bot-staging/v1/src/v1/metadata_service_client.ts new file mode 100644 index 00000000..780c1264 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/metadata_service_client.ts @@ -0,0 +1,5917 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/metadata_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './metadata_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * Service for reading and writing metadata entries. + * @class + * @memberof v1 + */ +export class MetadataServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + metadataServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of MetadataServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof MetadataServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listMetadataStores: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'metadataStores'), + listArtifacts: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'artifacts'), + listContexts: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'contexts'), + listExecutions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'executions'), + listMetadataSchemas: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'metadataSchemas') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const createMetadataStoreResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.MetadataStore') as gax.protobuf.Type; + const createMetadataStoreMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.CreateMetadataStoreOperationMetadata') as gax.protobuf.Type; + const deleteMetadataStoreResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteMetadataStoreMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteMetadataStoreOperationMetadata') as gax.protobuf.Type; + const deleteArtifactResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteArtifactMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + const purgeArtifactsResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.PurgeArtifactsResponse') as gax.protobuf.Type; + const purgeArtifactsMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.PurgeArtifactsMetadata') as gax.protobuf.Type; + const deleteContextResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteContextMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + const purgeContextsResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.PurgeContextsResponse') as gax.protobuf.Type; + const purgeContextsMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.PurgeContextsMetadata') as gax.protobuf.Type; + const deleteExecutionResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteExecutionMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + const purgeExecutionsResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.PurgeExecutionsResponse') as gax.protobuf.Type; + const purgeExecutionsMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.PurgeExecutionsMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createMetadataStore: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createMetadataStoreResponse.decode.bind(createMetadataStoreResponse), + createMetadataStoreMetadata.decode.bind(createMetadataStoreMetadata)), + deleteMetadataStore: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteMetadataStoreResponse.decode.bind(deleteMetadataStoreResponse), + deleteMetadataStoreMetadata.decode.bind(deleteMetadataStoreMetadata)), + deleteArtifact: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteArtifactResponse.decode.bind(deleteArtifactResponse), + deleteArtifactMetadata.decode.bind(deleteArtifactMetadata)), + purgeArtifacts: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + purgeArtifactsResponse.decode.bind(purgeArtifactsResponse), + purgeArtifactsMetadata.decode.bind(purgeArtifactsMetadata)), + deleteContext: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteContextResponse.decode.bind(deleteContextResponse), + deleteContextMetadata.decode.bind(deleteContextMetadata)), + purgeContexts: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + purgeContextsResponse.decode.bind(purgeContextsResponse), + purgeContextsMetadata.decode.bind(purgeContextsMetadata)), + deleteExecution: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteExecutionResponse.decode.bind(deleteExecutionResponse), + deleteExecutionMetadata.decode.bind(deleteExecutionMetadata)), + purgeExecutions: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + purgeExecutionsResponse.decode.bind(purgeExecutionsResponse), + purgeExecutionsMetadata.decode.bind(purgeExecutionsMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.MetadataService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.metadataServiceStub) { + return this.metadataServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.MetadataService. + this.metadataServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.MetadataService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.MetadataService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const metadataServiceStubMethods = + ['createMetadataStore', 'getMetadataStore', 'listMetadataStores', 'deleteMetadataStore', 'createArtifact', 'getArtifact', 'listArtifacts', 'updateArtifact', 'deleteArtifact', 'purgeArtifacts', 'createContext', 'getContext', 'listContexts', 'updateContext', 'deleteContext', 'purgeContexts', 'addContextArtifactsAndExecutions', 'addContextChildren', 'queryContextLineageSubgraph', 'createExecution', 'getExecution', 'listExecutions', 'updateExecution', 'deleteExecution', 'purgeExecutions', 'addExecutionEvents', 'queryExecutionInputsAndOutputs', 'createMetadataSchema', 'getMetadataSchema', 'listMetadataSchemas', 'queryArtifactLineageSubgraph']; + for (const methodName of metadataServiceStubMethods) { + const callPromise = this.metadataServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.metadataServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Retrieves a specific MetadataStore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the MetadataStore to retrieve. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MetadataStore]{@link google.cloud.aiplatform.v1.MetadataStore}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_GetMetadataStore_async + */ + getMetadataStore( + request?: protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IMetadataStore, + protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest|undefined, {}|undefined + ]>; + getMetadataStore( + request: protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IMetadataStore, + protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest|null|undefined, + {}|null|undefined>): void; + getMetadataStore( + request: protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IMetadataStore, + protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest|null|undefined, + {}|null|undefined>): void; + getMetadataStore( + request?: protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IMetadataStore, + protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IMetadataStore, + protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IMetadataStore, + protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getMetadataStore(request, options, callback); + } +/** + * Creates an Artifact associated with a MetadataStore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the MetadataStore where the Artifact should + * be created. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {google.cloud.aiplatform.v1.Artifact} request.artifact + * Required. The Artifact to create. + * @param {string} request.artifactId + * The {artifact} portion of the resource name with the format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + * If not provided, the Artifact's ID will be a UUID generated by the service. + * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. + * Must be unique across all Artifacts in the parent MetadataStore. (Otherwise + * the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the + * caller can't view the preexisting Artifact.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Artifact]{@link google.cloud.aiplatform.v1.Artifact}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_CreateArtifact_async + */ + createArtifact( + request?: protos.google.cloud.aiplatform.v1.ICreateArtifactRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IArtifact, + protos.google.cloud.aiplatform.v1.ICreateArtifactRequest|undefined, {}|undefined + ]>; + createArtifact( + request: protos.google.cloud.aiplatform.v1.ICreateArtifactRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IArtifact, + protos.google.cloud.aiplatform.v1.ICreateArtifactRequest|null|undefined, + {}|null|undefined>): void; + createArtifact( + request: protos.google.cloud.aiplatform.v1.ICreateArtifactRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IArtifact, + protos.google.cloud.aiplatform.v1.ICreateArtifactRequest|null|undefined, + {}|null|undefined>): void; + createArtifact( + request?: protos.google.cloud.aiplatform.v1.ICreateArtifactRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IArtifact, + protos.google.cloud.aiplatform.v1.ICreateArtifactRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IArtifact, + protos.google.cloud.aiplatform.v1.ICreateArtifactRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IArtifact, + protos.google.cloud.aiplatform.v1.ICreateArtifactRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createArtifact(request, options, callback); + } +/** + * Retrieves a specific Artifact. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Artifact to retrieve. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Artifact]{@link google.cloud.aiplatform.v1.Artifact}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_GetArtifact_async + */ + getArtifact( + request?: protos.google.cloud.aiplatform.v1.IGetArtifactRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IArtifact, + protos.google.cloud.aiplatform.v1.IGetArtifactRequest|undefined, {}|undefined + ]>; + getArtifact( + request: protos.google.cloud.aiplatform.v1.IGetArtifactRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IArtifact, + protos.google.cloud.aiplatform.v1.IGetArtifactRequest|null|undefined, + {}|null|undefined>): void; + getArtifact( + request: protos.google.cloud.aiplatform.v1.IGetArtifactRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IArtifact, + protos.google.cloud.aiplatform.v1.IGetArtifactRequest|null|undefined, + {}|null|undefined>): void; + getArtifact( + request?: protos.google.cloud.aiplatform.v1.IGetArtifactRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IArtifact, + protos.google.cloud.aiplatform.v1.IGetArtifactRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IArtifact, + protos.google.cloud.aiplatform.v1.IGetArtifactRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IArtifact, + protos.google.cloud.aiplatform.v1.IGetArtifactRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getArtifact(request, options, callback); + } +/** + * Updates a stored Artifact. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.Artifact} request.artifact + * Required. The Artifact containing updates. + * The Artifact's {@link google.cloud.aiplatform.v1.Artifact.name|Artifact.name} field is used to identify the Artifact to + * be updated. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. A FieldMask indicating which fields should be updated. + * Functionality of this field is not yet supported. + * @param {boolean} request.allowMissing + * If set to true, and the {@link google.cloud.aiplatform.v1.Artifact|Artifact} is not found, a new {@link google.cloud.aiplatform.v1.Artifact|Artifact} is + * created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Artifact]{@link google.cloud.aiplatform.v1.Artifact}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_UpdateArtifact_async + */ + updateArtifact( + request?: protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IArtifact, + protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest|undefined, {}|undefined + ]>; + updateArtifact( + request: protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IArtifact, + protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest|null|undefined, + {}|null|undefined>): void; + updateArtifact( + request: protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IArtifact, + protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest|null|undefined, + {}|null|undefined>): void; + updateArtifact( + request?: protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IArtifact, + protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IArtifact, + protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IArtifact, + protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'artifact.name': request.artifact!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateArtifact(request, options, callback); + } +/** + * Creates a Context associated with a MetadataStore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the MetadataStore where the Context should be + * created. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {google.cloud.aiplatform.v1.Context} request.context + * Required. The Context to create. + * @param {string} request.contextId + * The {context} portion of the resource name with the format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`. + * If not provided, the Context's ID will be a UUID generated by the service. + * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. + * Must be unique across all Contexts in the parent MetadataStore. (Otherwise + * the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the + * caller can't view the preexisting Context.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Context]{@link google.cloud.aiplatform.v1.Context}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_CreateContext_async + */ + createContext( + request?: protos.google.cloud.aiplatform.v1.ICreateContextRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IContext, + protos.google.cloud.aiplatform.v1.ICreateContextRequest|undefined, {}|undefined + ]>; + createContext( + request: protos.google.cloud.aiplatform.v1.ICreateContextRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IContext, + protos.google.cloud.aiplatform.v1.ICreateContextRequest|null|undefined, + {}|null|undefined>): void; + createContext( + request: protos.google.cloud.aiplatform.v1.ICreateContextRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IContext, + protos.google.cloud.aiplatform.v1.ICreateContextRequest|null|undefined, + {}|null|undefined>): void; + createContext( + request?: protos.google.cloud.aiplatform.v1.ICreateContextRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IContext, + protos.google.cloud.aiplatform.v1.ICreateContextRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IContext, + protos.google.cloud.aiplatform.v1.ICreateContextRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IContext, + protos.google.cloud.aiplatform.v1.ICreateContextRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createContext(request, options, callback); + } +/** + * Retrieves a specific Context. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Context to retrieve. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Context]{@link google.cloud.aiplatform.v1.Context}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_GetContext_async + */ + getContext( + request?: protos.google.cloud.aiplatform.v1.IGetContextRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IContext, + protos.google.cloud.aiplatform.v1.IGetContextRequest|undefined, {}|undefined + ]>; + getContext( + request: protos.google.cloud.aiplatform.v1.IGetContextRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IContext, + protos.google.cloud.aiplatform.v1.IGetContextRequest|null|undefined, + {}|null|undefined>): void; + getContext( + request: protos.google.cloud.aiplatform.v1.IGetContextRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IContext, + protos.google.cloud.aiplatform.v1.IGetContextRequest|null|undefined, + {}|null|undefined>): void; + getContext( + request?: protos.google.cloud.aiplatform.v1.IGetContextRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IContext, + protos.google.cloud.aiplatform.v1.IGetContextRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IContext, + protos.google.cloud.aiplatform.v1.IGetContextRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IContext, + protos.google.cloud.aiplatform.v1.IGetContextRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getContext(request, options, callback); + } +/** + * Updates a stored Context. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.Context} request.context + * Required. The Context containing updates. + * The Context's {@link google.cloud.aiplatform.v1.Context.name|Context.name} field is used to identify the Context to be + * updated. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. A FieldMask indicating which fields should be updated. + * Functionality of this field is not yet supported. + * @param {boolean} request.allowMissing + * If set to true, and the {@link google.cloud.aiplatform.v1.Context|Context} is not found, a new {@link google.cloud.aiplatform.v1.Context|Context} is + * created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Context]{@link google.cloud.aiplatform.v1.Context}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_UpdateContext_async + */ + updateContext( + request?: protos.google.cloud.aiplatform.v1.IUpdateContextRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IContext, + protos.google.cloud.aiplatform.v1.IUpdateContextRequest|undefined, {}|undefined + ]>; + updateContext( + request: protos.google.cloud.aiplatform.v1.IUpdateContextRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IContext, + protos.google.cloud.aiplatform.v1.IUpdateContextRequest|null|undefined, + {}|null|undefined>): void; + updateContext( + request: protos.google.cloud.aiplatform.v1.IUpdateContextRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IContext, + protos.google.cloud.aiplatform.v1.IUpdateContextRequest|null|undefined, + {}|null|undefined>): void; + updateContext( + request?: protos.google.cloud.aiplatform.v1.IUpdateContextRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IContext, + protos.google.cloud.aiplatform.v1.IUpdateContextRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IContext, + protos.google.cloud.aiplatform.v1.IUpdateContextRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IContext, + protos.google.cloud.aiplatform.v1.IUpdateContextRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'context.name': request.context!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateContext(request, options, callback); + } +/** + * Adds a set of Artifacts and Executions to a Context. If any of the + * Artifacts or Executions have already been added to a Context, they are + * simply skipped. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.context + * Required. The resource name of the Context that the Artifacts and Executions + * belong to. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + * @param {string[]} request.artifacts + * The resource names of the Artifacts to attribute to the Context. + * + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + * @param {string[]} request.executions + * The resource names of the Executions to associate with the + * Context. + * + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AddContextArtifactsAndExecutionsResponse]{@link google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_AddContextArtifactsAndExecutions_async + */ + addContextArtifactsAndExecutions( + request?: protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsResponse, + protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest|undefined, {}|undefined + ]>; + addContextArtifactsAndExecutions( + request: protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsResponse, + protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest|null|undefined, + {}|null|undefined>): void; + addContextArtifactsAndExecutions( + request: protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsResponse, + protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest|null|undefined, + {}|null|undefined>): void; + addContextArtifactsAndExecutions( + request?: protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsResponse, + protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsResponse, + protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsResponse, + protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'context': request.context || '', + }); + this.initialize(); + return this.innerApiCalls.addContextArtifactsAndExecutions(request, options, callback); + } +/** + * Adds a set of Contexts as children to a parent Context. If any of the + * child Contexts have already been added to the parent Context, they are + * simply skipped. If this call would create a cycle or cause any Context to + * have more than 10 parents, the request will fail with an INVALID_ARGUMENT + * error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.context + * Required. The resource name of the parent Context. + * + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + * @param {string[]} request.childContexts + * The resource names of the child Contexts. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AddContextChildrenResponse]{@link google.cloud.aiplatform.v1.AddContextChildrenResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_AddContextChildren_async + */ + addContextChildren( + request?: protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IAddContextChildrenResponse, + protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest|undefined, {}|undefined + ]>; + addContextChildren( + request: protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IAddContextChildrenResponse, + protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest|null|undefined, + {}|null|undefined>): void; + addContextChildren( + request: protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IAddContextChildrenResponse, + protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest|null|undefined, + {}|null|undefined>): void; + addContextChildren( + request?: protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IAddContextChildrenResponse, + protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IAddContextChildrenResponse, + protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IAddContextChildrenResponse, + protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'context': request.context || '', + }); + this.initialize(); + return this.innerApiCalls.addContextChildren(request, options, callback); + } +/** + * Retrieves Artifacts and Executions within the specified Context, connected + * by Event edges and returned as a LineageSubgraph. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.context + * Required. The resource name of the Context whose Artifacts and Executions + * should be retrieved as a LineageSubgraph. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + * + * The request may error with FAILED_PRECONDITION if the number of Artifacts, + * the number of Executions, or the number of Events that would be returned + * for the Context exceeds 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [LineageSubgraph]{@link google.cloud.aiplatform.v1.LineageSubgraph}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_QueryContextLineageSubgraph_async + */ + queryContextLineageSubgraph( + request?: protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest|undefined, {}|undefined + ]>; + queryContextLineageSubgraph( + request: protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest|null|undefined, + {}|null|undefined>): void; + queryContextLineageSubgraph( + request: protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest|null|undefined, + {}|null|undefined>): void; + queryContextLineageSubgraph( + request?: protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'context': request.context || '', + }); + this.initialize(); + return this.innerApiCalls.queryContextLineageSubgraph(request, options, callback); + } +/** + * Creates an Execution associated with a MetadataStore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the MetadataStore where the Execution should + * be created. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {google.cloud.aiplatform.v1.Execution} request.execution + * Required. The Execution to create. + * @param {string} request.executionId + * The {execution} portion of the resource name with the format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + * If not provided, the Execution's ID will be a UUID generated by the + * service. + * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. + * Must be unique across all Executions in the parent MetadataStore. + * (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + * if the caller can't view the preexisting Execution.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Execution]{@link google.cloud.aiplatform.v1.Execution}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_CreateExecution_async + */ + createExecution( + request?: protos.google.cloud.aiplatform.v1.ICreateExecutionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IExecution, + protos.google.cloud.aiplatform.v1.ICreateExecutionRequest|undefined, {}|undefined + ]>; + createExecution( + request: protos.google.cloud.aiplatform.v1.ICreateExecutionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IExecution, + protos.google.cloud.aiplatform.v1.ICreateExecutionRequest|null|undefined, + {}|null|undefined>): void; + createExecution( + request: protos.google.cloud.aiplatform.v1.ICreateExecutionRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IExecution, + protos.google.cloud.aiplatform.v1.ICreateExecutionRequest|null|undefined, + {}|null|undefined>): void; + createExecution( + request?: protos.google.cloud.aiplatform.v1.ICreateExecutionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IExecution, + protos.google.cloud.aiplatform.v1.ICreateExecutionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IExecution, + protos.google.cloud.aiplatform.v1.ICreateExecutionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IExecution, + protos.google.cloud.aiplatform.v1.ICreateExecutionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createExecution(request, options, callback); + } +/** + * Retrieves a specific Execution. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Execution to retrieve. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Execution]{@link google.cloud.aiplatform.v1.Execution}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_GetExecution_async + */ + getExecution( + request?: protos.google.cloud.aiplatform.v1.IGetExecutionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IExecution, + protos.google.cloud.aiplatform.v1.IGetExecutionRequest|undefined, {}|undefined + ]>; + getExecution( + request: protos.google.cloud.aiplatform.v1.IGetExecutionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IExecution, + protos.google.cloud.aiplatform.v1.IGetExecutionRequest|null|undefined, + {}|null|undefined>): void; + getExecution( + request: protos.google.cloud.aiplatform.v1.IGetExecutionRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IExecution, + protos.google.cloud.aiplatform.v1.IGetExecutionRequest|null|undefined, + {}|null|undefined>): void; + getExecution( + request?: protos.google.cloud.aiplatform.v1.IGetExecutionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IExecution, + protos.google.cloud.aiplatform.v1.IGetExecutionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IExecution, + protos.google.cloud.aiplatform.v1.IGetExecutionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IExecution, + protos.google.cloud.aiplatform.v1.IGetExecutionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getExecution(request, options, callback); + } +/** + * Updates a stored Execution. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.Execution} request.execution + * Required. The Execution containing updates. + * The Execution's {@link google.cloud.aiplatform.v1.Execution.name|Execution.name} field is used to identify the Execution + * to be updated. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. A FieldMask indicating which fields should be updated. + * Functionality of this field is not yet supported. + * @param {boolean} request.allowMissing + * If set to true, and the {@link google.cloud.aiplatform.v1.Execution|Execution} is not found, a new {@link google.cloud.aiplatform.v1.Execution|Execution} + * is created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Execution]{@link google.cloud.aiplatform.v1.Execution}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_UpdateExecution_async + */ + updateExecution( + request?: protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IExecution, + protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest|undefined, {}|undefined + ]>; + updateExecution( + request: protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IExecution, + protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest|null|undefined, + {}|null|undefined>): void; + updateExecution( + request: protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IExecution, + protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest|null|undefined, + {}|null|undefined>): void; + updateExecution( + request?: protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IExecution, + protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IExecution, + protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IExecution, + protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'execution.name': request.execution!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateExecution(request, options, callback); + } +/** + * Adds Events to the specified Execution. An Event indicates whether an + * Artifact was used as an input or output for an Execution. If an Event + * already exists between the Execution and the Artifact, the Event is + * skipped. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.execution + * Required. The resource name of the Execution that the Events connect + * Artifacts with. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + * @param {number[]} request.events + * The Events to create and add. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AddExecutionEventsResponse]{@link google.cloud.aiplatform.v1.AddExecutionEventsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_AddExecutionEvents_async + */ + addExecutionEvents( + request?: protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IAddExecutionEventsResponse, + protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest|undefined, {}|undefined + ]>; + addExecutionEvents( + request: protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IAddExecutionEventsResponse, + protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest|null|undefined, + {}|null|undefined>): void; + addExecutionEvents( + request: protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IAddExecutionEventsResponse, + protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest|null|undefined, + {}|null|undefined>): void; + addExecutionEvents( + request?: protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IAddExecutionEventsResponse, + protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IAddExecutionEventsResponse, + protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IAddExecutionEventsResponse, + protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'execution': request.execution || '', + }); + this.initialize(); + return this.innerApiCalls.addExecutionEvents(request, options, callback); + } +/** + * Obtains the set of input and output Artifacts for this Execution, in the + * form of LineageSubgraph that also contains the Execution and connecting + * Events. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.execution + * Required. The resource name of the Execution whose input and output Artifacts should + * be retrieved as a LineageSubgraph. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [LineageSubgraph]{@link google.cloud.aiplatform.v1.LineageSubgraph}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_QueryExecutionInputsAndOutputs_async + */ + queryExecutionInputsAndOutputs( + request?: protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest|undefined, {}|undefined + ]>; + queryExecutionInputsAndOutputs( + request: protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest|null|undefined, + {}|null|undefined>): void; + queryExecutionInputsAndOutputs( + request: protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest|null|undefined, + {}|null|undefined>): void; + queryExecutionInputsAndOutputs( + request?: protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'execution': request.execution || '', + }); + this.initialize(); + return this.innerApiCalls.queryExecutionInputsAndOutputs(request, options, callback); + } +/** + * Creates a MetadataSchema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the MetadataStore where the MetadataSchema should + * be created. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {google.cloud.aiplatform.v1.MetadataSchema} request.metadataSchema + * Required. The MetadataSchema to create. + * @param {string} request.metadataSchemaId + * The {metadata_schema} portion of the resource name with the format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` + * If not provided, the MetadataStore's ID will be a UUID generated by the + * service. + * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. + * Must be unique across all MetadataSchemas in the parent Location. + * (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + * if the caller can't view the preexisting MetadataSchema.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MetadataSchema]{@link google.cloud.aiplatform.v1.MetadataSchema}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_CreateMetadataSchema_async + */ + createMetadataSchema( + request?: protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IMetadataSchema, + protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest|undefined, {}|undefined + ]>; + createMetadataSchema( + request: protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IMetadataSchema, + protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest|null|undefined, + {}|null|undefined>): void; + createMetadataSchema( + request: protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IMetadataSchema, + protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest|null|undefined, + {}|null|undefined>): void; + createMetadataSchema( + request?: protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IMetadataSchema, + protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IMetadataSchema, + protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IMetadataSchema, + protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createMetadataSchema(request, options, callback); + } +/** + * Retrieves a specific MetadataSchema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the MetadataSchema to retrieve. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MetadataSchema]{@link google.cloud.aiplatform.v1.MetadataSchema}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_GetMetadataSchema_async + */ + getMetadataSchema( + request?: protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IMetadataSchema, + protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest|undefined, {}|undefined + ]>; + getMetadataSchema( + request: protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IMetadataSchema, + protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest|null|undefined, + {}|null|undefined>): void; + getMetadataSchema( + request: protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IMetadataSchema, + protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest|null|undefined, + {}|null|undefined>): void; + getMetadataSchema( + request?: protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IMetadataSchema, + protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IMetadataSchema, + protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IMetadataSchema, + protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getMetadataSchema(request, options, callback); + } +/** + * Retrieves lineage of an Artifact represented through Artifacts and + * Executions connected by Event edges and returned as a LineageSubgraph. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.artifact + * Required. The resource name of the Artifact whose Lineage needs to be retrieved as a + * LineageSubgraph. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + * + * The request may error with FAILED_PRECONDITION if the number of Artifacts, + * the number of Executions, or the number of Events that would be returned + * for the Context exceeds 1000. + * @param {number} request.maxHops + * Specifies the size of the lineage graph in terms of number of hops from the + * specified artifact. + * Negative Value: INVALID_ARGUMENT error is returned + * 0: Only input artifact is returned. + * No value: Transitive closure is performed to return the complete graph. + * @param {string} request.filter + * Filter specifying the boolean condition for the Artifacts to satisfy in + * order to be part of the Lineage Subgraph. + * The syntax to define filter query is based on https://google.aip.dev/160. + * The supported set of filters include the following: + * + * * **Attribute filtering**: + * For example: `display_name = "test"` + * Supported fields include: `name`, `display_name`, `uri`, `state`, + * `schema_title`, `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"` + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..`. + * For example: `metadata.field_1.number_value = 10.0` + * + * Each of the above supported filter types can be combined together using + * logical operators (`AND` & `OR`). + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [LineageSubgraph]{@link google.cloud.aiplatform.v1.LineageSubgraph}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_QueryArtifactLineageSubgraph_async + */ + queryArtifactLineageSubgraph( + request?: protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest|undefined, {}|undefined + ]>; + queryArtifactLineageSubgraph( + request: protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest|null|undefined, + {}|null|undefined>): void; + queryArtifactLineageSubgraph( + request: protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest|null|undefined, + {}|null|undefined>): void; + queryArtifactLineageSubgraph( + request?: protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'artifact': request.artifact || '', + }); + this.initialize(); + return this.innerApiCalls.queryArtifactLineageSubgraph(request, options, callback); + } + +/** + * Initializes a MetadataStore, including allocation of resources. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location where the MetadataStore should + * be created. + * Format: `projects/{project}/locations/{location}/` + * @param {google.cloud.aiplatform.v1.MetadataStore} request.metadataStore + * Required. The MetadataStore to create. + * @param {string} request.metadataStoreId + * The {metadatastore} portion of the resource name with the format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * If not provided, the MetadataStore's ID will be a UUID generated by the + * service. + * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. + * Must be unique across all MetadataStores in the parent Location. + * (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + * if the caller can't view the preexisting MetadataStore.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_CreateMetadataStore_async + */ + createMetadataStore( + request?: protos.google.cloud.aiplatform.v1.ICreateMetadataStoreRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createMetadataStore( + request: protos.google.cloud.aiplatform.v1.ICreateMetadataStoreRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createMetadataStore( + request: protos.google.cloud.aiplatform.v1.ICreateMetadataStoreRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createMetadataStore( + request?: protos.google.cloud.aiplatform.v1.ICreateMetadataStoreRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createMetadataStore(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createMetadataStore()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_CreateMetadataStore_async + */ + async checkCreateMetadataStoreProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createMetadataStore, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single MetadataStore and all its child resources (Artifacts, + * Executions, and Contexts). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the MetadataStore to delete. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {boolean} request.force + * Deprecated: Field is no longer supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_DeleteMetadataStore_async + */ + deleteMetadataStore( + request?: protos.google.cloud.aiplatform.v1.IDeleteMetadataStoreRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteMetadataStore( + request: protos.google.cloud.aiplatform.v1.IDeleteMetadataStoreRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteMetadataStore( + request: protos.google.cloud.aiplatform.v1.IDeleteMetadataStoreRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteMetadataStore( + request?: protos.google.cloud.aiplatform.v1.IDeleteMetadataStoreRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteMetadataStore(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteMetadataStore()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_DeleteMetadataStore_async + */ + async checkDeleteMetadataStoreProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteMetadataStore, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes an Artifact. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Artifact to delete. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + * @param {string} [request.etag] + * Optional. The etag of the Artifact to delete. + * If this is provided, it must match the server's etag. Otherwise, the + * request will fail with a FAILED_PRECONDITION. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_DeleteArtifact_async + */ + deleteArtifact( + request?: protos.google.cloud.aiplatform.v1.IDeleteArtifactRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteArtifact( + request: protos.google.cloud.aiplatform.v1.IDeleteArtifactRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteArtifact( + request: protos.google.cloud.aiplatform.v1.IDeleteArtifactRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteArtifact( + request?: protos.google.cloud.aiplatform.v1.IDeleteArtifactRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteArtifact(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteArtifact()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_DeleteArtifact_async + */ + async checkDeleteArtifactProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteArtifact, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Purges Artifacts. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The metadata store to purge Artifacts from. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {string} request.filter + * Required. A required filter matching the Artifacts to be purged. + * E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + * @param {boolean} [request.force] + * Optional. Flag to indicate to actually perform the purge. + * If `force` is set to false, the method will return a sample of + * Artifact names that would be deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_PurgeArtifacts_async + */ + purgeArtifacts( + request?: protos.google.cloud.aiplatform.v1.IPurgeArtifactsRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + purgeArtifacts( + request: protos.google.cloud.aiplatform.v1.IPurgeArtifactsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + purgeArtifacts( + request: protos.google.cloud.aiplatform.v1.IPurgeArtifactsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + purgeArtifacts( + request?: protos.google.cloud.aiplatform.v1.IPurgeArtifactsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.purgeArtifacts(request, options, callback); + } +/** + * Check the status of the long running operation returned by `purgeArtifacts()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_PurgeArtifacts_async + */ + async checkPurgeArtifactsProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.purgeArtifacts, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a stored Context. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Context to delete. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + * @param {boolean} request.force + * The force deletion semantics is still undefined. + * Users should not use this field. + * @param {string} [request.etag] + * Optional. The etag of the Context to delete. + * If this is provided, it must match the server's etag. Otherwise, the + * request will fail with a FAILED_PRECONDITION. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_DeleteContext_async + */ + deleteContext( + request?: protos.google.cloud.aiplatform.v1.IDeleteContextRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteContext( + request: protos.google.cloud.aiplatform.v1.IDeleteContextRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteContext( + request: protos.google.cloud.aiplatform.v1.IDeleteContextRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteContext( + request?: protos.google.cloud.aiplatform.v1.IDeleteContextRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteContext(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteContext()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_DeleteContext_async + */ + async checkDeleteContextProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteContext, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Purges Contexts. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The metadata store to purge Contexts from. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {string} request.filter + * Required. A required filter matching the Contexts to be purged. + * E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + * @param {boolean} [request.force] + * Optional. Flag to indicate to actually perform the purge. + * If `force` is set to false, the method will return a sample of + * Context names that would be deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_PurgeContexts_async + */ + purgeContexts( + request?: protos.google.cloud.aiplatform.v1.IPurgeContextsRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + purgeContexts( + request: protos.google.cloud.aiplatform.v1.IPurgeContextsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + purgeContexts( + request: protos.google.cloud.aiplatform.v1.IPurgeContextsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + purgeContexts( + request?: protos.google.cloud.aiplatform.v1.IPurgeContextsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.purgeContexts(request, options, callback); + } +/** + * Check the status of the long running operation returned by `purgeContexts()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_PurgeContexts_async + */ + async checkPurgeContextsProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.purgeContexts, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes an Execution. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Execution to delete. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + * @param {string} [request.etag] + * Optional. The etag of the Execution to delete. + * If this is provided, it must match the server's etag. Otherwise, the + * request will fail with a FAILED_PRECONDITION. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_DeleteExecution_async + */ + deleteExecution( + request?: protos.google.cloud.aiplatform.v1.IDeleteExecutionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteExecution( + request: protos.google.cloud.aiplatform.v1.IDeleteExecutionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteExecution( + request: protos.google.cloud.aiplatform.v1.IDeleteExecutionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteExecution( + request?: protos.google.cloud.aiplatform.v1.IDeleteExecutionRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteExecution(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteExecution()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_DeleteExecution_async + */ + async checkDeleteExecutionProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteExecution, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Purges Executions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The metadata store to purge Executions from. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {string} request.filter + * Required. A required filter matching the Executions to be purged. + * E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + * @param {boolean} [request.force] + * Optional. Flag to indicate to actually perform the purge. + * If `force` is set to false, the method will return a sample of + * Execution names that would be deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_PurgeExecutions_async + */ + purgeExecutions( + request?: protos.google.cloud.aiplatform.v1.IPurgeExecutionsRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + purgeExecutions( + request: protos.google.cloud.aiplatform.v1.IPurgeExecutionsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + purgeExecutions( + request: protos.google.cloud.aiplatform.v1.IPurgeExecutionsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + purgeExecutions( + request?: protos.google.cloud.aiplatform.v1.IPurgeExecutionsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.purgeExecutions(request, options, callback); + } +/** + * Check the status of the long running operation returned by `purgeExecutions()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_PurgeExecutions_async + */ + async checkPurgeExecutionsProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.purgeExecutions, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists MetadataStores for a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Location whose MetadataStores should be listed. + * Format: + * `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The maximum number of Metadata Stores to return. The service may return + * fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.MetadataService.ListMetadataStores|MetadataService.ListMetadataStores} call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [MetadataStore]{@link google.cloud.aiplatform.v1.MetadataStore}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listMetadataStoresAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listMetadataStores( + request?: protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IMetadataStore[], + protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest|null, + protos.google.cloud.aiplatform.v1.IListMetadataStoresResponse + ]>; + listMetadataStores( + request: protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, + protos.google.cloud.aiplatform.v1.IListMetadataStoresResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IMetadataStore>): void; + listMetadataStores( + request: protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, + protos.google.cloud.aiplatform.v1.IListMetadataStoresResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IMetadataStore>): void; + listMetadataStores( + request?: protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, + protos.google.cloud.aiplatform.v1.IListMetadataStoresResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IMetadataStore>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, + protos.google.cloud.aiplatform.v1.IListMetadataStoresResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IMetadataStore>): + Promise<[ + protos.google.cloud.aiplatform.v1.IMetadataStore[], + protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest|null, + protos.google.cloud.aiplatform.v1.IListMetadataStoresResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listMetadataStores(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Location whose MetadataStores should be listed. + * Format: + * `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The maximum number of Metadata Stores to return. The service may return + * fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.MetadataService.ListMetadataStores|MetadataService.ListMetadataStores} call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [MetadataStore]{@link google.cloud.aiplatform.v1.MetadataStore} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listMetadataStoresAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listMetadataStoresStream( + request?: protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listMetadataStores']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMetadataStores.createStream( + this.innerApiCalls.listMetadataStores as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listMetadataStores`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Location whose MetadataStores should be listed. + * Format: + * `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The maximum number of Metadata Stores to return. The service may return + * fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.MetadataService.ListMetadataStores|MetadataService.ListMetadataStores} call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [MetadataStore]{@link google.cloud.aiplatform.v1.MetadataStore}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_ListMetadataStores_async + */ + listMetadataStoresAsync( + request?: protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listMetadataStores']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMetadataStores.asyncIterate( + this.innerApiCalls['listMetadataStores'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists Artifacts in the MetadataStore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose Artifacts should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of Artifacts to return. The service may return fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous {@link google.cloud.aiplatform.v1.MetadataService.ListArtifacts|MetadataService.ListArtifacts} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * Filter specifying the boolean condition for the Artifacts to satisfy in + * order to be part of the result set. + * The syntax to define filter query is based on https://google.aip.dev/160. + * The supported set of filters include the following: + * + * * **Attribute filtering**: + * For example: `display_name = "test"`. + * Supported fields include: `name`, `display_name`, `uri`, `state`, + * `schema_title`, `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"` + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..`. + * For example: `metadata.field_1.number_value = 10.0` + * * **Context based filtering**: + * To filter Artifacts based on the contexts to which they belong, use the + * function operator with the full resource name + * `in_context()`. + * For example: + * `in_context("projects//locations//metadataStores//contexts/")` + * + * Each of the above supported filter types can be combined together using + * logical operators (`AND` & `OR`). + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Artifact]{@link google.cloud.aiplatform.v1.Artifact}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listArtifactsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listArtifacts( + request?: protos.google.cloud.aiplatform.v1.IListArtifactsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IArtifact[], + protos.google.cloud.aiplatform.v1.IListArtifactsRequest|null, + protos.google.cloud.aiplatform.v1.IListArtifactsResponse + ]>; + listArtifacts( + request: protos.google.cloud.aiplatform.v1.IListArtifactsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListArtifactsRequest, + protos.google.cloud.aiplatform.v1.IListArtifactsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IArtifact>): void; + listArtifacts( + request: protos.google.cloud.aiplatform.v1.IListArtifactsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListArtifactsRequest, + protos.google.cloud.aiplatform.v1.IListArtifactsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IArtifact>): void; + listArtifacts( + request?: protos.google.cloud.aiplatform.v1.IListArtifactsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListArtifactsRequest, + protos.google.cloud.aiplatform.v1.IListArtifactsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IArtifact>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListArtifactsRequest, + protos.google.cloud.aiplatform.v1.IListArtifactsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IArtifact>): + Promise<[ + protos.google.cloud.aiplatform.v1.IArtifact[], + protos.google.cloud.aiplatform.v1.IListArtifactsRequest|null, + protos.google.cloud.aiplatform.v1.IListArtifactsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listArtifacts(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose Artifacts should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of Artifacts to return. The service may return fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous {@link google.cloud.aiplatform.v1.MetadataService.ListArtifacts|MetadataService.ListArtifacts} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * Filter specifying the boolean condition for the Artifacts to satisfy in + * order to be part of the result set. + * The syntax to define filter query is based on https://google.aip.dev/160. + * The supported set of filters include the following: + * + * * **Attribute filtering**: + * For example: `display_name = "test"`. + * Supported fields include: `name`, `display_name`, `uri`, `state`, + * `schema_title`, `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"` + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..`. + * For example: `metadata.field_1.number_value = 10.0` + * * **Context based filtering**: + * To filter Artifacts based on the contexts to which they belong, use the + * function operator with the full resource name + * `in_context()`. + * For example: + * `in_context("projects//locations//metadataStores//contexts/")` + * + * Each of the above supported filter types can be combined together using + * logical operators (`AND` & `OR`). + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Artifact]{@link google.cloud.aiplatform.v1.Artifact} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listArtifactsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listArtifactsStream( + request?: protos.google.cloud.aiplatform.v1.IListArtifactsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listArtifacts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listArtifacts.createStream( + this.innerApiCalls.listArtifacts as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listArtifacts`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose Artifacts should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of Artifacts to return. The service may return fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous {@link google.cloud.aiplatform.v1.MetadataService.ListArtifacts|MetadataService.ListArtifacts} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * Filter specifying the boolean condition for the Artifacts to satisfy in + * order to be part of the result set. + * The syntax to define filter query is based on https://google.aip.dev/160. + * The supported set of filters include the following: + * + * * **Attribute filtering**: + * For example: `display_name = "test"`. + * Supported fields include: `name`, `display_name`, `uri`, `state`, + * `schema_title`, `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"` + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..`. + * For example: `metadata.field_1.number_value = 10.0` + * * **Context based filtering**: + * To filter Artifacts based on the contexts to which they belong, use the + * function operator with the full resource name + * `in_context()`. + * For example: + * `in_context("projects//locations//metadataStores//contexts/")` + * + * Each of the above supported filter types can be combined together using + * logical operators (`AND` & `OR`). + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Artifact]{@link google.cloud.aiplatform.v1.Artifact}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_ListArtifacts_async + */ + listArtifactsAsync( + request?: protos.google.cloud.aiplatform.v1.IListArtifactsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listArtifacts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listArtifacts.asyncIterate( + this.innerApiCalls['listArtifacts'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists Contexts on the MetadataStore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose Contexts should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of Contexts to return. The service may return fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous {@link google.cloud.aiplatform.v1.MetadataService.ListContexts|MetadataService.ListContexts} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * Filter specifying the boolean condition for the Contexts to satisfy in + * order to be part of the result set. + * The syntax to define filter query is based on https://google.aip.dev/160. + * Following are the supported set of filters: + * + * * **Attribute filtering**: + * For example: `display_name = "test"`. + * Supported fields include: `name`, `display_name`, `schema_title`, + * `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"`. + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..`. + * For example: `metadata.field_1.number_value = 10.0`. + * * **Parent Child filtering**: + * To filter Contexts based on parent-child relationship use the HAS + * operator as follows: + * + * ``` + * parent_contexts: + * "projects//locations//metadataStores//contexts/" + * child_contexts: + * "projects//locations//metadataStores//contexts/" + * ``` + * + * Each of the above supported filters can be combined together using + * logical operators (`AND` & `OR`). + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Context]{@link google.cloud.aiplatform.v1.Context}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listContextsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listContexts( + request?: protos.google.cloud.aiplatform.v1.IListContextsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IContext[], + protos.google.cloud.aiplatform.v1.IListContextsRequest|null, + protos.google.cloud.aiplatform.v1.IListContextsResponse + ]>; + listContexts( + request: protos.google.cloud.aiplatform.v1.IListContextsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListContextsRequest, + protos.google.cloud.aiplatform.v1.IListContextsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IContext>): void; + listContexts( + request: protos.google.cloud.aiplatform.v1.IListContextsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListContextsRequest, + protos.google.cloud.aiplatform.v1.IListContextsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IContext>): void; + listContexts( + request?: protos.google.cloud.aiplatform.v1.IListContextsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListContextsRequest, + protos.google.cloud.aiplatform.v1.IListContextsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IContext>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListContextsRequest, + protos.google.cloud.aiplatform.v1.IListContextsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IContext>): + Promise<[ + protos.google.cloud.aiplatform.v1.IContext[], + protos.google.cloud.aiplatform.v1.IListContextsRequest|null, + protos.google.cloud.aiplatform.v1.IListContextsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listContexts(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose Contexts should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of Contexts to return. The service may return fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous {@link google.cloud.aiplatform.v1.MetadataService.ListContexts|MetadataService.ListContexts} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * Filter specifying the boolean condition for the Contexts to satisfy in + * order to be part of the result set. + * The syntax to define filter query is based on https://google.aip.dev/160. + * Following are the supported set of filters: + * + * * **Attribute filtering**: + * For example: `display_name = "test"`. + * Supported fields include: `name`, `display_name`, `schema_title`, + * `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"`. + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..`. + * For example: `metadata.field_1.number_value = 10.0`. + * * **Parent Child filtering**: + * To filter Contexts based on parent-child relationship use the HAS + * operator as follows: + * + * ``` + * parent_contexts: + * "projects//locations//metadataStores//contexts/" + * child_contexts: + * "projects//locations//metadataStores//contexts/" + * ``` + * + * Each of the above supported filters can be combined together using + * logical operators (`AND` & `OR`). + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Context]{@link google.cloud.aiplatform.v1.Context} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listContextsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listContextsStream( + request?: protos.google.cloud.aiplatform.v1.IListContextsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listContexts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listContexts.createStream( + this.innerApiCalls.listContexts as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listContexts`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose Contexts should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of Contexts to return. The service may return fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous {@link google.cloud.aiplatform.v1.MetadataService.ListContexts|MetadataService.ListContexts} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * Filter specifying the boolean condition for the Contexts to satisfy in + * order to be part of the result set. + * The syntax to define filter query is based on https://google.aip.dev/160. + * Following are the supported set of filters: + * + * * **Attribute filtering**: + * For example: `display_name = "test"`. + * Supported fields include: `name`, `display_name`, `schema_title`, + * `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"`. + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..`. + * For example: `metadata.field_1.number_value = 10.0`. + * * **Parent Child filtering**: + * To filter Contexts based on parent-child relationship use the HAS + * operator as follows: + * + * ``` + * parent_contexts: + * "projects//locations//metadataStores//contexts/" + * child_contexts: + * "projects//locations//metadataStores//contexts/" + * ``` + * + * Each of the above supported filters can be combined together using + * logical operators (`AND` & `OR`). + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Context]{@link google.cloud.aiplatform.v1.Context}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_ListContexts_async + */ + listContextsAsync( + request?: protos.google.cloud.aiplatform.v1.IListContextsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listContexts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listContexts.asyncIterate( + this.innerApiCalls['listContexts'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists Executions in the MetadataStore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose Executions should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of Executions to return. The service may return fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous {@link google.cloud.aiplatform.v1.MetadataService.ListExecutions|MetadataService.ListExecutions} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with an + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * Filter specifying the boolean condition for the Executions to satisfy in + * order to be part of the result set. + * The syntax to define filter query is based on https://google.aip.dev/160. + * Following are the supported set of filters: + * + * * **Attribute filtering**: + * For example: `display_name = "test"`. + * Supported fields include: `name`, `display_name`, `state`, + * `schema_title`, `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"`. + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..` + * For example: `metadata.field_1.number_value = 10.0` + * * **Context based filtering**: + * To filter Executions based on the contexts to which they belong use + * the function operator with the full resource name: + * `in_context()`. + * For example: + * `in_context("projects//locations//metadataStores//contexts/")` + * + * Each of the above supported filters can be combined together using + * logical operators (`AND` & `OR`). + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Execution]{@link google.cloud.aiplatform.v1.Execution}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listExecutionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listExecutions( + request?: protos.google.cloud.aiplatform.v1.IListExecutionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IExecution[], + protos.google.cloud.aiplatform.v1.IListExecutionsRequest|null, + protos.google.cloud.aiplatform.v1.IListExecutionsResponse + ]>; + listExecutions( + request: protos.google.cloud.aiplatform.v1.IListExecutionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListExecutionsRequest, + protos.google.cloud.aiplatform.v1.IListExecutionsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IExecution>): void; + listExecutions( + request: protos.google.cloud.aiplatform.v1.IListExecutionsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListExecutionsRequest, + protos.google.cloud.aiplatform.v1.IListExecutionsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IExecution>): void; + listExecutions( + request?: protos.google.cloud.aiplatform.v1.IListExecutionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListExecutionsRequest, + protos.google.cloud.aiplatform.v1.IListExecutionsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IExecution>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListExecutionsRequest, + protos.google.cloud.aiplatform.v1.IListExecutionsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IExecution>): + Promise<[ + protos.google.cloud.aiplatform.v1.IExecution[], + protos.google.cloud.aiplatform.v1.IListExecutionsRequest|null, + protos.google.cloud.aiplatform.v1.IListExecutionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listExecutions(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose Executions should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of Executions to return. The service may return fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous {@link google.cloud.aiplatform.v1.MetadataService.ListExecutions|MetadataService.ListExecutions} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with an + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * Filter specifying the boolean condition for the Executions to satisfy in + * order to be part of the result set. + * The syntax to define filter query is based on https://google.aip.dev/160. + * Following are the supported set of filters: + * + * * **Attribute filtering**: + * For example: `display_name = "test"`. + * Supported fields include: `name`, `display_name`, `state`, + * `schema_title`, `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"`. + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..` + * For example: `metadata.field_1.number_value = 10.0` + * * **Context based filtering**: + * To filter Executions based on the contexts to which they belong use + * the function operator with the full resource name: + * `in_context()`. + * For example: + * `in_context("projects//locations//metadataStores//contexts/")` + * + * Each of the above supported filters can be combined together using + * logical operators (`AND` & `OR`). + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Execution]{@link google.cloud.aiplatform.v1.Execution} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listExecutionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listExecutionsStream( + request?: protos.google.cloud.aiplatform.v1.IListExecutionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listExecutions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listExecutions.createStream( + this.innerApiCalls.listExecutions as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listExecutions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose Executions should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of Executions to return. The service may return fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous {@link google.cloud.aiplatform.v1.MetadataService.ListExecutions|MetadataService.ListExecutions} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with an + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * Filter specifying the boolean condition for the Executions to satisfy in + * order to be part of the result set. + * The syntax to define filter query is based on https://google.aip.dev/160. + * Following are the supported set of filters: + * + * * **Attribute filtering**: + * For example: `display_name = "test"`. + * Supported fields include: `name`, `display_name`, `state`, + * `schema_title`, `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"`. + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..` + * For example: `metadata.field_1.number_value = 10.0` + * * **Context based filtering**: + * To filter Executions based on the contexts to which they belong use + * the function operator with the full resource name: + * `in_context()`. + * For example: + * `in_context("projects//locations//metadataStores//contexts/")` + * + * Each of the above supported filters can be combined together using + * logical operators (`AND` & `OR`). + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Execution]{@link google.cloud.aiplatform.v1.Execution}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_ListExecutions_async + */ + listExecutionsAsync( + request?: protos.google.cloud.aiplatform.v1.IListExecutionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listExecutions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listExecutions.asyncIterate( + this.innerApiCalls['listExecutions'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists MetadataSchemas. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose MetadataSchemas should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of MetadataSchemas to return. The service may return + * fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.MetadataService.ListMetadataSchemas|MetadataService.ListMetadataSchemas} call. Provide this to retrieve the + * next page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * A query to filter available MetadataSchemas for matching results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [MetadataSchema]{@link google.cloud.aiplatform.v1.MetadataSchema}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listMetadataSchemasAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listMetadataSchemas( + request?: protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IMetadataSchema[], + protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest|null, + protos.google.cloud.aiplatform.v1.IListMetadataSchemasResponse + ]>; + listMetadataSchemas( + request: protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, + protos.google.cloud.aiplatform.v1.IListMetadataSchemasResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IMetadataSchema>): void; + listMetadataSchemas( + request: protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, + protos.google.cloud.aiplatform.v1.IListMetadataSchemasResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IMetadataSchema>): void; + listMetadataSchemas( + request?: protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, + protos.google.cloud.aiplatform.v1.IListMetadataSchemasResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IMetadataSchema>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, + protos.google.cloud.aiplatform.v1.IListMetadataSchemasResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IMetadataSchema>): + Promise<[ + protos.google.cloud.aiplatform.v1.IMetadataSchema[], + protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest|null, + protos.google.cloud.aiplatform.v1.IListMetadataSchemasResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listMetadataSchemas(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose MetadataSchemas should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of MetadataSchemas to return. The service may return + * fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.MetadataService.ListMetadataSchemas|MetadataService.ListMetadataSchemas} call. Provide this to retrieve the + * next page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * A query to filter available MetadataSchemas for matching results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [MetadataSchema]{@link google.cloud.aiplatform.v1.MetadataSchema} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listMetadataSchemasAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listMetadataSchemasStream( + request?: protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listMetadataSchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMetadataSchemas.createStream( + this.innerApiCalls.listMetadataSchemas as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listMetadataSchemas`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose MetadataSchemas should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of MetadataSchemas to return. The service may return + * fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.MetadataService.ListMetadataSchemas|MetadataService.ListMetadataSchemas} call. Provide this to retrieve the + * next page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * A query to filter available MetadataSchemas for matching results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [MetadataSchema]{@link google.cloud.aiplatform.v1.MetadataSchema}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MetadataService_ListMetadataSchemas_async + */ + listMetadataSchemasAsync( + request?: protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listMetadataSchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMetadataSchemas.asyncIterate( + this.innerApiCalls['listMetadataSchemas'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.metadataServiceStub && !this._terminated) { + return this.metadataServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/metadata_service_client_config.json b/owl-bot-staging/v1/src/v1/metadata_service_client_config.json new file mode 100644 index 00000000..22fd826d --- /dev/null +++ b/owl-bot-staging/v1/src/v1/metadata_service_client_config.json @@ -0,0 +1,150 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.MetadataService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateMetadataStore": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetMetadataStore": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListMetadataStores": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteMetadataStore": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateArtifact": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetArtifact": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListArtifacts": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateArtifact": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteArtifact": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PurgeArtifacts": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateContext": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetContext": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListContexts": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateContext": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteContext": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PurgeContexts": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AddContextArtifactsAndExecutions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AddContextChildren": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "QueryContextLineageSubgraph": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateExecution": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetExecution": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListExecutions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateExecution": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteExecution": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PurgeExecutions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AddExecutionEvents": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "QueryExecutionInputsAndOutputs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateMetadataSchema": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetMetadataSchema": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListMetadataSchemas": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "QueryArtifactLineageSubgraph": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/metadata_service_proto_list.json b/owl-bot-staging/v1/src/v1/metadata_service_proto_list.json new file mode 100644 index 00000000..581a7346 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/metadata_service_proto_list.json @@ -0,0 +1,110 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1/src/v1/migration_service_client.ts b/owl-bot-staging/v1/src/v1/migration_service_client.ts new file mode 100644 index 00000000..f7ffabba --- /dev/null +++ b/owl-bot-staging/v1/src/v1/migration_service_client.ts @@ -0,0 +1,2642 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/migration_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './migration_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * A service that migrates resources from automl.googleapis.com, + * datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. + * @class + * @memberof v1 + */ +export class MigrationServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + migrationServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of MigrationServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof MigrationServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + searchMigratableResources: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'migratableResources') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const batchMigrateResourcesResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.BatchMigrateResourcesResponse') as gax.protobuf.Type; + const batchMigrateResourcesMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + batchMigrateResources: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchMigrateResourcesResponse.decode.bind(batchMigrateResourcesResponse), + batchMigrateResourcesMetadata.decode.bind(batchMigrateResourcesMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.MigrationService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.migrationServiceStub) { + return this.migrationServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.MigrationService. + this.migrationServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.MigrationService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.MigrationService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const migrationServiceStubMethods = + ['searchMigratableResources', 'batchMigrateResources']; + for (const methodName of migrationServiceStubMethods) { + const callPromise = this.migrationServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.migrationServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + +/** + * Batch migrates resources from ml.googleapis.com, automl.googleapis.com, + * and datalabeling.googleapis.com to Vertex AI. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location of the migrated resource will live in. + * Format: `projects/{project}/locations/{location}` + * @param {number[]} request.migrateResourceRequests + * Required. The request messages specifying the resources to migrate. + * They must be in the same location as the destination. + * Up to 50 resources can be migrated in one batch. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MigrationService_BatchMigrateResources_async + */ + batchMigrateResources( + request?: protos.google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + batchMigrateResources( + request: protos.google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchMigrateResources( + request: protos.google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchMigrateResources( + request?: protos.google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.batchMigrateResources(request, options, callback); + } +/** + * Check the status of the long running operation returned by `batchMigrateResources()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MigrationService_BatchMigrateResources_async + */ + async checkBatchMigrateResourcesProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.batchMigrateResources, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Searches all of the resources in automl.googleapis.com, + * datalabeling.googleapis.com and ml.googleapis.com that can be migrated to + * Vertex AI's given location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location that the migratable resources should be searched from. + * It's the Vertex AI location that the resources can be migrated to, not + * the resources' original location. + * Format: + * `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The standard page size. + * The default and maximum value is 100. + * @param {string} request.pageToken + * The standard page token. + * @param {string} request.filter + * A filter for your search. You can use the following types of filters: + * + * * Resource type filters. The following strings filter for a specific type + * of {@link google.cloud.aiplatform.v1.MigratableResource|MigratableResource}: + * * `ml_engine_model_version:*` + * * `automl_model:*` + * * `automl_dataset:*` + * * `data_labeling_dataset:*` + * * "Migrated or not" filters. The following strings filter for resources + * that either have or have not already been migrated: + * * `last_migrate_time:*` filters for migrated resources. + * * `NOT last_migrate_time:*` filters for not yet migrated resources. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [MigratableResource]{@link google.cloud.aiplatform.v1.MigratableResource}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `searchMigratableResourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchMigratableResources( + request?: protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IMigratableResource[], + protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest|null, + protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse + ]>; + searchMigratableResources( + request: protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, + protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IMigratableResource>): void; + searchMigratableResources( + request: protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, + protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IMigratableResource>): void; + searchMigratableResources( + request?: protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, + protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IMigratableResource>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, + protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IMigratableResource>): + Promise<[ + protos.google.cloud.aiplatform.v1.IMigratableResource[], + protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest|null, + protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.searchMigratableResources(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location that the migratable resources should be searched from. + * It's the Vertex AI location that the resources can be migrated to, not + * the resources' original location. + * Format: + * `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The standard page size. + * The default and maximum value is 100. + * @param {string} request.pageToken + * The standard page token. + * @param {string} request.filter + * A filter for your search. You can use the following types of filters: + * + * * Resource type filters. The following strings filter for a specific type + * of {@link google.cloud.aiplatform.v1.MigratableResource|MigratableResource}: + * * `ml_engine_model_version:*` + * * `automl_model:*` + * * `automl_dataset:*` + * * `data_labeling_dataset:*` + * * "Migrated or not" filters. The following strings filter for resources + * that either have or have not already been migrated: + * * `last_migrate_time:*` filters for migrated resources. + * * `NOT last_migrate_time:*` filters for not yet migrated resources. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [MigratableResource]{@link google.cloud.aiplatform.v1.MigratableResource} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `searchMigratableResourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchMigratableResourcesStream( + request?: protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['searchMigratableResources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchMigratableResources.createStream( + this.innerApiCalls.searchMigratableResources as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchMigratableResources`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location that the migratable resources should be searched from. + * It's the Vertex AI location that the resources can be migrated to, not + * the resources' original location. + * Format: + * `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The standard page size. + * The default and maximum value is 100. + * @param {string} request.pageToken + * The standard page token. + * @param {string} request.filter + * A filter for your search. You can use the following types of filters: + * + * * Resource type filters. The following strings filter for a specific type + * of {@link google.cloud.aiplatform.v1.MigratableResource|MigratableResource}: + * * `ml_engine_model_version:*` + * * `automl_model:*` + * * `automl_dataset:*` + * * `data_labeling_dataset:*` + * * "Migrated or not" filters. The following strings filter for resources + * that either have or have not already been migrated: + * * `last_migrate_time:*` filters for migrated resources. + * * `NOT last_migrate_time:*` filters for not yet migrated resources. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [MigratableResource]{@link google.cloud.aiplatform.v1.MigratableResource}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_MigrationService_SearchMigratableResources_async + */ + searchMigratableResourcesAsync( + request?: protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['searchMigratableResources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchMigratableResources.asyncIterate( + this.innerApiCalls['searchMigratableResources'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.migrationServiceStub && !this._terminated) { + return this.migrationServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/migration_service_client_config.json b/owl-bot-staging/v1/src/v1/migration_service_client_config.json new file mode 100644 index 00000000..59e4d9aa --- /dev/null +++ b/owl-bot-staging/v1/src/v1/migration_service_client_config.json @@ -0,0 +1,34 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.MigrationService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "SearchMigratableResources": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchMigrateResources": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/migration_service_proto_list.json b/owl-bot-staging/v1/src/v1/migration_service_proto_list.json new file mode 100644 index 00000000..581a7346 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/migration_service_proto_list.json @@ -0,0 +1,110 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1/src/v1/model_service_client.ts b/owl-bot-staging/v1/src/v1/model_service_client.ts new file mode 100644 index 00000000..29e16e20 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/model_service_client.ts @@ -0,0 +1,3672 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/model_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './model_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * A service for managing Vertex AI's machine learning Models. + * @class + * @memberof v1 + */ +export class ModelServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + modelServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ModelServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ModelServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listModels: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'models'), + listModelEvaluations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'modelEvaluations'), + listModelEvaluationSlices: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'modelEvaluationSlices') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const uploadModelResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.UploadModelResponse') as gax.protobuf.Type; + const uploadModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.UploadModelOperationMetadata') as gax.protobuf.Type; + const deleteModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + const exportModelResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.ExportModelResponse') as gax.protobuf.Type; + const exportModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.ExportModelOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + uploadModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + uploadModelResponse.decode.bind(uploadModelResponse), + uploadModelMetadata.decode.bind(uploadModelMetadata)), + deleteModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteModelResponse.decode.bind(deleteModelResponse), + deleteModelMetadata.decode.bind(deleteModelMetadata)), + exportModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportModelResponse.decode.bind(exportModelResponse), + exportModelMetadata.decode.bind(exportModelMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.ModelService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.modelServiceStub) { + return this.modelServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.ModelService. + this.modelServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.ModelService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.ModelService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const modelServiceStubMethods = + ['uploadModel', 'getModel', 'listModels', 'updateModel', 'deleteModel', 'exportModel', 'importModelEvaluation', 'getModelEvaluation', 'listModelEvaluations', 'getModelEvaluationSlice', 'listModelEvaluationSlices']; + for (const methodName of modelServiceStubMethods) { + const callPromise = this.modelServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.modelServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets a Model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Model resource. + * Format: `projects/{project}/locations/{location}/models/{model}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Model]{@link google.cloud.aiplatform.v1.Model}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_ModelService_GetModel_async + */ + getModel( + request?: protos.google.cloud.aiplatform.v1.IGetModelRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IModel, + protos.google.cloud.aiplatform.v1.IGetModelRequest|undefined, {}|undefined + ]>; + getModel( + request: protos.google.cloud.aiplatform.v1.IGetModelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IModel, + protos.google.cloud.aiplatform.v1.IGetModelRequest|null|undefined, + {}|null|undefined>): void; + getModel( + request: protos.google.cloud.aiplatform.v1.IGetModelRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IModel, + protos.google.cloud.aiplatform.v1.IGetModelRequest|null|undefined, + {}|null|undefined>): void; + getModel( + request?: protos.google.cloud.aiplatform.v1.IGetModelRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IModel, + protos.google.cloud.aiplatform.v1.IGetModelRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IModel, + protos.google.cloud.aiplatform.v1.IGetModelRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IModel, + protos.google.cloud.aiplatform.v1.IGetModelRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getModel(request, options, callback); + } +/** + * Updates a Model. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.Model} request.model + * Required. The Model which replaces the resource on the server. + * When Model Versioning is enabled, the model.name will be used to determine + * whether to update the model or model version. + * 1. model.name with the @ value, e.g. models/123@1, refers to a version + * specific update. + * 2. model.name without the @ value, e.g. models/123, refers to a model + * update. + * 3. model.name with @-, e.g. models/123@-, refers to a model update. + * 4. Supported model fields: display_name, description; supported + * version-specific fields: version_description. Labels are supported in both + * scenarios. Both the model labels and the version labels are merged when a + * model is returned. When updating labels, if the request is for + * model-specific update, model label gets updated. Otherwise, version labels + * get updated. + * 5. A model name or model version name fields update mismatch will cause a + * precondition error. + * 6. One request cannot update both the model and the version fields. You + * must update them separately. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Model]{@link google.cloud.aiplatform.v1.Model}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_ModelService_UpdateModel_async + */ + updateModel( + request?: protos.google.cloud.aiplatform.v1.IUpdateModelRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IModel, + protos.google.cloud.aiplatform.v1.IUpdateModelRequest|undefined, {}|undefined + ]>; + updateModel( + request: protos.google.cloud.aiplatform.v1.IUpdateModelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IModel, + protos.google.cloud.aiplatform.v1.IUpdateModelRequest|null|undefined, + {}|null|undefined>): void; + updateModel( + request: protos.google.cloud.aiplatform.v1.IUpdateModelRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IModel, + protos.google.cloud.aiplatform.v1.IUpdateModelRequest|null|undefined, + {}|null|undefined>): void; + updateModel( + request?: protos.google.cloud.aiplatform.v1.IUpdateModelRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IModel, + protos.google.cloud.aiplatform.v1.IUpdateModelRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IModel, + protos.google.cloud.aiplatform.v1.IUpdateModelRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IModel, + protos.google.cloud.aiplatform.v1.IUpdateModelRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'model.name': request.model!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateModel(request, options, callback); + } +/** + * Imports an externally generated ModelEvaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent model resource. + * Format: `projects/{project}/locations/{location}/models/{model}` + * @param {google.cloud.aiplatform.v1.ModelEvaluation} request.modelEvaluation + * Required. Model evaluation resource to be imported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ModelEvaluation]{@link google.cloud.aiplatform.v1.ModelEvaluation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_ModelService_ImportModelEvaluation_async + */ + importModelEvaluation( + request?: protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IModelEvaluation, + protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest|undefined, {}|undefined + ]>; + importModelEvaluation( + request: protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IModelEvaluation, + protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest|null|undefined, + {}|null|undefined>): void; + importModelEvaluation( + request: protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IModelEvaluation, + protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest|null|undefined, + {}|null|undefined>): void; + importModelEvaluation( + request?: protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IModelEvaluation, + protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IModelEvaluation, + protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IModelEvaluation, + protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.importModelEvaluation(request, options, callback); + } +/** + * Gets a ModelEvaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the ModelEvaluation resource. + * Format: + * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ModelEvaluation]{@link google.cloud.aiplatform.v1.ModelEvaluation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_ModelService_GetModelEvaluation_async + */ + getModelEvaluation( + request?: protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IModelEvaluation, + protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest|undefined, {}|undefined + ]>; + getModelEvaluation( + request: protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IModelEvaluation, + protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest|null|undefined, + {}|null|undefined>): void; + getModelEvaluation( + request: protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IModelEvaluation, + protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest|null|undefined, + {}|null|undefined>): void; + getModelEvaluation( + request?: protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IModelEvaluation, + protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IModelEvaluation, + protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IModelEvaluation, + protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getModelEvaluation(request, options, callback); + } +/** + * Gets a ModelEvaluationSlice. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the ModelEvaluationSlice resource. + * Format: + * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ModelEvaluationSlice]{@link google.cloud.aiplatform.v1.ModelEvaluationSlice}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_ModelService_GetModelEvaluationSlice_async + */ + getModelEvaluationSlice( + request?: protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IModelEvaluationSlice, + protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest|undefined, {}|undefined + ]>; + getModelEvaluationSlice( + request: protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IModelEvaluationSlice, + protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest|null|undefined, + {}|null|undefined>): void; + getModelEvaluationSlice( + request: protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IModelEvaluationSlice, + protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest|null|undefined, + {}|null|undefined>): void; + getModelEvaluationSlice( + request?: protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IModelEvaluationSlice, + protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IModelEvaluationSlice, + protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IModelEvaluationSlice, + protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getModelEvaluationSlice(request, options, callback); + } + +/** + * Uploads a Model artifact into Vertex AI. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location into which to upload the Model. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1.Model} request.model + * Required. The Model to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_ModelService_UploadModel_async + */ + uploadModel( + request?: protos.google.cloud.aiplatform.v1.IUploadModelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + uploadModel( + request: protos.google.cloud.aiplatform.v1.IUploadModelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + uploadModel( + request: protos.google.cloud.aiplatform.v1.IUploadModelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + uploadModel( + request?: protos.google.cloud.aiplatform.v1.IUploadModelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.uploadModel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `uploadModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_ModelService_UploadModel_async + */ + async checkUploadModelProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.uploadModel, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a Model. + * + * A model cannot be deleted if any {@link google.cloud.aiplatform.v1.Endpoint|Endpoint} resource has a + * {@link google.cloud.aiplatform.v1.DeployedModel|DeployedModel} based on the model in its + * {@link google.cloud.aiplatform.v1.Endpoint.deployed_models|deployed_models} field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Model resource to be deleted. + * Format: `projects/{project}/locations/{location}/models/{model}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_ModelService_DeleteModel_async + */ + deleteModel( + request?: protos.google.cloud.aiplatform.v1.IDeleteModelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteModel( + request: protos.google.cloud.aiplatform.v1.IDeleteModelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteModel( + request: protos.google.cloud.aiplatform.v1.IDeleteModelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteModel( + request?: protos.google.cloud.aiplatform.v1.IDeleteModelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteModel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_ModelService_DeleteModel_async + */ + async checkDeleteModelProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteModel, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Exports a trained, exportable Model to a location specified by the + * user. A Model is considered to be exportable if it has at least one + * {@link google.cloud.aiplatform.v1.Model.supported_export_formats|supported export format}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Model to export. + * @param {google.cloud.aiplatform.v1.ExportModelRequest.OutputConfig} request.outputConfig + * Required. The desired output location and configuration. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_ModelService_ExportModel_async + */ + exportModel( + request?: protos.google.cloud.aiplatform.v1.IExportModelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + exportModel( + request: protos.google.cloud.aiplatform.v1.IExportModelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportModel( + request: protos.google.cloud.aiplatform.v1.IExportModelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportModel( + request?: protos.google.cloud.aiplatform.v1.IExportModelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.exportModel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `exportModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_ModelService_ExportModel_async + */ + async checkExportModelProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.exportModel, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Models in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the Models from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `model` supports = and !=. `model` represents the Model ID, + * i.e. the last segment of the Model's {@link google.cloud.aiplatform.v1.Model.name|resource name}. + * * `display_name` supports = and != + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `model=1234` + * * `displayName="myDisplayName"` + * * `labels.myKey="myValue"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.ModelService.ListModels|ModelService.ListModels} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * * `display_name` + * * `create_time` + * * `update_time` + * + * Example: `display_name, create_time desc`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Model]{@link google.cloud.aiplatform.v1.Model}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listModelsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listModels( + request?: protos.google.cloud.aiplatform.v1.IListModelsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IModel[], + protos.google.cloud.aiplatform.v1.IListModelsRequest|null, + protos.google.cloud.aiplatform.v1.IListModelsResponse + ]>; + listModels( + request: protos.google.cloud.aiplatform.v1.IListModelsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelsRequest, + protos.google.cloud.aiplatform.v1.IListModelsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModel>): void; + listModels( + request: protos.google.cloud.aiplatform.v1.IListModelsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelsRequest, + protos.google.cloud.aiplatform.v1.IListModelsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModel>): void; + listModels( + request?: protos.google.cloud.aiplatform.v1.IListModelsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelsRequest, + protos.google.cloud.aiplatform.v1.IListModelsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModel>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelsRequest, + protos.google.cloud.aiplatform.v1.IListModelsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModel>): + Promise<[ + protos.google.cloud.aiplatform.v1.IModel[], + protos.google.cloud.aiplatform.v1.IListModelsRequest|null, + protos.google.cloud.aiplatform.v1.IListModelsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listModels(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the Models from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `model` supports = and !=. `model` represents the Model ID, + * i.e. the last segment of the Model's {@link google.cloud.aiplatform.v1.Model.name|resource name}. + * * `display_name` supports = and != + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `model=1234` + * * `displayName="myDisplayName"` + * * `labels.myKey="myValue"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.ModelService.ListModels|ModelService.ListModels} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * * `display_name` + * * `create_time` + * * `update_time` + * + * Example: `display_name, create_time desc`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Model]{@link google.cloud.aiplatform.v1.Model} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listModelsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listModelsStream( + request?: protos.google.cloud.aiplatform.v1.IListModelsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModels.createStream( + this.innerApiCalls.listModels as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listModels`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the Models from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `model` supports = and !=. `model` represents the Model ID, + * i.e. the last segment of the Model's {@link google.cloud.aiplatform.v1.Model.name|resource name}. + * * `display_name` supports = and != + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `model=1234` + * * `displayName="myDisplayName"` + * * `labels.myKey="myValue"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.ModelService.ListModels|ModelService.ListModels} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * * `display_name` + * * `create_time` + * * `update_time` + * + * Example: `display_name, create_time desc`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Model]{@link google.cloud.aiplatform.v1.Model}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_ModelService_ListModels_async + */ + listModelsAsync( + request?: protos.google.cloud.aiplatform.v1.IListModelsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModels.asyncIterate( + this.innerApiCalls['listModels'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists ModelEvaluations in a Model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Model to list the ModelEvaluations from. + * Format: `projects/{project}/locations/{location}/models/{model}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.ModelService.ListModelEvaluations|ModelService.ListModelEvaluations} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ModelEvaluation]{@link google.cloud.aiplatform.v1.ModelEvaluation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listModelEvaluationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listModelEvaluations( + request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IModelEvaluation[], + protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest|null, + protos.google.cloud.aiplatform.v1.IListModelEvaluationsResponse + ]>; + listModelEvaluations( + request: protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, + protos.google.cloud.aiplatform.v1.IListModelEvaluationsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModelEvaluation>): void; + listModelEvaluations( + request: protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, + protos.google.cloud.aiplatform.v1.IListModelEvaluationsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModelEvaluation>): void; + listModelEvaluations( + request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, + protos.google.cloud.aiplatform.v1.IListModelEvaluationsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModelEvaluation>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, + protos.google.cloud.aiplatform.v1.IListModelEvaluationsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModelEvaluation>): + Promise<[ + protos.google.cloud.aiplatform.v1.IModelEvaluation[], + protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest|null, + protos.google.cloud.aiplatform.v1.IListModelEvaluationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listModelEvaluations(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Model to list the ModelEvaluations from. + * Format: `projects/{project}/locations/{location}/models/{model}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.ModelService.ListModelEvaluations|ModelService.ListModelEvaluations} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ModelEvaluation]{@link google.cloud.aiplatform.v1.ModelEvaluation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listModelEvaluationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listModelEvaluationsStream( + request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listModelEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelEvaluations.createStream( + this.innerApiCalls.listModelEvaluations as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listModelEvaluations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Model to list the ModelEvaluations from. + * Format: `projects/{project}/locations/{location}/models/{model}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.ModelService.ListModelEvaluations|ModelService.ListModelEvaluations} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ModelEvaluation]{@link google.cloud.aiplatform.v1.ModelEvaluation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_ModelService_ListModelEvaluations_async + */ + listModelEvaluationsAsync( + request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listModelEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelEvaluations.asyncIterate( + this.innerApiCalls['listModelEvaluations'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists ModelEvaluationSlices in a ModelEvaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the ModelEvaluation to list the ModelEvaluationSlices + * from. Format: + * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + * @param {string} request.filter + * The standard list filter. + * + * * `slice.dimension` - for =. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListModelEvaluationSlicesResponse.next_page_token|ListModelEvaluationSlicesResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices|ModelService.ListModelEvaluationSlices} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ModelEvaluationSlice]{@link google.cloud.aiplatform.v1.ModelEvaluationSlice}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listModelEvaluationSlicesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listModelEvaluationSlices( + request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IModelEvaluationSlice[], + protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest|null, + protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesResponse + ]>; + listModelEvaluationSlices( + request: protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, + protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModelEvaluationSlice>): void; + listModelEvaluationSlices( + request: protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, + protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModelEvaluationSlice>): void; + listModelEvaluationSlices( + request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, + protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModelEvaluationSlice>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, + protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModelEvaluationSlice>): + Promise<[ + protos.google.cloud.aiplatform.v1.IModelEvaluationSlice[], + protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest|null, + protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listModelEvaluationSlices(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the ModelEvaluation to list the ModelEvaluationSlices + * from. Format: + * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + * @param {string} request.filter + * The standard list filter. + * + * * `slice.dimension` - for =. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListModelEvaluationSlicesResponse.next_page_token|ListModelEvaluationSlicesResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices|ModelService.ListModelEvaluationSlices} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ModelEvaluationSlice]{@link google.cloud.aiplatform.v1.ModelEvaluationSlice} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listModelEvaluationSlicesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listModelEvaluationSlicesStream( + request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listModelEvaluationSlices']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelEvaluationSlices.createStream( + this.innerApiCalls.listModelEvaluationSlices as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listModelEvaluationSlices`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the ModelEvaluation to list the ModelEvaluationSlices + * from. Format: + * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + * @param {string} request.filter + * The standard list filter. + * + * * `slice.dimension` - for =. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListModelEvaluationSlicesResponse.next_page_token|ListModelEvaluationSlicesResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices|ModelService.ListModelEvaluationSlices} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ModelEvaluationSlice]{@link google.cloud.aiplatform.v1.ModelEvaluationSlice}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_ModelService_ListModelEvaluationSlices_async + */ + listModelEvaluationSlicesAsync( + request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listModelEvaluationSlices']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelEvaluationSlices.asyncIterate( + this.innerApiCalls['listModelEvaluationSlices'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.modelServiceStub && !this._terminated) { + return this.modelServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/model_service_client_config.json b/owl-bot-staging/v1/src/v1/model_service_client_config.json new file mode 100644 index 00000000..8ecf5e9a --- /dev/null +++ b/owl-bot-staging/v1/src/v1/model_service_client_config.json @@ -0,0 +1,70 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.ModelService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "UploadModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListModels": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ImportModelEvaluation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetModelEvaluation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListModelEvaluations": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetModelEvaluationSlice": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListModelEvaluationSlices": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/model_service_proto_list.json b/owl-bot-staging/v1/src/v1/model_service_proto_list.json new file mode 100644 index 00000000..581a7346 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/model_service_proto_list.json @@ -0,0 +1,110 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1/src/v1/pipeline_service_client.ts b/owl-bot-staging/v1/src/v1/pipeline_service_client.ts new file mode 100644 index 00000000..9a013482 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/pipeline_service_client.ts @@ -0,0 +1,3550 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/pipeline_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './pipeline_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * A service for creating and managing Vertex AI's pipelines. This includes both + * `TrainingPipeline` resources (used for AutoML and custom training) and + * `PipelineJob` resources (used for Vertex AI Pipelines). + * @class + * @memberof v1 + */ +export class PipelineServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + pipelineServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PipelineServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof PipelineServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listTrainingPipelines: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'trainingPipelines'), + listPipelineJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'pipelineJobs') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const deleteTrainingPipelineResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteTrainingPipelineMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + const deletePipelineJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deletePipelineJobMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + deleteTrainingPipeline: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTrainingPipelineResponse.decode.bind(deleteTrainingPipelineResponse), + deleteTrainingPipelineMetadata.decode.bind(deleteTrainingPipelineMetadata)), + deletePipelineJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deletePipelineJobResponse.decode.bind(deletePipelineJobResponse), + deletePipelineJobMetadata.decode.bind(deletePipelineJobMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.PipelineService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.pipelineServiceStub) { + return this.pipelineServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.PipelineService. + this.pipelineServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.PipelineService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.PipelineService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const pipelineServiceStubMethods = + ['createTrainingPipeline', 'getTrainingPipeline', 'listTrainingPipelines', 'deleteTrainingPipeline', 'cancelTrainingPipeline', 'createPipelineJob', 'getPipelineJob', 'listPipelineJobs', 'deletePipelineJob', 'cancelPipelineJob']; + for (const methodName of pipelineServiceStubMethods) { + const callPromise = this.pipelineServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.pipelineServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Creates a TrainingPipeline. A created TrainingPipeline right away will be + * attempted to be run. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the TrainingPipeline in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1.TrainingPipeline} request.trainingPipeline + * Required. The TrainingPipeline to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TrainingPipeline]{@link google.cloud.aiplatform.v1.TrainingPipeline}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_PipelineService_CreateTrainingPipeline_async + */ + createTrainingPipeline( + request?: protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest|undefined, {}|undefined + ]>; + createTrainingPipeline( + request: protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest|null|undefined, + {}|null|undefined>): void; + createTrainingPipeline( + request: protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest|null|undefined, + {}|null|undefined>): void; + createTrainingPipeline( + request?: protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createTrainingPipeline(request, options, callback); + } +/** + * Gets a TrainingPipeline. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TrainingPipeline resource. + * Format: + * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TrainingPipeline]{@link google.cloud.aiplatform.v1.TrainingPipeline}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_PipelineService_GetTrainingPipeline_async + */ + getTrainingPipeline( + request?: protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest|undefined, {}|undefined + ]>; + getTrainingPipeline( + request: protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest|null|undefined, + {}|null|undefined>): void; + getTrainingPipeline( + request: protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest|null|undefined, + {}|null|undefined>): void; + getTrainingPipeline( + request?: protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getTrainingPipeline(request, options, callback); + } +/** + * Cancels a TrainingPipeline. + * Starts asynchronous cancellation on the TrainingPipeline. The server + * makes a best effort to cancel the pipeline, but success is not + * guaranteed. Clients can use {@link google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline|PipelineService.GetTrainingPipeline} or + * other methods to check whether the cancellation succeeded or whether the + * pipeline completed despite cancellation. On successful cancellation, + * the TrainingPipeline is not deleted; instead it becomes a pipeline with + * a {@link google.cloud.aiplatform.v1.TrainingPipeline.error|TrainingPipeline.error} value with a {@link google.rpc.Status.code|google.rpc.Status.code} of 1, + * corresponding to `Code.CANCELLED`, and {@link google.cloud.aiplatform.v1.TrainingPipeline.state|TrainingPipeline.state} is set to + * `CANCELLED`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TrainingPipeline to cancel. + * Format: + * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_PipelineService_CancelTrainingPipeline_async + */ + cancelTrainingPipeline( + request?: protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest|undefined, {}|undefined + ]>; + cancelTrainingPipeline( + request: protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest|null|undefined, + {}|null|undefined>): void; + cancelTrainingPipeline( + request: protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest|null|undefined, + {}|null|undefined>): void; + cancelTrainingPipeline( + request?: protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.cancelTrainingPipeline(request, options, callback); + } +/** + * Creates a PipelineJob. A PipelineJob will run immediately when created. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the PipelineJob in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1.PipelineJob} request.pipelineJob + * Required. The PipelineJob to create. + * @param {string} request.pipelineJobId + * The ID to use for the PipelineJob, which will become the final component of + * the PipelineJob name. If not provided, an ID will be automatically + * generated. + * + * This value should be less than 128 characters, and valid characters + * are /{@link 0-9|a-z}-/. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PipelineJob]{@link google.cloud.aiplatform.v1.PipelineJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_PipelineService_CreatePipelineJob_async + */ + createPipelineJob( + request?: protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IPipelineJob, + protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest|undefined, {}|undefined + ]>; + createPipelineJob( + request: protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IPipelineJob, + protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest|null|undefined, + {}|null|undefined>): void; + createPipelineJob( + request: protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IPipelineJob, + protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest|null|undefined, + {}|null|undefined>): void; + createPipelineJob( + request?: protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IPipelineJob, + protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IPipelineJob, + protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IPipelineJob, + protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createPipelineJob(request, options, callback); + } +/** + * Gets a PipelineJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the PipelineJob resource. + * Format: + * `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PipelineJob]{@link google.cloud.aiplatform.v1.PipelineJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_PipelineService_GetPipelineJob_async + */ + getPipelineJob( + request?: protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IPipelineJob, + protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest|undefined, {}|undefined + ]>; + getPipelineJob( + request: protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IPipelineJob, + protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest|null|undefined, + {}|null|undefined>): void; + getPipelineJob( + request: protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IPipelineJob, + protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest|null|undefined, + {}|null|undefined>): void; + getPipelineJob( + request?: protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IPipelineJob, + protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IPipelineJob, + protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IPipelineJob, + protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getPipelineJob(request, options, callback); + } +/** + * Cancels a PipelineJob. + * Starts asynchronous cancellation on the PipelineJob. The server + * makes a best effort to cancel the pipeline, but success is not + * guaranteed. Clients can use {@link google.cloud.aiplatform.v1.PipelineService.GetPipelineJob|PipelineService.GetPipelineJob} or + * other methods to check whether the cancellation succeeded or whether the + * pipeline completed despite cancellation. On successful cancellation, + * the PipelineJob is not deleted; instead it becomes a pipeline with + * a {@link google.cloud.aiplatform.v1.PipelineJob.error|PipelineJob.error} value with a {@link google.rpc.Status.code|google.rpc.Status.code} of 1, + * corresponding to `Code.CANCELLED`, and {@link google.cloud.aiplatform.v1.PipelineJob.state|PipelineJob.state} is set to + * `CANCELLED`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the PipelineJob to cancel. + * Format: + * `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_PipelineService_CancelPipelineJob_async + */ + cancelPipelineJob( + request?: protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest|undefined, {}|undefined + ]>; + cancelPipelineJob( + request: protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest|null|undefined, + {}|null|undefined>): void; + cancelPipelineJob( + request: protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest|null|undefined, + {}|null|undefined>): void; + cancelPipelineJob( + request?: protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.cancelPipelineJob(request, options, callback); + } + +/** + * Deletes a TrainingPipeline. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TrainingPipeline resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_PipelineService_DeleteTrainingPipeline_async + */ + deleteTrainingPipeline( + request?: protos.google.cloud.aiplatform.v1.IDeleteTrainingPipelineRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteTrainingPipeline( + request: protos.google.cloud.aiplatform.v1.IDeleteTrainingPipelineRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTrainingPipeline( + request: protos.google.cloud.aiplatform.v1.IDeleteTrainingPipelineRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTrainingPipeline( + request?: protos.google.cloud.aiplatform.v1.IDeleteTrainingPipelineRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteTrainingPipeline(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteTrainingPipeline()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_PipelineService_DeleteTrainingPipeline_async + */ + async checkDeleteTrainingPipelineProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTrainingPipeline, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a PipelineJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the PipelineJob resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_PipelineService_DeletePipelineJob_async + */ + deletePipelineJob( + request?: protos.google.cloud.aiplatform.v1.IDeletePipelineJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deletePipelineJob( + request: protos.google.cloud.aiplatform.v1.IDeletePipelineJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deletePipelineJob( + request: protos.google.cloud.aiplatform.v1.IDeletePipelineJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deletePipelineJob( + request?: protos.google.cloud.aiplatform.v1.IDeletePipelineJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deletePipelineJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deletePipelineJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_PipelineService_DeletePipelineJob_async + */ + async checkDeletePipelineJobProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deletePipelineJob, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists TrainingPipelines in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the TrainingPipelines from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name="my_pipeline"` + * + * * `state="PIPELINE_STATE_RUNNING" OR display_name="my_pipeline"` + * + * * `NOT display_name="my_pipeline"` + * + * * `state="PIPELINE_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListTrainingPipelinesResponse.next_page_token|ListTrainingPipelinesResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.PipelineService.ListTrainingPipelines|PipelineService.ListTrainingPipelines} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [TrainingPipeline]{@link google.cloud.aiplatform.v1.TrainingPipeline}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTrainingPipelinesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTrainingPipelines( + request?: protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITrainingPipeline[], + protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest|null, + protos.google.cloud.aiplatform.v1.IListTrainingPipelinesResponse + ]>; + listTrainingPipelines( + request: protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, + protos.google.cloud.aiplatform.v1.IListTrainingPipelinesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITrainingPipeline>): void; + listTrainingPipelines( + request: protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, + protos.google.cloud.aiplatform.v1.IListTrainingPipelinesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITrainingPipeline>): void; + listTrainingPipelines( + request?: protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, + protos.google.cloud.aiplatform.v1.IListTrainingPipelinesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITrainingPipeline>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, + protos.google.cloud.aiplatform.v1.IListTrainingPipelinesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITrainingPipeline>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITrainingPipeline[], + protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest|null, + protos.google.cloud.aiplatform.v1.IListTrainingPipelinesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listTrainingPipelines(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the TrainingPipelines from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name="my_pipeline"` + * + * * `state="PIPELINE_STATE_RUNNING" OR display_name="my_pipeline"` + * + * * `NOT display_name="my_pipeline"` + * + * * `state="PIPELINE_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListTrainingPipelinesResponse.next_page_token|ListTrainingPipelinesResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.PipelineService.ListTrainingPipelines|PipelineService.ListTrainingPipelines} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [TrainingPipeline]{@link google.cloud.aiplatform.v1.TrainingPipeline} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTrainingPipelinesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTrainingPipelinesStream( + request?: protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTrainingPipelines']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTrainingPipelines.createStream( + this.innerApiCalls.listTrainingPipelines as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTrainingPipelines`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the TrainingPipelines from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name="my_pipeline"` + * + * * `state="PIPELINE_STATE_RUNNING" OR display_name="my_pipeline"` + * + * * `NOT display_name="my_pipeline"` + * + * * `state="PIPELINE_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListTrainingPipelinesResponse.next_page_token|ListTrainingPipelinesResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.PipelineService.ListTrainingPipelines|PipelineService.ListTrainingPipelines} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TrainingPipeline]{@link google.cloud.aiplatform.v1.TrainingPipeline}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_PipelineService_ListTrainingPipelines_async + */ + listTrainingPipelinesAsync( + request?: protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTrainingPipelines']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTrainingPipelines.asyncIterate( + this.innerApiCalls['listTrainingPipelines'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists PipelineJobs in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the PipelineJobs from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the PipelineJobs that match the filter expression. The following + * fields are supported: + * + * * `pipeline_name`: Supports `=` and `!=` comparisons. + * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. + * * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. + * for example, can check if pipeline's display_name contains *step* by doing + * display_name:\"*step*\" + * * `state`: Supports `=` and `!=` comparisons. + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `labels`: Supports key-value equality and key presence. + * * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. + * * `template_metadata.version_name`: Supports `=`, `!=` comparisons, and `:` + * wildcard. + * + * Filter expressions can be combined together using logical operators + * (`AND` & `OR`). + * For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. + * + * The syntax to define filter expression is based on + * https://google.aip.dev/160. + * + * Examples: + * + * * `create_time>"2021-05-18T00:00:00Z" OR + * update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated + * after 2020-05-18 00:00:00 UTC. + * * `labels.env = "prod"` + * PipelineJobs with label "env" set to "prod". + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListPipelineJobsResponse.next_page_token|ListPipelineJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.PipelineService.ListPipelineJobs|PipelineService.ListPipelineJobs} call. + * @param {string} request.orderBy + * A comma-separated list of fields to order by. The default sort order is in + * ascending order. Use "desc" after a field name for descending. You can have + * multiple order_by fields provided e.g. "create_time desc, end_time", + * "end_time, start_time, update_time" For example, using "create_time desc, + * end_time" will order results by create time in descending order, and if + * there are multiple jobs having the same create time, order them by the end + * time in ascending order. if order_by is not specified, it will order by + * default order is create time in descending order. Supported fields: + * * `create_time` + * * `update_time` + * * `end_time` + * * `start_time` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [PipelineJob]{@link google.cloud.aiplatform.v1.PipelineJob}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listPipelineJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listPipelineJobs( + request?: protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IPipelineJob[], + protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest|null, + protos.google.cloud.aiplatform.v1.IListPipelineJobsResponse + ]>; + listPipelineJobs( + request: protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, + protos.google.cloud.aiplatform.v1.IListPipelineJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IPipelineJob>): void; + listPipelineJobs( + request: protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, + protos.google.cloud.aiplatform.v1.IListPipelineJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IPipelineJob>): void; + listPipelineJobs( + request?: protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, + protos.google.cloud.aiplatform.v1.IListPipelineJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IPipelineJob>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, + protos.google.cloud.aiplatform.v1.IListPipelineJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IPipelineJob>): + Promise<[ + protos.google.cloud.aiplatform.v1.IPipelineJob[], + protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest|null, + protos.google.cloud.aiplatform.v1.IListPipelineJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listPipelineJobs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the PipelineJobs from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the PipelineJobs that match the filter expression. The following + * fields are supported: + * + * * `pipeline_name`: Supports `=` and `!=` comparisons. + * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. + * * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. + * for example, can check if pipeline's display_name contains *step* by doing + * display_name:\"*step*\" + * * `state`: Supports `=` and `!=` comparisons. + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `labels`: Supports key-value equality and key presence. + * * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. + * * `template_metadata.version_name`: Supports `=`, `!=` comparisons, and `:` + * wildcard. + * + * Filter expressions can be combined together using logical operators + * (`AND` & `OR`). + * For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. + * + * The syntax to define filter expression is based on + * https://google.aip.dev/160. + * + * Examples: + * + * * `create_time>"2021-05-18T00:00:00Z" OR + * update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated + * after 2020-05-18 00:00:00 UTC. + * * `labels.env = "prod"` + * PipelineJobs with label "env" set to "prod". + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListPipelineJobsResponse.next_page_token|ListPipelineJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.PipelineService.ListPipelineJobs|PipelineService.ListPipelineJobs} call. + * @param {string} request.orderBy + * A comma-separated list of fields to order by. The default sort order is in + * ascending order. Use "desc" after a field name for descending. You can have + * multiple order_by fields provided e.g. "create_time desc, end_time", + * "end_time, start_time, update_time" For example, using "create_time desc, + * end_time" will order results by create time in descending order, and if + * there are multiple jobs having the same create time, order them by the end + * time in ascending order. if order_by is not specified, it will order by + * default order is create time in descending order. Supported fields: + * * `create_time` + * * `update_time` + * * `end_time` + * * `start_time` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [PipelineJob]{@link google.cloud.aiplatform.v1.PipelineJob} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listPipelineJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listPipelineJobsStream( + request?: protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listPipelineJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPipelineJobs.createStream( + this.innerApiCalls.listPipelineJobs as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listPipelineJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the PipelineJobs from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the PipelineJobs that match the filter expression. The following + * fields are supported: + * + * * `pipeline_name`: Supports `=` and `!=` comparisons. + * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. + * * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. + * for example, can check if pipeline's display_name contains *step* by doing + * display_name:\"*step*\" + * * `state`: Supports `=` and `!=` comparisons. + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `labels`: Supports key-value equality and key presence. + * * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. + * * `template_metadata.version_name`: Supports `=`, `!=` comparisons, and `:` + * wildcard. + * + * Filter expressions can be combined together using logical operators + * (`AND` & `OR`). + * For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. + * + * The syntax to define filter expression is based on + * https://google.aip.dev/160. + * + * Examples: + * + * * `create_time>"2021-05-18T00:00:00Z" OR + * update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated + * after 2020-05-18 00:00:00 UTC. + * * `labels.env = "prod"` + * PipelineJobs with label "env" set to "prod". + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1.ListPipelineJobsResponse.next_page_token|ListPipelineJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1.PipelineService.ListPipelineJobs|PipelineService.ListPipelineJobs} call. + * @param {string} request.orderBy + * A comma-separated list of fields to order by. The default sort order is in + * ascending order. Use "desc" after a field name for descending. You can have + * multiple order_by fields provided e.g. "create_time desc, end_time", + * "end_time, start_time, update_time" For example, using "create_time desc, + * end_time" will order results by create time in descending order, and if + * there are multiple jobs having the same create time, order them by the end + * time in ascending order. if order_by is not specified, it will order by + * default order is create time in descending order. Supported fields: + * * `create_time` + * * `update_time` + * * `end_time` + * * `start_time` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [PipelineJob]{@link google.cloud.aiplatform.v1.PipelineJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_PipelineService_ListPipelineJobs_async + */ + listPipelineJobsAsync( + request?: protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listPipelineJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPipelineJobs.asyncIterate( + this.innerApiCalls['listPipelineJobs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.pipelineServiceStub && !this._terminated) { + return this.pipelineServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/pipeline_service_client_config.json b/owl-bot-staging/v1/src/v1/pipeline_service_client_config.json new file mode 100644 index 00000000..0c4df912 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/pipeline_service_client_config.json @@ -0,0 +1,66 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.PipelineService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateTrainingPipeline": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTrainingPipeline": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTrainingPipelines": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTrainingPipeline": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelTrainingPipeline": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreatePipelineJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetPipelineJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListPipelineJobs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeletePipelineJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelPipelineJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/pipeline_service_proto_list.json b/owl-bot-staging/v1/src/v1/pipeline_service_proto_list.json new file mode 100644 index 00000000..581a7346 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/pipeline_service_proto_list.json @@ -0,0 +1,110 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1/src/v1/prediction_service_client.ts b/owl-bot-staging/v1/src/v1/prediction_service_client.ts new file mode 100644 index 00000000..c12c53de --- /dev/null +++ b/owl-bot-staging/v1/src/v1/prediction_service_client.ts @@ -0,0 +1,2532 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/prediction_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './prediction_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * A service for online predictions and explanations. + * @class + * @memberof v1 + */ +export class PredictionServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + predictionServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PredictionServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof PredictionServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.PredictionService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.predictionServiceStub) { + return this.predictionServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.PredictionService. + this.predictionServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.PredictionService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.PredictionService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const predictionServiceStubMethods = + ['predict', 'rawPredict', 'explain']; + for (const methodName of predictionServiceStubMethods) { + const callPromise = this.predictionServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.predictionServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Perform an online prediction. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.endpoint + * Required. The name of the Endpoint requested to serve the prediction. + * Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {number[]} request.instances + * Required. The instances that are the input to the prediction call. + * A DeployedModel may have an upper limit on the number of instances it + * supports per request, and when it is exceeded the prediction call errors + * in case of AutoML Models, or, in case of customer created Models, the + * behaviour is as documented by that Model. + * The schema of any single instance may be specified via Endpoint's + * DeployedModels' {@link google.cloud.aiplatform.v1.DeployedModel.model|Model's} + * {@link google.cloud.aiplatform.v1.Model.predict_schemata|PredictSchemata's} + * {@link google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri|instance_schema_uri}. + * @param {google.protobuf.Value} request.parameters + * The parameters that govern the prediction. The schema of the parameters may + * be specified via Endpoint's DeployedModels' {@link google.cloud.aiplatform.v1.DeployedModel.model|Model's } + * {@link google.cloud.aiplatform.v1.Model.predict_schemata|PredictSchemata's} + * {@link google.cloud.aiplatform.v1.PredictSchemata.parameters_schema_uri|parameters_schema_uri}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PredictResponse]{@link google.cloud.aiplatform.v1.PredictResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_PredictionService_Predict_async + */ + predict( + request?: protos.google.cloud.aiplatform.v1.IPredictRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IPredictResponse, + protos.google.cloud.aiplatform.v1.IPredictRequest|undefined, {}|undefined + ]>; + predict( + request: protos.google.cloud.aiplatform.v1.IPredictRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IPredictResponse, + protos.google.cloud.aiplatform.v1.IPredictRequest|null|undefined, + {}|null|undefined>): void; + predict( + request: protos.google.cloud.aiplatform.v1.IPredictRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IPredictResponse, + protos.google.cloud.aiplatform.v1.IPredictRequest|null|undefined, + {}|null|undefined>): void; + predict( + request?: protos.google.cloud.aiplatform.v1.IPredictRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IPredictResponse, + protos.google.cloud.aiplatform.v1.IPredictRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IPredictResponse, + protos.google.cloud.aiplatform.v1.IPredictRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IPredictResponse, + protos.google.cloud.aiplatform.v1.IPredictRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'endpoint': request.endpoint || '', + }); + this.initialize(); + return this.innerApiCalls.predict(request, options, callback); + } +/** + * Perform an online prediction with an arbitrary HTTP payload. + * + * The response includes the following HTTP headers: + * + * * `X-Vertex-AI-Endpoint-Id`: ID of the {@link google.cloud.aiplatform.v1.Endpoint|Endpoint} that served this + * prediction. + * + * * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's {@link google.cloud.aiplatform.v1.DeployedModel|DeployedModel} + * that served this prediction. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.endpoint + * Required. The name of the Endpoint requested to serve the prediction. + * Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {google.api.HttpBody} request.httpBody + * The prediction input. Supports HTTP headers and arbitrary data payload. + * + * A {@link google.cloud.aiplatform.v1.DeployedModel|DeployedModel} may have an upper limit on the number of instances it + * supports per request. When this limit it is exceeded for an AutoML model, + * the {@link google.cloud.aiplatform.v1.PredictionService.RawPredict|RawPredict} method returns an error. + * When this limit is exceeded for a custom-trained model, the behavior varies + * depending on the model. + * + * You can specify the schema for each instance in the + * {@link google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri|predict_schemata.instance_schema_uri} + * field when you create a {@link google.cloud.aiplatform.v1.Model|Model}. This schema applies when you deploy the + * `Model` as a `DeployedModel` to an {@link google.cloud.aiplatform.v1.Endpoint|Endpoint} and use the `RawPredict` + * method. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [HttpBody]{@link google.api.HttpBody}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_PredictionService_RawPredict_async + */ + rawPredict( + request?: protos.google.cloud.aiplatform.v1.IRawPredictRequest, + options?: CallOptions): + Promise<[ + protos.google.api.IHttpBody, + protos.google.cloud.aiplatform.v1.IRawPredictRequest|undefined, {}|undefined + ]>; + rawPredict( + request: protos.google.cloud.aiplatform.v1.IRawPredictRequest, + options: CallOptions, + callback: Callback< + protos.google.api.IHttpBody, + protos.google.cloud.aiplatform.v1.IRawPredictRequest|null|undefined, + {}|null|undefined>): void; + rawPredict( + request: protos.google.cloud.aiplatform.v1.IRawPredictRequest, + callback: Callback< + protos.google.api.IHttpBody, + protos.google.cloud.aiplatform.v1.IRawPredictRequest|null|undefined, + {}|null|undefined>): void; + rawPredict( + request?: protos.google.cloud.aiplatform.v1.IRawPredictRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.api.IHttpBody, + protos.google.cloud.aiplatform.v1.IRawPredictRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.api.IHttpBody, + protos.google.cloud.aiplatform.v1.IRawPredictRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.api.IHttpBody, + protos.google.cloud.aiplatform.v1.IRawPredictRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'endpoint': request.endpoint || '', + }); + this.initialize(); + return this.innerApiCalls.rawPredict(request, options, callback); + } +/** + * Perform an online explanation. + * + * If {@link google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id|deployed_model_id} is specified, + * the corresponding DeployModel must have + * {@link google.cloud.aiplatform.v1.DeployedModel.explanation_spec|explanation_spec} + * populated. If {@link google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id|deployed_model_id} + * is not specified, all DeployedModels must have + * {@link google.cloud.aiplatform.v1.DeployedModel.explanation_spec|explanation_spec} + * populated. Only deployed AutoML tabular Models have + * explanation_spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.endpoint + * Required. The name of the Endpoint requested to serve the explanation. + * Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {number[]} request.instances + * Required. The instances that are the input to the explanation call. + * A DeployedModel may have an upper limit on the number of instances it + * supports per request, and when it is exceeded the explanation call errors + * in case of AutoML Models, or, in case of customer created Models, the + * behaviour is as documented by that Model. + * The schema of any single instance may be specified via Endpoint's + * DeployedModels' {@link google.cloud.aiplatform.v1.DeployedModel.model|Model's} + * {@link google.cloud.aiplatform.v1.Model.predict_schemata|PredictSchemata's} + * {@link google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri|instance_schema_uri}. + * @param {google.protobuf.Value} request.parameters + * The parameters that govern the prediction. The schema of the parameters may + * be specified via Endpoint's DeployedModels' {@link google.cloud.aiplatform.v1.DeployedModel.model|Model's } + * {@link google.cloud.aiplatform.v1.Model.predict_schemata|PredictSchemata's} + * {@link google.cloud.aiplatform.v1.PredictSchemata.parameters_schema_uri|parameters_schema_uri}. + * @param {google.cloud.aiplatform.v1.ExplanationSpecOverride} request.explanationSpecOverride + * If specified, overrides the + * {@link google.cloud.aiplatform.v1.DeployedModel.explanation_spec|explanation_spec} of the DeployedModel. + * Can be used for explaining prediction results with different + * configurations, such as: + * - Explaining top-5 predictions results as opposed to top-1; + * - Increasing path count or step count of the attribution methods to reduce + * approximate errors; + * - Using different baselines for explaining the prediction results. + * @param {string} request.deployedModelId + * If specified, this ExplainRequest will be served by the chosen + * DeployedModel, overriding {@link google.cloud.aiplatform.v1.Endpoint.traffic_split|Endpoint.traffic_split}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ExplainResponse]{@link google.cloud.aiplatform.v1.ExplainResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_PredictionService_Explain_async + */ + explain( + request?: protos.google.cloud.aiplatform.v1.IExplainRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IExplainResponse, + protos.google.cloud.aiplatform.v1.IExplainRequest|undefined, {}|undefined + ]>; + explain( + request: protos.google.cloud.aiplatform.v1.IExplainRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IExplainResponse, + protos.google.cloud.aiplatform.v1.IExplainRequest|null|undefined, + {}|null|undefined>): void; + explain( + request: protos.google.cloud.aiplatform.v1.IExplainRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IExplainResponse, + protos.google.cloud.aiplatform.v1.IExplainRequest|null|undefined, + {}|null|undefined>): void; + explain( + request?: protos.google.cloud.aiplatform.v1.IExplainRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IExplainResponse, + protos.google.cloud.aiplatform.v1.IExplainRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IExplainResponse, + protos.google.cloud.aiplatform.v1.IExplainRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IExplainResponse, + protos.google.cloud.aiplatform.v1.IExplainRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'endpoint': request.endpoint || '', + }); + this.initialize(); + return this.innerApiCalls.explain(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.predictionServiceStub && !this._terminated) { + return this.predictionServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/prediction_service_client_config.json b/owl-bot-staging/v1/src/v1/prediction_service_client_config.json new file mode 100644 index 00000000..e043161e --- /dev/null +++ b/owl-bot-staging/v1/src/v1/prediction_service_client_config.json @@ -0,0 +1,38 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.PredictionService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "Predict": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RawPredict": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Explain": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/prediction_service_proto_list.json b/owl-bot-staging/v1/src/v1/prediction_service_proto_list.json new file mode 100644 index 00000000..581a7346 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/prediction_service_proto_list.json @@ -0,0 +1,110 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1/src/v1/specialist_pool_service_client.ts b/owl-bot-staging/v1/src/v1/specialist_pool_service_client.ts new file mode 100644 index 00000000..a7e01c72 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/specialist_pool_service_client.ts @@ -0,0 +1,2883 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/specialist_pool_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './specialist_pool_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * A service for creating and managing Customer SpecialistPools. + * When customers start Data Labeling jobs, they can reuse/create Specialist + * Pools to bring their own Specialists to label the data. + * Customers can add/remove Managers for the Specialist Pool on Cloud console, + * then Managers will get email notifications to manage Specialists and tasks on + * CrowdCompute console. + * @class + * @memberof v1 + */ +export class SpecialistPoolServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + specialistPoolServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SpecialistPoolServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SpecialistPoolServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listSpecialistPools: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'specialistPools') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const createSpecialistPoolResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.SpecialistPool') as gax.protobuf.Type; + const createSpecialistPoolMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata') as gax.protobuf.Type; + const deleteSpecialistPoolResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteSpecialistPoolMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + const updateSpecialistPoolResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.SpecialistPool') as gax.protobuf.Type; + const updateSpecialistPoolMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createSpecialistPool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSpecialistPoolResponse.decode.bind(createSpecialistPoolResponse), + createSpecialistPoolMetadata.decode.bind(createSpecialistPoolMetadata)), + deleteSpecialistPool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteSpecialistPoolResponse.decode.bind(deleteSpecialistPoolResponse), + deleteSpecialistPoolMetadata.decode.bind(deleteSpecialistPoolMetadata)), + updateSpecialistPool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateSpecialistPoolResponse.decode.bind(updateSpecialistPoolResponse), + updateSpecialistPoolMetadata.decode.bind(updateSpecialistPoolMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.SpecialistPoolService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.specialistPoolServiceStub) { + return this.specialistPoolServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.SpecialistPoolService. + this.specialistPoolServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.SpecialistPoolService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.SpecialistPoolService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const specialistPoolServiceStubMethods = + ['createSpecialistPool', 'getSpecialistPool', 'listSpecialistPools', 'deleteSpecialistPool', 'updateSpecialistPool']; + for (const methodName of specialistPoolServiceStubMethods) { + const callPromise = this.specialistPoolServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.specialistPoolServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets a SpecialistPool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the SpecialistPool resource. + * The form is + * `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SpecialistPool]{@link google.cloud.aiplatform.v1.SpecialistPool}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_SpecialistPoolService_GetSpecialistPool_async + */ + getSpecialistPool( + request?: protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ISpecialistPool, + protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest|undefined, {}|undefined + ]>; + getSpecialistPool( + request: protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ISpecialistPool, + protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest|null|undefined, + {}|null|undefined>): void; + getSpecialistPool( + request: protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ISpecialistPool, + protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest|null|undefined, + {}|null|undefined>): void; + getSpecialistPool( + request?: protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ISpecialistPool, + protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ISpecialistPool, + protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ISpecialistPool, + protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getSpecialistPool(request, options, callback); + } + +/** + * Creates a SpecialistPool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent Project name for the new SpecialistPool. + * The form is `projects/{project}/locations/{location}`. + * @param {google.cloud.aiplatform.v1.SpecialistPool} request.specialistPool + * Required. The SpecialistPool to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_SpecialistPoolService_CreateSpecialistPool_async + */ + createSpecialistPool( + request?: protos.google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createSpecialistPool( + request: protos.google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSpecialistPool( + request: protos.google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSpecialistPool( + request?: protos.google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createSpecialistPool(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createSpecialistPool()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_SpecialistPoolService_CreateSpecialistPool_async + */ + async checkCreateSpecialistPoolProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createSpecialistPool, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a SpecialistPool as well as all Specialists in the pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the SpecialistPool to delete. Format: + * `projects/{project}/locations/{location}/specialistPools/{specialist_pool}` + * @param {boolean} request.force + * If set to true, any specialist managers in this SpecialistPool will also be + * deleted. (Otherwise, the request will only work if the SpecialistPool has + * no specialist managers.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_SpecialistPoolService_DeleteSpecialistPool_async + */ + deleteSpecialistPool( + request?: protos.google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteSpecialistPool( + request: protos.google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteSpecialistPool( + request: protos.google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteSpecialistPool( + request?: protos.google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteSpecialistPool(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteSpecialistPool()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_SpecialistPoolService_DeleteSpecialistPool_async + */ + async checkDeleteSpecialistPoolProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteSpecialistPool, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates a SpecialistPool. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.SpecialistPool} request.specialistPool + * Required. The SpecialistPool which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_SpecialistPoolService_UpdateSpecialistPool_async + */ + updateSpecialistPool( + request?: protos.google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateSpecialistPool( + request: protos.google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateSpecialistPool( + request: protos.google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateSpecialistPool( + request?: protos.google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'specialist_pool.name': request.specialistPool!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateSpecialistPool(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateSpecialistPool()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_SpecialistPoolService_UpdateSpecialistPool_async + */ + async checkUpdateSpecialistPoolProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateSpecialistPool, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists SpecialistPools in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the SpecialistPool's parent resource. + * Format: `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained by {@link google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.next_page_token|ListSpecialistPoolsResponse.next_page_token} of + * the previous {@link google.cloud.aiplatform.v1.SpecialistPoolService.ListSpecialistPools|SpecialistPoolService.ListSpecialistPools} call. Return + * first page if empty. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. FieldMask represents a set of + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [SpecialistPool]{@link google.cloud.aiplatform.v1.SpecialistPool}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSpecialistPoolsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSpecialistPools( + request?: protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ISpecialistPool[], + protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest|null, + protos.google.cloud.aiplatform.v1.IListSpecialistPoolsResponse + ]>; + listSpecialistPools( + request: protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, + protos.google.cloud.aiplatform.v1.IListSpecialistPoolsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ISpecialistPool>): void; + listSpecialistPools( + request: protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, + protos.google.cloud.aiplatform.v1.IListSpecialistPoolsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ISpecialistPool>): void; + listSpecialistPools( + request?: protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, + protos.google.cloud.aiplatform.v1.IListSpecialistPoolsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ISpecialistPool>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, + protos.google.cloud.aiplatform.v1.IListSpecialistPoolsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ISpecialistPool>): + Promise<[ + protos.google.cloud.aiplatform.v1.ISpecialistPool[], + protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest|null, + protos.google.cloud.aiplatform.v1.IListSpecialistPoolsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listSpecialistPools(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the SpecialistPool's parent resource. + * Format: `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained by {@link google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.next_page_token|ListSpecialistPoolsResponse.next_page_token} of + * the previous {@link google.cloud.aiplatform.v1.SpecialistPoolService.ListSpecialistPools|SpecialistPoolService.ListSpecialistPools} call. Return + * first page if empty. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. FieldMask represents a set of + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [SpecialistPool]{@link google.cloud.aiplatform.v1.SpecialistPool} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSpecialistPoolsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSpecialistPoolsStream( + request?: protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listSpecialistPools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSpecialistPools.createStream( + this.innerApiCalls.listSpecialistPools as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSpecialistPools`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the SpecialistPool's parent resource. + * Format: `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained by {@link google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.next_page_token|ListSpecialistPoolsResponse.next_page_token} of + * the previous {@link google.cloud.aiplatform.v1.SpecialistPoolService.ListSpecialistPools|SpecialistPoolService.ListSpecialistPools} call. Return + * first page if empty. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. FieldMask represents a set of + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [SpecialistPool]{@link google.cloud.aiplatform.v1.SpecialistPool}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_SpecialistPoolService_ListSpecialistPools_async + */ + listSpecialistPoolsAsync( + request?: protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listSpecialistPools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSpecialistPools.asyncIterate( + this.innerApiCalls['listSpecialistPools'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.specialistPoolServiceStub && !this._terminated) { + return this.specialistPoolServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/specialist_pool_service_client_config.json b/owl-bot-staging/v1/src/v1/specialist_pool_service_client_config.json new file mode 100644 index 00000000..a80b72c2 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/specialist_pool_service_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.SpecialistPoolService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateSpecialistPool": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSpecialistPool": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSpecialistPools": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSpecialistPool": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSpecialistPool": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/specialist_pool_service_proto_list.json b/owl-bot-staging/v1/src/v1/specialist_pool_service_proto_list.json new file mode 100644 index 00000000..581a7346 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/specialist_pool_service_proto_list.json @@ -0,0 +1,110 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1/src/v1/tensorboard_service_client.ts b/owl-bot-staging/v1/src/v1/tensorboard_service_client.ts new file mode 100644 index 00000000..4d0c6c02 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/tensorboard_service_client.ts @@ -0,0 +1,5388 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall, GoogleError} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import { PassThrough } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/tensorboard_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './tensorboard_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * TensorboardService + * @class + * @memberof v1 + */ +export class TensorboardServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + tensorboardServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TensorboardServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof TensorboardServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listTensorboards: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tensorboards'), + listTensorboardExperiments: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tensorboardExperiments'), + listTensorboardRuns: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tensorboardRuns'), + listTensorboardTimeSeries: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tensorboardTimeSeries'), + exportTensorboardTimeSeriesData: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'timeSeriesDataPoints') + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + readTensorboardBlobData: new this._gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING) + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const createTensorboardResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.Tensorboard') as gax.protobuf.Type; + const createTensorboardMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata') as gax.protobuf.Type; + const updateTensorboardResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.Tensorboard') as gax.protobuf.Type; + const updateTensorboardMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata') as gax.protobuf.Type; + const deleteTensorboardResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteTensorboardMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + const deleteTensorboardExperimentResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteTensorboardExperimentMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + const deleteTensorboardRunResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteTensorboardRunMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + const deleteTensorboardTimeSeriesResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteTensorboardTimeSeriesMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createTensorboard: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createTensorboardResponse.decode.bind(createTensorboardResponse), + createTensorboardMetadata.decode.bind(createTensorboardMetadata)), + updateTensorboard: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateTensorboardResponse.decode.bind(updateTensorboardResponse), + updateTensorboardMetadata.decode.bind(updateTensorboardMetadata)), + deleteTensorboard: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTensorboardResponse.decode.bind(deleteTensorboardResponse), + deleteTensorboardMetadata.decode.bind(deleteTensorboardMetadata)), + deleteTensorboardExperiment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTensorboardExperimentResponse.decode.bind(deleteTensorboardExperimentResponse), + deleteTensorboardExperimentMetadata.decode.bind(deleteTensorboardExperimentMetadata)), + deleteTensorboardRun: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTensorboardRunResponse.decode.bind(deleteTensorboardRunResponse), + deleteTensorboardRunMetadata.decode.bind(deleteTensorboardRunMetadata)), + deleteTensorboardTimeSeries: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTensorboardTimeSeriesResponse.decode.bind(deleteTensorboardTimeSeriesResponse), + deleteTensorboardTimeSeriesMetadata.decode.bind(deleteTensorboardTimeSeriesMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.TensorboardService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.tensorboardServiceStub) { + return this.tensorboardServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.TensorboardService. + this.tensorboardServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.TensorboardService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.TensorboardService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const tensorboardServiceStubMethods = + ['createTensorboard', 'getTensorboard', 'updateTensorboard', 'listTensorboards', 'deleteTensorboard', 'createTensorboardExperiment', 'getTensorboardExperiment', 'updateTensorboardExperiment', 'listTensorboardExperiments', 'deleteTensorboardExperiment', 'createTensorboardRun', 'batchCreateTensorboardRuns', 'getTensorboardRun', 'updateTensorboardRun', 'listTensorboardRuns', 'deleteTensorboardRun', 'batchCreateTensorboardTimeSeries', 'createTensorboardTimeSeries', 'getTensorboardTimeSeries', 'updateTensorboardTimeSeries', 'listTensorboardTimeSeries', 'deleteTensorboardTimeSeries', 'batchReadTensorboardTimeSeriesData', 'readTensorboardTimeSeriesData', 'readTensorboardBlobData', 'writeTensorboardExperimentData', 'writeTensorboardRunData', 'exportTensorboardTimeSeriesData']; + for (const methodName of tensorboardServiceStubMethods) { + const callPromise = this.tensorboardServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough(); + setImmediate(() => { + stream.emit('error', new GoogleError('The client has already been closed.')); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.tensorboardServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets a Tensorboard. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Tensorboard resource. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Tensorboard]{@link google.cloud.aiplatform.v1.Tensorboard}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_GetTensorboard_async + */ + getTensorboard( + request?: protos.google.cloud.aiplatform.v1.IGetTensorboardRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboard, + protos.google.cloud.aiplatform.v1.IGetTensorboardRequest|undefined, {}|undefined + ]>; + getTensorboard( + request: protos.google.cloud.aiplatform.v1.IGetTensorboardRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboard, + protos.google.cloud.aiplatform.v1.IGetTensorboardRequest|null|undefined, + {}|null|undefined>): void; + getTensorboard( + request: protos.google.cloud.aiplatform.v1.IGetTensorboardRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboard, + protos.google.cloud.aiplatform.v1.IGetTensorboardRequest|null|undefined, + {}|null|undefined>): void; + getTensorboard( + request?: protos.google.cloud.aiplatform.v1.IGetTensorboardRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ITensorboard, + protos.google.cloud.aiplatform.v1.IGetTensorboardRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ITensorboard, + protos.google.cloud.aiplatform.v1.IGetTensorboardRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboard, + protos.google.cloud.aiplatform.v1.IGetTensorboardRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getTensorboard(request, options, callback); + } +/** + * Creates a TensorboardExperiment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Tensorboard to create the TensorboardExperiment + * in. Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + * @param {google.cloud.aiplatform.v1.TensorboardExperiment} request.tensorboardExperiment + * The TensorboardExperiment to create. + * @param {string} request.tensorboardExperimentId + * Required. The ID to use for the Tensorboard experiment, which will become the final + * component of the Tensorboard experiment's resource name. + * + * This value should be 1-128 characters, and valid characters + * are /{@link 0-9|a-z}-/. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TensorboardExperiment]{@link google.cloud.aiplatform.v1.TensorboardExperiment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_CreateTensorboardExperiment_async + */ + createTensorboardExperiment( + request?: protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest|undefined, {}|undefined + ]>; + createTensorboardExperiment( + request: protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest|null|undefined, + {}|null|undefined>): void; + createTensorboardExperiment( + request: protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest|null|undefined, + {}|null|undefined>): void; + createTensorboardExperiment( + request?: protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createTensorboardExperiment(request, options, callback); + } +/** + * Gets a TensorboardExperiment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TensorboardExperiment resource. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TensorboardExperiment]{@link google.cloud.aiplatform.v1.TensorboardExperiment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_GetTensorboardExperiment_async + */ + getTensorboardExperiment( + request?: protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest|undefined, {}|undefined + ]>; + getTensorboardExperiment( + request: protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest|null|undefined, + {}|null|undefined>): void; + getTensorboardExperiment( + request: protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest|null|undefined, + {}|null|undefined>): void; + getTensorboardExperiment( + request?: protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getTensorboardExperiment(request, options, callback); + } +/** + * Updates a TensorboardExperiment. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * TensorboardExperiment resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten if new + * values are specified. + * @param {google.cloud.aiplatform.v1.TensorboardExperiment} request.tensorboardExperiment + * Required. The TensorboardExperiment's `name` field is used to identify the + * TensorboardExperiment to be updated. Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TensorboardExperiment]{@link google.cloud.aiplatform.v1.TensorboardExperiment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_UpdateTensorboardExperiment_async + */ + updateTensorboardExperiment( + request?: protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest|undefined, {}|undefined + ]>; + updateTensorboardExperiment( + request: protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest|null|undefined, + {}|null|undefined>): void; + updateTensorboardExperiment( + request: protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest|null|undefined, + {}|null|undefined>): void; + updateTensorboardExperiment( + request?: protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard_experiment.name': request.tensorboardExperiment!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateTensorboardExperiment(request, options, callback); + } +/** + * Creates a TensorboardRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardExperiment to create the TensorboardRun + * in. Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + * @param {google.cloud.aiplatform.v1.TensorboardRun} request.tensorboardRun + * Required. The TensorboardRun to create. + * @param {string} request.tensorboardRunId + * Required. The ID to use for the Tensorboard run, which will become the final + * component of the Tensorboard run's resource name. + * + * This value should be 1-128 characters, and valid characters + * are /{@link 0-9|a-z}-/. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TensorboardRun]{@link google.cloud.aiplatform.v1.TensorboardRun}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_CreateTensorboardRun_async + */ + createTensorboardRun( + request?: protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardRun, + protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest|undefined, {}|undefined + ]>; + createTensorboardRun( + request: protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardRun, + protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest|null|undefined, + {}|null|undefined>): void; + createTensorboardRun( + request: protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardRun, + protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest|null|undefined, + {}|null|undefined>): void; + createTensorboardRun( + request?: protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ITensorboardRun, + protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardRun, + protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardRun, + protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createTensorboardRun(request, options, callback); + } +/** + * Batch create TensorboardRuns. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardExperiment to create the + * TensorboardRuns in. Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + * The parent field in the CreateTensorboardRunRequest messages must match + * this field. + * @param {number[]} request.requests + * Required. The request message specifying the TensorboardRuns to create. + * A maximum of 1000 TensorboardRuns can be created in a batch. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchCreateTensorboardRunsResponse]{@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_BatchCreateTensorboardRuns_async + */ + batchCreateTensorboardRuns( + request?: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse, + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest|undefined, {}|undefined + ]>; + batchCreateTensorboardRuns( + request: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse, + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest|null|undefined, + {}|null|undefined>): void; + batchCreateTensorboardRuns( + request: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse, + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest|null|undefined, + {}|null|undefined>): void; + batchCreateTensorboardRuns( + request?: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse, + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse, + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse, + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.batchCreateTensorboardRuns(request, options, callback); + } +/** + * Gets a TensorboardRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TensorboardRun resource. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TensorboardRun]{@link google.cloud.aiplatform.v1.TensorboardRun}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_GetTensorboardRun_async + */ + getTensorboardRun( + request?: protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardRun, + protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest|undefined, {}|undefined + ]>; + getTensorboardRun( + request: protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardRun, + protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest|null|undefined, + {}|null|undefined>): void; + getTensorboardRun( + request: protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardRun, + protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest|null|undefined, + {}|null|undefined>): void; + getTensorboardRun( + request?: protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ITensorboardRun, + protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardRun, + protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardRun, + protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getTensorboardRun(request, options, callback); + } +/** + * Updates a TensorboardRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * TensorboardRun resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten if new + * values are specified. + * @param {google.cloud.aiplatform.v1.TensorboardRun} request.tensorboardRun + * Required. The TensorboardRun's `name` field is used to identify the TensorboardRun to + * be updated. Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TensorboardRun]{@link google.cloud.aiplatform.v1.TensorboardRun}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_UpdateTensorboardRun_async + */ + updateTensorboardRun( + request?: protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardRun, + protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest|undefined, {}|undefined + ]>; + updateTensorboardRun( + request: protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardRun, + protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest|null|undefined, + {}|null|undefined>): void; + updateTensorboardRun( + request: protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardRun, + protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest|null|undefined, + {}|null|undefined>): void; + updateTensorboardRun( + request?: protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ITensorboardRun, + protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardRun, + protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardRun, + protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard_run.name': request.tensorboardRun!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateTensorboardRun(request, options, callback); + } +/** + * Batch create TensorboardTimeSeries that belong to a TensorboardExperiment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardExperiment to create the + * TensorboardTimeSeries in. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + * The TensorboardRuns referenced by the parent fields in the + * CreateTensorboardTimeSeriesRequest messages must be sub resources of this + * TensorboardExperiment. + * @param {number[]} request.requests + * Required. The request message specifying the TensorboardTimeSeries to create. + * A maximum of 1000 TensorboardTimeSeries can be created in a batch. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchCreateTensorboardTimeSeriesResponse]{@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_BatchCreateTensorboardTimeSeries_async + */ + batchCreateTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse, + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest|undefined, {}|undefined + ]>; + batchCreateTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse, + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): void; + batchCreateTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse, + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): void; + batchCreateTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse, + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse, + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse, + protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.batchCreateTensorboardTimeSeries(request, options, callback); + } +/** + * Creates a TensorboardTimeSeries. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardRun to create the + * TensorboardTimeSeries in. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + * @param {string} [request.tensorboardTimeSeriesId] + * Optional. The user specified unique ID to use for the TensorboardTimeSeries, which + * will become the final component of the TensorboardTimeSeries's resource + * name. + * This value should match "{@link a-z0-9-|a-z0-9}{0, 127}" + * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries} request.tensorboardTimeSeries + * Required. The TensorboardTimeSeries to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1.TensorboardTimeSeries}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_CreateTensorboardTimeSeries_async + */ + createTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest|undefined, {}|undefined + ]>; + createTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): void; + createTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): void; + createTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createTensorboardTimeSeries(request, options, callback); + } +/** + * Gets a TensorboardTimeSeries. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TensorboardTimeSeries resource. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1.TensorboardTimeSeries}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_GetTensorboardTimeSeries_async + */ + getTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest|undefined, {}|undefined + ]>; + getTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): void; + getTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): void; + getTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getTensorboardTimeSeries(request, options, callback); + } +/** + * Updates a TensorboardTimeSeries. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * TensorboardTimeSeries resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten if new + * values are specified. + * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries} request.tensorboardTimeSeries + * Required. The TensorboardTimeSeries' `name` field is used to identify the + * TensorboardTimeSeries to be updated. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1.TensorboardTimeSeries}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_UpdateTensorboardTimeSeries_async + */ + updateTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest|undefined, {}|undefined + ]>; + updateTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): void; + updateTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): void; + updateTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard_time_series.name': request.tensorboardTimeSeries!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateTensorboardTimeSeries(request, options, callback); + } +/** + * Reads multiple TensorboardTimeSeries' data. The data point number limit is + * 1000 for scalars, 100 for tensors and blob references. If the number of + * data points stored is less than the limit, all data will be returned. + * Otherwise, that limit number of data points will be randomly selected from + * this time series and returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tensorboard + * Required. The resource name of the Tensorboard containing TensorboardTimeSeries to + * read data from. Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}`. + * The TensorboardTimeSeries referenced by {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest.time_series|time_series} must be sub + * resources of this Tensorboard. + * @param {string[]} request.timeSeries + * Required. The resource names of the TensorboardTimeSeries to read data from. Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchReadTensorboardTimeSeriesDataResponse]{@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_BatchReadTensorboardTimeSeriesData_async + */ + batchReadTensorboardTimeSeriesData( + request?: protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest|undefined, {}|undefined + ]>; + batchReadTensorboardTimeSeriesData( + request: protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest|null|undefined, + {}|null|undefined>): void; + batchReadTensorboardTimeSeriesData( + request: protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest|null|undefined, + {}|null|undefined>): void; + batchReadTensorboardTimeSeriesData( + request?: protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard': request.tensorboard || '', + }); + this.initialize(); + return this.innerApiCalls.batchReadTensorboardTimeSeriesData(request, options, callback); + } +/** + * Reads a TensorboardTimeSeries' data. By default, if the number of data + * points stored is less than 1000, all data will be returned. Otherwise, 1000 + * data points will be randomly selected from this time series and returned. + * This value can be changed by changing max_data_points, which can't be + * greater than 10k. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tensorboardTimeSeries + * Required. The resource name of the TensorboardTimeSeries to read data from. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + * @param {number} request.maxDataPoints + * The maximum number of TensorboardTimeSeries' data to return. + * + * This value should be a positive integer. + * This value can be set to -1 to return all data. + * @param {string} request.filter + * Reads the TensorboardTimeSeries' data that match the filter expression. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ReadTensorboardTimeSeriesDataResponse]{@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_ReadTensorboardTimeSeriesData_async + */ + readTensorboardTimeSeriesData( + request?: protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest|undefined, {}|undefined + ]>; + readTensorboardTimeSeriesData( + request: protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest|null|undefined, + {}|null|undefined>): void; + readTensorboardTimeSeriesData( + request: protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest|null|undefined, + {}|null|undefined>): void; + readTensorboardTimeSeriesData( + request?: protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard_time_series': request.tensorboardTimeSeries || '', + }); + this.initialize(); + return this.innerApiCalls.readTensorboardTimeSeriesData(request, options, callback); + } +/** + * Write time series data points of multiple TensorboardTimeSeries in multiple + * TensorboardRun's. If any data fail to be ingested, an error will be + * returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tensorboardExperiment + * Required. The resource name of the TensorboardExperiment to write data to. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + * @param {number[]} request.writeRunDataRequests + * Required. Requests containing per-run TensorboardTimeSeries data to write. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [WriteTensorboardExperimentDataResponse]{@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_WriteTensorboardExperimentData_async + */ + writeTensorboardExperimentData( + request?: protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse, + protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest|undefined, {}|undefined + ]>; + writeTensorboardExperimentData( + request: protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse, + protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest|null|undefined, + {}|null|undefined>): void; + writeTensorboardExperimentData( + request: protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse, + protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest|null|undefined, + {}|null|undefined>): void; + writeTensorboardExperimentData( + request?: protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse, + protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse, + protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse, + protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard_experiment': request.tensorboardExperiment || '', + }); + this.initialize(); + return this.innerApiCalls.writeTensorboardExperimentData(request, options, callback); + } +/** + * Write time series data points into multiple TensorboardTimeSeries under + * a TensorboardRun. If any data fail to be ingested, an error will be + * returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tensorboardRun + * Required. The resource name of the TensorboardRun to write data to. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + * @param {number[]} request.timeSeriesData + * Required. The TensorboardTimeSeries data to write. + * Values with in a time series are indexed by their step value. + * Repeated writes to the same step will overwrite the existing value for that + * step. + * The upper limit of data points per write request is 5000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [WriteTensorboardRunDataResponse]{@link google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_WriteTensorboardRunData_async + */ + writeTensorboardRunData( + request?: protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse, + protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest|undefined, {}|undefined + ]>; + writeTensorboardRunData( + request: protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse, + protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest|null|undefined, + {}|null|undefined>): void; + writeTensorboardRunData( + request: protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse, + protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest|null|undefined, + {}|null|undefined>): void; + writeTensorboardRunData( + request?: protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse, + protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse, + protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse, + protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard_run': request.tensorboardRun || '', + }); + this.initialize(); + return this.innerApiCalls.writeTensorboardRunData(request, options, callback); + } + +/** + * Gets bytes of TensorboardBlobs. + * This is to allow reading blob data stored in consumer project's Cloud + * Storage bucket without users having to obtain Cloud Storage access + * permission. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.timeSeries + * Required. The resource name of the TensorboardTimeSeries to list Blobs. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + * @param {string[]} request.blobIds + * IDs of the blobs to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits [ReadTensorboardBlobDataResponse]{@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse} on 'data' event. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_ReadTensorboardBlobData_async + */ + readTensorboardBlobData( + request?: protos.google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest, + options?: CallOptions): + gax.CancellableStream{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'time_series': request.timeSeries || '', + }); + this.initialize(); + return this.innerApiCalls.readTensorboardBlobData(request, options); + } + +/** + * Creates a Tensorboard. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the Tensorboard in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1.Tensorboard} request.tensorboard + * Required. The Tensorboard to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_CreateTensorboard_async + */ + createTensorboard( + request?: protos.google.cloud.aiplatform.v1.ICreateTensorboardRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createTensorboard( + request: protos.google.cloud.aiplatform.v1.ICreateTensorboardRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createTensorboard( + request: protos.google.cloud.aiplatform.v1.ICreateTensorboardRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createTensorboard( + request?: protos.google.cloud.aiplatform.v1.ICreateTensorboardRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createTensorboard(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createTensorboard()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_CreateTensorboard_async + */ + async checkCreateTensorboardProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createTensorboard, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates a Tensorboard. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * Tensorboard resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten if new + * values are specified. + * @param {google.cloud.aiplatform.v1.Tensorboard} request.tensorboard + * Required. The Tensorboard's `name` field is used to identify the + * Tensorboard to be updated. Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_UpdateTensorboard_async + */ + updateTensorboard( + request?: protos.google.cloud.aiplatform.v1.IUpdateTensorboardRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateTensorboard( + request: protos.google.cloud.aiplatform.v1.IUpdateTensorboardRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateTensorboard( + request: protos.google.cloud.aiplatform.v1.IUpdateTensorboardRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateTensorboard( + request?: protos.google.cloud.aiplatform.v1.IUpdateTensorboardRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard.name': request.tensorboard!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateTensorboard(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateTensorboard()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_UpdateTensorboard_async + */ + async checkUpdateTensorboardProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateTensorboard, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a Tensorboard. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Tensorboard to be deleted. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_DeleteTensorboard_async + */ + deleteTensorboard( + request?: protos.google.cloud.aiplatform.v1.IDeleteTensorboardRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteTensorboard( + request: protos.google.cloud.aiplatform.v1.IDeleteTensorboardRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTensorboard( + request: protos.google.cloud.aiplatform.v1.IDeleteTensorboardRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTensorboard( + request?: protos.google.cloud.aiplatform.v1.IDeleteTensorboardRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteTensorboard(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteTensorboard()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_DeleteTensorboard_async + */ + async checkDeleteTensorboardProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTensorboard, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a TensorboardExperiment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TensorboardExperiment to be deleted. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_DeleteTensorboardExperiment_async + */ + deleteTensorboardExperiment( + request?: protos.google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteTensorboardExperiment( + request: protos.google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTensorboardExperiment( + request: protos.google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTensorboardExperiment( + request?: protos.google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteTensorboardExperiment(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteTensorboardExperiment()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_DeleteTensorboardExperiment_async + */ + async checkDeleteTensorboardExperimentProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTensorboardExperiment, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a TensorboardRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TensorboardRun to be deleted. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_DeleteTensorboardRun_async + */ + deleteTensorboardRun( + request?: protos.google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteTensorboardRun( + request: protos.google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTensorboardRun( + request: protos.google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTensorboardRun( + request?: protos.google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteTensorboardRun(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteTensorboardRun()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_DeleteTensorboardRun_async + */ + async checkDeleteTensorboardRunProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTensorboardRun, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a TensorboardTimeSeries. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TensorboardTimeSeries to be deleted. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_DeleteTensorboardTimeSeries_async + */ + deleteTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteTensorboardTimeSeries(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteTensorboardTimeSeries()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_DeleteTensorboardTimeSeries_async + */ + async checkDeleteTensorboardTimeSeriesProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTensorboardTimeSeries, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Tensorboards in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list Tensorboards. + * Format: + * `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the Tensorboards that match the filter expression. + * @param {number} request.pageSize + * The maximum number of Tensorboards to return. The service may return + * fewer than this value. If unspecified, at most 100 Tensorboards will be + * returned. The maximum value is 100; values above 100 will be coerced to + * 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Tensorboard]{@link google.cloud.aiplatform.v1.Tensorboard}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTensorboardsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTensorboards( + request?: protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboard[], + protos.google.cloud.aiplatform.v1.IListTensorboardsRequest|null, + protos.google.cloud.aiplatform.v1.IListTensorboardsResponse + ]>; + listTensorboards( + request: protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, + protos.google.cloud.aiplatform.v1.IListTensorboardsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITensorboard>): void; + listTensorboards( + request: protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, + protos.google.cloud.aiplatform.v1.IListTensorboardsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITensorboard>): void; + listTensorboards( + request?: protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, + protos.google.cloud.aiplatform.v1.IListTensorboardsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITensorboard>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, + protos.google.cloud.aiplatform.v1.IListTensorboardsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITensorboard>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboard[], + protos.google.cloud.aiplatform.v1.IListTensorboardsRequest|null, + protos.google.cloud.aiplatform.v1.IListTensorboardsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listTensorboards(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list Tensorboards. + * Format: + * `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the Tensorboards that match the filter expression. + * @param {number} request.pageSize + * The maximum number of Tensorboards to return. The service may return + * fewer than this value. If unspecified, at most 100 Tensorboards will be + * returned. The maximum value is 100; values above 100 will be coerced to + * 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Tensorboard]{@link google.cloud.aiplatform.v1.Tensorboard} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTensorboardsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTensorboardsStream( + request?: protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTensorboards']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTensorboards.createStream( + this.innerApiCalls.listTensorboards as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTensorboards`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list Tensorboards. + * Format: + * `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the Tensorboards that match the filter expression. + * @param {number} request.pageSize + * The maximum number of Tensorboards to return. The service may return + * fewer than this value. If unspecified, at most 100 Tensorboards will be + * returned. The maximum value is 100; values above 100 will be coerced to + * 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Tensorboard]{@link google.cloud.aiplatform.v1.Tensorboard}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_ListTensorboards_async + */ + listTensorboardsAsync( + request?: protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTensorboards']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTensorboards.asyncIterate( + this.innerApiCalls['listTensorboards'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists TensorboardExperiments in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Tensorboard to list TensorboardExperiments. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + * @param {string} request.filter + * Lists the TensorboardExperiments that match the filter expression. + * @param {number} request.pageSize + * The maximum number of TensorboardExperiments to return. The service may + * return fewer than this value. If unspecified, at most 50 + * TensorboardExperiments will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [TensorboardExperiment]{@link google.cloud.aiplatform.v1.TensorboardExperiment}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTensorboardExperimentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTensorboardExperiments( + request?: protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardExperiment[], + protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest|null, + protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse + ]>; + listTensorboardExperiments( + request: protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, + protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITensorboardExperiment>): void; + listTensorboardExperiments( + request: protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, + protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITensorboardExperiment>): void; + listTensorboardExperiments( + request?: protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, + protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITensorboardExperiment>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, + protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITensorboardExperiment>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardExperiment[], + protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest|null, + protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listTensorboardExperiments(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Tensorboard to list TensorboardExperiments. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + * @param {string} request.filter + * Lists the TensorboardExperiments that match the filter expression. + * @param {number} request.pageSize + * The maximum number of TensorboardExperiments to return. The service may + * return fewer than this value. If unspecified, at most 50 + * TensorboardExperiments will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [TensorboardExperiment]{@link google.cloud.aiplatform.v1.TensorboardExperiment} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTensorboardExperimentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTensorboardExperimentsStream( + request?: protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTensorboardExperiments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTensorboardExperiments.createStream( + this.innerApiCalls.listTensorboardExperiments as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTensorboardExperiments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Tensorboard to list TensorboardExperiments. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + * @param {string} request.filter + * Lists the TensorboardExperiments that match the filter expression. + * @param {number} request.pageSize + * The maximum number of TensorboardExperiments to return. The service may + * return fewer than this value. If unspecified, at most 50 + * TensorboardExperiments will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TensorboardExperiment]{@link google.cloud.aiplatform.v1.TensorboardExperiment}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_ListTensorboardExperiments_async + */ + listTensorboardExperimentsAsync( + request?: protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTensorboardExperiments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTensorboardExperiments.asyncIterate( + this.innerApiCalls['listTensorboardExperiments'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists TensorboardRuns in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardExperiment to list TensorboardRuns. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + * @param {string} request.filter + * Lists the TensorboardRuns that match the filter expression. + * @param {number} request.pageSize + * The maximum number of TensorboardRuns to return. The service may return + * fewer than this value. If unspecified, at most 50 TensorboardRuns will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [TensorboardRun]{@link google.cloud.aiplatform.v1.TensorboardRun}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTensorboardRunsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTensorboardRuns( + request?: protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardRun[], + protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest|null, + protos.google.cloud.aiplatform.v1.IListTensorboardRunsResponse + ]>; + listTensorboardRuns( + request: protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, + protos.google.cloud.aiplatform.v1.IListTensorboardRunsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITensorboardRun>): void; + listTensorboardRuns( + request: protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, + protos.google.cloud.aiplatform.v1.IListTensorboardRunsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITensorboardRun>): void; + listTensorboardRuns( + request?: protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, + protos.google.cloud.aiplatform.v1.IListTensorboardRunsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITensorboardRun>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, + protos.google.cloud.aiplatform.v1.IListTensorboardRunsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITensorboardRun>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardRun[], + protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest|null, + protos.google.cloud.aiplatform.v1.IListTensorboardRunsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listTensorboardRuns(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardExperiment to list TensorboardRuns. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + * @param {string} request.filter + * Lists the TensorboardRuns that match the filter expression. + * @param {number} request.pageSize + * The maximum number of TensorboardRuns to return. The service may return + * fewer than this value. If unspecified, at most 50 TensorboardRuns will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [TensorboardRun]{@link google.cloud.aiplatform.v1.TensorboardRun} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTensorboardRunsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTensorboardRunsStream( + request?: protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTensorboardRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTensorboardRuns.createStream( + this.innerApiCalls.listTensorboardRuns as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTensorboardRuns`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardExperiment to list TensorboardRuns. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + * @param {string} request.filter + * Lists the TensorboardRuns that match the filter expression. + * @param {number} request.pageSize + * The maximum number of TensorboardRuns to return. The service may return + * fewer than this value. If unspecified, at most 50 TensorboardRuns will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TensorboardRun]{@link google.cloud.aiplatform.v1.TensorboardRun}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_ListTensorboardRuns_async + */ + listTensorboardRunsAsync( + request?: protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTensorboardRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTensorboardRuns.asyncIterate( + this.innerApiCalls['listTensorboardRuns'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists TensorboardTimeSeries in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardRun to list TensorboardTimeSeries. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + * @param {string} request.filter + * Lists the TensorboardTimeSeries that match the filter expression. + * @param {number} request.pageSize + * The maximum number of TensorboardTimeSeries to return. The service may + * return fewer than this value. If unspecified, at most 50 + * TensorboardTimeSeries will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1.TensorboardTimeSeries}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTensorboardTimeSeriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries[], + protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest|null, + protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse + ]>; + listTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, + protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries>): void; + listTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, + protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries>): void; + listTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, + protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, + protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries[], + protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest|null, + protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listTensorboardTimeSeries(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardRun to list TensorboardTimeSeries. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + * @param {string} request.filter + * Lists the TensorboardTimeSeries that match the filter expression. + * @param {number} request.pageSize + * The maximum number of TensorboardTimeSeries to return. The service may + * return fewer than this value. If unspecified, at most 50 + * TensorboardTimeSeries will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1.TensorboardTimeSeries} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTensorboardTimeSeriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTensorboardTimeSeriesStream( + request?: protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTensorboardTimeSeries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTensorboardTimeSeries.createStream( + this.innerApiCalls.listTensorboardTimeSeries as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTensorboardTimeSeries`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardRun to list TensorboardTimeSeries. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + * @param {string} request.filter + * Lists the TensorboardTimeSeries that match the filter expression. + * @param {number} request.pageSize + * The maximum number of TensorboardTimeSeries to return. The service may + * return fewer than this value. If unspecified, at most 50 + * TensorboardTimeSeries will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1.TensorboardTimeSeries}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_ListTensorboardTimeSeries_async + */ + listTensorboardTimeSeriesAsync( + request?: protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTensorboardTimeSeries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTensorboardTimeSeries.asyncIterate( + this.innerApiCalls['listTensorboardTimeSeries'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Exports a TensorboardTimeSeries' data. Data is returned in paginated + * responses. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tensorboardTimeSeries + * Required. The resource name of the TensorboardTimeSeries to export data from. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + * @param {string} request.filter + * Exports the TensorboardTimeSeries' data that match the filter expression. + * @param {number} request.pageSize + * The maximum number of data points to return per page. + * The default page_size will be 1000. Values must be between 1 and 10000. + * Values above 10000 will be coerced to 10000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link |TensorboardService.ExportTensorboardTimeSeries} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link |TensorboardService.ExportTensorboardTimeSeries} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the TensorboardTimeSeries' data. + * By default, TensorboardTimeSeries' data will be returned in a pseudo random + * order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [TimeSeriesDataPoint]{@link google.cloud.aiplatform.v1.TimeSeriesDataPoint}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `exportTensorboardTimeSeriesDataAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + exportTensorboardTimeSeriesData( + request?: protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITimeSeriesDataPoint[], + protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest|null, + protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse + ]>; + exportTensorboardTimeSeriesData( + request: protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, + protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITimeSeriesDataPoint>): void; + exportTensorboardTimeSeriesData( + request: protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, + protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITimeSeriesDataPoint>): void; + exportTensorboardTimeSeriesData( + request?: protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, + protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITimeSeriesDataPoint>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, + protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITimeSeriesDataPoint>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITimeSeriesDataPoint[], + protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest|null, + protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard_time_series': request.tensorboardTimeSeries || '', + }); + this.initialize(); + return this.innerApiCalls.exportTensorboardTimeSeriesData(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tensorboardTimeSeries + * Required. The resource name of the TensorboardTimeSeries to export data from. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + * @param {string} request.filter + * Exports the TensorboardTimeSeries' data that match the filter expression. + * @param {number} request.pageSize + * The maximum number of data points to return per page. + * The default page_size will be 1000. Values must be between 1 and 10000. + * Values above 10000 will be coerced to 10000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link |TensorboardService.ExportTensorboardTimeSeries} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link |TensorboardService.ExportTensorboardTimeSeries} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the TensorboardTimeSeries' data. + * By default, TensorboardTimeSeries' data will be returned in a pseudo random + * order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [TimeSeriesDataPoint]{@link google.cloud.aiplatform.v1.TimeSeriesDataPoint} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `exportTensorboardTimeSeriesDataAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + exportTensorboardTimeSeriesDataStream( + request?: protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard_time_series': request.tensorboardTimeSeries || '', + }); + const defaultCallSettings = this._defaults['exportTensorboardTimeSeriesData']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.exportTensorboardTimeSeriesData.createStream( + this.innerApiCalls.exportTensorboardTimeSeriesData as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `exportTensorboardTimeSeriesData`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tensorboardTimeSeries + * Required. The resource name of the TensorboardTimeSeries to export data from. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + * @param {string} request.filter + * Exports the TensorboardTimeSeries' data that match the filter expression. + * @param {number} request.pageSize + * The maximum number of data points to return per page. + * The default page_size will be 1000. Values must be between 1 and 10000. + * Values above 10000 will be coerced to 10000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link |TensorboardService.ExportTensorboardTimeSeries} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link |TensorboardService.ExportTensorboardTimeSeries} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the TensorboardTimeSeries' data. + * By default, TensorboardTimeSeries' data will be returned in a pseudo random + * order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TimeSeriesDataPoint]{@link google.cloud.aiplatform.v1.TimeSeriesDataPoint}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_TensorboardService_ExportTensorboardTimeSeriesData_async + */ + exportTensorboardTimeSeriesDataAsync( + request?: protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard_time_series': request.tensorboardTimeSeries || '', + }); + const defaultCallSettings = this._defaults['exportTensorboardTimeSeriesData']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate( + this.innerApiCalls['exportTensorboardTimeSeriesData'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.tensorboardServiceStub && !this._terminated) { + return this.tensorboardServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/tensorboard_service_client_config.json b/owl-bot-staging/v1/src/v1/tensorboard_service_client_config.json new file mode 100644 index 00000000..8f49b63c --- /dev/null +++ b/owl-bot-staging/v1/src/v1/tensorboard_service_client_config.json @@ -0,0 +1,138 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.TensorboardService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateTensorboard": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTensorboard": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTensorboard": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTensorboards": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTensorboard": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateTensorboardExperiment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTensorboardExperiment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTensorboardExperiment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTensorboardExperiments": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTensorboardExperiment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateTensorboardRun": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchCreateTensorboardRuns": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTensorboardRun": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTensorboardRun": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTensorboardRuns": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTensorboardRun": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchCreateTensorboardTimeSeries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateTensorboardTimeSeries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTensorboardTimeSeries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTensorboardTimeSeries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTensorboardTimeSeries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTensorboardTimeSeries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchReadTensorboardTimeSeriesData": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReadTensorboardTimeSeriesData": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReadTensorboardBlobData": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "WriteTensorboardExperimentData": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "WriteTensorboardRunData": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportTensorboardTimeSeriesData": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/tensorboard_service_proto_list.json b/owl-bot-staging/v1/src/v1/tensorboard_service_proto_list.json new file mode 100644 index 00000000..581a7346 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/tensorboard_service_proto_list.json @@ -0,0 +1,110 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1/src/v1/vizier_service_client.ts b/owl-bot-staging/v1/src/v1/vizier_service_client.ts new file mode 100644 index 00000000..23655d18 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/vizier_service_client.ts @@ -0,0 +1,3713 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/vizier_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './vizier_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * Vertex AI Vizier API. + * + * Vertex AI Vizier is a service to solve blackbox optimization problems, + * such as tuning machine learning hyperparameters and searching over deep + * learning architectures. + * @class + * @memberof v1 + */ +export class VizierServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + vizierServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of VizierServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof VizierServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listStudies: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'studies'), + listTrials: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'trials') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const suggestTrialsResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.SuggestTrialsResponse') as gax.protobuf.Type; + const suggestTrialsMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.SuggestTrialsMetadata') as gax.protobuf.Type; + const checkTrialEarlyStoppingStateResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateResponse') as gax.protobuf.Type; + const checkTrialEarlyStoppingStateMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateMetatdata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + suggestTrials: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + suggestTrialsResponse.decode.bind(suggestTrialsResponse), + suggestTrialsMetadata.decode.bind(suggestTrialsMetadata)), + checkTrialEarlyStoppingState: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + checkTrialEarlyStoppingStateResponse.decode.bind(checkTrialEarlyStoppingStateResponse), + checkTrialEarlyStoppingStateMetadata.decode.bind(checkTrialEarlyStoppingStateMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.VizierService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.vizierServiceStub) { + return this.vizierServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.VizierService. + this.vizierServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.VizierService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.VizierService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const vizierServiceStubMethods = + ['createStudy', 'getStudy', 'listStudies', 'deleteStudy', 'lookupStudy', 'suggestTrials', 'createTrial', 'getTrial', 'listTrials', 'addTrialMeasurement', 'completeTrial', 'deleteTrial', 'checkTrialEarlyStoppingState', 'stopTrial', 'listOptimalTrials']; + for (const methodName of vizierServiceStubMethods) { + const callPromise = this.vizierServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.vizierServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Creates a Study. A resource name will be generated after creation of the + * Study. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the CustomJob in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1.Study} request.study + * Required. The Study configuration used to create the Study. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Study]{@link google.cloud.aiplatform.v1.Study}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_VizierService_CreateStudy_async + */ + createStudy( + request?: protos.google.cloud.aiplatform.v1.ICreateStudyRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IStudy, + protos.google.cloud.aiplatform.v1.ICreateStudyRequest|undefined, {}|undefined + ]>; + createStudy( + request: protos.google.cloud.aiplatform.v1.ICreateStudyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IStudy, + protos.google.cloud.aiplatform.v1.ICreateStudyRequest|null|undefined, + {}|null|undefined>): void; + createStudy( + request: protos.google.cloud.aiplatform.v1.ICreateStudyRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IStudy, + protos.google.cloud.aiplatform.v1.ICreateStudyRequest|null|undefined, + {}|null|undefined>): void; + createStudy( + request?: protos.google.cloud.aiplatform.v1.ICreateStudyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IStudy, + protos.google.cloud.aiplatform.v1.ICreateStudyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IStudy, + protos.google.cloud.aiplatform.v1.ICreateStudyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IStudy, + protos.google.cloud.aiplatform.v1.ICreateStudyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createStudy(request, options, callback); + } +/** + * Gets a Study by name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Study resource. + * Format: `projects/{project}/locations/{location}/studies/{study}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Study]{@link google.cloud.aiplatform.v1.Study}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_VizierService_GetStudy_async + */ + getStudy( + request?: protos.google.cloud.aiplatform.v1.IGetStudyRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IStudy, + protos.google.cloud.aiplatform.v1.IGetStudyRequest|undefined, {}|undefined + ]>; + getStudy( + request: protos.google.cloud.aiplatform.v1.IGetStudyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IStudy, + protos.google.cloud.aiplatform.v1.IGetStudyRequest|null|undefined, + {}|null|undefined>): void; + getStudy( + request: protos.google.cloud.aiplatform.v1.IGetStudyRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IStudy, + protos.google.cloud.aiplatform.v1.IGetStudyRequest|null|undefined, + {}|null|undefined>): void; + getStudy( + request?: protos.google.cloud.aiplatform.v1.IGetStudyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IStudy, + protos.google.cloud.aiplatform.v1.IGetStudyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IStudy, + protos.google.cloud.aiplatform.v1.IGetStudyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IStudy, + protos.google.cloud.aiplatform.v1.IGetStudyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getStudy(request, options, callback); + } +/** + * Deletes a Study. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Study resource to be deleted. + * Format: `projects/{project}/locations/{location}/studies/{study}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_VizierService_DeleteStudy_async + */ + deleteStudy( + request?: protos.google.cloud.aiplatform.v1.IDeleteStudyRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteStudyRequest|undefined, {}|undefined + ]>; + deleteStudy( + request: protos.google.cloud.aiplatform.v1.IDeleteStudyRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteStudyRequest|null|undefined, + {}|null|undefined>): void; + deleteStudy( + request: protos.google.cloud.aiplatform.v1.IDeleteStudyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteStudyRequest|null|undefined, + {}|null|undefined>): void; + deleteStudy( + request?: protos.google.cloud.aiplatform.v1.IDeleteStudyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteStudyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteStudyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteStudyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteStudy(request, options, callback); + } +/** + * Looks a study up using the user-defined display_name field instead of the + * fully qualified resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to get the Study from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.displayName + * Required. The user-defined display name of the Study + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Study]{@link google.cloud.aiplatform.v1.Study}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_VizierService_LookupStudy_async + */ + lookupStudy( + request?: protos.google.cloud.aiplatform.v1.ILookupStudyRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IStudy, + protos.google.cloud.aiplatform.v1.ILookupStudyRequest|undefined, {}|undefined + ]>; + lookupStudy( + request: protos.google.cloud.aiplatform.v1.ILookupStudyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IStudy, + protos.google.cloud.aiplatform.v1.ILookupStudyRequest|null|undefined, + {}|null|undefined>): void; + lookupStudy( + request: protos.google.cloud.aiplatform.v1.ILookupStudyRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IStudy, + protos.google.cloud.aiplatform.v1.ILookupStudyRequest|null|undefined, + {}|null|undefined>): void; + lookupStudy( + request?: protos.google.cloud.aiplatform.v1.ILookupStudyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IStudy, + protos.google.cloud.aiplatform.v1.ILookupStudyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IStudy, + protos.google.cloud.aiplatform.v1.ILookupStudyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IStudy, + protos.google.cloud.aiplatform.v1.ILookupStudyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.lookupStudy(request, options, callback); + } +/** + * Adds a user provided Trial to a Study. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Study to create the Trial in. + * Format: `projects/{project}/locations/{location}/studies/{study}` + * @param {google.cloud.aiplatform.v1.Trial} request.trial + * Required. The Trial to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1.Trial}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_VizierService_CreateTrial_async + */ + createTrial( + request?: protos.google.cloud.aiplatform.v1.ICreateTrialRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.ICreateTrialRequest|undefined, {}|undefined + ]>; + createTrial( + request: protos.google.cloud.aiplatform.v1.ICreateTrialRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.ICreateTrialRequest|null|undefined, + {}|null|undefined>): void; + createTrial( + request: protos.google.cloud.aiplatform.v1.ICreateTrialRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.ICreateTrialRequest|null|undefined, + {}|null|undefined>): void; + createTrial( + request?: protos.google.cloud.aiplatform.v1.ICreateTrialRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.ICreateTrialRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.ICreateTrialRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.ICreateTrialRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createTrial(request, options, callback); + } +/** + * Gets a Trial. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Trial resource. + * Format: + * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1.Trial}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_VizierService_GetTrial_async + */ + getTrial( + request?: protos.google.cloud.aiplatform.v1.IGetTrialRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.IGetTrialRequest|undefined, {}|undefined + ]>; + getTrial( + request: protos.google.cloud.aiplatform.v1.IGetTrialRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.IGetTrialRequest|null|undefined, + {}|null|undefined>): void; + getTrial( + request: protos.google.cloud.aiplatform.v1.IGetTrialRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.IGetTrialRequest|null|undefined, + {}|null|undefined>): void; + getTrial( + request?: protos.google.cloud.aiplatform.v1.IGetTrialRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.IGetTrialRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.IGetTrialRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.IGetTrialRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getTrial(request, options, callback); + } +/** + * Adds a measurement of the objective metrics to a Trial. This measurement + * is assumed to have been taken before the Trial is complete. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.trialName + * Required. The name of the trial to add measurement. + * Format: + * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + * @param {google.cloud.aiplatform.v1.Measurement} request.measurement + * Required. The measurement to be added to a Trial. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1.Trial}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_VizierService_AddTrialMeasurement_async + */ + addTrialMeasurement( + request?: protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest|undefined, {}|undefined + ]>; + addTrialMeasurement( + request: protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest|null|undefined, + {}|null|undefined>): void; + addTrialMeasurement( + request: protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest|null|undefined, + {}|null|undefined>): void; + addTrialMeasurement( + request?: protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'trial_name': request.trialName || '', + }); + this.initialize(); + return this.innerApiCalls.addTrialMeasurement(request, options, callback); + } +/** + * Marks a Trial as complete. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The Trial's name. + * Format: + * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + * @param {google.cloud.aiplatform.v1.Measurement} [request.finalMeasurement] + * Optional. If provided, it will be used as the completed Trial's + * final_measurement; Otherwise, the service will auto-select a + * previously reported measurement as the final-measurement + * @param {boolean} [request.trialInfeasible] + * Optional. True if the Trial cannot be run with the given Parameter, and + * final_measurement will be ignored. + * @param {string} [request.infeasibleReason] + * Optional. A human readable reason why the trial was infeasible. This should + * only be provided if `trial_infeasible` is true. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1.Trial}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_VizierService_CompleteTrial_async + */ + completeTrial( + request?: protos.google.cloud.aiplatform.v1.ICompleteTrialRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.ICompleteTrialRequest|undefined, {}|undefined + ]>; + completeTrial( + request: protos.google.cloud.aiplatform.v1.ICompleteTrialRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.ICompleteTrialRequest|null|undefined, + {}|null|undefined>): void; + completeTrial( + request: protos.google.cloud.aiplatform.v1.ICompleteTrialRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.ICompleteTrialRequest|null|undefined, + {}|null|undefined>): void; + completeTrial( + request?: protos.google.cloud.aiplatform.v1.ICompleteTrialRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.ICompleteTrialRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.ICompleteTrialRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.ICompleteTrialRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.completeTrial(request, options, callback); + } +/** + * Deletes a Trial. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The Trial's name. + * Format: + * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_VizierService_DeleteTrial_async + */ + deleteTrial( + request?: protos.google.cloud.aiplatform.v1.IDeleteTrialRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteTrialRequest|undefined, {}|undefined + ]>; + deleteTrial( + request: protos.google.cloud.aiplatform.v1.IDeleteTrialRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteTrialRequest|null|undefined, + {}|null|undefined>): void; + deleteTrial( + request: protos.google.cloud.aiplatform.v1.IDeleteTrialRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteTrialRequest|null|undefined, + {}|null|undefined>): void; + deleteTrial( + request?: protos.google.cloud.aiplatform.v1.IDeleteTrialRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteTrialRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteTrialRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteTrialRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteTrial(request, options, callback); + } +/** + * Stops a Trial. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The Trial's name. + * Format: + * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1.Trial}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_VizierService_StopTrial_async + */ + stopTrial( + request?: protos.google.cloud.aiplatform.v1.IStopTrialRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.IStopTrialRequest|undefined, {}|undefined + ]>; + stopTrial( + request: protos.google.cloud.aiplatform.v1.IStopTrialRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.IStopTrialRequest|null|undefined, + {}|null|undefined>): void; + stopTrial( + request: protos.google.cloud.aiplatform.v1.IStopTrialRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.IStopTrialRequest|null|undefined, + {}|null|undefined>): void; + stopTrial( + request?: protos.google.cloud.aiplatform.v1.IStopTrialRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.IStopTrialRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.IStopTrialRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITrial, + protos.google.cloud.aiplatform.v1.IStopTrialRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.stopTrial(request, options, callback); + } +/** + * Lists the pareto-optimal Trials for multi-objective Study or the + * optimal Trials for single-objective Study. The definition of + * pareto-optimal can be checked in wiki page. + * https://en.wikipedia.org/wiki/Pareto_efficiency + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the Study that the optimal Trial belongs to. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ListOptimalTrialsResponse]{@link google.cloud.aiplatform.v1.ListOptimalTrialsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_VizierService_ListOptimalTrials_async + */ + listOptimalTrials( + request?: protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IListOptimalTrialsResponse, + protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest|undefined, {}|undefined + ]>; + listOptimalTrials( + request: protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IListOptimalTrialsResponse, + protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest|null|undefined, + {}|null|undefined>): void; + listOptimalTrials( + request: protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IListOptimalTrialsResponse, + protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest|null|undefined, + {}|null|undefined>): void; + listOptimalTrials( + request?: protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IListOptimalTrialsResponse, + protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IListOptimalTrialsResponse, + protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IListOptimalTrialsResponse, + protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listOptimalTrials(request, options, callback); + } + +/** + * Adds one or more Trials to a Study, with parameter values + * suggested by Vertex AI Vizier. Returns a long-running + * operation associated with the generation of Trial suggestions. + * When this long-running operation succeeds, it will contain + * a {@link google.cloud.ml.v1.SuggestTrialsResponse|SuggestTrialsResponse}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location that the Study belongs to. + * Format: `projects/{project}/locations/{location}/studies/{study}` + * @param {number} request.suggestionCount + * Required. The number of suggestions requested. + * @param {string} request.clientId + * Required. The identifier of the client that is requesting the suggestion. + * + * If multiple SuggestTrialsRequests have the same `client_id`, + * the service will return the identical suggested Trial if the Trial is + * pending, and provide a new Trial if the last suggested Trial was completed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_VizierService_SuggestTrials_async + */ + suggestTrials( + request?: protos.google.cloud.aiplatform.v1.ISuggestTrialsRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + suggestTrials( + request: protos.google.cloud.aiplatform.v1.ISuggestTrialsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + suggestTrials( + request: protos.google.cloud.aiplatform.v1.ISuggestTrialsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + suggestTrials( + request?: protos.google.cloud.aiplatform.v1.ISuggestTrialsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.suggestTrials(request, options, callback); + } +/** + * Check the status of the long running operation returned by `suggestTrials()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_VizierService_SuggestTrials_async + */ + async checkSuggestTrialsProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.suggestTrials, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Checks whether a Trial should stop or not. Returns a + * long-running operation. When the operation is successful, + * it will contain a + * {@link google.cloud.ml.v1.CheckTrialEarlyStoppingStateResponse|CheckTrialEarlyStoppingStateResponse}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.trialName + * Required. The Trial's name. + * Format: + * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_VizierService_CheckTrialEarlyStoppingState_async + */ + checkTrialEarlyStoppingState( + request?: protos.google.cloud.aiplatform.v1.ICheckTrialEarlyStoppingStateRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + checkTrialEarlyStoppingState( + request: protos.google.cloud.aiplatform.v1.ICheckTrialEarlyStoppingStateRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + checkTrialEarlyStoppingState( + request: protos.google.cloud.aiplatform.v1.ICheckTrialEarlyStoppingStateRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + checkTrialEarlyStoppingState( + request?: protos.google.cloud.aiplatform.v1.ICheckTrialEarlyStoppingStateRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'trial_name': request.trialName || '', + }); + this.initialize(); + return this.innerApiCalls.checkTrialEarlyStoppingState(request, options, callback); + } +/** + * Check the status of the long running operation returned by `checkTrialEarlyStoppingState()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_VizierService_CheckTrialEarlyStoppingState_async + */ + async checkCheckTrialEarlyStoppingStateProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.checkTrialEarlyStoppingState, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists all the studies in a region for an associated project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the Study from. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.pageToken] + * Optional. A page token to request the next page of results. + * If unspecified, there are no subsequent pages. + * @param {number} [request.pageSize] + * Optional. The maximum number of studies to return per "page" of results. + * If unspecified, service will pick an appropriate default. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Study]{@link google.cloud.aiplatform.v1.Study}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listStudiesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listStudies( + request?: protos.google.cloud.aiplatform.v1.IListStudiesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IStudy[], + protos.google.cloud.aiplatform.v1.IListStudiesRequest|null, + protos.google.cloud.aiplatform.v1.IListStudiesResponse + ]>; + listStudies( + request: protos.google.cloud.aiplatform.v1.IListStudiesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListStudiesRequest, + protos.google.cloud.aiplatform.v1.IListStudiesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IStudy>): void; + listStudies( + request: protos.google.cloud.aiplatform.v1.IListStudiesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListStudiesRequest, + protos.google.cloud.aiplatform.v1.IListStudiesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IStudy>): void; + listStudies( + request?: protos.google.cloud.aiplatform.v1.IListStudiesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListStudiesRequest, + protos.google.cloud.aiplatform.v1.IListStudiesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IStudy>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListStudiesRequest, + protos.google.cloud.aiplatform.v1.IListStudiesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IStudy>): + Promise<[ + protos.google.cloud.aiplatform.v1.IStudy[], + protos.google.cloud.aiplatform.v1.IListStudiesRequest|null, + protos.google.cloud.aiplatform.v1.IListStudiesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listStudies(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the Study from. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.pageToken] + * Optional. A page token to request the next page of results. + * If unspecified, there are no subsequent pages. + * @param {number} [request.pageSize] + * Optional. The maximum number of studies to return per "page" of results. + * If unspecified, service will pick an appropriate default. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Study]{@link google.cloud.aiplatform.v1.Study} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listStudiesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listStudiesStream( + request?: protos.google.cloud.aiplatform.v1.IListStudiesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listStudies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listStudies.createStream( + this.innerApiCalls.listStudies as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listStudies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the Study from. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.pageToken] + * Optional. A page token to request the next page of results. + * If unspecified, there are no subsequent pages. + * @param {number} [request.pageSize] + * Optional. The maximum number of studies to return per "page" of results. + * If unspecified, service will pick an appropriate default. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Study]{@link google.cloud.aiplatform.v1.Study}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_VizierService_ListStudies_async + */ + listStudiesAsync( + request?: protos.google.cloud.aiplatform.v1.IListStudiesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listStudies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listStudies.asyncIterate( + this.innerApiCalls['listStudies'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists the Trials associated with a Study. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Study to list the Trial from. + * Format: `projects/{project}/locations/{location}/studies/{study}` + * @param {string} [request.pageToken] + * Optional. A page token to request the next page of results. + * If unspecified, there are no subsequent pages. + * @param {number} [request.pageSize] + * Optional. The number of Trials to retrieve per "page" of results. + * If unspecified, the service will pick an appropriate default. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Trial]{@link google.cloud.aiplatform.v1.Trial}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTrialsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTrials( + request?: protos.google.cloud.aiplatform.v1.IListTrialsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ITrial[], + protos.google.cloud.aiplatform.v1.IListTrialsRequest|null, + protos.google.cloud.aiplatform.v1.IListTrialsResponse + ]>; + listTrials( + request: protos.google.cloud.aiplatform.v1.IListTrialsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTrialsRequest, + protos.google.cloud.aiplatform.v1.IListTrialsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITrial>): void; + listTrials( + request: protos.google.cloud.aiplatform.v1.IListTrialsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTrialsRequest, + protos.google.cloud.aiplatform.v1.IListTrialsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITrial>): void; + listTrials( + request?: protos.google.cloud.aiplatform.v1.IListTrialsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTrialsRequest, + protos.google.cloud.aiplatform.v1.IListTrialsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITrial>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListTrialsRequest, + protos.google.cloud.aiplatform.v1.IListTrialsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ITrial>): + Promise<[ + protos.google.cloud.aiplatform.v1.ITrial[], + protos.google.cloud.aiplatform.v1.IListTrialsRequest|null, + protos.google.cloud.aiplatform.v1.IListTrialsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listTrials(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Study to list the Trial from. + * Format: `projects/{project}/locations/{location}/studies/{study}` + * @param {string} [request.pageToken] + * Optional. A page token to request the next page of results. + * If unspecified, there are no subsequent pages. + * @param {number} [request.pageSize] + * Optional. The number of Trials to retrieve per "page" of results. + * If unspecified, the service will pick an appropriate default. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Trial]{@link google.cloud.aiplatform.v1.Trial} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTrialsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTrialsStream( + request?: protos.google.cloud.aiplatform.v1.IListTrialsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTrials']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTrials.createStream( + this.innerApiCalls.listTrials as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTrials`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Study to list the Trial from. + * Format: `projects/{project}/locations/{location}/studies/{study}` + * @param {string} [request.pageToken] + * Optional. A page token to request the next page of results. + * If unspecified, there are no subsequent pages. + * @param {number} [request.pageSize] + * Optional. The number of Trials to retrieve per "page" of results. + * If unspecified, the service will pick an appropriate default. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Trial]{@link google.cloud.aiplatform.v1.Trial}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1_generated_VizierService_ListTrials_async + */ + listTrialsAsync( + request?: protos.google.cloud.aiplatform.v1.IListTrialsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTrials']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTrials.asyncIterate( + this.innerApiCalls['listTrials'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.vizierServiceStub && !this._terminated) { + return this.vizierServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/vizier_service_client_config.json b/owl-bot-staging/v1/src/v1/vizier_service_client_config.json new file mode 100644 index 00000000..fe86ba2b --- /dev/null +++ b/owl-bot-staging/v1/src/v1/vizier_service_client_config.json @@ -0,0 +1,86 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.VizierService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateStudy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetStudy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListStudies": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteStudy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "LookupStudy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SuggestTrials": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateTrial": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTrial": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTrials": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AddTrialMeasurement": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CompleteTrial": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTrial": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CheckTrialEarlyStoppingState": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StopTrial": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListOptimalTrials": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/vizier_service_proto_list.json b/owl-bot-staging/v1/src/v1/vizier_service_proto_list.json new file mode 100644 index 00000000..581a7346 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/vizier_service_proto_list.json @@ -0,0 +1,110 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000..ffac9b16 --- /dev/null +++ b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,41 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const aiplatform = require('@google-cloud/aiplatform'); + +function main() { + const datasetServiceClient = new aiplatform.DatasetServiceClient(); + const endpointServiceClient = new aiplatform.EndpointServiceClient(); + const featurestoreOnlineServingServiceClient = new aiplatform.FeaturestoreOnlineServingServiceClient(); + const featurestoreServiceClient = new aiplatform.FeaturestoreServiceClient(); + const indexEndpointServiceClient = new aiplatform.IndexEndpointServiceClient(); + const indexServiceClient = new aiplatform.IndexServiceClient(); + const jobServiceClient = new aiplatform.JobServiceClient(); + const metadataServiceClient = new aiplatform.MetadataServiceClient(); + const migrationServiceClient = new aiplatform.MigrationServiceClient(); + const modelServiceClient = new aiplatform.ModelServiceClient(); + const pipelineServiceClient = new aiplatform.PipelineServiceClient(); + const predictionServiceClient = new aiplatform.PredictionServiceClient(); + const specialistPoolServiceClient = new aiplatform.SpecialistPoolServiceClient(); + const tensorboardServiceClient = new aiplatform.TensorboardServiceClient(); + const vizierServiceClient = new aiplatform.VizierServiceClient(); +} + +main(); diff --git a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000..6d8165e0 --- /dev/null +++ b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,116 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {DatasetServiceClient, EndpointServiceClient, FeaturestoreOnlineServingServiceClient, FeaturestoreServiceClient, IndexEndpointServiceClient, IndexServiceClient, JobServiceClient, MetadataServiceClient, MigrationServiceClient, ModelServiceClient, PipelineServiceClient, PredictionServiceClient, SpecialistPoolServiceClient, TensorboardServiceClient, VizierServiceClient} from '@google-cloud/aiplatform'; + +// check that the client class type name can be used +function doStuffWithDatasetServiceClient(client: DatasetServiceClient) { + client.close(); +} +function doStuffWithEndpointServiceClient(client: EndpointServiceClient) { + client.close(); +} +function doStuffWithFeaturestoreOnlineServingServiceClient(client: FeaturestoreOnlineServingServiceClient) { + client.close(); +} +function doStuffWithFeaturestoreServiceClient(client: FeaturestoreServiceClient) { + client.close(); +} +function doStuffWithIndexEndpointServiceClient(client: IndexEndpointServiceClient) { + client.close(); +} +function doStuffWithIndexServiceClient(client: IndexServiceClient) { + client.close(); +} +function doStuffWithJobServiceClient(client: JobServiceClient) { + client.close(); +} +function doStuffWithMetadataServiceClient(client: MetadataServiceClient) { + client.close(); +} +function doStuffWithMigrationServiceClient(client: MigrationServiceClient) { + client.close(); +} +function doStuffWithModelServiceClient(client: ModelServiceClient) { + client.close(); +} +function doStuffWithPipelineServiceClient(client: PipelineServiceClient) { + client.close(); +} +function doStuffWithPredictionServiceClient(client: PredictionServiceClient) { + client.close(); +} +function doStuffWithSpecialistPoolServiceClient(client: SpecialistPoolServiceClient) { + client.close(); +} +function doStuffWithTensorboardServiceClient(client: TensorboardServiceClient) { + client.close(); +} +function doStuffWithVizierServiceClient(client: VizierServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const datasetServiceClient = new DatasetServiceClient(); + doStuffWithDatasetServiceClient(datasetServiceClient); + // check that the client instance can be created + const endpointServiceClient = new EndpointServiceClient(); + doStuffWithEndpointServiceClient(endpointServiceClient); + // check that the client instance can be created + const featurestoreOnlineServingServiceClient = new FeaturestoreOnlineServingServiceClient(); + doStuffWithFeaturestoreOnlineServingServiceClient(featurestoreOnlineServingServiceClient); + // check that the client instance can be created + const featurestoreServiceClient = new FeaturestoreServiceClient(); + doStuffWithFeaturestoreServiceClient(featurestoreServiceClient); + // check that the client instance can be created + const indexEndpointServiceClient = new IndexEndpointServiceClient(); + doStuffWithIndexEndpointServiceClient(indexEndpointServiceClient); + // check that the client instance can be created + const indexServiceClient = new IndexServiceClient(); + doStuffWithIndexServiceClient(indexServiceClient); + // check that the client instance can be created + const jobServiceClient = new JobServiceClient(); + doStuffWithJobServiceClient(jobServiceClient); + // check that the client instance can be created + const metadataServiceClient = new MetadataServiceClient(); + doStuffWithMetadataServiceClient(metadataServiceClient); + // check that the client instance can be created + const migrationServiceClient = new MigrationServiceClient(); + doStuffWithMigrationServiceClient(migrationServiceClient); + // check that the client instance can be created + const modelServiceClient = new ModelServiceClient(); + doStuffWithModelServiceClient(modelServiceClient); + // check that the client instance can be created + const pipelineServiceClient = new PipelineServiceClient(); + doStuffWithPipelineServiceClient(pipelineServiceClient); + // check that the client instance can be created + const predictionServiceClient = new PredictionServiceClient(); + doStuffWithPredictionServiceClient(predictionServiceClient); + // check that the client instance can be created + const specialistPoolServiceClient = new SpecialistPoolServiceClient(); + doStuffWithSpecialistPoolServiceClient(specialistPoolServiceClient); + // check that the client instance can be created + const tensorboardServiceClient = new TensorboardServiceClient(); + doStuffWithTensorboardServiceClient(tensorboardServiceClient); + // check that the client instance can be created + const vizierServiceClient = new VizierServiceClient(); + doStuffWithVizierServiceClient(vizierServiceClient); +} + +main(); diff --git a/owl-bot-staging/v1/system-test/install.ts b/owl-bot-staging/v1/system-test/install.ts new file mode 100644 index 00000000..8ec45222 --- /dev/null +++ b/owl-bot-staging/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import { packNTest } from 'pack-n-play'; +import { readFileSync } from 'fs'; +import { describe, it } from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/v1/test/gapic_dataset_service_v1.ts b/owl-bot-staging/v1/test/gapic_dataset_service_v1.ts new file mode 100644 index 00000000..3d43d6ab --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_dataset_service_v1.ts @@ -0,0 +1,3419 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as datasetserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.DatasetServiceClient', () => { + it('has servicePath', () => { + const servicePath = datasetserviceModule.v1.DatasetServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = datasetserviceModule.v1.DatasetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = datasetserviceModule.v1.DatasetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new datasetserviceModule.v1.DatasetServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.datasetServiceStub, undefined); + await client.initialize(); + assert(client.datasetServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.datasetServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.datasetServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getDataset', () => { + it('invokes getDataset without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetDatasetRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()); + client.innerApiCalls.getDataset = stubSimpleCall(expectedResponse); + const [response] = await client.getDataset(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDataset without error using callback', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetDatasetRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()); + client.innerApiCalls.getDataset = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataset( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IDataset|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getDataset with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetDatasetRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataset(request), expectedError); + assert((client.innerApiCalls.getDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDataset with closed client', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetDatasetRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataset(request), expectedError); + }); + }); + + describe('updateDataset', () => { + it('invokes updateDataset without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateDatasetRequest()); + request.dataset = {}; + request.dataset.name = ''; + const expectedHeaderRequestParams = "dataset.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()); + client.innerApiCalls.updateDataset = stubSimpleCall(expectedResponse); + const [response] = await client.updateDataset(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateDataset without error using callback', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateDatasetRequest()); + request.dataset = {}; + request.dataset.name = ''; + const expectedHeaderRequestParams = "dataset.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()); + client.innerApiCalls.updateDataset = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataset( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IDataset|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateDataset with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateDatasetRequest()); + request.dataset = {}; + request.dataset.name = ''; + const expectedHeaderRequestParams = "dataset.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDataset(request), expectedError); + assert((client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateDataset with closed client', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateDatasetRequest()); + request.dataset = {}; + request.dataset.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDataset(request), expectedError); + }); + }); + + describe('getAnnotationSpec', () => { + it('invokes getAnnotationSpec without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetAnnotationSpecRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AnnotationSpec()); + client.innerApiCalls.getAnnotationSpec = stubSimpleCall(expectedResponse); + const [response] = await client.getAnnotationSpec(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getAnnotationSpec as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getAnnotationSpec without error using callback', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetAnnotationSpecRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AnnotationSpec()); + client.innerApiCalls.getAnnotationSpec = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAnnotationSpec( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IAnnotationSpec|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getAnnotationSpec as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getAnnotationSpec with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetAnnotationSpecRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getAnnotationSpec = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAnnotationSpec(request), expectedError); + assert((client.innerApiCalls.getAnnotationSpec as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getAnnotationSpec with closed client', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetAnnotationSpecRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAnnotationSpec(request), expectedError); + }); + }); + + describe('createDataset', () => { + it('invokes createDataset without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateDatasetRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createDataset = stubLongRunningCall(expectedResponse); + const [operation] = await client.createDataset(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createDataset without error using callback', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateDatasetRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createDataset = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDataset( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createDataset with call error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateDatasetRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataset = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createDataset(request), expectedError); + assert((client.innerApiCalls.createDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createDataset with LRO error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateDatasetRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataset = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createDataset(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateDatasetProgress without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateDatasetProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateDatasetProgress with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateDatasetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteDataset', () => { + it('invokes deleteDataset without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteDatasetRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteDataset = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteDataset(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteDataset without error using callback', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteDatasetRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteDataset = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDataset( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteDataset with call error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteDatasetRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteDataset(request), expectedError); + assert((client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteDataset with LRO error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteDatasetRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteDataset(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteDatasetProgress without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteDatasetProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteDatasetProgress with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteDatasetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('importData', () => { + it('invokes importData without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportDataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.importData = stubLongRunningCall(expectedResponse); + const [operation] = await client.importData(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.importData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes importData without error using callback', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportDataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.importData = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importData( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.importData as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes importData with call error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportDataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.importData = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.importData(request), expectedError); + assert((client.innerApiCalls.importData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes importData with LRO error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportDataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.importData = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.importData(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.importData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkImportDataProgress without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkImportDataProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportDataProgress with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkImportDataProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('exportData', () => { + it('invokes exportData without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportDataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.exportData = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportData(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.exportData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes exportData without error using callback', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportDataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.exportData = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportData( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.exportData as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes exportData with call error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportDataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportData = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportData(request), expectedError); + assert((client.innerApiCalls.exportData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes exportData with LRO error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportDataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportData = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportData(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.exportData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkExportDataProgress without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkExportDataProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportDataProgress with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkExportDataProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listDatasets', () => { + it('invokes listDatasets without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDatasetsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), + ]; + client.innerApiCalls.listDatasets = stubSimpleCall(expectedResponse); + const [response] = await client.listDatasets(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDatasets as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDatasets without error using callback', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDatasetsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), + ]; + client.innerApiCalls.listDatasets = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDatasets( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IDataset[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDatasets as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listDatasets with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDatasetsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listDatasets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDatasets(request), expectedError); + assert((client.innerApiCalls.listDatasets as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDatasetsStream without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDatasetsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), + ]; + client.descriptors.page.listDatasets.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Dataset[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Dataset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDatasets, request)); + assert.strictEqual( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listDatasetsStream with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDatasetsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listDatasets.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Dataset[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Dataset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDatasets, request)); + assert.strictEqual( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDatasets without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDatasetsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), + ]; + client.descriptors.page.listDatasets.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IDataset[] = []; + const iterable = client.listDatasetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDatasets with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDatasetsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listDatasets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDatasetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IDataset[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listDataItems', () => { + it('invokes listDataItems without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataItemsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), + ]; + client.innerApiCalls.listDataItems = stubSimpleCall(expectedResponse); + const [response] = await client.listDataItems(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDataItems as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDataItems without error using callback', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataItemsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), + ]; + client.innerApiCalls.listDataItems = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDataItems( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IDataItem[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDataItems as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listDataItems with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataItemsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataItems = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDataItems(request), expectedError); + assert((client.innerApiCalls.listDataItems as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDataItemsStream without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataItemsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), + ]; + client.descriptors.page.listDataItems.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDataItemsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.DataItem[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.DataItem) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDataItems, request)); + assert.strictEqual( + (client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listDataItemsStream with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataItemsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listDataItems.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDataItemsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.DataItem[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.DataItem) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDataItems, request)); + assert.strictEqual( + (client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDataItems without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataItemsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), + ]; + client.descriptors.page.listDataItems.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IDataItem[] = []; + const iterable = client.listDataItemsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDataItems.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDataItems.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDataItems with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataItemsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listDataItems.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDataItemsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IDataItem[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDataItems.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDataItems.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listAnnotations', () => { + it('invokes listAnnotations without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListAnnotationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), + ]; + client.innerApiCalls.listAnnotations = stubSimpleCall(expectedResponse); + const [response] = await client.listAnnotations(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listAnnotations as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listAnnotations without error using callback', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListAnnotationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), + ]; + client.innerApiCalls.listAnnotations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAnnotations( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IAnnotation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listAnnotations as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listAnnotations with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListAnnotationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAnnotations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAnnotations(request), expectedError); + assert((client.innerApiCalls.listAnnotations as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listAnnotationsStream without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListAnnotationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), + ]; + client.descriptors.page.listAnnotations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAnnotationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Annotation[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Annotation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAnnotations, request)); + assert.strictEqual( + (client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listAnnotationsStream with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListAnnotationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listAnnotations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAnnotationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Annotation[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Annotation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAnnotations, request)); + assert.strictEqual( + (client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAnnotations without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListAnnotationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), + ]; + client.descriptors.page.listAnnotations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IAnnotation[] = []; + const iterable = client.listAnnotationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAnnotations with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListAnnotationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listAnnotations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAnnotationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IAnnotation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/test/gapic_endpoint_service_v1.ts b/owl-bot-staging/v1/test/gapic_endpoint_service_v1.ts new file mode 100644 index 00000000..c498411e --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_endpoint_service_v1.ts @@ -0,0 +1,2876 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as endpointserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.EndpointServiceClient', () => { + it('has servicePath', () => { + const servicePath = endpointserviceModule.v1.EndpointServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = endpointserviceModule.v1.EndpointServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = endpointserviceModule.v1.EndpointServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new endpointserviceModule.v1.EndpointServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.endpointServiceStub, undefined); + await client.initialize(); + assert(client.endpointServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.endpointServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.endpointServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getEndpoint', () => { + it('invokes getEndpoint without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()); + client.innerApiCalls.getEndpoint = stubSimpleCall(expectedResponse); + const [response] = await client.getEndpoint(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getEndpoint without error using callback', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()); + client.innerApiCalls.getEndpoint = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEndpoint( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IEndpoint|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getEndpoint with error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getEndpoint = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEndpoint(request), expectedError); + assert((client.innerApiCalls.getEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getEndpoint with closed client', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetEndpointRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getEndpoint(request), expectedError); + }); + }); + + describe('updateEndpoint', () => { + it('invokes updateEndpoint without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateEndpointRequest()); + request.endpoint = {}; + request.endpoint.name = ''; + const expectedHeaderRequestParams = "endpoint.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()); + client.innerApiCalls.updateEndpoint = stubSimpleCall(expectedResponse); + const [response] = await client.updateEndpoint(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateEndpoint without error using callback', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateEndpointRequest()); + request.endpoint = {}; + request.endpoint.name = ''; + const expectedHeaderRequestParams = "endpoint.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()); + client.innerApiCalls.updateEndpoint = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEndpoint( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IEndpoint|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateEndpoint with error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateEndpointRequest()); + request.endpoint = {}; + request.endpoint.name = ''; + const expectedHeaderRequestParams = "endpoint.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEndpoint = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateEndpoint(request), expectedError); + assert((client.innerApiCalls.updateEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateEndpoint with closed client', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateEndpointRequest()); + request.endpoint = {}; + request.endpoint.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateEndpoint(request), expectedError); + }); + }); + + describe('createEndpoint', () => { + it('invokes createEndpoint without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateEndpointRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createEndpoint = stubLongRunningCall(expectedResponse); + const [operation] = await client.createEndpoint(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createEndpoint without error using callback', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateEndpointRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createEndpoint = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEndpoint( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createEndpoint with call error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateEndpointRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createEndpoint(request), expectedError); + assert((client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createEndpoint with LRO error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateEndpointRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateEndpointProgress without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateEndpointProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateEndpointProgress with error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateEndpointProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteEndpoint', () => { + it('invokes deleteEndpoint without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteEndpoint = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteEndpoint(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteEndpoint without error using callback', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteEndpoint = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEndpoint( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteEndpoint with call error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteEndpoint(request), expectedError); + assert((client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteEndpoint with LRO error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteEndpointProgress without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteEndpointProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteEndpointProgress with error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteEndpointProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deployModel', () => { + it('invokes deployModel without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeployModelRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deployModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.deployModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deployModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deployModel without error using callback', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeployModelRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deployModel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deployModel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deployModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deployModel with call error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeployModelRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deployModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deployModel(request), expectedError); + assert((client.innerApiCalls.deployModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deployModel with LRO error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeployModelRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deployModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deployModel(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deployModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeployModelProgress without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeployModelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeployModelProgress with error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeployModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('undeployModel', () => { + it('invokes undeployModel without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UndeployModelRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.undeployModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.undeployModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes undeployModel without error using callback', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UndeployModelRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.undeployModel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeployModel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes undeployModel with call error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UndeployModelRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.undeployModel(request), expectedError); + assert((client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes undeployModel with LRO error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UndeployModelRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.undeployModel(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUndeployModelProgress without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUndeployModelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeployModelProgress with error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUndeployModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listEndpoints', () => { + it('invokes listEndpoints without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), + ]; + client.innerApiCalls.listEndpoints = stubSimpleCall(expectedResponse); + const [response] = await client.listEndpoints(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listEndpoints as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listEndpoints without error using callback', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), + ]; + client.innerApiCalls.listEndpoints = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEndpoints( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IEndpoint[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listEndpoints as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listEndpoints with error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listEndpoints = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEndpoints(request), expectedError); + assert((client.innerApiCalls.listEndpoints as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listEndpointsStream without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), + ]; + client.descriptors.page.listEndpoints.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listEndpointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Endpoint[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Endpoint) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listEndpoints.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEndpoints, request)); + assert.strictEqual( + (client.descriptors.page.listEndpoints.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listEndpointsStream with error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listEndpoints.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listEndpointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Endpoint[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Endpoint) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listEndpoints.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEndpoints, request)); + assert.strictEqual( + (client.descriptors.page.listEndpoints.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listEndpoints without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), + ]; + client.descriptors.page.listEndpoints.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IEndpoint[] = []; + const iterable = client.listEndpointsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listEndpoints with error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listEndpoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEndpointsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IEndpoint[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/test/gapic_featurestore_online_serving_service_v1.ts b/owl-bot-staging/v1/test/gapic_featurestore_online_serving_service_v1.ts new file mode 100644 index 00000000..61862c2d --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_featurestore_online_serving_service_v1.ts @@ -0,0 +1,1978 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as featurestoreonlineservingserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubServerStreamingCall(response?: ResponseType, error?: Error) { + const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // write something to the stream to trigger transformStub and send the response back to the client + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + return sinon.stub().returns(mockStream); +} + +describe('v1.FeaturestoreOnlineServingServiceClient', () => { + it('has servicePath', () => { + const servicePath = featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.featurestoreOnlineServingServiceStub, undefined); + await client.initialize(); + assert(client.featurestoreOnlineServingServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.featurestoreOnlineServingServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.featurestoreOnlineServingServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('readFeatureValues', () => { + it('invokes readFeatureValues without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse()); + client.innerApiCalls.readFeatureValues = stubSimpleCall(expectedResponse); + const [response] = await client.readFeatureValues(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.readFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes readFeatureValues without error using callback', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse()); + client.innerApiCalls.readFeatureValues = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.readFeatureValues( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IReadFeatureValuesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.readFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes readFeatureValues with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.readFeatureValues = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.readFeatureValues(request), expectedError); + assert((client.innerApiCalls.readFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes readFeatureValues with closed client', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadFeatureValuesRequest()); + request.entityType = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.readFeatureValues(request), expectedError); + }); + }); + + describe('streamingReadFeatureValues', () => { + it('invokes streamingReadFeatureValues without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.StreamingReadFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse()); + client.innerApiCalls.streamingReadFeatureValues = stubServerStreamingCall(expectedResponse); + const stream = client.streamingReadFeatureValues(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.streamingReadFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions)); + }); + + it('invokes streamingReadFeatureValues with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.StreamingReadFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.streamingReadFeatureValues = stubServerStreamingCall(undefined, expectedError); + const stream = client.streamingReadFeatureValues(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.innerApiCalls.streamingReadFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions)); + }); + + it('invokes streamingReadFeatureValues with closed client', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.StreamingReadFeatureValuesRequest()); + request.entityType = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + const stream = client.streamingReadFeatureValues(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/test/gapic_featurestore_service_v1.ts b/owl-bot-staging/v1/test/gapic_featurestore_service_v1.ts new file mode 100644 index 00000000..a6263b8c --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_featurestore_service_v1.ts @@ -0,0 +1,4882 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as featurestoreserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.FeaturestoreServiceClient', () => { + it('has servicePath', () => { + const servicePath = featurestoreserviceModule.v1.FeaturestoreServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = featurestoreserviceModule.v1.FeaturestoreServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = featurestoreserviceModule.v1.FeaturestoreServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.featurestoreServiceStub, undefined); + await client.initialize(); + assert(client.featurestoreServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.featurestoreServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.featurestoreServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getFeaturestore', () => { + it('invokes getFeaturestore without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetFeaturestoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()); + client.innerApiCalls.getFeaturestore = stubSimpleCall(expectedResponse); + const [response] = await client.getFeaturestore(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getFeaturestore without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetFeaturestoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()); + client.innerApiCalls.getFeaturestore = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFeaturestore( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IFeaturestore|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getFeaturestore with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetFeaturestoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getFeaturestore = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getFeaturestore(request), expectedError); + assert((client.innerApiCalls.getFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getFeaturestore with closed client', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetFeaturestoreRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getFeaturestore(request), expectedError); + }); + }); + + describe('getEntityType', () => { + it('invokes getEntityType without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetEntityTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()); + client.innerApiCalls.getEntityType = stubSimpleCall(expectedResponse); + const [response] = await client.getEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getEntityType without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetEntityTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()); + client.innerApiCalls.getEntityType = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEntityType( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IEntityType|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getEntityType with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetEntityTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getEntityType = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEntityType(request), expectedError); + assert((client.innerApiCalls.getEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getEntityType with closed client', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetEntityTypeRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getEntityType(request), expectedError); + }); + }); + + describe('updateEntityType', () => { + it('invokes updateEntityType without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateEntityTypeRequest()); + request.entityType = {}; + request.entityType.name = ''; + const expectedHeaderRequestParams = "entity_type.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()); + client.innerApiCalls.updateEntityType = stubSimpleCall(expectedResponse); + const [response] = await client.updateEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateEntityType without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateEntityTypeRequest()); + request.entityType = {}; + request.entityType.name = ''; + const expectedHeaderRequestParams = "entity_type.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()); + client.innerApiCalls.updateEntityType = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEntityType( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IEntityType|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateEntityType with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateEntityTypeRequest()); + request.entityType = {}; + request.entityType.name = ''; + const expectedHeaderRequestParams = "entity_type.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEntityType = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateEntityType(request), expectedError); + assert((client.innerApiCalls.updateEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateEntityType with closed client', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateEntityTypeRequest()); + request.entityType = {}; + request.entityType.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateEntityType(request), expectedError); + }); + }); + + describe('getFeature', () => { + it('invokes getFeature without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetFeatureRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()); + client.innerApiCalls.getFeature = stubSimpleCall(expectedResponse); + const [response] = await client.getFeature(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getFeature without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetFeatureRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()); + client.innerApiCalls.getFeature = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFeature( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IFeature|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getFeature with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetFeatureRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getFeature = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getFeature(request), expectedError); + assert((client.innerApiCalls.getFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getFeature with closed client', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetFeatureRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getFeature(request), expectedError); + }); + }); + + describe('updateFeature', () => { + it('invokes updateFeature without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateFeatureRequest()); + request.feature = {}; + request.feature.name = ''; + const expectedHeaderRequestParams = "feature.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()); + client.innerApiCalls.updateFeature = stubSimpleCall(expectedResponse); + const [response] = await client.updateFeature(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateFeature without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateFeatureRequest()); + request.feature = {}; + request.feature.name = ''; + const expectedHeaderRequestParams = "feature.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()); + client.innerApiCalls.updateFeature = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateFeature( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IFeature|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateFeature with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateFeatureRequest()); + request.feature = {}; + request.feature.name = ''; + const expectedHeaderRequestParams = "feature.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFeature = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateFeature(request), expectedError); + assert((client.innerApiCalls.updateFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateFeature with closed client', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateFeatureRequest()); + request.feature = {}; + request.feature.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateFeature(request), expectedError); + }); + }); + + describe('createFeaturestore', () => { + it('invokes createFeaturestore without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateFeaturestoreRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createFeaturestore = stubLongRunningCall(expectedResponse); + const [operation] = await client.createFeaturestore(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createFeaturestore without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateFeaturestoreRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createFeaturestore = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFeaturestore( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createFeaturestore with call error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateFeaturestoreRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeaturestore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createFeaturestore(request), expectedError); + assert((client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createFeaturestore with LRO error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateFeaturestoreRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createFeaturestore(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateFeaturestoreProgress without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateFeaturestoreProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateFeaturestoreProgress with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateFeaturestoreProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateFeaturestore', () => { + it('invokes updateFeaturestore without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateFeaturestoreRequest()); + request.featurestore = {}; + request.featurestore.name = ''; + const expectedHeaderRequestParams = "featurestore.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateFeaturestore = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateFeaturestore(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateFeaturestore without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateFeaturestoreRequest()); + request.featurestore = {}; + request.featurestore.name = ''; + const expectedHeaderRequestParams = "featurestore.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateFeaturestore = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateFeaturestore( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateFeaturestore with call error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateFeaturestoreRequest()); + request.featurestore = {}; + request.featurestore.name = ''; + const expectedHeaderRequestParams = "featurestore.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFeaturestore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateFeaturestore(request), expectedError); + assert((client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateFeaturestore with LRO error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateFeaturestoreRequest()); + request.featurestore = {}; + request.featurestore.name = ''; + const expectedHeaderRequestParams = "featurestore.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateFeaturestore(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUpdateFeaturestoreProgress without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateFeaturestoreProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateFeaturestoreProgress with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateFeaturestoreProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteFeaturestore', () => { + it('invokes deleteFeaturestore without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteFeaturestoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteFeaturestore(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteFeaturestore without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteFeaturestoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteFeaturestore = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteFeaturestore( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteFeaturestore with call error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteFeaturestoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteFeaturestore(request), expectedError); + assert((client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteFeaturestore with LRO error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteFeaturestoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteFeaturestore(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteFeaturestoreProgress without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteFeaturestoreProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteFeaturestoreProgress with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteFeaturestoreProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createEntityType', () => { + it('invokes createEntityType without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateEntityTypeRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createEntityType = stubLongRunningCall(expectedResponse); + const [operation] = await client.createEntityType(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createEntityType without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateEntityTypeRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createEntityType = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEntityType( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createEntityType with call error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateEntityTypeRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createEntityType = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createEntityType(request), expectedError); + assert((client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createEntityType with LRO error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateEntityTypeRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createEntityType = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createEntityType(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateEntityTypeProgress without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateEntityTypeProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateEntityTypeProgress with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateEntityTypeProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteEntityType', () => { + it('invokes deleteEntityType without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteEntityTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteEntityType = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteEntityType(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteEntityType without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteEntityTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteEntityType = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEntityType( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteEntityType with call error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteEntityTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEntityType = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteEntityType(request), expectedError); + assert((client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteEntityType with LRO error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteEntityTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEntityType = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteEntityType(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteEntityTypeProgress without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteEntityTypeProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteEntityTypeProgress with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteEntityTypeProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createFeature', () => { + it('invokes createFeature without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateFeatureRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createFeature = stubLongRunningCall(expectedResponse); + const [operation] = await client.createFeature(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createFeature without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateFeatureRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createFeature = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFeature( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createFeature with call error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateFeatureRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeature = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createFeature(request), expectedError); + assert((client.innerApiCalls.createFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createFeature with LRO error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateFeatureRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeature = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createFeature(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateFeatureProgress without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateFeatureProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateFeatureProgress with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateFeatureProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('batchCreateFeatures', () => { + it('invokes batchCreateFeatures without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchCreateFeatures(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchCreateFeatures without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.batchCreateFeatures = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchCreateFeatures( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes batchCreateFeatures with call error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchCreateFeatures(request), expectedError); + assert((client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchCreateFeatures with LRO error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchCreateFeatures(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkBatchCreateFeaturesProgress without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchCreateFeaturesProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchCreateFeaturesProgress with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkBatchCreateFeaturesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteFeature', () => { + it('invokes deleteFeature without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteFeatureRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteFeature = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteFeature(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteFeature without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteFeatureRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteFeature = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteFeature( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteFeature with call error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteFeatureRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeature = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteFeature(request), expectedError); + assert((client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteFeature with LRO error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteFeatureRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeature = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteFeature(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteFeatureProgress without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteFeatureProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteFeatureProgress with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteFeatureProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('importFeatureValues', () => { + it('invokes importFeatureValues without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.importFeatureValues = stubLongRunningCall(expectedResponse); + const [operation] = await client.importFeatureValues(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes importFeatureValues without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.importFeatureValues = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importFeatureValues( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes importFeatureValues with call error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.importFeatureValues = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.importFeatureValues(request), expectedError); + assert((client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes importFeatureValues with LRO error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.importFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.importFeatureValues(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkImportFeatureValuesProgress without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkImportFeatureValuesProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportFeatureValuesProgress with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkImportFeatureValuesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('batchReadFeatureValues', () => { + it('invokes batchReadFeatureValues without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadFeatureValuesRequest()); + request.featurestore = ''; + const expectedHeaderRequestParams = "featurestore="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchReadFeatureValues(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchReadFeatureValues without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadFeatureValuesRequest()); + request.featurestore = ''; + const expectedHeaderRequestParams = "featurestore="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.batchReadFeatureValues = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchReadFeatureValues( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes batchReadFeatureValues with call error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadFeatureValuesRequest()); + request.featurestore = ''; + const expectedHeaderRequestParams = "featurestore="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchReadFeatureValues(request), expectedError); + assert((client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchReadFeatureValues with LRO error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadFeatureValuesRequest()); + request.featurestore = ''; + const expectedHeaderRequestParams = "featurestore="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchReadFeatureValues(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkBatchReadFeatureValuesProgress without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchReadFeatureValuesProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchReadFeatureValuesProgress with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkBatchReadFeatureValuesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('exportFeatureValues', () => { + it('invokes exportFeatureValues without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.exportFeatureValues = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportFeatureValues(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes exportFeatureValues without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.exportFeatureValues = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportFeatureValues( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes exportFeatureValues with call error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportFeatureValues = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportFeatureValues(request), expectedError); + assert((client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes exportFeatureValues with LRO error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportFeatureValues(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkExportFeatureValuesProgress without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkExportFeatureValuesProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportFeatureValuesProgress with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkExportFeatureValuesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listFeaturestores', () => { + it('invokes listFeaturestores without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturestoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), + ]; + client.innerApiCalls.listFeaturestores = stubSimpleCall(expectedResponse); + const [response] = await client.listFeaturestores(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listFeaturestores as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listFeaturestores without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturestoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), + ]; + client.innerApiCalls.listFeaturestores = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFeaturestores( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IFeaturestore[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listFeaturestores as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listFeaturestores with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturestoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listFeaturestores = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFeaturestores(request), expectedError); + assert((client.innerApiCalls.listFeaturestores as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listFeaturestoresStream without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturestoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), + ]; + client.descriptors.page.listFeaturestores.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listFeaturestoresStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Featurestore[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Featurestore) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listFeaturestores.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFeaturestores, request)); + assert.strictEqual( + (client.descriptors.page.listFeaturestores.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listFeaturestoresStream with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturestoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listFeaturestores.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listFeaturestoresStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Featurestore[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Featurestore) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listFeaturestores.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFeaturestores, request)); + assert.strictEqual( + (client.descriptors.page.listFeaturestores.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listFeaturestores without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturestoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), + ]; + client.descriptors.page.listFeaturestores.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IFeaturestore[] = []; + const iterable = client.listFeaturestoresAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listFeaturestores with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturestoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listFeaturestores.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listFeaturestoresAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IFeaturestore[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listEntityTypes', () => { + it('invokes listEntityTypes without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEntityTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), + ]; + client.innerApiCalls.listEntityTypes = stubSimpleCall(expectedResponse); + const [response] = await client.listEntityTypes(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listEntityTypes as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listEntityTypes without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEntityTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), + ]; + client.innerApiCalls.listEntityTypes = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEntityTypes( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IEntityType[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listEntityTypes as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listEntityTypes with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEntityTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listEntityTypes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEntityTypes(request), expectedError); + assert((client.innerApiCalls.listEntityTypes as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listEntityTypesStream without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEntityTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), + ]; + client.descriptors.page.listEntityTypes.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listEntityTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.EntityType[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.EntityType) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEntityTypes, request)); + assert.strictEqual( + (client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listEntityTypesStream with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEntityTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listEntityTypes.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listEntityTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.EntityType[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.EntityType) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEntityTypes, request)); + assert.strictEqual( + (client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listEntityTypes without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEntityTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), + ]; + client.descriptors.page.listEntityTypes.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IEntityType[] = []; + const iterable = client.listEntityTypesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listEntityTypes with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEntityTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listEntityTypes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEntityTypesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IEntityType[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listFeatures', () => { + it('invokes listFeatures without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + ]; + client.innerApiCalls.listFeatures = stubSimpleCall(expectedResponse); + const [response] = await client.listFeatures(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listFeatures without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + ]; + client.innerApiCalls.listFeatures = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFeatures( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IFeature[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listFeatures with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listFeatures = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFeatures(request), expectedError); + assert((client.innerApiCalls.listFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listFeaturesStream without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + ]; + client.descriptors.page.listFeatures.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listFeaturesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Feature[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Feature) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listFeatures.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFeatures, request)); + assert.strictEqual( + (client.descriptors.page.listFeatures.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listFeaturesStream with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listFeatures.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listFeaturesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Feature[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Feature) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listFeatures.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFeatures, request)); + assert.strictEqual( + (client.descriptors.page.listFeatures.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listFeatures without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + ]; + client.descriptors.page.listFeatures.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IFeature[] = []; + const iterable = client.listFeaturesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listFeatures.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listFeatures.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listFeatures with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listFeatures.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listFeaturesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IFeature[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listFeatures.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listFeatures.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('searchFeatures', () => { + it('invokes searchFeatures without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchFeaturesRequest()); + request.location = ''; + const expectedHeaderRequestParams = "location="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + ]; + client.innerApiCalls.searchFeatures = stubSimpleCall(expectedResponse); + const [response] = await client.searchFeatures(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.searchFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes searchFeatures without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchFeaturesRequest()); + request.location = ''; + const expectedHeaderRequestParams = "location="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + ]; + client.innerApiCalls.searchFeatures = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchFeatures( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IFeature[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.searchFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes searchFeatures with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchFeaturesRequest()); + request.location = ''; + const expectedHeaderRequestParams = "location="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.searchFeatures = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchFeatures(request), expectedError); + assert((client.innerApiCalls.searchFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes searchFeaturesStream without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchFeaturesRequest()); + request.location = ''; + const expectedHeaderRequestParams = "location="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + ]; + client.descriptors.page.searchFeatures.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchFeaturesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Feature[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Feature) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.searchFeatures.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchFeatures, request)); + assert.strictEqual( + (client.descriptors.page.searchFeatures.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes searchFeaturesStream with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchFeaturesRequest()); + request.location = ''; + const expectedHeaderRequestParams = "location="; + const expectedError = new Error('expected'); + client.descriptors.page.searchFeatures.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchFeaturesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Feature[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Feature) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchFeatures.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchFeatures, request)); + assert.strictEqual( + (client.descriptors.page.searchFeatures.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchFeatures without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchFeaturesRequest()); + request.location = ''; + const expectedHeaderRequestParams = "location="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), + ]; + client.descriptors.page.searchFeatures.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IFeature[] = []; + const iterable = client.searchFeaturesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchFeatures with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchFeaturesRequest()); + request.location = ''; + const expectedHeaderRequestParams = "location=";const expectedError = new Error('expected'); + client.descriptors.page.searchFeatures.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchFeaturesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IFeature[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/test/gapic_index_endpoint_service_v1.ts b/owl-bot-staging/v1/test/gapic_index_endpoint_service_v1.ts new file mode 100644 index 00000000..b864da79 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_index_endpoint_service_v1.ts @@ -0,0 +1,3020 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as indexendpointserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.IndexEndpointServiceClient', () => { + it('has servicePath', () => { + const servicePath = indexendpointserviceModule.v1.IndexEndpointServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = indexendpointserviceModule.v1.IndexEndpointServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = indexendpointserviceModule.v1.IndexEndpointServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.indexEndpointServiceStub, undefined); + await client.initialize(); + assert(client.indexEndpointServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.indexEndpointServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.indexEndpointServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getIndexEndpoint', () => { + it('invokes getIndexEndpoint without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetIndexEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()); + client.innerApiCalls.getIndexEndpoint = stubSimpleCall(expectedResponse); + const [response] = await client.getIndexEndpoint(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getIndexEndpoint without error using callback', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetIndexEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()); + client.innerApiCalls.getIndexEndpoint = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIndexEndpoint( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IIndexEndpoint|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getIndexEndpoint with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetIndexEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIndexEndpoint = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIndexEndpoint(request), expectedError); + assert((client.innerApiCalls.getIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getIndexEndpoint with closed client', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetIndexEndpointRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIndexEndpoint(request), expectedError); + }); + }); + + describe('updateIndexEndpoint', () => { + it('invokes updateIndexEndpoint without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateIndexEndpointRequest()); + request.indexEndpoint = {}; + request.indexEndpoint.name = ''; + const expectedHeaderRequestParams = "index_endpoint.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()); + client.innerApiCalls.updateIndexEndpoint = stubSimpleCall(expectedResponse); + const [response] = await client.updateIndexEndpoint(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateIndexEndpoint without error using callback', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateIndexEndpointRequest()); + request.indexEndpoint = {}; + request.indexEndpoint.name = ''; + const expectedHeaderRequestParams = "index_endpoint.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()); + client.innerApiCalls.updateIndexEndpoint = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateIndexEndpoint( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IIndexEndpoint|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateIndexEndpoint with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateIndexEndpointRequest()); + request.indexEndpoint = {}; + request.indexEndpoint.name = ''; + const expectedHeaderRequestParams = "index_endpoint.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateIndexEndpoint = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateIndexEndpoint(request), expectedError); + assert((client.innerApiCalls.updateIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateIndexEndpoint with closed client', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateIndexEndpointRequest()); + request.indexEndpoint = {}; + request.indexEndpoint.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateIndexEndpoint(request), expectedError); + }); + }); + + describe('createIndexEndpoint', () => { + it('invokes createIndexEndpoint without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateIndexEndpointRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(expectedResponse); + const [operation] = await client.createIndexEndpoint(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createIndexEndpoint without error using callback', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateIndexEndpointRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createIndexEndpoint = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createIndexEndpoint( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createIndexEndpoint with call error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateIndexEndpointRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createIndexEndpoint(request), expectedError); + assert((client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createIndexEndpoint with LRO error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateIndexEndpointRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createIndexEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateIndexEndpointProgress without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateIndexEndpointProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateIndexEndpointProgress with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateIndexEndpointProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteIndexEndpoint', () => { + it('invokes deleteIndexEndpoint without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteIndexEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteIndexEndpoint(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteIndexEndpoint without error using callback', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteIndexEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteIndexEndpoint( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteIndexEndpoint with call error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteIndexEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteIndexEndpoint(request), expectedError); + assert((client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteIndexEndpoint with LRO error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteIndexEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteIndexEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteIndexEndpointProgress without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteIndexEndpointProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteIndexEndpointProgress with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteIndexEndpointProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deployIndex', () => { + it('invokes deployIndex without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeployIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deployIndex = stubLongRunningCall(expectedResponse); + const [operation] = await client.deployIndex(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deployIndex without error using callback', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeployIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deployIndex = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deployIndex( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deployIndex with call error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeployIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deployIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deployIndex(request), expectedError); + assert((client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deployIndex with LRO error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeployIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deployIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deployIndex(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeployIndexProgress without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeployIndexProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeployIndexProgress with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeployIndexProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('undeployIndex', () => { + it('invokes undeployIndex without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UndeployIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.undeployIndex = stubLongRunningCall(expectedResponse); + const [operation] = await client.undeployIndex(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes undeployIndex without error using callback', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UndeployIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.undeployIndex = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeployIndex( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes undeployIndex with call error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UndeployIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.undeployIndex(request), expectedError); + assert((client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes undeployIndex with LRO error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UndeployIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.undeployIndex(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUndeployIndexProgress without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUndeployIndexProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeployIndexProgress with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUndeployIndexProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('mutateDeployedIndex', () => { + it('invokes mutateDeployedIndex without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MutateDeployedIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(expectedResponse); + const [operation] = await client.mutateDeployedIndex(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes mutateDeployedIndex without error using callback', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MutateDeployedIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.mutateDeployedIndex = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.mutateDeployedIndex( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes mutateDeployedIndex with call error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MutateDeployedIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.mutateDeployedIndex(request), expectedError); + assert((client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes mutateDeployedIndex with LRO error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MutateDeployedIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.mutateDeployedIndex(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkMutateDeployedIndexProgress without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkMutateDeployedIndexProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkMutateDeployedIndexProgress with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkMutateDeployedIndexProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listIndexEndpoints', () => { + it('invokes listIndexEndpoints without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), + ]; + client.innerApiCalls.listIndexEndpoints = stubSimpleCall(expectedResponse); + const [response] = await client.listIndexEndpoints(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listIndexEndpoints as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listIndexEndpoints without error using callback', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), + ]; + client.innerApiCalls.listIndexEndpoints = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listIndexEndpoints( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IIndexEndpoint[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listIndexEndpoints as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listIndexEndpoints with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listIndexEndpoints = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listIndexEndpoints(request), expectedError); + assert((client.innerApiCalls.listIndexEndpoints as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listIndexEndpointsStream without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), + ]; + client.descriptors.page.listIndexEndpoints.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listIndexEndpointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.IndexEndpoint[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.IndexEndpoint) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listIndexEndpoints.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listIndexEndpoints, request)); + assert.strictEqual( + (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listIndexEndpointsStream with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listIndexEndpoints.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listIndexEndpointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.IndexEndpoint[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.IndexEndpoint) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listIndexEndpoints.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listIndexEndpoints, request)); + assert.strictEqual( + (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listIndexEndpoints without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), + ]; + client.descriptors.page.listIndexEndpoints.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IIndexEndpoint[] = []; + const iterable = client.listIndexEndpointsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listIndexEndpoints with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listIndexEndpoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listIndexEndpointsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IIndexEndpoint[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/test/gapic_index_service_v1.ts b/owl-bot-staging/v1/test/gapic_index_service_v1.ts new file mode 100644 index 00000000..32f83b15 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_index_service_v1.ts @@ -0,0 +1,2635 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as indexserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.IndexServiceClient', () => { + it('has servicePath', () => { + const servicePath = indexserviceModule.v1.IndexServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = indexserviceModule.v1.IndexServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = indexserviceModule.v1.IndexServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new indexserviceModule.v1.IndexServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.indexServiceStub, undefined); + await client.initialize(); + assert(client.indexServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.indexServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.indexServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getIndex', () => { + it('invokes getIndex without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetIndexRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()); + client.innerApiCalls.getIndex = stubSimpleCall(expectedResponse); + const [response] = await client.getIndex(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getIndex without error using callback', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetIndexRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()); + client.innerApiCalls.getIndex = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIndex( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IIndex|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getIndex with error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetIndexRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIndex = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIndex(request), expectedError); + assert((client.innerApiCalls.getIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getIndex with closed client', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetIndexRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIndex(request), expectedError); + }); + }); + + describe('createIndex', () => { + it('invokes createIndex without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateIndexRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createIndex = stubLongRunningCall(expectedResponse); + const [operation] = await client.createIndex(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createIndex without error using callback', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateIndexRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createIndex = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createIndex( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createIndex with call error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateIndexRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createIndex(request), expectedError); + assert((client.innerApiCalls.createIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createIndex with LRO error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateIndexRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createIndex(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateIndexProgress without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateIndexProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateIndexProgress with error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateIndexProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateIndex', () => { + it('invokes updateIndex without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateIndexRequest()); + request.index = {}; + request.index.name = ''; + const expectedHeaderRequestParams = "index.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateIndex = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateIndex(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateIndex without error using callback', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateIndexRequest()); + request.index = {}; + request.index.name = ''; + const expectedHeaderRequestParams = "index.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateIndex = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateIndex( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateIndex with call error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateIndexRequest()); + request.index = {}; + request.index.name = ''; + const expectedHeaderRequestParams = "index.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateIndex(request), expectedError); + assert((client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateIndex with LRO error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateIndexRequest()); + request.index = {}; + request.index.name = ''; + const expectedHeaderRequestParams = "index.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateIndex(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUpdateIndexProgress without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateIndexProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateIndexProgress with error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateIndexProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteIndex', () => { + it('invokes deleteIndex without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteIndexRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteIndex = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteIndex(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteIndex without error using callback', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteIndexRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteIndex = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteIndex( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteIndex with call error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteIndexRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteIndex(request), expectedError); + assert((client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteIndex with LRO error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteIndexRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteIndex(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteIndexProgress without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteIndexProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteIndexProgress with error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteIndexProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listIndexes', () => { + it('invokes listIndexes without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), + ]; + client.innerApiCalls.listIndexes = stubSimpleCall(expectedResponse); + const [response] = await client.listIndexes(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listIndexes as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listIndexes without error using callback', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), + ]; + client.innerApiCalls.listIndexes = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listIndexes( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IIndex[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listIndexes as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listIndexes with error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listIndexes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listIndexes(request), expectedError); + assert((client.innerApiCalls.listIndexes as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listIndexesStream without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), + ]; + client.descriptors.page.listIndexes.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listIndexesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Index[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Index) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listIndexes.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listIndexes, request)); + assert.strictEqual( + (client.descriptors.page.listIndexes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listIndexesStream with error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listIndexes.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listIndexesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Index[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Index) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listIndexes.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listIndexes, request)); + assert.strictEqual( + (client.descriptors.page.listIndexes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listIndexes without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), + ]; + client.descriptors.page.listIndexes.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IIndex[] = []; + const iterable = client.listIndexesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listIndexes.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listIndexes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listIndexes with error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listIndexes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listIndexesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IIndex[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listIndexes.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listIndexes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/test/gapic_job_service_v1.ts b/owl-bot-staging/v1/test/gapic_job_service_v1.ts new file mode 100644 index 00000000..40715ff5 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_job_service_v1.ts @@ -0,0 +1,5637 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as jobserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.JobServiceClient', () => { + it('has servicePath', () => { + const servicePath = jobserviceModule.v1.JobServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = jobserviceModule.v1.JobServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = jobserviceModule.v1.JobServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new jobserviceModule.v1.JobServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new jobserviceModule.v1.JobServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.jobServiceStub, undefined); + await client.initialize(); + assert(client.jobServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.jobServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.jobServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('createCustomJob', () => { + it('invokes createCustomJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateCustomJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()); + client.innerApiCalls.createCustomJob = stubSimpleCall(expectedResponse); + const [response] = await client.createCustomJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createCustomJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateCustomJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()); + client.innerApiCalls.createCustomJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCustomJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ICustomJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createCustomJob with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateCustomJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCustomJob(request), expectedError); + assert((client.innerApiCalls.createCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createCustomJob with closed client', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateCustomJobRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createCustomJob(request), expectedError); + }); + }); + + describe('getCustomJob', () => { + it('invokes getCustomJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()); + client.innerApiCalls.getCustomJob = stubSimpleCall(expectedResponse); + const [response] = await client.getCustomJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getCustomJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()); + client.innerApiCalls.getCustomJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCustomJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ICustomJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getCustomJob with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getCustomJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCustomJob(request), expectedError); + assert((client.innerApiCalls.getCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getCustomJob with closed client', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetCustomJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCustomJob(request), expectedError); + }); + }); + + describe('cancelCustomJob', () => { + it('invokes cancelCustomJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelCustomJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelCustomJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelCustomJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelCustomJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelCustomJob( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes cancelCustomJob with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelCustomJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelCustomJob(request), expectedError); + assert((client.innerApiCalls.cancelCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelCustomJob with closed client', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelCustomJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelCustomJob(request), expectedError); + }); + }); + + describe('createDataLabelingJob', () => { + it('invokes createDataLabelingJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateDataLabelingJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()); + client.innerApiCalls.createDataLabelingJob = stubSimpleCall(expectedResponse); + const [response] = await client.createDataLabelingJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createDataLabelingJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateDataLabelingJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()); + client.innerApiCalls.createDataLabelingJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDataLabelingJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IDataLabelingJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createDataLabelingJob with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateDataLabelingJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataLabelingJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDataLabelingJob(request), expectedError); + assert((client.innerApiCalls.createDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createDataLabelingJob with closed client', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateDataLabelingJobRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDataLabelingJob(request), expectedError); + }); + }); + + describe('getDataLabelingJob', () => { + it('invokes getDataLabelingJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()); + client.innerApiCalls.getDataLabelingJob = stubSimpleCall(expectedResponse); + const [response] = await client.getDataLabelingJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDataLabelingJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()); + client.innerApiCalls.getDataLabelingJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataLabelingJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IDataLabelingJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getDataLabelingJob with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataLabelingJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataLabelingJob(request), expectedError); + assert((client.innerApiCalls.getDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDataLabelingJob with closed client', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetDataLabelingJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataLabelingJob(request), expectedError); + }); + }); + + describe('cancelDataLabelingJob', () => { + it('invokes cancelDataLabelingJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelDataLabelingJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelDataLabelingJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelDataLabelingJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelDataLabelingJob( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes cancelDataLabelingJob with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelDataLabelingJob(request), expectedError); + assert((client.innerApiCalls.cancelDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelDataLabelingJob with closed client', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelDataLabelingJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelDataLabelingJob(request), expectedError); + }); + }); + + describe('createHyperparameterTuningJob', () => { + it('invokes createHyperparameterTuningJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateHyperparameterTuningJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()); + client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCall(expectedResponse); + const [response] = await client.createHyperparameterTuningJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createHyperparameterTuningJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateHyperparameterTuningJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()); + client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createHyperparameterTuningJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createHyperparameterTuningJob with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateHyperparameterTuningJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createHyperparameterTuningJob(request), expectedError); + assert((client.innerApiCalls.createHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createHyperparameterTuningJob with closed client', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateHyperparameterTuningJobRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createHyperparameterTuningJob(request), expectedError); + }); + }); + + describe('getHyperparameterTuningJob', () => { + it('invokes getHyperparameterTuningJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()); + client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCall(expectedResponse); + const [response] = await client.getHyperparameterTuningJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getHyperparameterTuningJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()); + client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getHyperparameterTuningJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getHyperparameterTuningJob with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getHyperparameterTuningJob(request), expectedError); + assert((client.innerApiCalls.getHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getHyperparameterTuningJob with closed client', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetHyperparameterTuningJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getHyperparameterTuningJob(request), expectedError); + }); + }); + + describe('cancelHyperparameterTuningJob', () => { + it('invokes cancelHyperparameterTuningJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelHyperparameterTuningJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelHyperparameterTuningJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelHyperparameterTuningJob( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes cancelHyperparameterTuningJob with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelHyperparameterTuningJob(request), expectedError); + assert((client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelHyperparameterTuningJob with closed client', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelHyperparameterTuningJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelHyperparameterTuningJob(request), expectedError); + }); + }); + + describe('createBatchPredictionJob', () => { + it('invokes createBatchPredictionJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateBatchPredictionJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()); + client.innerApiCalls.createBatchPredictionJob = stubSimpleCall(expectedResponse); + const [response] = await client.createBatchPredictionJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createBatchPredictionJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateBatchPredictionJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()); + client.innerApiCalls.createBatchPredictionJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBatchPredictionJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IBatchPredictionJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createBatchPredictionJob with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateBatchPredictionJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createBatchPredictionJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createBatchPredictionJob(request), expectedError); + assert((client.innerApiCalls.createBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createBatchPredictionJob with closed client', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateBatchPredictionJobRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createBatchPredictionJob(request), expectedError); + }); + }); + + describe('getBatchPredictionJob', () => { + it('invokes getBatchPredictionJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()); + client.innerApiCalls.getBatchPredictionJob = stubSimpleCall(expectedResponse); + const [response] = await client.getBatchPredictionJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getBatchPredictionJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()); + client.innerApiCalls.getBatchPredictionJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBatchPredictionJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IBatchPredictionJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getBatchPredictionJob with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getBatchPredictionJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBatchPredictionJob(request), expectedError); + assert((client.innerApiCalls.getBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getBatchPredictionJob with closed client', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetBatchPredictionJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBatchPredictionJob(request), expectedError); + }); + }); + + describe('cancelBatchPredictionJob', () => { + it('invokes cancelBatchPredictionJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelBatchPredictionJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelBatchPredictionJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelBatchPredictionJob( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes cancelBatchPredictionJob with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelBatchPredictionJob(request), expectedError); + assert((client.innerApiCalls.cancelBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelBatchPredictionJob with closed client', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelBatchPredictionJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelBatchPredictionJob(request), expectedError); + }); + }); + + describe('createModelDeploymentMonitoringJob', () => { + it('invokes createModelDeploymentMonitoringJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateModelDeploymentMonitoringJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()); + client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); + const [response] = await client.createModelDeploymentMonitoringJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createModelDeploymentMonitoringJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateModelDeploymentMonitoringJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()); + client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createModelDeploymentMonitoringJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createModelDeploymentMonitoringJob with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateModelDeploymentMonitoringJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createModelDeploymentMonitoringJob(request), expectedError); + assert((client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createModelDeploymentMonitoringJob with closed client', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateModelDeploymentMonitoringJobRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createModelDeploymentMonitoringJob(request), expectedError); + }); + }); + + describe('getModelDeploymentMonitoringJob', () => { + it('invokes getModelDeploymentMonitoringJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()); + client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); + const [response] = await client.getModelDeploymentMonitoringJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getModelDeploymentMonitoringJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()); + client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModelDeploymentMonitoringJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getModelDeploymentMonitoringJob with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModelDeploymentMonitoringJob(request), expectedError); + assert((client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getModelDeploymentMonitoringJob with closed client', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getModelDeploymentMonitoringJob(request), expectedError); + }); + }); + + describe('pauseModelDeploymentMonitoringJob', () => { + it('invokes pauseModelDeploymentMonitoringJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PauseModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); + const [response] = await client.pauseModelDeploymentMonitoringJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes pauseModelDeploymentMonitoringJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PauseModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pauseModelDeploymentMonitoringJob( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes pauseModelDeploymentMonitoringJob with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PauseModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.pauseModelDeploymentMonitoringJob(request), expectedError); + assert((client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes pauseModelDeploymentMonitoringJob with closed client', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PauseModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.pauseModelDeploymentMonitoringJob(request), expectedError); + }); + }); + + describe('resumeModelDeploymentMonitoringJob', () => { + it('invokes resumeModelDeploymentMonitoringJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ResumeModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); + const [response] = await client.resumeModelDeploymentMonitoringJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes resumeModelDeploymentMonitoringJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ResumeModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resumeModelDeploymentMonitoringJob( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes resumeModelDeploymentMonitoringJob with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ResumeModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.resumeModelDeploymentMonitoringJob(request), expectedError); + assert((client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes resumeModelDeploymentMonitoringJob with closed client', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ResumeModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.resumeModelDeploymentMonitoringJob(request), expectedError); + }); + }); + + describe('deleteCustomJob', () => { + it('invokes deleteCustomJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteCustomJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCustomJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteCustomJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteCustomJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCustomJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteCustomJob with call error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteCustomJob(request), expectedError); + assert((client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteCustomJob with LRO error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteCustomJob(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteCustomJobProgress without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteCustomJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteCustomJobProgress with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteCustomJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteDataLabelingJob', () => { + it('invokes deleteDataLabelingJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteDataLabelingJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteDataLabelingJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDataLabelingJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteDataLabelingJob with call error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteDataLabelingJob(request), expectedError); + assert((client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteDataLabelingJob with LRO error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteDataLabelingJob(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteDataLabelingJobProgress without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteDataLabelingJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteDataLabelingJobProgress with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteDataLabelingJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteHyperparameterTuningJob', () => { + it('invokes deleteHyperparameterTuningJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteHyperparameterTuningJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteHyperparameterTuningJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteHyperparameterTuningJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteHyperparameterTuningJob with call error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteHyperparameterTuningJob(request), expectedError); + assert((client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteHyperparameterTuningJob with LRO error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteHyperparameterTuningJob(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteHyperparameterTuningJobProgress without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteHyperparameterTuningJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteHyperparameterTuningJobProgress with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteHyperparameterTuningJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteBatchPredictionJob', () => { + it('invokes deleteBatchPredictionJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBatchPredictionJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteBatchPredictionJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBatchPredictionJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteBatchPredictionJob with call error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteBatchPredictionJob(request), expectedError); + assert((client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteBatchPredictionJob with LRO error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteBatchPredictionJob(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteBatchPredictionJobProgress without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteBatchPredictionJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBatchPredictionJobProgress with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteBatchPredictionJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateModelDeploymentMonitoringJob', () => { + it('invokes updateModelDeploymentMonitoringJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateModelDeploymentMonitoringJobRequest()); + request.modelDeploymentMonitoringJob = {}; + request.modelDeploymentMonitoringJob.name = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateModelDeploymentMonitoringJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateModelDeploymentMonitoringJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateModelDeploymentMonitoringJobRequest()); + request.modelDeploymentMonitoringJob = {}; + request.modelDeploymentMonitoringJob.name = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateModelDeploymentMonitoringJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateModelDeploymentMonitoringJob with call error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateModelDeploymentMonitoringJobRequest()); + request.modelDeploymentMonitoringJob = {}; + request.modelDeploymentMonitoringJob.name = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateModelDeploymentMonitoringJob(request), expectedError); + assert((client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateModelDeploymentMonitoringJob with LRO error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateModelDeploymentMonitoringJobRequest()); + request.modelDeploymentMonitoringJob = {}; + request.modelDeploymentMonitoringJob.name = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateModelDeploymentMonitoringJob(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUpdateModelDeploymentMonitoringJobProgress without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateModelDeploymentMonitoringJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateModelDeploymentMonitoringJobProgress with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateModelDeploymentMonitoringJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteModelDeploymentMonitoringJob', () => { + it('invokes deleteModelDeploymentMonitoringJob without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteModelDeploymentMonitoringJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteModelDeploymentMonitoringJob without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteModelDeploymentMonitoringJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteModelDeploymentMonitoringJob with call error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteModelDeploymentMonitoringJob(request), expectedError); + assert((client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteModelDeploymentMonitoringJob with LRO error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteModelDeploymentMonitoringJob(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteModelDeploymentMonitoringJobProgress without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteModelDeploymentMonitoringJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteModelDeploymentMonitoringJobProgress with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteModelDeploymentMonitoringJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listCustomJobs', () => { + it('invokes listCustomJobs without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListCustomJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), + ]; + client.innerApiCalls.listCustomJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listCustomJobs(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listCustomJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listCustomJobs without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListCustomJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), + ]; + client.innerApiCalls.listCustomJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCustomJobs( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ICustomJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listCustomJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listCustomJobs with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListCustomJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listCustomJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCustomJobs(request), expectedError); + assert((client.innerApiCalls.listCustomJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listCustomJobsStream without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListCustomJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), + ]; + client.descriptors.page.listCustomJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listCustomJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.CustomJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.CustomJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listCustomJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomJobs, request)); + assert.strictEqual( + (client.descriptors.page.listCustomJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listCustomJobsStream with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListCustomJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listCustomJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.CustomJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.CustomJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listCustomJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomJobs, request)); + assert.strictEqual( + (client.descriptors.page.listCustomJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listCustomJobs without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListCustomJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), + ]; + client.descriptors.page.listCustomJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.ICustomJob[] = []; + const iterable = client.listCustomJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listCustomJobs with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListCustomJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listCustomJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCustomJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.ICustomJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listDataLabelingJobs', () => { + it('invokes listDataLabelingJobs without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), + ]; + client.innerApiCalls.listDataLabelingJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listDataLabelingJobs(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDataLabelingJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDataLabelingJobs without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), + ]; + client.innerApiCalls.listDataLabelingJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDataLabelingJobs( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IDataLabelingJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDataLabelingJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listDataLabelingJobs with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataLabelingJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDataLabelingJobs(request), expectedError); + assert((client.innerApiCalls.listDataLabelingJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDataLabelingJobsStream without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), + ]; + client.descriptors.page.listDataLabelingJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDataLabelingJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.DataLabelingJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.DataLabelingJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDataLabelingJobs, request)); + assert.strictEqual( + (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listDataLabelingJobsStream with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listDataLabelingJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDataLabelingJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.DataLabelingJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.DataLabelingJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDataLabelingJobs, request)); + assert.strictEqual( + (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDataLabelingJobs without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), + ]; + client.descriptors.page.listDataLabelingJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IDataLabelingJob[] = []; + const iterable = client.listDataLabelingJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDataLabelingJobs with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listDataLabelingJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDataLabelingJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IDataLabelingJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listHyperparameterTuningJobs', () => { + it('invokes listHyperparameterTuningJobs without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), + ]; + client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listHyperparameterTuningJobs(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listHyperparameterTuningJobs without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), + ]; + client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listHyperparameterTuningJobs( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listHyperparameterTuningJobs with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listHyperparameterTuningJobs(request), expectedError); + assert((client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listHyperparameterTuningJobsStream without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), + ]; + client.descriptors.page.listHyperparameterTuningJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listHyperparameterTuningJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.HyperparameterTuningJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.HyperparameterTuningJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listHyperparameterTuningJobs, request)); + assert.strictEqual( + (client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listHyperparameterTuningJobsStream with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listHyperparameterTuningJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listHyperparameterTuningJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.HyperparameterTuningJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.HyperparameterTuningJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listHyperparameterTuningJobs, request)); + assert.strictEqual( + (client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listHyperparameterTuningJobs without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), + ]; + client.descriptors.page.listHyperparameterTuningJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob[] = []; + const iterable = client.listHyperparameterTuningJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listHyperparameterTuningJobs with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listHyperparameterTuningJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listHyperparameterTuningJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listBatchPredictionJobs', () => { + it('invokes listBatchPredictionJobs without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), + ]; + client.innerApiCalls.listBatchPredictionJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listBatchPredictionJobs(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listBatchPredictionJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listBatchPredictionJobs without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), + ]; + client.innerApiCalls.listBatchPredictionJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBatchPredictionJobs( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IBatchPredictionJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listBatchPredictionJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listBatchPredictionJobs with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listBatchPredictionJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBatchPredictionJobs(request), expectedError); + assert((client.innerApiCalls.listBatchPredictionJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listBatchPredictionJobsStream without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), + ]; + client.descriptors.page.listBatchPredictionJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBatchPredictionJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.BatchPredictionJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.BatchPredictionJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBatchPredictionJobs, request)); + assert.strictEqual( + (client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listBatchPredictionJobsStream with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listBatchPredictionJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listBatchPredictionJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.BatchPredictionJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.BatchPredictionJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBatchPredictionJobs, request)); + assert.strictEqual( + (client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listBatchPredictionJobs without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), + ]; + client.descriptors.page.listBatchPredictionJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IBatchPredictionJob[] = []; + const iterable = client.listBatchPredictionJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listBatchPredictionJobs with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listBatchPredictionJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBatchPredictionJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IBatchPredictionJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('searchModelDeploymentMonitoringStatsAnomalies', () => { + it('invokes searchModelDeploymentMonitoringStatsAnomalies without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); + request.modelDeploymentMonitoringJob = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), + ]; + client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCall(expectedResponse); + const [response] = await client.searchModelDeploymentMonitoringStatsAnomalies(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes searchModelDeploymentMonitoringStatsAnomalies without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); + request.modelDeploymentMonitoringJob = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), + ]; + client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchModelDeploymentMonitoringStatsAnomalies( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModelMonitoringStatsAnomalies[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes searchModelDeploymentMonitoringStatsAnomalies with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); + request.modelDeploymentMonitoringJob = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchModelDeploymentMonitoringStatsAnomalies(request), expectedError); + assert((client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes searchModelDeploymentMonitoringStatsAnomaliesStream without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); + request.modelDeploymentMonitoringJob = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), + ]; + client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchModelDeploymentMonitoringStatsAnomaliesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies, request)); + assert.strictEqual( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes searchModelDeploymentMonitoringStatsAnomaliesStream with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); + request.modelDeploymentMonitoringJob = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job="; + const expectedError = new Error('expected'); + client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchModelDeploymentMonitoringStatsAnomaliesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies, request)); + assert.strictEqual( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchModelDeploymentMonitoringStatsAnomalies without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); + request.modelDeploymentMonitoringJob = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), + ]; + client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IModelMonitoringStatsAnomalies[] = []; + const iterable = client.searchModelDeploymentMonitoringStatsAnomaliesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchModelDeploymentMonitoringStatsAnomalies with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); + request.modelDeploymentMonitoringJob = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job=";const expectedError = new Error('expected'); + client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchModelDeploymentMonitoringStatsAnomaliesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IModelMonitoringStatsAnomalies[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listModelDeploymentMonitoringJobs', () => { + it('invokes listModelDeploymentMonitoringJobs without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), + ]; + client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listModelDeploymentMonitoringJobs(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listModelDeploymentMonitoringJobs without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), + ]; + client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModelDeploymentMonitoringJobs( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listModelDeploymentMonitoringJobs with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModelDeploymentMonitoringJobs(request), expectedError); + assert((client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listModelDeploymentMonitoringJobsStream without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), + ]; + client.descriptors.page.listModelDeploymentMonitoringJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listModelDeploymentMonitoringJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModelDeploymentMonitoringJobs, request)); + assert.strictEqual( + (client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listModelDeploymentMonitoringJobsStream with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listModelDeploymentMonitoringJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listModelDeploymentMonitoringJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModelDeploymentMonitoringJobs, request)); + assert.strictEqual( + (client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listModelDeploymentMonitoringJobs without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), + ]; + client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob[] = []; + const iterable = client.listModelDeploymentMonitoringJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listModelDeploymentMonitoringJobs with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listModelDeploymentMonitoringJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/test/gapic_metadata_service_v1.ts b/owl-bot-staging/v1/test/gapic_metadata_service_v1.ts new file mode 100644 index 00000000..6c826745 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_metadata_service_v1.ts @@ -0,0 +1,5934 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as metadataserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.MetadataServiceClient', () => { + it('has servicePath', () => { + const servicePath = metadataserviceModule.v1.MetadataServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = metadataserviceModule.v1.MetadataServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = metadataserviceModule.v1.MetadataServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new metadataserviceModule.v1.MetadataServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.metadataServiceStub, undefined); + await client.initialize(); + assert(client.metadataServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.metadataServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.metadataServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getMetadataStore', () => { + it('invokes getMetadataStore without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetMetadataStoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()); + client.innerApiCalls.getMetadataStore = stubSimpleCall(expectedResponse); + const [response] = await client.getMetadataStore(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getMetadataStore without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetMetadataStoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()); + client.innerApiCalls.getMetadataStore = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMetadataStore( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IMetadataStore|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getMetadataStore with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetMetadataStoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getMetadataStore = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMetadataStore(request), expectedError); + assert((client.innerApiCalls.getMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getMetadataStore with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetMetadataStoreRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMetadataStore(request), expectedError); + }); + }); + + describe('createArtifact', () => { + it('invokes createArtifact without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateArtifactRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()); + client.innerApiCalls.createArtifact = stubSimpleCall(expectedResponse); + const [response] = await client.createArtifact(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createArtifact without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateArtifactRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()); + client.innerApiCalls.createArtifact = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createArtifact( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IArtifact|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createArtifact with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateArtifactRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createArtifact = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createArtifact(request), expectedError); + assert((client.innerApiCalls.createArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createArtifact with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateArtifactRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createArtifact(request), expectedError); + }); + }); + + describe('getArtifact', () => { + it('invokes getArtifact without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetArtifactRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()); + client.innerApiCalls.getArtifact = stubSimpleCall(expectedResponse); + const [response] = await client.getArtifact(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getArtifact without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetArtifactRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()); + client.innerApiCalls.getArtifact = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getArtifact( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IArtifact|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getArtifact with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetArtifactRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getArtifact = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getArtifact(request), expectedError); + assert((client.innerApiCalls.getArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getArtifact with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetArtifactRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getArtifact(request), expectedError); + }); + }); + + describe('updateArtifact', () => { + it('invokes updateArtifact without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateArtifactRequest()); + request.artifact = {}; + request.artifact.name = ''; + const expectedHeaderRequestParams = "artifact.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()); + client.innerApiCalls.updateArtifact = stubSimpleCall(expectedResponse); + const [response] = await client.updateArtifact(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateArtifact without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateArtifactRequest()); + request.artifact = {}; + request.artifact.name = ''; + const expectedHeaderRequestParams = "artifact.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()); + client.innerApiCalls.updateArtifact = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateArtifact( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IArtifact|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateArtifact with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateArtifactRequest()); + request.artifact = {}; + request.artifact.name = ''; + const expectedHeaderRequestParams = "artifact.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateArtifact = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateArtifact(request), expectedError); + assert((client.innerApiCalls.updateArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateArtifact with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateArtifactRequest()); + request.artifact = {}; + request.artifact.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateArtifact(request), expectedError); + }); + }); + + describe('createContext', () => { + it('invokes createContext without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateContextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()); + client.innerApiCalls.createContext = stubSimpleCall(expectedResponse); + const [response] = await client.createContext(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createContext without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateContextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()); + client.innerApiCalls.createContext = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createContext( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IContext|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createContext with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateContextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createContext = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createContext(request), expectedError); + assert((client.innerApiCalls.createContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createContext with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateContextRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createContext(request), expectedError); + }); + }); + + describe('getContext', () => { + it('invokes getContext without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetContextRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()); + client.innerApiCalls.getContext = stubSimpleCall(expectedResponse); + const [response] = await client.getContext(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getContext without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetContextRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()); + client.innerApiCalls.getContext = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getContext( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IContext|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getContext with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetContextRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getContext = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getContext(request), expectedError); + assert((client.innerApiCalls.getContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getContext with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetContextRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getContext(request), expectedError); + }); + }); + + describe('updateContext', () => { + it('invokes updateContext without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateContextRequest()); + request.context = {}; + request.context.name = ''; + const expectedHeaderRequestParams = "context.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()); + client.innerApiCalls.updateContext = stubSimpleCall(expectedResponse); + const [response] = await client.updateContext(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateContext without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateContextRequest()); + request.context = {}; + request.context.name = ''; + const expectedHeaderRequestParams = "context.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()); + client.innerApiCalls.updateContext = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateContext( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IContext|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateContext with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateContextRequest()); + request.context = {}; + request.context.name = ''; + const expectedHeaderRequestParams = "context.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateContext = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateContext(request), expectedError); + assert((client.innerApiCalls.updateContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateContext with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateContextRequest()); + request.context = {}; + request.context.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateContext(request), expectedError); + }); + }); + + describe('addContextArtifactsAndExecutions', () => { + it('invokes addContextArtifactsAndExecutions without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsRequest()); + request.context = ''; + const expectedHeaderRequestParams = "context="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsResponse()); + client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCall(expectedResponse); + const [response] = await client.addContextArtifactsAndExecutions(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes addContextArtifactsAndExecutions without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsRequest()); + request.context = ''; + const expectedHeaderRequestParams = "context="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsResponse()); + client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addContextArtifactsAndExecutions( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes addContextArtifactsAndExecutions with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsRequest()); + request.context = ''; + const expectedHeaderRequestParams = "context="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addContextArtifactsAndExecutions(request), expectedError); + assert((client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes addContextArtifactsAndExecutions with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsRequest()); + request.context = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.addContextArtifactsAndExecutions(request), expectedError); + }); + }); + + describe('addContextChildren', () => { + it('invokes addContextChildren without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextChildrenRequest()); + request.context = ''; + const expectedHeaderRequestParams = "context="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextChildrenResponse()); + client.innerApiCalls.addContextChildren = stubSimpleCall(expectedResponse); + const [response] = await client.addContextChildren(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addContextChildren as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes addContextChildren without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextChildrenRequest()); + request.context = ''; + const expectedHeaderRequestParams = "context="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextChildrenResponse()); + client.innerApiCalls.addContextChildren = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addContextChildren( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IAddContextChildrenResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addContextChildren as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes addContextChildren with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextChildrenRequest()); + request.context = ''; + const expectedHeaderRequestParams = "context="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addContextChildren = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addContextChildren(request), expectedError); + assert((client.innerApiCalls.addContextChildren as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes addContextChildren with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextChildrenRequest()); + request.context = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.addContextChildren(request), expectedError); + }); + }); + + describe('queryContextLineageSubgraph', () => { + it('invokes queryContextLineageSubgraph without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryContextLineageSubgraphRequest()); + request.context = ''; + const expectedHeaderRequestParams = "context="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LineageSubgraph()); + client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCall(expectedResponse); + const [response] = await client.queryContextLineageSubgraph(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryContextLineageSubgraph as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryContextLineageSubgraph without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryContextLineageSubgraphRequest()); + request.context = ''; + const expectedHeaderRequestParams = "context="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LineageSubgraph()); + client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryContextLineageSubgraph( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ILineageSubgraph|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryContextLineageSubgraph as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes queryContextLineageSubgraph with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryContextLineageSubgraphRequest()); + request.context = ''; + const expectedHeaderRequestParams = "context="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryContextLineageSubgraph(request), expectedError); + assert((client.innerApiCalls.queryContextLineageSubgraph as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryContextLineageSubgraph with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryContextLineageSubgraphRequest()); + request.context = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.queryContextLineageSubgraph(request), expectedError); + }); + }); + + describe('createExecution', () => { + it('invokes createExecution without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateExecutionRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()); + client.innerApiCalls.createExecution = stubSimpleCall(expectedResponse); + const [response] = await client.createExecution(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createExecution without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateExecutionRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()); + client.innerApiCalls.createExecution = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createExecution( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IExecution|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createExecution with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateExecutionRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createExecution = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createExecution(request), expectedError); + assert((client.innerApiCalls.createExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createExecution with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateExecutionRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createExecution(request), expectedError); + }); + }); + + describe('getExecution', () => { + it('invokes getExecution without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetExecutionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()); + client.innerApiCalls.getExecution = stubSimpleCall(expectedResponse); + const [response] = await client.getExecution(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getExecution without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetExecutionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()); + client.innerApiCalls.getExecution = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getExecution( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IExecution|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getExecution with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetExecutionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getExecution = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getExecution(request), expectedError); + assert((client.innerApiCalls.getExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getExecution with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetExecutionRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getExecution(request), expectedError); + }); + }); + + describe('updateExecution', () => { + it('invokes updateExecution without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateExecutionRequest()); + request.execution = {}; + request.execution.name = ''; + const expectedHeaderRequestParams = "execution.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()); + client.innerApiCalls.updateExecution = stubSimpleCall(expectedResponse); + const [response] = await client.updateExecution(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateExecution without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateExecutionRequest()); + request.execution = {}; + request.execution.name = ''; + const expectedHeaderRequestParams = "execution.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()); + client.innerApiCalls.updateExecution = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExecution( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IExecution|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateExecution with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateExecutionRequest()); + request.execution = {}; + request.execution.name = ''; + const expectedHeaderRequestParams = "execution.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExecution = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateExecution(request), expectedError); + assert((client.innerApiCalls.updateExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateExecution with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateExecutionRequest()); + request.execution = {}; + request.execution.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateExecution(request), expectedError); + }); + }); + + describe('addExecutionEvents', () => { + it('invokes addExecutionEvents without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddExecutionEventsRequest()); + request.execution = ''; + const expectedHeaderRequestParams = "execution="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddExecutionEventsResponse()); + client.innerApiCalls.addExecutionEvents = stubSimpleCall(expectedResponse); + const [response] = await client.addExecutionEvents(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addExecutionEvents as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes addExecutionEvents without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddExecutionEventsRequest()); + request.execution = ''; + const expectedHeaderRequestParams = "execution="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddExecutionEventsResponse()); + client.innerApiCalls.addExecutionEvents = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addExecutionEvents( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IAddExecutionEventsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addExecutionEvents as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes addExecutionEvents with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddExecutionEventsRequest()); + request.execution = ''; + const expectedHeaderRequestParams = "execution="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addExecutionEvents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addExecutionEvents(request), expectedError); + assert((client.innerApiCalls.addExecutionEvents as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes addExecutionEvents with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddExecutionEventsRequest()); + request.execution = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.addExecutionEvents(request), expectedError); + }); + }); + + describe('queryExecutionInputsAndOutputs', () => { + it('invokes queryExecutionInputsAndOutputs without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryExecutionInputsAndOutputsRequest()); + request.execution = ''; + const expectedHeaderRequestParams = "execution="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LineageSubgraph()); + client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCall(expectedResponse); + const [response] = await client.queryExecutionInputsAndOutputs(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryExecutionInputsAndOutputs without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryExecutionInputsAndOutputsRequest()); + request.execution = ''; + const expectedHeaderRequestParams = "execution="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LineageSubgraph()); + client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryExecutionInputsAndOutputs( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ILineageSubgraph|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes queryExecutionInputsAndOutputs with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryExecutionInputsAndOutputsRequest()); + request.execution = ''; + const expectedHeaderRequestParams = "execution="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryExecutionInputsAndOutputs(request), expectedError); + assert((client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryExecutionInputsAndOutputs with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryExecutionInputsAndOutputsRequest()); + request.execution = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.queryExecutionInputsAndOutputs(request), expectedError); + }); + }); + + describe('createMetadataSchema', () => { + it('invokes createMetadataSchema without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateMetadataSchemaRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()); + client.innerApiCalls.createMetadataSchema = stubSimpleCall(expectedResponse); + const [response] = await client.createMetadataSchema(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createMetadataSchema as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createMetadataSchema without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateMetadataSchemaRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()); + client.innerApiCalls.createMetadataSchema = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMetadataSchema( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IMetadataSchema|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createMetadataSchema as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createMetadataSchema with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateMetadataSchemaRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createMetadataSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createMetadataSchema(request), expectedError); + assert((client.innerApiCalls.createMetadataSchema as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createMetadataSchema with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateMetadataSchemaRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createMetadataSchema(request), expectedError); + }); + }); + + describe('getMetadataSchema', () => { + it('invokes getMetadataSchema without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetMetadataSchemaRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()); + client.innerApiCalls.getMetadataSchema = stubSimpleCall(expectedResponse); + const [response] = await client.getMetadataSchema(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getMetadataSchema as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getMetadataSchema without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetMetadataSchemaRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()); + client.innerApiCalls.getMetadataSchema = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMetadataSchema( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IMetadataSchema|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getMetadataSchema as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getMetadataSchema with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetMetadataSchemaRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getMetadataSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMetadataSchema(request), expectedError); + assert((client.innerApiCalls.getMetadataSchema as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getMetadataSchema with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetMetadataSchemaRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMetadataSchema(request), expectedError); + }); + }); + + describe('queryArtifactLineageSubgraph', () => { + it('invokes queryArtifactLineageSubgraph without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest()); + request.artifact = ''; + const expectedHeaderRequestParams = "artifact="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LineageSubgraph()); + client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCall(expectedResponse); + const [response] = await client.queryArtifactLineageSubgraph(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryArtifactLineageSubgraph without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest()); + request.artifact = ''; + const expectedHeaderRequestParams = "artifact="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LineageSubgraph()); + client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryArtifactLineageSubgraph( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ILineageSubgraph|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes queryArtifactLineageSubgraph with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest()); + request.artifact = ''; + const expectedHeaderRequestParams = "artifact="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryArtifactLineageSubgraph(request), expectedError); + assert((client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryArtifactLineageSubgraph with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest()); + request.artifact = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.queryArtifactLineageSubgraph(request), expectedError); + }); + }); + + describe('createMetadataStore', () => { + it('invokes createMetadataStore without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateMetadataStoreRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createMetadataStore = stubLongRunningCall(expectedResponse); + const [operation] = await client.createMetadataStore(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createMetadataStore without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateMetadataStoreRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createMetadataStore = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMetadataStore( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createMetadataStore with call error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateMetadataStoreRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createMetadataStore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createMetadataStore(request), expectedError); + assert((client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createMetadataStore with LRO error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateMetadataStoreRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createMetadataStore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createMetadataStore(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateMetadataStoreProgress without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateMetadataStoreProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateMetadataStoreProgress with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateMetadataStoreProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteMetadataStore', () => { + it('invokes deleteMetadataStore without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteMetadataStoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteMetadataStore(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteMetadataStore without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteMetadataStoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteMetadataStore = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteMetadataStore( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteMetadataStore with call error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteMetadataStoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteMetadataStore(request), expectedError); + assert((client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteMetadataStore with LRO error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteMetadataStoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteMetadataStore(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteMetadataStoreProgress without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteMetadataStoreProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteMetadataStoreProgress with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteMetadataStoreProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteArtifact', () => { + it('invokes deleteArtifact without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteArtifactRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteArtifact = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteArtifact(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteArtifact without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteArtifactRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteArtifact = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteArtifact( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteArtifact with call error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteArtifactRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteArtifact = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteArtifact(request), expectedError); + assert((client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteArtifact with LRO error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteArtifactRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteArtifact = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteArtifact(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteArtifactProgress without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteArtifactProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteArtifactProgress with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteArtifactProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('purgeArtifacts', () => { + it('invokes purgeArtifacts without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.purgeArtifacts = stubLongRunningCall(expectedResponse); + const [operation] = await client.purgeArtifacts(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes purgeArtifacts without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.purgeArtifacts = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.purgeArtifacts( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes purgeArtifacts with call error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeArtifacts = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.purgeArtifacts(request), expectedError); + assert((client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes purgeArtifacts with LRO error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeArtifacts = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.purgeArtifacts(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkPurgeArtifactsProgress without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkPurgeArtifactsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkPurgeArtifactsProgress with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkPurgeArtifactsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteContext', () => { + it('invokes deleteContext without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteContextRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteContext = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteContext(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteContext without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteContextRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteContext = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteContext( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteContext with call error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteContextRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteContext = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteContext(request), expectedError); + assert((client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteContext with LRO error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteContextRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteContext = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteContext(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteContextProgress without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteContextProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteContextProgress with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteContextProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('purgeContexts', () => { + it('invokes purgeContexts without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.purgeContexts = stubLongRunningCall(expectedResponse); + const [operation] = await client.purgeContexts(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes purgeContexts without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.purgeContexts = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.purgeContexts( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes purgeContexts with call error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeContexts = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.purgeContexts(request), expectedError); + assert((client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes purgeContexts with LRO error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeContexts = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.purgeContexts(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkPurgeContextsProgress without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkPurgeContextsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkPurgeContextsProgress with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkPurgeContextsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteExecution', () => { + it('invokes deleteExecution without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteExecutionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteExecution = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteExecution(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteExecution without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteExecutionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteExecution = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteExecution( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteExecution with call error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteExecutionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteExecution(request), expectedError); + assert((client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteExecution with LRO error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteExecutionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteExecution(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteExecutionProgress without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteExecutionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteExecutionProgress with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteExecutionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('purgeExecutions', () => { + it('invokes purgeExecutions without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.purgeExecutions = stubLongRunningCall(expectedResponse); + const [operation] = await client.purgeExecutions(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes purgeExecutions without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.purgeExecutions = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.purgeExecutions( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes purgeExecutions with call error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeExecutions = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.purgeExecutions(request), expectedError); + assert((client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes purgeExecutions with LRO error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeExecutions = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.purgeExecutions(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkPurgeExecutionsProgress without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkPurgeExecutionsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkPurgeExecutionsProgress with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkPurgeExecutionsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listMetadataStores', () => { + it('invokes listMetadataStores without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataStoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), + ]; + client.innerApiCalls.listMetadataStores = stubSimpleCall(expectedResponse); + const [response] = await client.listMetadataStores(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listMetadataStores as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listMetadataStores without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataStoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), + ]; + client.innerApiCalls.listMetadataStores = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMetadataStores( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IMetadataStore[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listMetadataStores as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listMetadataStores with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataStoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listMetadataStores = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMetadataStores(request), expectedError); + assert((client.innerApiCalls.listMetadataStores as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listMetadataStoresStream without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataStoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), + ]; + client.descriptors.page.listMetadataStores.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listMetadataStoresStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.MetadataStore[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.MetadataStore) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listMetadataStores.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMetadataStores, request)); + assert.strictEqual( + (client.descriptors.page.listMetadataStores.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listMetadataStoresStream with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataStoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listMetadataStores.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listMetadataStoresStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.MetadataStore[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.MetadataStore) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listMetadataStores.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMetadataStores, request)); + assert.strictEqual( + (client.descriptors.page.listMetadataStores.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listMetadataStores without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataStoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), + ]; + client.descriptors.page.listMetadataStores.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IMetadataStore[] = []; + const iterable = client.listMetadataStoresAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listMetadataStores with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataStoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listMetadataStores.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMetadataStoresAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IMetadataStore[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listArtifacts', () => { + it('invokes listArtifacts without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), + ]; + client.innerApiCalls.listArtifacts = stubSimpleCall(expectedResponse); + const [response] = await client.listArtifacts(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listArtifacts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listArtifacts without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), + ]; + client.innerApiCalls.listArtifacts = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listArtifacts( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IArtifact[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listArtifacts as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listArtifacts with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listArtifacts = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listArtifacts(request), expectedError); + assert((client.innerApiCalls.listArtifacts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listArtifactsStream without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), + ]; + client.descriptors.page.listArtifacts.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listArtifactsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Artifact[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Artifact) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listArtifacts, request)); + assert.strictEqual( + (client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listArtifactsStream with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listArtifacts.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listArtifactsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Artifact[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Artifact) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listArtifacts, request)); + assert.strictEqual( + (client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listArtifacts without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), + ]; + client.descriptors.page.listArtifacts.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IArtifact[] = []; + const iterable = client.listArtifactsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listArtifacts with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listArtifacts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listArtifactsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IArtifact[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listContexts', () => { + it('invokes listContexts without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), + ]; + client.innerApiCalls.listContexts = stubSimpleCall(expectedResponse); + const [response] = await client.listContexts(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listContexts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listContexts without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), + ]; + client.innerApiCalls.listContexts = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listContexts( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IContext[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listContexts as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listContexts with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listContexts = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listContexts(request), expectedError); + assert((client.innerApiCalls.listContexts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listContextsStream without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), + ]; + client.descriptors.page.listContexts.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listContextsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Context[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Context) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listContexts.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listContexts, request)); + assert.strictEqual( + (client.descriptors.page.listContexts.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listContextsStream with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listContexts.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listContextsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Context[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Context) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listContexts.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listContexts, request)); + assert.strictEqual( + (client.descriptors.page.listContexts.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listContexts without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), + ]; + client.descriptors.page.listContexts.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IContext[] = []; + const iterable = client.listContextsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listContexts.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listContexts.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listContexts with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listContexts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listContextsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IContext[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listContexts.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listContexts.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listExecutions', () => { + it('invokes listExecutions without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), + ]; + client.innerApiCalls.listExecutions = stubSimpleCall(expectedResponse); + const [response] = await client.listExecutions(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listExecutions without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), + ]; + client.innerApiCalls.listExecutions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listExecutions( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IExecution[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listExecutions with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listExecutions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listExecutions(request), expectedError); + assert((client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listExecutionsStream without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), + ]; + client.descriptors.page.listExecutions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listExecutionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Execution[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Execution) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listExecutions, request)); + assert.strictEqual( + (client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listExecutionsStream with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listExecutions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listExecutionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Execution[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Execution) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listExecutions, request)); + assert.strictEqual( + (client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listExecutions without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), + ]; + client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IExecution[] = []; + const iterable = client.listExecutionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listExecutions with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listExecutionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IExecution[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listMetadataSchemas', () => { + it('invokes listMetadataSchemas without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataSchemasRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), + ]; + client.innerApiCalls.listMetadataSchemas = stubSimpleCall(expectedResponse); + const [response] = await client.listMetadataSchemas(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listMetadataSchemas as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listMetadataSchemas without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataSchemasRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), + ]; + client.innerApiCalls.listMetadataSchemas = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMetadataSchemas( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IMetadataSchema[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listMetadataSchemas as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listMetadataSchemas with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataSchemasRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listMetadataSchemas = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMetadataSchemas(request), expectedError); + assert((client.innerApiCalls.listMetadataSchemas as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listMetadataSchemasStream without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataSchemasRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), + ]; + client.descriptors.page.listMetadataSchemas.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listMetadataSchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.MetadataSchema[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.MetadataSchema) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listMetadataSchemas.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMetadataSchemas, request)); + assert.strictEqual( + (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listMetadataSchemasStream with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataSchemasRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listMetadataSchemas.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listMetadataSchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.MetadataSchema[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.MetadataSchema) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listMetadataSchemas.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMetadataSchemas, request)); + assert.strictEqual( + (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listMetadataSchemas without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataSchemasRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), + ]; + client.descriptors.page.listMetadataSchemas.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IMetadataSchema[] = []; + const iterable = client.listMetadataSchemasAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listMetadataSchemas with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataSchemasRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listMetadataSchemas.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMetadataSchemasAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IMetadataSchema[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/test/gapic_migration_service_v1.ts b/owl-bot-staging/v1/test/gapic_migration_service_v1.ts new file mode 100644 index 00000000..b7238a7e --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_migration_service_v1.ts @@ -0,0 +1,2246 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as migrationserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.MigrationServiceClient', () => { + it('has servicePath', () => { + const servicePath = migrationserviceModule.v1.MigrationServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = migrationserviceModule.v1.MigrationServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = migrationserviceModule.v1.MigrationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new migrationserviceModule.v1.MigrationServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.migrationServiceStub, undefined); + await client.initialize(); + assert(client.migrationServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.migrationServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.migrationServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('batchMigrateResources', () => { + it('invokes batchMigrateResources without error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchMigrateResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.batchMigrateResources = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchMigrateResources(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchMigrateResources without error using callback', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchMigrateResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.batchMigrateResources = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchMigrateResources( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes batchMigrateResources with call error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchMigrateResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchMigrateResources = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchMigrateResources(request), expectedError); + assert((client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchMigrateResources with LRO error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchMigrateResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchMigrateResources = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchMigrateResources(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkBatchMigrateResourcesProgress without error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchMigrateResourcesProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchMigrateResourcesProgress with error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkBatchMigrateResourcesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('searchMigratableResources', () => { + it('invokes searchMigratableResources without error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), + ]; + client.innerApiCalls.searchMigratableResources = stubSimpleCall(expectedResponse); + const [response] = await client.searchMigratableResources(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.searchMigratableResources as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes searchMigratableResources without error using callback', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), + ]; + client.innerApiCalls.searchMigratableResources = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchMigratableResources( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IMigratableResource[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.searchMigratableResources as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes searchMigratableResources with error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.searchMigratableResources = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchMigratableResources(request), expectedError); + assert((client.innerApiCalls.searchMigratableResources as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes searchMigratableResourcesStream without error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), + ]; + client.descriptors.page.searchMigratableResources.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchMigratableResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.MigratableResource[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.MigratableResource) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.searchMigratableResources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchMigratableResources, request)); + assert.strictEqual( + (client.descriptors.page.searchMigratableResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes searchMigratableResourcesStream with error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.searchMigratableResources.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchMigratableResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.MigratableResource[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.MigratableResource) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchMigratableResources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchMigratableResources, request)); + assert.strictEqual( + (client.descriptors.page.searchMigratableResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchMigratableResources without error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), + ]; + client.descriptors.page.searchMigratableResources.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IMigratableResource[] = []; + const iterable = client.searchMigratableResourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchMigratableResources with error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.searchMigratableResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchMigratableResourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IMigratableResource[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/test/gapic_model_service_v1.ts b/owl-bot-staging/v1/test/gapic_model_service_v1.ts new file mode 100644 index 00000000..10c7597a --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_model_service_v1.ts @@ -0,0 +1,3469 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as modelserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.ModelServiceClient', () => { + it('has servicePath', () => { + const servicePath = modelserviceModule.v1.ModelServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = modelserviceModule.v1.ModelServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = modelserviceModule.v1.ModelServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new modelserviceModule.v1.ModelServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.modelServiceStub, undefined); + await client.initialize(); + assert(client.modelServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.modelServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.modelServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getModel', () => { + it('invokes getModel without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()); + client.innerApiCalls.getModel = stubSimpleCall(expectedResponse); + const [response] = await client.getModel(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getModel without error using callback', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()); + client.innerApiCalls.getModel = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModel( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModel|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getModel with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModel(request), expectedError); + assert((client.innerApiCalls.getModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getModel with closed client', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getModel(request), expectedError); + }); + }); + + describe('updateModel', () => { + it('invokes updateModel without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateModelRequest()); + request.model = {}; + request.model.name = ''; + const expectedHeaderRequestParams = "model.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()); + client.innerApiCalls.updateModel = stubSimpleCall(expectedResponse); + const [response] = await client.updateModel(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateModel without error using callback', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateModelRequest()); + request.model = {}; + request.model.name = ''; + const expectedHeaderRequestParams = "model.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()); + client.innerApiCalls.updateModel = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateModel( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModel|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateModel with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateModelRequest()); + request.model = {}; + request.model.name = ''; + const expectedHeaderRequestParams = "model.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateModel = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateModel(request), expectedError); + assert((client.innerApiCalls.updateModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateModel with closed client', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateModelRequest()); + request.model = {}; + request.model.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateModel(request), expectedError); + }); + }); + + describe('importModelEvaluation', () => { + it('invokes importModelEvaluation without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportModelEvaluationRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()); + client.innerApiCalls.importModelEvaluation = stubSimpleCall(expectedResponse); + const [response] = await client.importModelEvaluation(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.importModelEvaluation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes importModelEvaluation without error using callback', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportModelEvaluationRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()); + client.innerApiCalls.importModelEvaluation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importModelEvaluation( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModelEvaluation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.importModelEvaluation as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes importModelEvaluation with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportModelEvaluationRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.importModelEvaluation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.importModelEvaluation(request), expectedError); + assert((client.innerApiCalls.importModelEvaluation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes importModelEvaluation with closed client', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportModelEvaluationRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.importModelEvaluation(request), expectedError); + }); + }); + + describe('getModelEvaluation', () => { + it('invokes getModelEvaluation without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelEvaluationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()); + client.innerApiCalls.getModelEvaluation = stubSimpleCall(expectedResponse); + const [response] = await client.getModelEvaluation(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getModelEvaluation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getModelEvaluation without error using callback', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelEvaluationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()); + client.innerApiCalls.getModelEvaluation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModelEvaluation( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModelEvaluation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getModelEvaluation as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getModelEvaluation with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelEvaluationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getModelEvaluation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModelEvaluation(request), expectedError); + assert((client.innerApiCalls.getModelEvaluation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getModelEvaluation with closed client', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelEvaluationRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getModelEvaluation(request), expectedError); + }); + }); + + describe('getModelEvaluationSlice', () => { + it('invokes getModelEvaluationSlice without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelEvaluationSliceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()); + client.innerApiCalls.getModelEvaluationSlice = stubSimpleCall(expectedResponse); + const [response] = await client.getModelEvaluationSlice(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getModelEvaluationSlice as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getModelEvaluationSlice without error using callback', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelEvaluationSliceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()); + client.innerApiCalls.getModelEvaluationSlice = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModelEvaluationSlice( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModelEvaluationSlice|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getModelEvaluationSlice as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getModelEvaluationSlice with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelEvaluationSliceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getModelEvaluationSlice = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModelEvaluationSlice(request), expectedError); + assert((client.innerApiCalls.getModelEvaluationSlice as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getModelEvaluationSlice with closed client', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelEvaluationSliceRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getModelEvaluationSlice(request), expectedError); + }); + }); + + describe('uploadModel', () => { + it('invokes uploadModel without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UploadModelRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.uploadModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.uploadModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes uploadModel without error using callback', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UploadModelRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.uploadModel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.uploadModel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes uploadModel with call error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UploadModelRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.uploadModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.uploadModel(request), expectedError); + assert((client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes uploadModel with LRO error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UploadModelRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.uploadModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.uploadModel(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUploadModelProgress without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUploadModelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUploadModelProgress with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUploadModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteModel', () => { + it('invokes deleteModel without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteModel without error using callback', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteModel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteModel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteModel with call error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteModel(request), expectedError); + assert((client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteModel with LRO error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteModel(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteModelProgress without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteModelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteModelProgress with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('exportModel', () => { + it('invokes exportModel without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.exportModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.exportModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes exportModel without error using callback', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.exportModel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportModel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.exportModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes exportModel with call error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportModel(request), expectedError); + assert((client.innerApiCalls.exportModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes exportModel with LRO error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportModel(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.exportModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkExportModelProgress without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkExportModelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportModelProgress with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkExportModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listModels', () => { + it('invokes listModels without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), + ]; + client.innerApiCalls.listModels = stubSimpleCall(expectedResponse); + const [response] = await client.listModels(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listModels as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listModels without error using callback', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), + ]; + client.innerApiCalls.listModels = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModels( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModel[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listModels as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listModels with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listModels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModels(request), expectedError); + assert((client.innerApiCalls.listModels as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listModelsStream without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), + ]; + client.descriptors.page.listModels.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Model[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Model) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModels, request)); + assert.strictEqual( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listModelsStream with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listModels.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Model[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Model) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModels, request)); + assert.strictEqual( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listModels without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), + ]; + client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IModel[] = []; + const iterable = client.listModelsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listModels with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listModelsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IModel[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listModelEvaluations', () => { + it('invokes listModelEvaluations without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), + ]; + client.innerApiCalls.listModelEvaluations = stubSimpleCall(expectedResponse); + const [response] = await client.listModelEvaluations(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listModelEvaluations as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listModelEvaluations without error using callback', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), + ]; + client.innerApiCalls.listModelEvaluations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModelEvaluations( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModelEvaluation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listModelEvaluations as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listModelEvaluations with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelEvaluations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModelEvaluations(request), expectedError); + assert((client.innerApiCalls.listModelEvaluations as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listModelEvaluationsStream without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), + ]; + client.descriptors.page.listModelEvaluations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listModelEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.ModelEvaluation[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.ModelEvaluation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModelEvaluations, request)); + assert.strictEqual( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listModelEvaluationsStream with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listModelEvaluations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listModelEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.ModelEvaluation[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.ModelEvaluation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModelEvaluations, request)); + assert.strictEqual( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listModelEvaluations without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), + ]; + client.descriptors.page.listModelEvaluations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IModelEvaluation[] = []; + const iterable = client.listModelEvaluationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listModelEvaluations with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listModelEvaluations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listModelEvaluationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IModelEvaluation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listModelEvaluationSlices', () => { + it('invokes listModelEvaluationSlices without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), + ]; + client.innerApiCalls.listModelEvaluationSlices = stubSimpleCall(expectedResponse); + const [response] = await client.listModelEvaluationSlices(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listModelEvaluationSlices as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listModelEvaluationSlices without error using callback', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), + ]; + client.innerApiCalls.listModelEvaluationSlices = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModelEvaluationSlices( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModelEvaluationSlice[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listModelEvaluationSlices as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listModelEvaluationSlices with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelEvaluationSlices = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModelEvaluationSlices(request), expectedError); + assert((client.innerApiCalls.listModelEvaluationSlices as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listModelEvaluationSlicesStream without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), + ]; + client.descriptors.page.listModelEvaluationSlices.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listModelEvaluationSlicesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.ModelEvaluationSlice[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.ModelEvaluationSlice) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModelEvaluationSlices, request)); + assert.strictEqual( + (client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listModelEvaluationSlicesStream with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listModelEvaluationSlices.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listModelEvaluationSlicesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.ModelEvaluationSlice[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.ModelEvaluationSlice) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModelEvaluationSlices, request)); + assert.strictEqual( + (client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listModelEvaluationSlices without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), + ]; + client.descriptors.page.listModelEvaluationSlices.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IModelEvaluationSlice[] = []; + const iterable = client.listModelEvaluationSlicesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listModelEvaluationSlices with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listModelEvaluationSlices.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listModelEvaluationSlicesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IModelEvaluationSlice[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/test/gapic_pipeline_service_v1.ts b/owl-bot-staging/v1/test/gapic_pipeline_service_v1.ts new file mode 100644 index 00000000..4df4dfa4 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_pipeline_service_v1.ts @@ -0,0 +1,3195 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as pipelineserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.PipelineServiceClient', () => { + it('has servicePath', () => { + const servicePath = pipelineserviceModule.v1.PipelineServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = pipelineserviceModule.v1.PipelineServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = pipelineserviceModule.v1.PipelineServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.pipelineServiceStub, undefined); + await client.initialize(); + assert(client.pipelineServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.pipelineServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.pipelineServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('createTrainingPipeline', () => { + it('invokes createTrainingPipeline without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTrainingPipelineRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()); + client.innerApiCalls.createTrainingPipeline = stubSimpleCall(expectedResponse); + const [response] = await client.createTrainingPipeline(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTrainingPipeline without error using callback', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTrainingPipelineRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()); + client.innerApiCalls.createTrainingPipeline = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTrainingPipeline( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITrainingPipeline|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createTrainingPipeline with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTrainingPipelineRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createTrainingPipeline = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTrainingPipeline(request), expectedError); + assert((client.innerApiCalls.createTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTrainingPipeline with closed client', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTrainingPipelineRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createTrainingPipeline(request), expectedError); + }); + }); + + describe('getTrainingPipeline', () => { + it('invokes getTrainingPipeline without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()); + client.innerApiCalls.getTrainingPipeline = stubSimpleCall(expectedResponse); + const [response] = await client.getTrainingPipeline(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTrainingPipeline without error using callback', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()); + client.innerApiCalls.getTrainingPipeline = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTrainingPipeline( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITrainingPipeline|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getTrainingPipeline with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getTrainingPipeline = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTrainingPipeline(request), expectedError); + assert((client.innerApiCalls.getTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTrainingPipeline with closed client', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTrainingPipelineRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTrainingPipeline(request), expectedError); + }); + }); + + describe('cancelTrainingPipeline', () => { + it('invokes cancelTrainingPipeline without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall(expectedResponse); + const [response] = await client.cancelTrainingPipeline(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelTrainingPipeline without error using callback', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelTrainingPipeline = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelTrainingPipeline( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes cancelTrainingPipeline with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelTrainingPipeline(request), expectedError); + assert((client.innerApiCalls.cancelTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelTrainingPipeline with closed client', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelTrainingPipelineRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelTrainingPipeline(request), expectedError); + }); + }); + + describe('createPipelineJob', () => { + it('invokes createPipelineJob without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreatePipelineJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()); + client.innerApiCalls.createPipelineJob = stubSimpleCall(expectedResponse); + const [response] = await client.createPipelineJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createPipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createPipelineJob without error using callback', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreatePipelineJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()); + client.innerApiCalls.createPipelineJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPipelineJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IPipelineJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createPipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createPipelineJob with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreatePipelineJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createPipelineJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createPipelineJob(request), expectedError); + assert((client.innerApiCalls.createPipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createPipelineJob with closed client', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreatePipelineJobRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createPipelineJob(request), expectedError); + }); + }); + + describe('getPipelineJob', () => { + it('invokes getPipelineJob without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetPipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()); + client.innerApiCalls.getPipelineJob = stubSimpleCall(expectedResponse); + const [response] = await client.getPipelineJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getPipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getPipelineJob without error using callback', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetPipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()); + client.innerApiCalls.getPipelineJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPipelineJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IPipelineJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getPipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getPipelineJob with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetPipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getPipelineJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getPipelineJob(request), expectedError); + assert((client.innerApiCalls.getPipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getPipelineJob with closed client', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetPipelineJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getPipelineJob(request), expectedError); + }); + }); + + describe('cancelPipelineJob', () => { + it('invokes cancelPipelineJob without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelPipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelPipelineJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelPipelineJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelPipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelPipelineJob without error using callback', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelPipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelPipelineJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelPipelineJob( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelPipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes cancelPipelineJob with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelPipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelPipelineJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelPipelineJob(request), expectedError); + assert((client.innerApiCalls.cancelPipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelPipelineJob with closed client', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelPipelineJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelPipelineJob(request), expectedError); + }); + }); + + describe('deleteTrainingPipeline', () => { + it('invokes deleteTrainingPipeline without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTrainingPipeline(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTrainingPipeline without error using callback', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTrainingPipeline( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteTrainingPipeline with call error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTrainingPipeline(request), expectedError); + assert((client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTrainingPipeline with LRO error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTrainingPipeline(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteTrainingPipelineProgress without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteTrainingPipelineProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTrainingPipelineProgress with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteTrainingPipelineProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deletePipelineJob', () => { + it('invokes deletePipelineJob without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeletePipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deletePipelineJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deletePipelineJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deletePipelineJob without error using callback', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeletePipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deletePipelineJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePipelineJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deletePipelineJob with call error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeletePipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePipelineJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deletePipelineJob(request), expectedError); + assert((client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deletePipelineJob with LRO error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeletePipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePipelineJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deletePipelineJob(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeletePipelineJobProgress without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeletePipelineJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeletePipelineJobProgress with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeletePipelineJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listTrainingPipelines', () => { + it('invokes listTrainingPipelines without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), + ]; + client.innerApiCalls.listTrainingPipelines = stubSimpleCall(expectedResponse); + const [response] = await client.listTrainingPipelines(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTrainingPipelines as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTrainingPipelines without error using callback', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), + ]; + client.innerApiCalls.listTrainingPipelines = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTrainingPipelines( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITrainingPipeline[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTrainingPipelines as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listTrainingPipelines with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listTrainingPipelines = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTrainingPipelines(request), expectedError); + assert((client.innerApiCalls.listTrainingPipelines as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTrainingPipelinesStream without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), + ]; + client.descriptors.page.listTrainingPipelines.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTrainingPipelinesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.TrainingPipeline[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.TrainingPipeline) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listTrainingPipelines.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTrainingPipelines, request)); + assert.strictEqual( + (client.descriptors.page.listTrainingPipelines.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listTrainingPipelinesStream with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listTrainingPipelines.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTrainingPipelinesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.TrainingPipeline[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.TrainingPipeline) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTrainingPipelines.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTrainingPipelines, request)); + assert.strictEqual( + (client.descriptors.page.listTrainingPipelines.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTrainingPipelines without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), + ]; + client.descriptors.page.listTrainingPipelines.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.ITrainingPipeline[] = []; + const iterable = client.listTrainingPipelinesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTrainingPipelines with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listTrainingPipelines.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTrainingPipelinesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.ITrainingPipeline[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listPipelineJobs', () => { + it('invokes listPipelineJobs without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListPipelineJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), + ]; + client.innerApiCalls.listPipelineJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listPipelineJobs(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listPipelineJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listPipelineJobs without error using callback', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListPipelineJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), + ]; + client.innerApiCalls.listPipelineJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPipelineJobs( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IPipelineJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listPipelineJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listPipelineJobs with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListPipelineJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listPipelineJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listPipelineJobs(request), expectedError); + assert((client.innerApiCalls.listPipelineJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listPipelineJobsStream without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListPipelineJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), + ]; + client.descriptors.page.listPipelineJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listPipelineJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.PipelineJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.PipelineJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listPipelineJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPipelineJobs, request)); + assert.strictEqual( + (client.descriptors.page.listPipelineJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listPipelineJobsStream with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListPipelineJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listPipelineJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listPipelineJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.PipelineJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.PipelineJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listPipelineJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPipelineJobs, request)); + assert.strictEqual( + (client.descriptors.page.listPipelineJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listPipelineJobs without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListPipelineJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), + ]; + client.descriptors.page.listPipelineJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IPipelineJob[] = []; + const iterable = client.listPipelineJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listPipelineJobs with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListPipelineJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listPipelineJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPipelineJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IPipelineJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/test/gapic_prediction_service_v1.ts b/owl-bot-staging/v1/test/gapic_prediction_service_v1.ts new file mode 100644 index 00000000..1c7d6c06 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_prediction_service_v1.ts @@ -0,0 +1,2069 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as predictionserviceModule from '../src'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +describe('v1.PredictionServiceClient', () => { + it('has servicePath', () => { + const servicePath = predictionserviceModule.v1.PredictionServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = predictionserviceModule.v1.PredictionServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = predictionserviceModule.v1.PredictionServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new predictionserviceModule.v1.PredictionServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.predictionServiceStub, undefined); + await client.initialize(); + assert(client.predictionServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.predictionServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.predictionServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('predict', () => { + it('invokes predict without error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PredictRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PredictResponse()); + client.innerApiCalls.predict = stubSimpleCall(expectedResponse); + const [response] = await client.predict(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.predict as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes predict without error using callback', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PredictRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PredictResponse()); + client.innerApiCalls.predict = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.predict( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IPredictResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.predict as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes predict with error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PredictRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.predict = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.predict(request), expectedError); + assert((client.innerApiCalls.predict as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes predict with closed client', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PredictRequest()); + request.endpoint = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.predict(request), expectedError); + }); + }); + + describe('rawPredict', () => { + it('invokes rawPredict without error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.RawPredictRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.api.HttpBody()); + client.innerApiCalls.rawPredict = stubSimpleCall(expectedResponse); + const [response] = await client.rawPredict(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.rawPredict as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes rawPredict without error using callback', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.RawPredictRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.api.HttpBody()); + client.innerApiCalls.rawPredict = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rawPredict( + request, + (err?: Error|null, result?: protos.google.api.IHttpBody|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.rawPredict as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes rawPredict with error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.RawPredictRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.rawPredict = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.rawPredict(request), expectedError); + assert((client.innerApiCalls.rawPredict as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes rawPredict with closed client', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.RawPredictRequest()); + request.endpoint = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.rawPredict(request), expectedError); + }); + }); + + describe('explain', () => { + it('invokes explain without error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExplainRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExplainResponse()); + client.innerApiCalls.explain = stubSimpleCall(expectedResponse); + const [response] = await client.explain(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.explain as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes explain without error using callback', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExplainRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExplainResponse()); + client.innerApiCalls.explain = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.explain( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IExplainResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.explain as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes explain with error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExplainRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.explain = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.explain(request), expectedError); + assert((client.innerApiCalls.explain as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes explain with closed client', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExplainRequest()); + request.endpoint = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.explain(request), expectedError); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/test/gapic_specialist_pool_service_v1.ts b/owl-bot-staging/v1/test/gapic_specialist_pool_service_v1.ts new file mode 100644 index 00000000..9daff9e3 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_specialist_pool_service_v1.ts @@ -0,0 +1,2635 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as specialistpoolserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.SpecialistPoolServiceClient', () => { + it('has servicePath', () => { + const servicePath = specialistpoolserviceModule.v1.SpecialistPoolServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = specialistpoolserviceModule.v1.SpecialistPoolServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = specialistpoolserviceModule.v1.SpecialistPoolServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.specialistPoolServiceStub, undefined); + await client.initialize(); + assert(client.specialistPoolServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.specialistPoolServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.specialistPoolServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getSpecialistPool', () => { + it('invokes getSpecialistPool without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetSpecialistPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()); + client.innerApiCalls.getSpecialistPool = stubSimpleCall(expectedResponse); + const [response] = await client.getSpecialistPool(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getSpecialistPool without error using callback', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetSpecialistPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()); + client.innerApiCalls.getSpecialistPool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSpecialistPool( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ISpecialistPool|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getSpecialistPool with error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetSpecialistPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getSpecialistPool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSpecialistPool(request), expectedError); + assert((client.innerApiCalls.getSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getSpecialistPool with closed client', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetSpecialistPoolRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSpecialistPool(request), expectedError); + }); + }); + + describe('createSpecialistPool', () => { + it('invokes createSpecialistPool without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateSpecialistPoolRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createSpecialistPool = stubLongRunningCall(expectedResponse); + const [operation] = await client.createSpecialistPool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createSpecialistPool without error using callback', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateSpecialistPoolRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createSpecialistPool = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSpecialistPool( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createSpecialistPool with call error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateSpecialistPoolRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createSpecialistPool = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createSpecialistPool(request), expectedError); + assert((client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createSpecialistPool with LRO error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateSpecialistPoolRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createSpecialistPool(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateSpecialistPoolProgress without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateSpecialistPoolProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateSpecialistPoolProgress with error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateSpecialistPoolProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteSpecialistPool', () => { + it('invokes deleteSpecialistPool without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteSpecialistPool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteSpecialistPool without error using callback', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteSpecialistPool = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSpecialistPool( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteSpecialistPool with call error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteSpecialistPool(request), expectedError); + assert((client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteSpecialistPool with LRO error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteSpecialistPool(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteSpecialistPoolProgress without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteSpecialistPoolProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteSpecialistPoolProgress with error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteSpecialistPoolProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateSpecialistPool', () => { + it('invokes updateSpecialistPool without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest()); + request.specialistPool = {}; + request.specialistPool.name = ''; + const expectedHeaderRequestParams = "specialist_pool.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateSpecialistPool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateSpecialistPool without error using callback', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest()); + request.specialistPool = {}; + request.specialistPool.name = ''; + const expectedHeaderRequestParams = "specialist_pool.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateSpecialistPool = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSpecialistPool( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateSpecialistPool with call error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest()); + request.specialistPool = {}; + request.specialistPool.name = ''; + const expectedHeaderRequestParams = "specialist_pool.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateSpecialistPool(request), expectedError); + assert((client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateSpecialistPool with LRO error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest()); + request.specialistPool = {}; + request.specialistPool.name = ''; + const expectedHeaderRequestParams = "specialist_pool.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateSpecialistPool(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUpdateSpecialistPoolProgress without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateSpecialistPoolProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateSpecialistPoolProgress with error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateSpecialistPoolProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listSpecialistPools', () => { + it('invokes listSpecialistPools without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), + ]; + client.innerApiCalls.listSpecialistPools = stubSimpleCall(expectedResponse); + const [response] = await client.listSpecialistPools(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listSpecialistPools as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listSpecialistPools without error using callback', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), + ]; + client.innerApiCalls.listSpecialistPools = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSpecialistPools( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ISpecialistPool[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listSpecialistPools as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listSpecialistPools with error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listSpecialistPools = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSpecialistPools(request), expectedError); + assert((client.innerApiCalls.listSpecialistPools as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listSpecialistPoolsStream without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), + ]; + client.descriptors.page.listSpecialistPools.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSpecialistPoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.SpecialistPool[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.SpecialistPool) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listSpecialistPools.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSpecialistPools, request)); + assert.strictEqual( + (client.descriptors.page.listSpecialistPools.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listSpecialistPoolsStream with error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listSpecialistPools.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSpecialistPoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.SpecialistPool[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.SpecialistPool) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSpecialistPools.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSpecialistPools, request)); + assert.strictEqual( + (client.descriptors.page.listSpecialistPools.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listSpecialistPools without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), + ]; + client.descriptors.page.listSpecialistPools.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.ISpecialistPool[] = []; + const iterable = client.listSpecialistPoolsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listSpecialistPools with error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listSpecialistPools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSpecialistPoolsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.ISpecialistPool[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/test/gapic_tensorboard_service_v1.ts b/owl-bot-staging/v1/test/gapic_tensorboard_service_v1.ts new file mode 100644 index 00000000..8cc6150b --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_tensorboard_service_v1.ts @@ -0,0 +1,5557 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as tensorboardserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubServerStreamingCall(response?: ResponseType, error?: Error) { + const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // write something to the stream to trigger transformStub and send the response back to the client + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + return sinon.stub().returns(mockStream); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.TensorboardServiceClient', () => { + it('has servicePath', () => { + const servicePath = tensorboardserviceModule.v1.TensorboardServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = tensorboardserviceModule.v1.TensorboardServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = tensorboardserviceModule.v1.TensorboardServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.tensorboardServiceStub, undefined); + await client.initialize(); + assert(client.tensorboardServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.tensorboardServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.tensorboardServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getTensorboard', () => { + it('invokes getTensorboard without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()); + client.innerApiCalls.getTensorboard = stubSimpleCall(expectedResponse); + const [response] = await client.getTensorboard(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTensorboard without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()); + client.innerApiCalls.getTensorboard = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTensorboard( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboard|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getTensorboard with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getTensorboard = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTensorboard(request), expectedError); + assert((client.innerApiCalls.getTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTensorboard with closed client', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTensorboard(request), expectedError); + }); + }); + + describe('createTensorboardExperiment', () => { + it('invokes createTensorboardExperiment without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()); + client.innerApiCalls.createTensorboardExperiment = stubSimpleCall(expectedResponse); + const [response] = await client.createTensorboardExperiment(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTensorboardExperiment without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()); + client.innerApiCalls.createTensorboardExperiment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTensorboardExperiment( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardExperiment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createTensorboardExperiment with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboardExperiment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTensorboardExperiment(request), expectedError); + assert((client.innerApiCalls.createTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTensorboardExperiment with closed client', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createTensorboardExperiment(request), expectedError); + }); + }); + + describe('getTensorboardExperiment', () => { + it('invokes getTensorboardExperiment without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardExperimentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()); + client.innerApiCalls.getTensorboardExperiment = stubSimpleCall(expectedResponse); + const [response] = await client.getTensorboardExperiment(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTensorboardExperiment without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardExperimentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()); + client.innerApiCalls.getTensorboardExperiment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTensorboardExperiment( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardExperiment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getTensorboardExperiment with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardExperimentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getTensorboardExperiment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTensorboardExperiment(request), expectedError); + assert((client.innerApiCalls.getTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTensorboardExperiment with closed client', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardExperimentRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTensorboardExperiment(request), expectedError); + }); + }); + + describe('updateTensorboardExperiment', () => { + it('invokes updateTensorboardExperiment without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest()); + request.tensorboardExperiment = {}; + request.tensorboardExperiment.name = ''; + const expectedHeaderRequestParams = "tensorboard_experiment.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()); + client.innerApiCalls.updateTensorboardExperiment = stubSimpleCall(expectedResponse); + const [response] = await client.updateTensorboardExperiment(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateTensorboardExperiment without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest()); + request.tensorboardExperiment = {}; + request.tensorboardExperiment.name = ''; + const expectedHeaderRequestParams = "tensorboard_experiment.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()); + client.innerApiCalls.updateTensorboardExperiment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTensorboardExperiment( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardExperiment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateTensorboardExperiment with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest()); + request.tensorboardExperiment = {}; + request.tensorboardExperiment.name = ''; + const expectedHeaderRequestParams = "tensorboard_experiment.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboardExperiment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateTensorboardExperiment(request), expectedError); + assert((client.innerApiCalls.updateTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateTensorboardExperiment with closed client', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest()); + request.tensorboardExperiment = {}; + request.tensorboardExperiment.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateTensorboardExperiment(request), expectedError); + }); + }); + + describe('createTensorboardRun', () => { + it('invokes createTensorboardRun without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardRunRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()); + client.innerApiCalls.createTensorboardRun = stubSimpleCall(expectedResponse); + const [response] = await client.createTensorboardRun(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTensorboardRun without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardRunRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()); + client.innerApiCalls.createTensorboardRun = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTensorboardRun( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardRun|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createTensorboardRun with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardRunRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboardRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTensorboardRun(request), expectedError); + assert((client.innerApiCalls.createTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTensorboardRun with closed client', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardRunRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createTensorboardRun(request), expectedError); + }); + }); + + describe('batchCreateTensorboardRuns', () => { + it('invokes batchCreateTensorboardRuns without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse()); + client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCall(expectedResponse); + const [response] = await client.batchCreateTensorboardRuns(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchCreateTensorboardRuns without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse()); + client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchCreateTensorboardRuns( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes batchCreateTensorboardRuns with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchCreateTensorboardRuns(request), expectedError); + assert((client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchCreateTensorboardRuns with closed client', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchCreateTensorboardRuns(request), expectedError); + }); + }); + + describe('getTensorboardRun', () => { + it('invokes getTensorboardRun without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardRunRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()); + client.innerApiCalls.getTensorboardRun = stubSimpleCall(expectedResponse); + const [response] = await client.getTensorboardRun(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTensorboardRun without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardRunRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()); + client.innerApiCalls.getTensorboardRun = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTensorboardRun( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardRun|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getTensorboardRun with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardRunRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getTensorboardRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTensorboardRun(request), expectedError); + assert((client.innerApiCalls.getTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTensorboardRun with closed client', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardRunRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTensorboardRun(request), expectedError); + }); + }); + + describe('updateTensorboardRun', () => { + it('invokes updateTensorboardRun without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardRunRequest()); + request.tensorboardRun = {}; + request.tensorboardRun.name = ''; + const expectedHeaderRequestParams = "tensorboard_run.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()); + client.innerApiCalls.updateTensorboardRun = stubSimpleCall(expectedResponse); + const [response] = await client.updateTensorboardRun(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateTensorboardRun without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardRunRequest()); + request.tensorboardRun = {}; + request.tensorboardRun.name = ''; + const expectedHeaderRequestParams = "tensorboard_run.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()); + client.innerApiCalls.updateTensorboardRun = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTensorboardRun( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardRun|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateTensorboardRun with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardRunRequest()); + request.tensorboardRun = {}; + request.tensorboardRun.name = ''; + const expectedHeaderRequestParams = "tensorboard_run.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboardRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateTensorboardRun(request), expectedError); + assert((client.innerApiCalls.updateTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateTensorboardRun with closed client', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardRunRequest()); + request.tensorboardRun = {}; + request.tensorboardRun.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateTensorboardRun(request), expectedError); + }); + }); + + describe('batchCreateTensorboardTimeSeries', () => { + it('invokes batchCreateTensorboardTimeSeries without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse()); + client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCall(expectedResponse); + const [response] = await client.batchCreateTensorboardTimeSeries(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchCreateTensorboardTimeSeries without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse()); + client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchCreateTensorboardTimeSeries( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes batchCreateTensorboardTimeSeries with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchCreateTensorboardTimeSeries(request), expectedError); + assert((client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchCreateTensorboardTimeSeries with closed client', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchCreateTensorboardTimeSeries(request), expectedError); + }); + }); + + describe('createTensorboardTimeSeries', () => { + it('invokes createTensorboardTimeSeries without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()); + client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCall(expectedResponse); + const [response] = await client.createTensorboardTimeSeries(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTensorboardTimeSeries without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()); + client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTensorboardTimeSeries( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createTensorboardTimeSeries with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTensorboardTimeSeries(request), expectedError); + assert((client.innerApiCalls.createTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTensorboardTimeSeries with closed client', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createTensorboardTimeSeries(request), expectedError); + }); + }); + + describe('getTensorboardTimeSeries', () => { + it('invokes getTensorboardTimeSeries without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()); + client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCall(expectedResponse); + const [response] = await client.getTensorboardTimeSeries(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTensorboardTimeSeries without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()); + client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTensorboardTimeSeries( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getTensorboardTimeSeries with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTensorboardTimeSeries(request), expectedError); + assert((client.innerApiCalls.getTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTensorboardTimeSeries with closed client', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTensorboardTimeSeries(request), expectedError); + }); + }); + + describe('updateTensorboardTimeSeries', () => { + it('invokes updateTensorboardTimeSeries without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest()); + request.tensorboardTimeSeries = {}; + request.tensorboardTimeSeries.name = ''; + const expectedHeaderRequestParams = "tensorboard_time_series.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()); + client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCall(expectedResponse); + const [response] = await client.updateTensorboardTimeSeries(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateTensorboardTimeSeries without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest()); + request.tensorboardTimeSeries = {}; + request.tensorboardTimeSeries.name = ''; + const expectedHeaderRequestParams = "tensorboard_time_series.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()); + client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTensorboardTimeSeries( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateTensorboardTimeSeries with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest()); + request.tensorboardTimeSeries = {}; + request.tensorboardTimeSeries.name = ''; + const expectedHeaderRequestParams = "tensorboard_time_series.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateTensorboardTimeSeries(request), expectedError); + assert((client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateTensorboardTimeSeries with closed client', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest()); + request.tensorboardTimeSeries = {}; + request.tensorboardTimeSeries.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateTensorboardTimeSeries(request), expectedError); + }); + }); + + describe('batchReadTensorboardTimeSeriesData', () => { + it('invokes batchReadTensorboardTimeSeriesData without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest()); + request.tensorboard = ''; + const expectedHeaderRequestParams = "tensorboard="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse()); + client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCall(expectedResponse); + const [response] = await client.batchReadTensorboardTimeSeriesData(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchReadTensorboardTimeSeriesData without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest()); + request.tensorboard = ''; + const expectedHeaderRequestParams = "tensorboard="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse()); + client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchReadTensorboardTimeSeriesData( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes batchReadTensorboardTimeSeriesData with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest()); + request.tensorboard = ''; + const expectedHeaderRequestParams = "tensorboard="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchReadTensorboardTimeSeriesData(request), expectedError); + assert((client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchReadTensorboardTimeSeriesData with closed client', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest()); + request.tensorboard = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchReadTensorboardTimeSeriesData(request), expectedError); + }); + }); + + describe('readTensorboardTimeSeriesData', () => { + it('invokes readTensorboardTimeSeriesData without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse()); + client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCall(expectedResponse); + const [response] = await client.readTensorboardTimeSeriesData(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes readTensorboardTimeSeriesData without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse()); + client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.readTensorboardTimeSeriesData( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes readTensorboardTimeSeriesData with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.readTensorboardTimeSeriesData(request), expectedError); + assert((client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes readTensorboardTimeSeriesData with closed client', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.readTensorboardTimeSeriesData(request), expectedError); + }); + }); + + describe('writeTensorboardExperimentData', () => { + it('invokes writeTensorboardExperimentData without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest()); + request.tensorboardExperiment = ''; + const expectedHeaderRequestParams = "tensorboard_experiment="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse()); + client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCall(expectedResponse); + const [response] = await client.writeTensorboardExperimentData(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.writeTensorboardExperimentData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes writeTensorboardExperimentData without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest()); + request.tensorboardExperiment = ''; + const expectedHeaderRequestParams = "tensorboard_experiment="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse()); + client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.writeTensorboardExperimentData( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.writeTensorboardExperimentData as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes writeTensorboardExperimentData with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest()); + request.tensorboardExperiment = ''; + const expectedHeaderRequestParams = "tensorboard_experiment="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.writeTensorboardExperimentData(request), expectedError); + assert((client.innerApiCalls.writeTensorboardExperimentData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes writeTensorboardExperimentData with closed client', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest()); + request.tensorboardExperiment = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.writeTensorboardExperimentData(request), expectedError); + }); + }); + + describe('writeTensorboardRunData', () => { + it('invokes writeTensorboardRunData without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest()); + request.tensorboardRun = ''; + const expectedHeaderRequestParams = "tensorboard_run="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse()); + client.innerApiCalls.writeTensorboardRunData = stubSimpleCall(expectedResponse); + const [response] = await client.writeTensorboardRunData(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.writeTensorboardRunData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes writeTensorboardRunData without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest()); + request.tensorboardRun = ''; + const expectedHeaderRequestParams = "tensorboard_run="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse()); + client.innerApiCalls.writeTensorboardRunData = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.writeTensorboardRunData( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.writeTensorboardRunData as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes writeTensorboardRunData with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest()); + request.tensorboardRun = ''; + const expectedHeaderRequestParams = "tensorboard_run="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.writeTensorboardRunData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.writeTensorboardRunData(request), expectedError); + assert((client.innerApiCalls.writeTensorboardRunData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes writeTensorboardRunData with closed client', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest()); + request.tensorboardRun = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.writeTensorboardRunData(request), expectedError); + }); + }); + + describe('createTensorboard', () => { + it('invokes createTensorboard without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createTensorboard = stubLongRunningCall(expectedResponse); + const [operation] = await client.createTensorboard(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTensorboard without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createTensorboard = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTensorboard( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createTensorboard with call error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboard = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createTensorboard(request), expectedError); + assert((client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTensorboard with LRO error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboard = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createTensorboard(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateTensorboardProgress without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateTensorboardProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateTensorboardProgress with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateTensorboardProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateTensorboard', () => { + it('invokes updateTensorboard without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardRequest()); + request.tensorboard = {}; + request.tensorboard.name = ''; + const expectedHeaderRequestParams = "tensorboard.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateTensorboard = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateTensorboard(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateTensorboard without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardRequest()); + request.tensorboard = {}; + request.tensorboard.name = ''; + const expectedHeaderRequestParams = "tensorboard.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateTensorboard = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTensorboard( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateTensorboard with call error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardRequest()); + request.tensorboard = {}; + request.tensorboard.name = ''; + const expectedHeaderRequestParams = "tensorboard.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboard = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateTensorboard(request), expectedError); + assert((client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateTensorboard with LRO error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardRequest()); + request.tensorboard = {}; + request.tensorboard.name = ''; + const expectedHeaderRequestParams = "tensorboard.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboard = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateTensorboard(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUpdateTensorboardProgress without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateTensorboardProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateTensorboardProgress with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateTensorboardProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteTensorboard', () => { + it('invokes deleteTensorboard without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTensorboard = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTensorboard(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTensorboard without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTensorboard = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTensorboard( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteTensorboard with call error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboard = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTensorboard(request), expectedError); + assert((client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTensorboard with LRO error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboard = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTensorboard(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteTensorboardProgress without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteTensorboardProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTensorboardProgress with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteTensorboardProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteTensorboardExperiment', () => { + it('invokes deleteTensorboardExperiment without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTensorboardExperiment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTensorboardExperiment without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTensorboardExperiment( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteTensorboardExperiment with call error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTensorboardExperiment(request), expectedError); + assert((client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTensorboardExperiment with LRO error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTensorboardExperiment(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteTensorboardExperimentProgress without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteTensorboardExperimentProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTensorboardExperimentProgress with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteTensorboardExperimentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteTensorboardRun', () => { + it('invokes deleteTensorboardRun without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardRunRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTensorboardRun(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTensorboardRun without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardRunRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTensorboardRun = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTensorboardRun( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteTensorboardRun with call error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardRunRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTensorboardRun(request), expectedError); + assert((client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTensorboardRun with LRO error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardRunRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTensorboardRun(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteTensorboardRunProgress without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteTensorboardRunProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTensorboardRunProgress with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteTensorboardRunProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteTensorboardTimeSeries', () => { + it('invokes deleteTensorboardTimeSeries without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTensorboardTimeSeries(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTensorboardTimeSeries without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTensorboardTimeSeries( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteTensorboardTimeSeries with call error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTensorboardTimeSeries(request), expectedError); + assert((client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTensorboardTimeSeries with LRO error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTensorboardTimeSeries(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteTensorboardTimeSeriesProgress without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteTensorboardTimeSeriesProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTensorboardTimeSeriesProgress with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteTensorboardTimeSeriesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('readTensorboardBlobData', () => { + it('invokes readTensorboardBlobData without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest()); + request.timeSeries = ''; + const expectedHeaderRequestParams = "time_series="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse()); + client.innerApiCalls.readTensorboardBlobData = stubServerStreamingCall(expectedResponse); + const stream = client.readTensorboardBlobData(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.readTensorboardBlobData as SinonStub) + .getCall(0).calledWith(request, expectedOptions)); + }); + + it('invokes readTensorboardBlobData with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest()); + request.timeSeries = ''; + const expectedHeaderRequestParams = "time_series="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.readTensorboardBlobData = stubServerStreamingCall(undefined, expectedError); + const stream = client.readTensorboardBlobData(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.innerApiCalls.readTensorboardBlobData as SinonStub) + .getCall(0).calledWith(request, expectedOptions)); + }); + + it('invokes readTensorboardBlobData with closed client', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest()); + request.timeSeries = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + const stream = client.readTensorboardBlobData(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + }); + + describe('listTensorboards', () => { + it('invokes listTensorboards without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), + ]; + client.innerApiCalls.listTensorboards = stubSimpleCall(expectedResponse); + const [response] = await client.listTensorboards(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTensorboards as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTensorboards without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), + ]; + client.innerApiCalls.listTensorboards = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTensorboards( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboard[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTensorboards as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listTensorboards with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listTensorboards = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTensorboards(request), expectedError); + assert((client.innerApiCalls.listTensorboards as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTensorboardsStream without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), + ]; + client.descriptors.page.listTensorboards.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTensorboardsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Tensorboard[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Tensorboard) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listTensorboards.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTensorboards, request)); + assert.strictEqual( + (client.descriptors.page.listTensorboards.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listTensorboardsStream with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listTensorboards.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTensorboardsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Tensorboard[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Tensorboard) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTensorboards.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTensorboards, request)); + assert.strictEqual( + (client.descriptors.page.listTensorboards.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTensorboards without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), + ]; + client.descriptors.page.listTensorboards.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.ITensorboard[] = []; + const iterable = client.listTensorboardsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTensorboards with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listTensorboards.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTensorboardsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.ITensorboard[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listTensorboardExperiments', () => { + it('invokes listTensorboardExperiments without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), + ]; + client.innerApiCalls.listTensorboardExperiments = stubSimpleCall(expectedResponse); + const [response] = await client.listTensorboardExperiments(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTensorboardExperiments as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTensorboardExperiments without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), + ]; + client.innerApiCalls.listTensorboardExperiments = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTensorboardExperiments( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardExperiment[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTensorboardExperiments as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listTensorboardExperiments with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listTensorboardExperiments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTensorboardExperiments(request), expectedError); + assert((client.innerApiCalls.listTensorboardExperiments as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTensorboardExperimentsStream without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), + ]; + client.descriptors.page.listTensorboardExperiments.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTensorboardExperimentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.TensorboardExperiment[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.TensorboardExperiment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTensorboardExperiments, request)); + assert.strictEqual( + (client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listTensorboardExperimentsStream with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listTensorboardExperiments.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTensorboardExperimentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.TensorboardExperiment[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.TensorboardExperiment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTensorboardExperiments, request)); + assert.strictEqual( + (client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTensorboardExperiments without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), + ]; + client.descriptors.page.listTensorboardExperiments.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.ITensorboardExperiment[] = []; + const iterable = client.listTensorboardExperimentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTensorboardExperiments with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listTensorboardExperiments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTensorboardExperimentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.ITensorboardExperiment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listTensorboardRuns', () => { + it('invokes listTensorboardRuns without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), + ]; + client.innerApiCalls.listTensorboardRuns = stubSimpleCall(expectedResponse); + const [response] = await client.listTensorboardRuns(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTensorboardRuns as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTensorboardRuns without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), + ]; + client.innerApiCalls.listTensorboardRuns = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTensorboardRuns( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardRun[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTensorboardRuns as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listTensorboardRuns with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listTensorboardRuns = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTensorboardRuns(request), expectedError); + assert((client.innerApiCalls.listTensorboardRuns as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTensorboardRunsStream without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), + ]; + client.descriptors.page.listTensorboardRuns.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTensorboardRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.TensorboardRun[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.TensorboardRun) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listTensorboardRuns.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTensorboardRuns, request)); + assert.strictEqual( + (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listTensorboardRunsStream with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listTensorboardRuns.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTensorboardRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.TensorboardRun[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.TensorboardRun) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTensorboardRuns.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTensorboardRuns, request)); + assert.strictEqual( + (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTensorboardRuns without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), + ]; + client.descriptors.page.listTensorboardRuns.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.ITensorboardRun[] = []; + const iterable = client.listTensorboardRunsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTensorboardRuns with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listTensorboardRuns.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTensorboardRunsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.ITensorboardRun[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listTensorboardTimeSeries', () => { + it('invokes listTensorboardTimeSeries without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), + ]; + client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCall(expectedResponse); + const [response] = await client.listTensorboardTimeSeries(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTensorboardTimeSeries without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), + ]; + client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTensorboardTimeSeries( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listTensorboardTimeSeries with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTensorboardTimeSeries(request), expectedError); + assert((client.innerApiCalls.listTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTensorboardTimeSeriesStream without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), + ]; + client.descriptors.page.listTensorboardTimeSeries.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTensorboardTimeSeriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.TensorboardTimeSeries[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.TensorboardTimeSeries) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTensorboardTimeSeries, request)); + assert.strictEqual( + (client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listTensorboardTimeSeriesStream with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listTensorboardTimeSeries.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTensorboardTimeSeriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.TensorboardTimeSeries[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.TensorboardTimeSeries) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTensorboardTimeSeries, request)); + assert.strictEqual( + (client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTensorboardTimeSeries without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), + ]; + client.descriptors.page.listTensorboardTimeSeries.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries[] = []; + const iterable = client.listTensorboardTimeSeriesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTensorboardTimeSeries with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listTensorboardTimeSeries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTensorboardTimeSeriesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('exportTensorboardTimeSeriesData', () => { + it('invokes exportTensorboardTimeSeriesData without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), + ]; + client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCall(expectedResponse); + const [response] = await client.exportTensorboardTimeSeriesData(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes exportTensorboardTimeSeriesData without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), + ]; + client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportTensorboardTimeSeriesData( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITimeSeriesDataPoint[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes exportTensorboardTimeSeriesData with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.exportTensorboardTimeSeriesData(request), expectedError); + assert((client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes exportTensorboardTimeSeriesDataStream without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), + ]; + client.descriptors.page.exportTensorboardTimeSeriesData.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.exportTensorboardTimeSeriesDataStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.exportTensorboardTimeSeriesData, request)); + assert.strictEqual( + (client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes exportTensorboardTimeSeriesDataStream with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series="; + const expectedError = new Error('expected'); + client.descriptors.page.exportTensorboardTimeSeriesData.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.exportTensorboardTimeSeriesDataStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.exportTensorboardTimeSeriesData, request)); + assert.strictEqual( + (client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with exportTensorboardTimeSeriesData without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), + ]; + client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.ITimeSeriesDataPoint[] = []; + const iterable = client.exportTensorboardTimeSeriesDataAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with exportTensorboardTimeSeriesData with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series=";const expectedError = new Error('expected'); + client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.exportTensorboardTimeSeriesDataAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.ITimeSeriesDataPoint[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/test/gapic_vizier_service_v1.ts b/owl-bot-staging/v1/test/gapic_vizier_service_v1.ts new file mode 100644 index 00000000..26a7fa45 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_vizier_service_v1.ts @@ -0,0 +1,3680 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as vizierserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.VizierServiceClient', () => { + it('has servicePath', () => { + const servicePath = vizierserviceModule.v1.VizierServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = vizierserviceModule.v1.VizierServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = vizierserviceModule.v1.VizierServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new vizierserviceModule.v1.VizierServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.vizierServiceStub, undefined); + await client.initialize(); + assert(client.vizierServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.vizierServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.vizierServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('createStudy', () => { + it('invokes createStudy without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateStudyRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()); + client.innerApiCalls.createStudy = stubSimpleCall(expectedResponse); + const [response] = await client.createStudy(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createStudy without error using callback', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateStudyRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()); + client.innerApiCalls.createStudy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createStudy( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IStudy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createStudy with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateStudyRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createStudy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createStudy(request), expectedError); + assert((client.innerApiCalls.createStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createStudy with closed client', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateStudyRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createStudy(request), expectedError); + }); + }); + + describe('getStudy', () => { + it('invokes getStudy without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetStudyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()); + client.innerApiCalls.getStudy = stubSimpleCall(expectedResponse); + const [response] = await client.getStudy(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getStudy without error using callback', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetStudyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()); + client.innerApiCalls.getStudy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getStudy( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IStudy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getStudy with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetStudyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getStudy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getStudy(request), expectedError); + assert((client.innerApiCalls.getStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getStudy with closed client', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetStudyRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getStudy(request), expectedError); + }); + }); + + describe('deleteStudy', () => { + it('invokes deleteStudy without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteStudyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteStudy = stubSimpleCall(expectedResponse); + const [response] = await client.deleteStudy(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteStudy without error using callback', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteStudyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteStudy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteStudy( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteStudy with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteStudyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteStudy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteStudy(request), expectedError); + assert((client.innerApiCalls.deleteStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteStudy with closed client', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteStudyRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteStudy(request), expectedError); + }); + }); + + describe('lookupStudy', () => { + it('invokes lookupStudy without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LookupStudyRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()); + client.innerApiCalls.lookupStudy = stubSimpleCall(expectedResponse); + const [response] = await client.lookupStudy(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.lookupStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes lookupStudy without error using callback', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LookupStudyRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()); + client.innerApiCalls.lookupStudy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.lookupStudy( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IStudy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.lookupStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes lookupStudy with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LookupStudyRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.lookupStudy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.lookupStudy(request), expectedError); + assert((client.innerApiCalls.lookupStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes lookupStudy with closed client', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LookupStudyRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.lookupStudy(request), expectedError); + }); + }); + + describe('createTrial', () => { + it('invokes createTrial without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTrialRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); + client.innerApiCalls.createTrial = stubSimpleCall(expectedResponse); + const [response] = await client.createTrial(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTrial without error using callback', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTrialRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); + client.innerApiCalls.createTrial = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTrial( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITrial|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createTrial with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTrialRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTrial(request), expectedError); + assert((client.innerApiCalls.createTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTrial with closed client', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTrialRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createTrial(request), expectedError); + }); + }); + + describe('getTrial', () => { + it('invokes getTrial without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); + client.innerApiCalls.getTrial = stubSimpleCall(expectedResponse); + const [response] = await client.getTrial(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTrial without error using callback', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); + client.innerApiCalls.getTrial = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTrial( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITrial|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getTrial with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTrial(request), expectedError); + assert((client.innerApiCalls.getTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTrial with closed client', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTrialRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTrial(request), expectedError); + }); + }); + + describe('addTrialMeasurement', () => { + it('invokes addTrialMeasurement without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddTrialMeasurementRequest()); + request.trialName = ''; + const expectedHeaderRequestParams = "trial_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); + client.innerApiCalls.addTrialMeasurement = stubSimpleCall(expectedResponse); + const [response] = await client.addTrialMeasurement(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addTrialMeasurement as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes addTrialMeasurement without error using callback', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddTrialMeasurementRequest()); + request.trialName = ''; + const expectedHeaderRequestParams = "trial_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); + client.innerApiCalls.addTrialMeasurement = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addTrialMeasurement( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITrial|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addTrialMeasurement as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes addTrialMeasurement with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddTrialMeasurementRequest()); + request.trialName = ''; + const expectedHeaderRequestParams = "trial_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addTrialMeasurement = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addTrialMeasurement(request), expectedError); + assert((client.innerApiCalls.addTrialMeasurement as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes addTrialMeasurement with closed client', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddTrialMeasurementRequest()); + request.trialName = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.addTrialMeasurement(request), expectedError); + }); + }); + + describe('completeTrial', () => { + it('invokes completeTrial without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CompleteTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); + client.innerApiCalls.completeTrial = stubSimpleCall(expectedResponse); + const [response] = await client.completeTrial(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.completeTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes completeTrial without error using callback', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CompleteTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); + client.innerApiCalls.completeTrial = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.completeTrial( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITrial|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.completeTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes completeTrial with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CompleteTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.completeTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.completeTrial(request), expectedError); + assert((client.innerApiCalls.completeTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes completeTrial with closed client', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CompleteTrialRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.completeTrial(request), expectedError); + }); + }); + + describe('deleteTrial', () => { + it('invokes deleteTrial without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteTrial = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTrial(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTrial without error using callback', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteTrial = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTrial( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteTrial with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteTrial(request), expectedError); + assert((client.innerApiCalls.deleteTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTrial with closed client', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTrialRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteTrial(request), expectedError); + }); + }); + + describe('stopTrial', () => { + it('invokes stopTrial without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.StopTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); + client.innerApiCalls.stopTrial = stubSimpleCall(expectedResponse); + const [response] = await client.stopTrial(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.stopTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes stopTrial without error using callback', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.StopTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); + client.innerApiCalls.stopTrial = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.stopTrial( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITrial|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.stopTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes stopTrial with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.StopTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.stopTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.stopTrial(request), expectedError); + assert((client.innerApiCalls.stopTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes stopTrial with closed client', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.StopTrialRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.stopTrial(request), expectedError); + }); + }); + + describe('listOptimalTrials', () => { + it('invokes listOptimalTrials without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListOptimalTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListOptimalTrialsResponse()); + client.innerApiCalls.listOptimalTrials = stubSimpleCall(expectedResponse); + const [response] = await client.listOptimalTrials(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listOptimalTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listOptimalTrials without error using callback', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListOptimalTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListOptimalTrialsResponse()); + client.innerApiCalls.listOptimalTrials = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listOptimalTrials( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IListOptimalTrialsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listOptimalTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listOptimalTrials with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListOptimalTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listOptimalTrials = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listOptimalTrials(request), expectedError); + assert((client.innerApiCalls.listOptimalTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listOptimalTrials with closed client', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListOptimalTrialsRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listOptimalTrials(request), expectedError); + }); + }); + + describe('suggestTrials', () => { + it('invokes suggestTrials without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SuggestTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.suggestTrials = stubLongRunningCall(expectedResponse); + const [operation] = await client.suggestTrials(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes suggestTrials without error using callback', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SuggestTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.suggestTrials = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.suggestTrials( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes suggestTrials with call error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SuggestTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.suggestTrials = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.suggestTrials(request), expectedError); + assert((client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes suggestTrials with LRO error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SuggestTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.suggestTrials = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.suggestTrials(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkSuggestTrialsProgress without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkSuggestTrialsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkSuggestTrialsProgress with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkSuggestTrialsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('checkTrialEarlyStoppingState', () => { + it('invokes checkTrialEarlyStoppingState without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateRequest()); + request.trialName = ''; + const expectedHeaderRequestParams = "trial_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(expectedResponse); + const [operation] = await client.checkTrialEarlyStoppingState(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkTrialEarlyStoppingState without error using callback', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateRequest()); + request.trialName = ''; + const expectedHeaderRequestParams = "trial_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.checkTrialEarlyStoppingState( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes checkTrialEarlyStoppingState with call error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateRequest()); + request.trialName = ''; + const expectedHeaderRequestParams = "trial_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.checkTrialEarlyStoppingState(request), expectedError); + assert((client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkTrialEarlyStoppingState with LRO error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateRequest()); + request.trialName = ''; + const expectedHeaderRequestParams = "trial_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.checkTrialEarlyStoppingState(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCheckTrialEarlyStoppingStateProgress without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCheckTrialEarlyStoppingStateProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCheckTrialEarlyStoppingStateProgress with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCheckTrialEarlyStoppingStateProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listStudies', () => { + it('invokes listStudies without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListStudiesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), + ]; + client.innerApiCalls.listStudies = stubSimpleCall(expectedResponse); + const [response] = await client.listStudies(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listStudies as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listStudies without error using callback', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListStudiesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), + ]; + client.innerApiCalls.listStudies = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listStudies( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IStudy[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listStudies as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listStudies with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListStudiesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listStudies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listStudies(request), expectedError); + assert((client.innerApiCalls.listStudies as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listStudiesStream without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListStudiesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), + ]; + client.descriptors.page.listStudies.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listStudiesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Study[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Study) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listStudies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listStudies, request)); + assert.strictEqual( + (client.descriptors.page.listStudies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStudiesStream with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListStudiesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listStudies.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listStudiesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Study[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Study) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listStudies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listStudies, request)); + assert.strictEqual( + (client.descriptors.page.listStudies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listStudies without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListStudiesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), + ]; + client.descriptors.page.listStudies.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IStudy[] = []; + const iterable = client.listStudiesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listStudies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listStudies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listStudies with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListStudiesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listStudies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listStudiesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IStudy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listStudies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listStudies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listTrials', () => { + it('invokes listTrials without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), + ]; + client.innerApiCalls.listTrials = stubSimpleCall(expectedResponse); + const [response] = await client.listTrials(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTrials without error using callback', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), + ]; + client.innerApiCalls.listTrials = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTrials( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITrial[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listTrials with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listTrials = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTrials(request), expectedError); + assert((client.innerApiCalls.listTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTrialsStream without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), + ]; + client.descriptors.page.listTrials.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTrialsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Trial[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Trial) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listTrials.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTrials, request)); + assert.strictEqual( + (client.descriptors.page.listTrials.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listTrialsStream with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listTrials.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTrialsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.Trial[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.Trial) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTrials.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTrials, request)); + assert.strictEqual( + (client.descriptors.page.listTrials.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTrials without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), + ]; + client.descriptors.page.listTrials.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.ITrial[] = []; + const iterable = client.listTrialsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTrials.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTrials.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTrials with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listTrials.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTrialsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.ITrial[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTrials.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTrials.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1/tsconfig.json b/owl-bot-staging/v1/tsconfig.json new file mode 100644 index 00000000..c78f1c88 --- /dev/null +++ b/owl-bot-staging/v1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/v1/webpack.config.js b/owl-bot-staging/v1/webpack.config.js new file mode 100644 index 00000000..f4947d41 --- /dev/null +++ b/owl-bot-staging/v1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 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 +// +// https://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. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'DatasetService', + filename: './dataset-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/owl-bot-staging/v1beta1/.eslintignore b/owl-bot-staging/v1beta1/.eslintignore new file mode 100644 index 00000000..cfc348ec --- /dev/null +++ b/owl-bot-staging/v1beta1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/v1beta1/.eslintrc.json b/owl-bot-staging/v1beta1/.eslintrc.json new file mode 100644 index 00000000..78215349 --- /dev/null +++ b/owl-bot-staging/v1beta1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/v1beta1/.gitignore b/owl-bot-staging/v1beta1/.gitignore new file mode 100644 index 00000000..5d32b237 --- /dev/null +++ b/owl-bot-staging/v1beta1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/v1beta1/.jsdoc.js b/owl-bot-staging/v1beta1/.jsdoc.js new file mode 100644 index 00000000..a5ec80d7 --- /dev/null +++ b/owl-bot-staging/v1beta1/.jsdoc.js @@ -0,0 +1,55 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/aiplatform', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/v1beta1/.mocharc.js b/owl-bot-staging/v1beta1/.mocharc.js new file mode 100644 index 00000000..481c522b --- /dev/null +++ b/owl-bot-staging/v1beta1/.mocharc.js @@ -0,0 +1,33 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/v1beta1/.prettierrc.js b/owl-bot-staging/v1beta1/.prettierrc.js new file mode 100644 index 00000000..494e1478 --- /dev/null +++ b/owl-bot-staging/v1beta1/.prettierrc.js @@ -0,0 +1,22 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/v1beta1/README.md b/owl-bot-staging/v1beta1/README.md new file mode 100644 index 00000000..7f057918 --- /dev/null +++ b/owl-bot-staging/v1beta1/README.md @@ -0,0 +1 @@ +Aiplatform: Nodejs Client diff --git a/owl-bot-staging/v1beta1/linkinator.config.json b/owl-bot-staging/v1beta1/linkinator.config.json new file mode 100644 index 00000000..befd23c8 --- /dev/null +++ b/owl-bot-staging/v1beta1/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/owl-bot-staging/v1beta1/package.json b/owl-bot-staging/v1beta1/package.json new file mode 100644 index 00000000..b8fe84e8 --- /dev/null +++ b/owl-bot-staging/v1beta1/package.json @@ -0,0 +1,78 @@ +{ + "name": "@google-cloud/aiplatform", + "version": "0.1.0", + "description": "Aiplatform client for Node.js", + "repository": "googleapis/nodejs-aiplatform", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google aiplatform", + "aiplatform", + "dataset service", + "endpoint service", + "featurestore online serving service", + "featurestore service", + "index endpoint service", + "index service", + "job service", + "metadata service", + "migration service", + "model service", + "pipeline service", + "prediction service", + "specialist pool service", + "tensorboard service", + "vizier service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^2.29.4" + }, + "devDependencies": { + "@types/mocha": "^9.1.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.8", + "c8": "^7.11.0", + "gts": "^3.1.0", + "jsdoc": "^3.6.7", + "jsdoc-fresh": "^1.1.1", + "jsdoc-region-tag": "^1.3.1", + "linkinator": "^3.0.0", + "mocha": "^9.1.4", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^13.0.0", + "ts-loader": "^9.2.6", + "typescript": "^4.5.5", + "webpack": "^5.67.0", + "webpack-cli": "^4.9.1" + }, + "engines": { + "node": ">=v10.24.0" + } +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto new file mode 100644 index 00000000..af624cb7 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto @@ -0,0 +1,55 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "AcceleratorTypeProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Represents a hardware accelerator type. +enum AcceleratorType { + // Unspecified accelerator type, which means no accelerator. + ACCELERATOR_TYPE_UNSPECIFIED = 0; + + // Nvidia Tesla K80 GPU. + NVIDIA_TESLA_K80 = 1; + + // Nvidia Tesla P100 GPU. + NVIDIA_TESLA_P100 = 2; + + // Nvidia Tesla V100 GPU. + NVIDIA_TESLA_V100 = 3; + + // Nvidia Tesla P4 GPU. + NVIDIA_TESLA_P4 = 4; + + // Nvidia Tesla T4 GPU. + NVIDIA_TESLA_T4 = 5; + + // Nvidia Tesla A100 GPU. + NVIDIA_TESLA_A100 = 8; + + // TPU v2. + TPU_V2 = 6; + + // TPU v3. + TPU_V3 = 7; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation.proto new file mode 100644 index 00000000..e57ab445 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation.proto @@ -0,0 +1,90 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/user_action_reference.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Used to assign specific AnnotationSpec to a particular area of a DataItem or +// the whole part of the DataItem. +message Annotation { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Annotation" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}" + }; + + // Output only. Resource name of the Annotation. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Google Cloud Storage URI points to a YAML file describing [payload][google.cloud.aiplatform.v1beta1.Annotation.payload]. The + // schema is defined as an [OpenAPI 3.0.2 Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + // The schema files that can be used here are found in + // gs://google-cloud-aiplatform/schema/dataset/annotation/, note that the + // chosen schema must be consistent with the parent Dataset's + // [metadata][google.cloud.aiplatform.v1beta1.Dataset.metadata_schema_uri]. + string payload_schema_uri = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The schema of the payload can be found in + // [payload_schema][google.cloud.aiplatform.v1beta1.Annotation.payload_schema_uri]. + google.protobuf.Value payload = 3 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Timestamp when this Annotation was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Annotation was last updated. + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The source of the Annotation. + UserActionReference annotation_source = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The labels with user-defined metadata to organize your Annotations. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one Annotation(System + // labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. Following system labels exist for each Annotation: + // + // * "aiplatform.googleapis.com/annotation_set_name": + // optional, name of the UI's annotation set this Annotation belongs to. + // If not set, the Annotation is not visible in the UI. + // + // * "aiplatform.googleapis.com/payload_schema": + // output only, its value is the [payload_schema's][google.cloud.aiplatform.v1beta1.Annotation.payload_schema_uri] + // title. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto new file mode 100644 index 00000000..5d4c5664 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto @@ -0,0 +1,55 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationSpecProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Identifies a concept with which DataItems may be annotated with. +message AnnotationSpec { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/AnnotationSpec" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}" + }; + + // Output only. Resource name of the AnnotationSpec. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The user-defined name of the AnnotationSpec. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Timestamp when this AnnotationSpec was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when AnnotationSpec was last updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 5 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/artifact.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/artifact.proto new file mode 100644 index 00000000..378afb3f --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/artifact.proto @@ -0,0 +1,109 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ArtifactProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Instance of a general artifact. +message Artifact { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Artifact" + pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}" + }; + + // Describes the state of the Artifact. + enum State { + // Unspecified state for the Artifact. + STATE_UNSPECIFIED = 0; + + // A state used by systems like Vertex AI Pipelines to indicate that the + // underlying data item represented by this Artifact is being created. + PENDING = 1; + + // A state indicating that the Artifact should exist, unless something + // external to the system deletes it. + LIVE = 2; + } + + // Output only. The resource name of the Artifact. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User provided display name of the Artifact. + // May be up to 128 Unicode characters. + string display_name = 2; + + // The uniform resource identifier of the artifact file. + // May be empty if there is no actual artifact file. + string uri = 6; + + // An eTag used to perform consistent read-modify-write updates. If not set, a + // blind "overwrite" update happens. + string etag = 9; + + // The labels with user-defined metadata to organize your Artifacts. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one Artifact (System + // labels are excluded). + map labels = 10; + + // Output only. Timestamp when this Artifact was created. + google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Artifact was last updated. + google.protobuf.Timestamp update_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The state of this Artifact. This is a property of the Artifact, and does + // not imply or capture any ongoing process. This property is managed by + // clients (such as Vertex AI Pipelines), and the system does not prescribe + // or check the validity of state transitions. + State state = 13; + + // The title of the schema describing the metadata. + // + // Schema title and version is expected to be registered in earlier Create + // Schema calls. And both are used together as unique identifiers to identify + // schemas within the local metadata store. + string schema_title = 14; + + // The version of the schema in schema_name to use. + // + // Schema title and version is expected to be registered in earlier Create + // Schema calls. And both are used together as unique identifiers to identify + // schemas within the local metadata store. + string schema_version = 15; + + // Properties of the Artifact. + // The size of this field should not exceed 200KB. + google.protobuf.Struct metadata = 16; + + // Description of the Artifact + string description = 17; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto new file mode 100644 index 00000000..b50a8feb --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto @@ -0,0 +1,298 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/completion_stats.proto"; +import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1beta1/explanation.proto"; +import "google/cloud/aiplatform/v1beta1/io.proto"; +import "google/cloud/aiplatform/v1beta1/job_state.proto"; +import "google/cloud/aiplatform/v1beta1/machine_resources.proto"; +import "google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto"; +import "google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "BatchPredictionJobProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A job that uses a [Model][google.cloud.aiplatform.v1beta1.BatchPredictionJob.model] to produce predictions +// on multiple [input instances][google.cloud.aiplatform.v1beta1.BatchPredictionJob.input_config]. If +// predictions for significant portion of the instances fail, the job may finish +// without attempting predictions for all remaining instances. +message BatchPredictionJob { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/BatchPredictionJob" + pattern: "projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}" + }; + + // Configures the input to [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob]. + // See [Model.supported_input_storage_formats][google.cloud.aiplatform.v1beta1.Model.supported_input_storage_formats] for Model's supported input + // formats, and how instances should be expressed via any of them. + message InputConfig { + // Required. The source of the input. + oneof source { + // The Cloud Storage location for the input instances. + GcsSource gcs_source = 2; + + // The BigQuery location of the input table. + // The schema of the table should be in the format described by the given + // context OpenAPI Schema, if one is provided. The table may contain + // additional columns that are not described by the schema, and they will + // be ignored. + BigQuerySource bigquery_source = 3; + } + + // Required. The format in which instances are given, must be one of the + // [Model's][google.cloud.aiplatform.v1beta1.BatchPredictionJob.model] + // [supported_input_storage_formats][google.cloud.aiplatform.v1beta1.Model.supported_input_storage_formats]. + string instances_format = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Configures the output of [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob]. + // See [Model.supported_output_storage_formats][google.cloud.aiplatform.v1beta1.Model.supported_output_storage_formats] for supported output + // formats, and how predictions are expressed via any of them. + message OutputConfig { + // Required. The destination of the output. + oneof destination { + // The Cloud Storage location of the directory where the output is + // to be written to. In the given directory a new directory is created. + // Its name is `prediction--`, + // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. + // Inside of it files `predictions_0001.`, + // `predictions_0002.`, ..., `predictions_N.` + // are created where `` depends on chosen + // [predictions_format][google.cloud.aiplatform.v1beta1.BatchPredictionJob.OutputConfig.predictions_format], and N may equal 0001 and depends on the total + // number of successfully predicted instances. + // If the Model has both [instance][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri] + // and [prediction][google.cloud.aiplatform.v1beta1.PredictSchemata.parameters_schema_uri] schemata + // defined then each such file contains predictions as per the + // [predictions_format][google.cloud.aiplatform.v1beta1.BatchPredictionJob.OutputConfig.predictions_format]. + // If prediction for any instance failed (partially or completely), then + // an additional `errors_0001.`, `errors_0002.`,..., + // `errors_N.` files are created (N depends on total number + // of failed predictions). These files contain the failed instances, + // as per their schema, followed by an additional `error` field which as + // value has [google.rpc.Status][google.rpc.Status] + // containing only `code` and `message` fields. + GcsDestination gcs_destination = 2; + + // The BigQuery project or dataset location where the output is to be + // written to. If project is provided, a new dataset is created with name + // `prediction__` + // where is made + // BigQuery-dataset-name compatible (for example, most special characters + // become underscores), and timestamp is in + // YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In the dataset + // two tables will be created, `predictions`, and `errors`. + // If the Model has both [instance][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri] + // and [prediction][google.cloud.aiplatform.v1beta1.PredictSchemata.parameters_schema_uri] schemata + // defined then the tables have columns as follows: The `predictions` + // table contains instances for which the prediction succeeded, it + // has columns as per a concatenation of the Model's instance and + // prediction schemata. The `errors` table contains rows for which the + // prediction has failed, it has instance columns, as per the + // instance schema, followed by a single "errors" column, which as values + // has [google.rpc.Status][google.rpc.Status] + // represented as a STRUCT, and containing only `code` and `message`. + BigQueryDestination bigquery_destination = 3; + } + + // Required. The format in which Vertex AI gives the predictions, must be one of the + // [Model's][google.cloud.aiplatform.v1beta1.BatchPredictionJob.model] + // [supported_output_storage_formats][google.cloud.aiplatform.v1beta1.Model.supported_output_storage_formats]. + string predictions_format = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Further describes this job's output. + // Supplements [output_config][google.cloud.aiplatform.v1beta1.BatchPredictionJob.output_config]. + message OutputInfo { + // The output location into which prediction output is written. + oneof output_location { + // Output only. The full path of the Cloud Storage directory created, into which + // the prediction output is written. + string gcs_output_directory = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The path of the BigQuery dataset created, in + // `bq://projectId.bqDatasetId` + // format, into which the prediction output is written. + string bigquery_output_dataset = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The name of the BigQuery table created, in + // `predictions_` + // format, into which the prediction output is written. + // Can be used by UI to generate the BigQuery output path, for example. + string bigquery_output_table = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Resource name of the BatchPredictionJob. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The user-defined name of this BatchPredictionJob. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The name of the Model resoure that produces the predictions via this job, + // must share the same ancestor Location. + // Starting this job has no impact on any existing deployments of the Model + // and their resources. + // Exactly one of model and unmanaged_container_model must be set. + string model = 3 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + }]; + + // Output only. The version ID of the Model that produces the predictions via this job. + string model_version_id = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Contains model information necessary to perform batch prediction without + // requiring uploading to model registry. + // Exactly one of model and unmanaged_container_model must be set. + UnmanagedContainerModel unmanaged_container_model = 28; + + // Required. Input configuration of the instances on which predictions are performed. + // The schema of any single instance may be specified via + // the [Model's][google.cloud.aiplatform.v1beta1.BatchPredictionJob.model] + // [PredictSchemata's][google.cloud.aiplatform.v1beta1.Model.predict_schemata] + // [instance_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri]. + InputConfig input_config = 4 [(google.api.field_behavior) = REQUIRED]; + + // The parameters that govern the predictions. The schema of the parameters + // may be specified via the [Model's][google.cloud.aiplatform.v1beta1.BatchPredictionJob.model] + // [PredictSchemata's][google.cloud.aiplatform.v1beta1.Model.predict_schemata] + // [parameters_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.parameters_schema_uri]. + google.protobuf.Value model_parameters = 5; + + // Required. The Configuration specifying where output predictions should + // be written. + // The schema of any single prediction may be specified as a concatenation + // of [Model's][google.cloud.aiplatform.v1beta1.BatchPredictionJob.model] + // [PredictSchemata's][google.cloud.aiplatform.v1beta1.Model.predict_schemata] + // [instance_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri] + // and + // [prediction_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.prediction_schema_uri]. + OutputConfig output_config = 6 [(google.api.field_behavior) = REQUIRED]; + + // The config of resources used by the Model during the batch prediction. If + // the Model [supports][google.cloud.aiplatform.v1beta1.Model.supported_deployment_resources_types] + // DEDICATED_RESOURCES this config may be provided (and the job will use these + // resources), if the Model doesn't support AUTOMATIC_RESOURCES, this config + // must be provided. + BatchDedicatedResources dedicated_resources = 7; + + // The service account that the DeployedModel's container runs as. If not + // specified, a system generated one will be used, which + // has minimal permissions and the custom container, if used, may not have + // enough permission to access other GCP resources. + // + // Users deploying the Model must have the `iam.serviceAccounts.actAs` + // permission on this service account. + string service_account = 29; + + // Immutable. Parameters configuring the batch behavior. Currently only applicable when + // [dedicated_resources][google.cloud.aiplatform.v1beta1.BatchPredictionJob.dedicated_resources] are used (in other cases Vertex AI does + // the tuning itself). + ManualBatchTuningParameters manual_batch_tuning_parameters = 8 [(google.api.field_behavior) = IMMUTABLE]; + + // Generate explanation with the batch prediction results. + // + // When set to `true`, the batch prediction output changes based on the + // `predictions_format` field of the + // [BatchPredictionJob.output_config][google.cloud.aiplatform.v1beta1.BatchPredictionJob.output_config] object: + // + // * `bigquery`: output includes a column named `explanation`. The value + // is a struct that conforms to the [Explanation][google.cloud.aiplatform.v1beta1.Explanation] object. + // * `jsonl`: The JSON objects on each line include an additional entry + // keyed `explanation`. The value of the entry is a JSON object that + // conforms to the [Explanation][google.cloud.aiplatform.v1beta1.Explanation] object. + // * `csv`: Generating explanations for CSV format is not supported. + // + // If this field is set to true, either the [Model.explanation_spec][google.cloud.aiplatform.v1beta1.Model.explanation_spec] or + // [explanation_spec][google.cloud.aiplatform.v1beta1.BatchPredictionJob.explanation_spec] must be populated. + bool generate_explanation = 23; + + // Explanation configuration for this BatchPredictionJob. Can be + // specified only if [generate_explanation][google.cloud.aiplatform.v1beta1.BatchPredictionJob.generate_explanation] is set to `true`. + // + // This value overrides the value of [Model.explanation_spec][google.cloud.aiplatform.v1beta1.Model.explanation_spec]. All fields of + // [explanation_spec][google.cloud.aiplatform.v1beta1.BatchPredictionJob.explanation_spec] are optional in the request. If a field of the + // [explanation_spec][google.cloud.aiplatform.v1beta1.BatchPredictionJob.explanation_spec] object is not populated, the corresponding field of + // the [Model.explanation_spec][google.cloud.aiplatform.v1beta1.Model.explanation_spec] object is inherited. + ExplanationSpec explanation_spec = 25; + + // Output only. Information further describing the output of this job. + OutputInfo output_info = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The detailed state of the job. + JobState state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Only populated when the job's state is JOB_STATE_FAILED or + // JOB_STATE_CANCELLED. + google.rpc.Status error = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Partial failures encountered. + // For example, single files that can't be read. + // This field never exceeds 20 entries. + // Status details fields contain standard GCP error details. + repeated google.rpc.Status partial_failures = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Information about resources that had been consumed by this job. + // Provided in real time at best effort basis, as well as a final value + // once the job completes. + // + // Note: This field currently may be not populated for batch predictions that + // use AutoML Models. + ResourcesConsumed resources_consumed = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Statistics on completed and failed prediction instances. + CompletionStats completion_stats = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the BatchPredictionJob was created. + google.protobuf.Timestamp create_time = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the BatchPredictionJob for the first time entered the + // `JOB_STATE_RUNNING` state. + google.protobuf.Timestamp start_time = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the BatchPredictionJob entered any of the following states: + // `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. + google.protobuf.Timestamp end_time = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the BatchPredictionJob was most recently updated. + google.protobuf.Timestamp update_time = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize BatchPredictionJobs. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 19; + + // Customer-managed encryption key options for a BatchPredictionJob. If this + // is set, then all resources created by the BatchPredictionJob will be + // encrypted with the provided encryption key. + EncryptionSpec encryption_spec = 24; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/completion_stats.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/completion_stats.proto new file mode 100644 index 00000000..7d539d82 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/completion_stats.proto @@ -0,0 +1,44 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "CompletionStatsProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Success and error statistics of processing multiple entities +// (for example, DataItems or structured data rows) in batch. +message CompletionStats { + // Output only. The number of entities that had been processed successfully. + int64 successful_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of entities for which any error was encountered. + int64 failed_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. In cases when enough errors are encountered a job, pipeline, or operation + // may be failed as a whole. Below is the number of entities for which the + // processing had not been finished (either in successful or failed state). + // Set to -1 if the number is unknown (for example, the operation failed + // before the total entity number could be collected). + int64 incomplete_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/context.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/context.proto new file mode 100644 index 00000000..7f81ce4c --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/context.proto @@ -0,0 +1,94 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ContextProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Instance of a general context. +message Context { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Context" + pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}" + }; + + // Output only. The resource name of the Context. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User provided display name of the Context. + // May be up to 128 Unicode characters. + string display_name = 2; + + // An eTag used to perform consistent read-modify-write updates. If not set, a + // blind "overwrite" update happens. + string etag = 8; + + // The labels with user-defined metadata to organize your Contexts. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one Context (System + // labels are excluded). + map labels = 9; + + // Output only. Timestamp when this Context was created. + google.protobuf.Timestamp create_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Context was last updated. + google.protobuf.Timestamp update_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A list of resource names of Contexts that are parents of this Context. + // A Context may have at most 10 parent_contexts. + repeated string parent_contexts = 12 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; + + // The title of the schema describing the metadata. + // + // Schema title and version is expected to be registered in earlier Create + // Schema calls. And both are used together as unique identifiers to identify + // schemas within the local metadata store. + string schema_title = 13; + + // The version of the schema in schema_name to use. + // + // Schema title and version is expected to be registered in earlier Create + // Schema calls. And both are used together as unique identifiers to identify + // schemas within the local metadata store. + string schema_version = 14; + + // Properties of the Context. + // The size of this field should not exceed 200KB. + google.protobuf.Struct metadata = 15; + + // Description of the Context + string description = 16; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto new file mode 100644 index 00000000..d2f1464d --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto @@ -0,0 +1,268 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1beta1/io.proto"; +import "google/cloud/aiplatform/v1beta1/job_state.proto"; +import "google/cloud/aiplatform/v1beta1/machine_resources.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "CustomJobProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Represents a job that runs custom workloads such as a Docker container or a +// Python package. A CustomJob can have multiple worker pools and each worker +// pool can have its own machine and input spec. A CustomJob will be cleaned up +// once the job enters terminal state (failed or succeeded). +message CustomJob { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/CustomJob" + pattern: "projects/{project}/locations/{location}/customJobs/{custom_job}" + }; + + // Output only. Resource name of a CustomJob. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the CustomJob. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Job spec. + CustomJobSpec job_spec = 4 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The detailed state of the job. + JobState state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the CustomJob was created. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the CustomJob for the first time entered the + // `JOB_STATE_RUNNING` state. + google.protobuf.Timestamp start_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the CustomJob entered any of the following states: + // `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. + google.protobuf.Timestamp end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the CustomJob was most recently updated. + google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Only populated when job's state is `JOB_STATE_FAILED` or + // `JOB_STATE_CANCELLED`. + google.rpc.Status error = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize CustomJobs. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 11; + + // Customer-managed encryption key options for a CustomJob. If this is set, + // then all resources created by the CustomJob will be encrypted with the + // provided encryption key. + EncryptionSpec encryption_spec = 12; + + // Output only. URIs for accessing [interactive + // shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) + // (one URI for each training node). Only available if + // [job_spec.enable_web_access][google.cloud.aiplatform.v1beta1.CustomJobSpec.enable_web_access] is `true`. + // + // The keys are names of each node in the training job; for example, + // `workerpool0-0` for the primary node, `workerpool1-0` for the first node in + // the second worker pool, and `workerpool1-1` for the second node in the + // second worker pool. + // + // The values are the URIs for each node's interactive shell. + map web_access_uris = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents the spec of a CustomJob. +// Next Id: 14 +message CustomJobSpec { + // Required. The spec of the worker pools including machine type and Docker image. + // All worker pools except the first one are optional and can be skipped by + // providing an empty value. + repeated WorkerPoolSpec worker_pool_specs = 1 [(google.api.field_behavior) = REQUIRED]; + + // Scheduling options for a CustomJob. + Scheduling scheduling = 3; + + // Specifies the service account for workload run-as account. + // Users submitting jobs must have act-as permission on this run-as account. + // If unspecified, the [Vertex AI Custom Code Service + // Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) + // for the CustomJob's project is used. + string service_account = 4; + + // The full name of the Compute Engine + // [network](/compute/docs/networks-and-firewalls#networks) to which the Job + // should be peered. For example, `projects/12345/global/networks/myVPC`. + // [Format](/compute/docs/reference/rest/v1/networks/insert) + // is of the form `projects/{project}/global/networks/{network}`. + // Where {project} is a project number, as in `12345`, and {network} is a + // network name. + // + // To specify this field, you must have already [configured VPC Network + // Peering for Vertex + // AI](https://cloud.google.com/vertex-ai/docs/general/vpc-peering). + // + // If this field is left unspecified, the job is not peered with any network. + string network = 5 [(google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + }]; + + // Optional. A list of names for the reserved ip ranges under the VPC network + // that can be used for this job. + // + // If set, we will deploy the job within the provided ip ranges. Otherwise, + // the job will be deployed to any ip ranges under the provided VPC + // network. + // + // Example: ['vertex-ai-ip-range']. + repeated string reserved_ip_ranges = 13 [(google.api.field_behavior) = OPTIONAL]; + + // The Cloud Storage location to store the output of this CustomJob or + // HyperparameterTuningJob. For HyperparameterTuningJob, + // the baseOutputDirectory of + // each child CustomJob backing a Trial is set to a subdirectory of name + // [id][google.cloud.aiplatform.v1beta1.Trial.id] under its parent HyperparameterTuningJob's + // baseOutputDirectory. + // + // The following Vertex AI environment variables will be passed to + // containers or python modules when this field is set: + // + // For CustomJob: + // + // * AIP_MODEL_DIR = `/model/` + // * AIP_CHECKPOINT_DIR = `/checkpoints/` + // * AIP_TENSORBOARD_LOG_DIR = `/logs/` + // + // For CustomJob backing a Trial of HyperparameterTuningJob: + // + // * AIP_MODEL_DIR = `//model/` + // * AIP_CHECKPOINT_DIR = `//checkpoints/` + // * AIP_TENSORBOARD_LOG_DIR = `//logs/` + GcsDestination base_output_directory = 6; + + // Optional. The name of a Vertex AI [Tensorboard][google.cloud.aiplatform.v1beta1.Tensorboard] resource to which this CustomJob + // will upload Tensorboard logs. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + string tensorboard = 7 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Tensorboard" + } + ]; + + // Optional. Whether you want Vertex AI to enable [interactive shell + // access](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) + // to training containers. + // + // If set to `true`, you can access interactive shells at the URIs given + // by [CustomJob.web_access_uris][google.cloud.aiplatform.v1beta1.CustomJob.web_access_uris] or [Trial.web_access_uris][google.cloud.aiplatform.v1beta1.Trial.web_access_uris] (within + // [HyperparameterTuningJob.trials][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.trials]). + bool enable_web_access = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the spec of a worker pool in a job. +message WorkerPoolSpec { + // The custom task to be executed in this worker pool. + oneof task { + // The custom container task. + ContainerSpec container_spec = 6; + + // The Python packaged task. + PythonPackageSpec python_package_spec = 7; + } + + // Optional. Immutable. The specification of a single machine. + MachineSpec machine_spec = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. The number of worker replicas to use for this worker pool. + int64 replica_count = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of NFS mount spec. + repeated NfsMount nfs_mounts = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Disk spec. + DiskSpec disk_spec = 5; +} + +// The spec of a Container. +message ContainerSpec { + // Required. The URI of a container image in the Container Registry that is to be run on + // each worker replica. + string image_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // The command to be invoked when the container is started. + // It overrides the entrypoint instruction in Dockerfile when provided. + repeated string command = 2; + + // The arguments to be passed when starting the container. + repeated string args = 3; +} + +// The spec of a Python packaged code. +message PythonPackageSpec { + // Required. The URI of a container image in Artifact Registry that will run the + // provided Python package. Vertex AI provides a wide range of executor + // images with pre-installed packages to meet users' various use cases. See + // the list of [pre-built containers for + // training](https://cloud.google.com/vertex-ai/docs/training/pre-built-containers). + // You must use an image from this list. + string executor_image_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Google Cloud Storage location of the Python package files which are + // the training program and its dependent packages. + // The maximum number of package URIs is 100. + repeated string package_uris = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Python module name to run after installing the packages. + string python_module = 3 [(google.api.field_behavior) = REQUIRED]; + + // Command line arguments to be passed to the Python task. + repeated string args = 4; +} + +// All parameters related to queuing and scheduling of custom jobs. +message Scheduling { + // The maximum job running time. The default is 7 days. + google.protobuf.Duration timeout = 1; + + // Restarts the entire CustomJob if a worker gets restarted. + // This feature can be used by distributed training jobs that are not + // resilient to workers leaving and joining a job. + bool restart_job_on_worker_restart = 3; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_item.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_item.proto new file mode 100644 index 00000000..5c3e443b --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_item.proto @@ -0,0 +1,70 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "DataItemProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A piece of data in a Dataset. Could be an image, a video, a document or plain +// text. +message DataItem { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/DataItem" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}" + }; + + // Output only. The resource name of the DataItem. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this DataItem was created. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this DataItem was last updated. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The labels with user-defined metadata to organize your DataItems. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one DataItem(System + // labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. + map labels = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The data that the DataItem represents (for example, an image or a text + // snippet). The schema of the payload is stored in the parent Dataset's + // [metadata schema's][google.cloud.aiplatform.v1beta1.Dataset.metadata_schema_uri] dataItemSchemaUri field. + google.protobuf.Value payload = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 7 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto new file mode 100644 index 00000000..3a7160a5 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto @@ -0,0 +1,207 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1beta1/job_state.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/type/money.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "DataLabelingJobProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// DataLabelingJob is used to trigger a human labeling job on unlabeled data +// from the following Dataset: +message DataLabelingJob { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/DataLabelingJob" + pattern: "projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}" + }; + + // Output only. Resource name of the DataLabelingJob. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The user-defined name of the DataLabelingJob. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + // Display name of a DataLabelingJob. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset resource names. Right now we only support labeling from a single + // Dataset. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}` + repeated string datasets = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + } + ]; + + // Labels to assign to annotations generated by this DataLabelingJob. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. + map annotation_labels = 12; + + // Required. Number of labelers to work on each DataItem. + int32 labeler_count = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Google Cloud Storage location of the instruction pdf. This pdf is + // shared with labelers, and provides detailed description on how to label + // DataItems in Datasets. + string instruction_uri = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. Points to a YAML file stored on Google Cloud Storage describing the + // config for a specific type of DataLabelingJob. + // The schema files that can be used here are found in the + // https://storage.googleapis.com/google-cloud-aiplatform bucket in the + // /schema/datalabelingjob/inputs/ folder. + string inputs_schema_uri = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input config parameters for the DataLabelingJob. + google.protobuf.Value inputs = 7 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The detailed state of the job. + JobState state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current labeling job progress percentage scaled in interval [0, 100], + // indicating the percentage of DataItems that has been finished. + int32 labeling_progress = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Estimated cost(in US dollars) that the DataLabelingJob has incurred to + // date. + google.type.Money current_spend = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this DataLabelingJob was created. + google.protobuf.Timestamp create_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this DataLabelingJob was updated most recently. + google.protobuf.Timestamp update_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. DataLabelingJob errors. It is only populated when job's state is + // `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`. + google.rpc.Status error = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize your DataLabelingJobs. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. Following system labels exist for each DataLabelingJob: + // + // * "aiplatform.googleapis.com/schema": output only, its value is the + // [inputs_schema][google.cloud.aiplatform.v1beta1.DataLabelingJob.inputs_schema_uri]'s title. + map labels = 11; + + // The SpecialistPools' resource names associated with this job. + repeated string specialist_pools = 16; + + // Customer-managed encryption key spec for a DataLabelingJob. If set, this + // DataLabelingJob will be secured by this key. + // + // Note: Annotations created in the DataLabelingJob are associated with + // the EncryptionSpec of the Dataset they are exported to. + EncryptionSpec encryption_spec = 20; + + // Parameters that configure the active learning pipeline. Active learning + // will label the data incrementally via several iterations. For every + // iteration, it will select a batch of data based on the sampling strategy. + ActiveLearningConfig active_learning_config = 21; +} + +// Parameters that configure the active learning pipeline. Active learning will +// label the data incrementally by several iterations. For every iteration, it +// will select a batch of data based on the sampling strategy. +message ActiveLearningConfig { + // Required. Max human labeling DataItems. The rest part will be labeled by + // machine. + oneof human_labeling_budget { + // Max number of human labeled DataItems. + int64 max_data_item_count = 1; + + // Max percent of total DataItems for human labeling. + int32 max_data_item_percentage = 2; + } + + // Active learning data sampling config. For every active learning labeling + // iteration, it will select a batch of data based on the sampling strategy. + SampleConfig sample_config = 3; + + // CMLE training config. For every active learning labeling iteration, system + // will train a machine learning model on CMLE. The trained model will be used + // by data sampling algorithm to select DataItems. + TrainingConfig training_config = 4; +} + +// Active learning data sampling config. For every active learning labeling +// iteration, it will select a batch of data based on the sampling strategy. +message SampleConfig { + // Sample strategy decides which subset of DataItems should be selected for + // human labeling in every batch. + enum SampleStrategy { + // Default will be treated as UNCERTAINTY. + SAMPLE_STRATEGY_UNSPECIFIED = 0; + + // Sample the most uncertain data to label. + UNCERTAINTY = 1; + } + + // Decides sample size for the initial batch. initial_batch_sample_percentage + // is used by default. + oneof initial_batch_sample_size { + // The percentage of data needed to be labeled in the first batch. + int32 initial_batch_sample_percentage = 1; + } + + // Decides sample size for the following batches. + // following_batch_sample_percentage is used by default. + oneof following_batch_sample_size { + // The percentage of data needed to be labeled in each following batch + // (except the first batch). + int32 following_batch_sample_percentage = 3; + } + + // Field to choose sampling strategy. Sampling strategy will decide which data + // should be selected for human labeling in every batch. + SampleStrategy sample_strategy = 5; +} + +// CMLE training config. For every active learning labeling iteration, system +// will train a machine learning model on CMLE. The trained model will be used +// by data sampling algorithm to select DataItems. +message TrainingConfig { + // The timeout hours for the CMLE training job, expressed in milli hours + // i.e. 1,000 value in this field means 1 hour. + int64 timeout_training_milli_hours = 1; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto new file mode 100644 index 00000000..5d1f197f --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto @@ -0,0 +1,144 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1beta1/io.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "DatasetProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A collection of DataItems and Annotations on them. +message Dataset { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Dataset" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}" + }; + + // Output only. The resource name of the Dataset. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The user-defined name of the Dataset. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the Dataset. + string description = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Points to a YAML file stored on Google Cloud Storage describing additional + // information about the Dataset. + // The schema is defined as an OpenAPI 3.0.2 Schema Object. + // The schema files that can be used here are found in + // gs://google-cloud-aiplatform/schema/dataset/metadata/. + string metadata_schema_uri = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Additional information about the Dataset. + google.protobuf.Value metadata = 8 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Timestamp when this Dataset was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Dataset was last updated. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 6; + + // The labels with user-defined metadata to organize your Datasets. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one Dataset (System + // labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. Following system labels exist for each Dataset: + // + // * "aiplatform.googleapis.com/dataset_metadata_schema": output only, its + // value is the [metadata_schema's][google.cloud.aiplatform.v1beta1.Dataset.metadata_schema_uri] title. + map labels = 7; + + // Customer-managed encryption key spec for a Dataset. If set, this Dataset + // and all sub-resources of this Dataset will be secured by this key. + EncryptionSpec encryption_spec = 11; +} + +// Describes the location from where we import data into a Dataset, together +// with the labels that will be applied to the DataItems and the Annotations. +message ImportDataConfig { + // The source of the input. + oneof source { + // The Google Cloud Storage location for the input content. + GcsSource gcs_source = 1; + } + + // Labels that will be applied to newly imported DataItems. If an identical + // DataItem as one being imported already exists in the Dataset, then these + // labels will be appended to these of the already existing one, and if labels + // with identical key is imported before, the old label value will be + // overwritten. If two DataItems are identical in the same import data + // operation, the labels will be combined and if key collision happens in this + // case, one of the values will be picked randomly. Two DataItems are + // considered identical if their content bytes are identical (e.g. image bytes + // or pdf bytes). + // These labels will be overridden by Annotation labels specified inside index + // file referenced by [import_schema_uri][google.cloud.aiplatform.v1beta1.ImportDataConfig.import_schema_uri], e.g. jsonl file. + map data_item_labels = 2; + + // Required. Points to a YAML file stored on Google Cloud Storage describing the import + // format. Validation will be done against the schema. The schema is defined + // as an [OpenAPI 3.0.2 Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + string import_schema_uri = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Describes what part of the Dataset is to be exported, the destination of +// the export and how to export. +message ExportDataConfig { + // The destination of the output. + oneof destination { + // The Google Cloud Storage location where the output is to be written to. + // In the given directory a new directory will be created with name: + // `export-data--` where + // timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export + // output will be written into that directory. Inside that directory, + // annotations with the same schema will be grouped into sub directories + // which are named with the corresponding annotations' schema title. Inside + // these sub directories, a schema.yaml will be created to describe the + // output format. + GcsDestination gcs_destination = 1; + } + + // A filter on Annotations of the Dataset. Only Annotations on to-be-exported + // DataItems(specified by [data_items_filter][]) that match this filter will + // be exported. The filter syntax is the same as in + // [ListAnnotations][google.cloud.aiplatform.v1beta1.DatasetService.ListAnnotations]. + string annotations_filter = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset_service.proto new file mode 100644 index 00000000..92bb4628 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset_service.proto @@ -0,0 +1,412 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/annotation.proto"; +import "google/cloud/aiplatform/v1beta1/annotation_spec.proto"; +import "google/cloud/aiplatform/v1beta1/data_item.proto"; +import "google/cloud/aiplatform/v1beta1/dataset.proto"; +import "google/cloud/aiplatform/v1beta1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "DatasetServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// The service that handles the CRUD of Vertex AI Dataset and its child +// resources. +service DatasetService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a Dataset. + rpc CreateDataset(CreateDatasetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/datasets" + body: "dataset" + }; + option (google.api.method_signature) = "parent,dataset"; + option (google.longrunning.operation_info) = { + response_type: "Dataset" + metadata_type: "CreateDatasetOperationMetadata" + }; + } + + // Gets a Dataset. + rpc GetDataset(GetDatasetRequest) returns (Dataset) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/datasets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a Dataset. + rpc UpdateDataset(UpdateDatasetRequest) returns (Dataset) { + option (google.api.http) = { + patch: "/v1beta1/{dataset.name=projects/*/locations/*/datasets/*}" + body: "dataset" + }; + option (google.api.method_signature) = "dataset,update_mask"; + } + + // Lists Datasets in a Location. + rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/datasets" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a Dataset. + rpc DeleteDataset(DeleteDatasetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/datasets/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Imports data into a Dataset. + rpc ImportData(ImportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/datasets/*}:import" + body: "*" + }; + option (google.api.method_signature) = "name,import_configs"; + option (google.longrunning.operation_info) = { + response_type: "ImportDataResponse" + metadata_type: "ImportDataOperationMetadata" + }; + } + + // Exports data from a Dataset. + rpc ExportData(ExportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/datasets/*}:export" + body: "*" + }; + option (google.api.method_signature) = "name,export_config"; + option (google.longrunning.operation_info) = { + response_type: "ExportDataResponse" + metadata_type: "ExportDataOperationMetadata" + }; + } + + // Lists DataItems in a Dataset. + rpc ListDataItems(ListDataItemsRequest) returns (ListDataItemsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/datasets/*}/dataItems" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets an AnnotationSpec. + rpc GetAnnotationSpec(GetAnnotationSpecRequest) returns (AnnotationSpec) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Annotations belongs to a dataitem + rpc ListAnnotations(ListAnnotationsRequest) returns (ListAnnotationsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/datasets/*/dataItems/*}/annotations" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for [DatasetService.CreateDataset][google.cloud.aiplatform.v1beta1.DatasetService.CreateDataset]. +message CreateDatasetRequest { + // Required. The resource name of the Location to create the Dataset in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The Dataset to create. + Dataset dataset = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Runtime operation information for [DatasetService.CreateDataset][google.cloud.aiplatform.v1beta1.DatasetService.CreateDataset]. +message CreateDatasetOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [DatasetService.GetDataset][google.cloud.aiplatform.v1beta1.DatasetService.GetDataset]. +message GetDatasetRequest { + // Required. The name of the Dataset resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + } + ]; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 2; +} + +// Request message for [DatasetService.UpdateDataset][google.cloud.aiplatform.v1beta1.DatasetService.UpdateDataset]. +message UpdateDatasetRequest { + // Required. The Dataset which replaces the resource on the server. + Dataset dataset = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. + // For the `FieldMask` definition, see [google.protobuf.FieldMask][google.protobuf.FieldMask]. + // Updatable fields: + // + // * `display_name` + // * `description` + // * `labels` + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [DatasetService.ListDatasets][google.cloud.aiplatform.v1beta1.DatasetService.ListDatasets]. +message ListDatasetsRequest { + // Required. The name of the Dataset's parent resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // An expression for filtering the results of the request. For field names + // both snake_case and camelCase are supported. + // + // * `display_name`: supports = and != + // * `metadata_schema_uri`: supports = and != + // * `labels` supports general map functions that is: + // * `labels.key=value` - key:value equality + // * `labels.key:* or labels:key - key existence + // * A key including a space must be quoted. `labels."a key"`. + // + // Some examples: + // * `displayName="myDisplayName"` + // * `labels.myKey="myValue"` + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; + + // A comma-separated list of fields to order by, sorted in ascending order. + // Use "desc" after a field name for descending. + // Supported fields: + // * `display_name` + // * `create_time` + // * `update_time` + string order_by = 6; +} + +// Response message for [DatasetService.ListDatasets][google.cloud.aiplatform.v1beta1.DatasetService.ListDatasets]. +message ListDatasetsResponse { + // A list of Datasets that matches the specified filter in the request. + repeated Dataset datasets = 1; + + // The standard List next-page token. + string next_page_token = 2; +} + +// Request message for [DatasetService.DeleteDataset][google.cloud.aiplatform.v1beta1.DatasetService.DeleteDataset]. +message DeleteDatasetRequest { + // Required. The resource name of the Dataset to delete. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + } + ]; +} + +// Request message for [DatasetService.ImportData][google.cloud.aiplatform.v1beta1.DatasetService.ImportData]. +message ImportDataRequest { + // Required. The name of the Dataset resource. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + } + ]; + + // Required. The desired input locations. The contents of all input locations will be + // imported in one batch. + repeated ImportDataConfig import_configs = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [DatasetService.ImportData][google.cloud.aiplatform.v1beta1.DatasetService.ImportData]. +message ImportDataResponse { + +} + +// Runtime operation information for [DatasetService.ImportData][google.cloud.aiplatform.v1beta1.DatasetService.ImportData]. +message ImportDataOperationMetadata { + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [DatasetService.ExportData][google.cloud.aiplatform.v1beta1.DatasetService.ExportData]. +message ExportDataRequest { + // Required. The name of the Dataset resource. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + } + ]; + + // Required. The desired output location. + ExportDataConfig export_config = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [DatasetService.ExportData][google.cloud.aiplatform.v1beta1.DatasetService.ExportData]. +message ExportDataResponse { + // All of the files that are exported in this export operation. + repeated string exported_files = 1; +} + +// Runtime operation information for [DatasetService.ExportData][google.cloud.aiplatform.v1beta1.DatasetService.ExportData]. +message ExportDataOperationMetadata { + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; + + // A Google Cloud Storage directory which path ends with '/'. The exported + // data is stored in the directory. + string gcs_output_directory = 2; +} + +// Request message for [DatasetService.ListDataItems][google.cloud.aiplatform.v1beta1.DatasetService.ListDataItems]. +message ListDataItemsRequest { + // Required. The resource name of the Dataset to list DataItems from. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + } + ]; + + // The standard list filter. + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; + + // A comma-separated list of fields to order by, sorted in ascending order. + // Use "desc" after a field name for descending. + string order_by = 6; +} + +// Response message for [DatasetService.ListDataItems][google.cloud.aiplatform.v1beta1.DatasetService.ListDataItems]. +message ListDataItemsResponse { + // A list of DataItems that matches the specified filter in the request. + repeated DataItem data_items = 1; + + // The standard List next-page token. + string next_page_token = 2; +} + +// Request message for [DatasetService.GetAnnotationSpec][google.cloud.aiplatform.v1beta1.DatasetService.GetAnnotationSpec]. +message GetAnnotationSpecRequest { + // Required. The name of the AnnotationSpec resource. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/AnnotationSpec" + } + ]; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 2; +} + +// Request message for [DatasetService.ListAnnotations][google.cloud.aiplatform.v1beta1.DatasetService.ListAnnotations]. +message ListAnnotationsRequest { + // Required. The resource name of the DataItem to list Annotations from. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/DataItem" + } + ]; + + // The standard list filter. + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; + + // A comma-separated list of fields to order by, sorted in ascending order. + // Use "desc" after a field name for descending. + string order_by = 6; +} + +// Response message for [DatasetService.ListAnnotations][google.cloud.aiplatform.v1beta1.DatasetService.ListAnnotations]. +message ListAnnotationsResponse { + // A list of Annotations that matches the specified filter in the request. + repeated Annotation annotations = 1; + + // The standard List next-page token. + string next_page_token = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto new file mode 100644 index 00000000..fd20f4d6 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto @@ -0,0 +1,42 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "DeployedIndexRefProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Points to a DeployedIndex. +message DeployedIndexRef { + // Immutable. A resource name of the IndexEndpoint. + string index_endpoint = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/IndexEndpoint" + } + ]; + + // Immutable. The ID of the DeployedIndex in the above IndexEndpoint. + string deployed_index_id = 2 [(google.api.field_behavior) = IMMUTABLE]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto new file mode 100644 index 00000000..337ba55e --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto @@ -0,0 +1,42 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "DeployedModelNameProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Points to a DeployedModel. +message DeployedModelRef { + // Immutable. A resource name of an Endpoint. + string endpoint = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Immutable. An ID of a DeployedModel in the above Endpoint. + string deployed_model_id = 2 [(google.api.field_behavior) = IMMUTABLE]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto new file mode 100644 index 00000000..27e2bade --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto @@ -0,0 +1,38 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "EncryptionSpecProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Represents a customer-managed encryption key spec that can be applied to +// a top-level resource. +message EncryptionSpec { + // Required. The Cloud KMS resource identifier of the customer managed encryption key + // used to protect a resource. Has the form: + // `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. + // The key needs to be in the same region as where the compute resource is + // created. + string kms_key_name = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto new file mode 100644 index 00000000..b2d12694 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto @@ -0,0 +1,252 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1beta1/explanation.proto"; +import "google/cloud/aiplatform/v1beta1/io.proto"; +import "google/cloud/aiplatform/v1beta1/machine_resources.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "EndpointProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Models are deployed into it, and afterwards Endpoint is called to obtain +// predictions and explanations. +message Endpoint { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Endpoint" + pattern: "projects/{project}/locations/{location}/endpoints/{endpoint}" + }; + + // Output only. The resource name of the Endpoint. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the Endpoint. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the Endpoint. + string description = 3; + + // Output only. The models deployed in this Endpoint. + // To add or remove DeployedModels use [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel] and + // [EndpointService.UndeployModel][google.cloud.aiplatform.v1beta1.EndpointService.UndeployModel] respectively. + repeated DeployedModel deployed_models = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A map from a DeployedModel's ID to the percentage of this Endpoint's + // traffic that should be forwarded to that DeployedModel. + // + // If a DeployedModel's ID is not listed in this map, then it receives no + // traffic. + // + // The traffic percentage values must add up to 100, or map must be empty if + // the Endpoint is to not accept any traffic at a moment. + map traffic_split = 5; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 6; + + // The labels with user-defined metadata to organize your Endpoints. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 7; + + // Output only. Timestamp when this Endpoint was created. + google.protobuf.Timestamp create_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Endpoint was last updated. + google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Customer-managed encryption key spec for an Endpoint. If set, this + // Endpoint and all sub-resources of this Endpoint will be secured by + // this key. + EncryptionSpec encryption_spec = 10; + + // The full name of the Google Compute Engine + // [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks) + // to which the Endpoint should be peered. + // + // Private services access must already be configured for the network. If left + // unspecified, the Endpoint is not peered with any network. + // + // Only one of the fields, [network][google.cloud.aiplatform.v1beta1.Endpoint.network] or + // [enable_private_service_connect][google.cloud.aiplatform.v1beta1.Endpoint.enable_private_service_connect], + // can be set. + // + // [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert): + // `projects/{project}/global/networks/{network}`. + // Where `{project}` is a project number, as in `12345`, and `{network}` is + // network name. + string network = 13 [(google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + }]; + + // Deprecated: If true, expose the Endpoint via private service connect. + // + // Only one of the fields, [network][google.cloud.aiplatform.v1beta1.Endpoint.network] or + // [enable_private_service_connect][google.cloud.aiplatform.v1beta1.Endpoint.enable_private_service_connect], + // can be set. + bool enable_private_service_connect = 17 [deprecated = true]; + + // Output only. Resource name of the Model Monitoring job associated with this Endpoint + // if monitoring is enabled by [CreateModelDeploymentMonitoringJob][]. + // Format: + // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + string model_deployment_monitoring_job = 14 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" + } + ]; + + // Configures the request-response logging for online prediction. + PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; +} + +// A deployment of a Model. Endpoints contain one or more DeployedModels. +message DeployedModel { + // The prediction (for example, the machine) resources that the DeployedModel + // uses. The user is billed for the resources (at least their minimal amount) + // even if the DeployedModel receives no traffic. + // Not all Models support all resources types. See + // [Model.supported_deployment_resources_types][google.cloud.aiplatform.v1beta1.Model.supported_deployment_resources_types]. + oneof prediction_resources { + // A description of resources that are dedicated to the DeployedModel, and + // that need a higher degree of manual configuration. + DedicatedResources dedicated_resources = 7; + + // A description of resources that to large degree are decided by Vertex + // AI, and require only a modest additional configuration. + AutomaticResources automatic_resources = 8; + } + + // Immutable. The ID of the DeployedModel. If not provided upon deployment, Vertex AI + // will generate a value for this ID. + // + // This value should be 1-10 characters, and valid characters are /[0-9]/. + string id = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. The name of the Model that this is the deployment of. Note that the Model + // may be in a different location than the DeployedModel's Endpoint. + string model = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // Output only. The version ID of the model that is deployed. + string model_version_id = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The display name of the DeployedModel. If not provided upon creation, + // the Model's display_name is used. + string display_name = 3; + + // Output only. Timestamp when the DeployedModel was created. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Explanation configuration for this DeployedModel. + // + // When deploying a Model using [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel], this value + // overrides the value of [Model.explanation_spec][google.cloud.aiplatform.v1beta1.Model.explanation_spec]. All fields of + // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] are optional in the request. If a field of + // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] is not populated, the value of the same field of + // [Model.explanation_spec][google.cloud.aiplatform.v1beta1.Model.explanation_spec] is inherited. If the corresponding + // [Model.explanation_spec][google.cloud.aiplatform.v1beta1.Model.explanation_spec] is not populated, all fields of the + // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] will be used for the explanation configuration. + ExplanationSpec explanation_spec = 9; + + // The service account that the DeployedModel's container runs as. Specify the + // email address of the service account. If this service account is not + // specified, the container runs as a service account that doesn't have access + // to the resource project. + // + // Users deploying the Model must have the `iam.serviceAccounts.actAs` + // permission on this service account. + string service_account = 11; + + // If true, the container of the DeployedModel instances will send `stderr` + // and `stdout` streams to Stackdriver Logging. + // + // Only supported for custom-trained Models and AutoML Tabular Models. + bool enable_container_logging = 12; + + // These logs are like standard server access logs, containing + // information like timestamp and latency for each prediction request. + // + // Note that Stackdriver logs may incur a cost, especially if your project + // receives prediction requests at a high queries per second rate (QPS). + // Estimate your costs before enabling this option. + bool enable_access_logging = 13; + + // Output only. Provide paths for users to send predict/explain/health requests directly to + // the deployed model services running on Cloud via private services access. + // This field is populated if [network][google.cloud.aiplatform.v1beta1.Endpoint.network] is configured. + PrivateEndpoints private_endpoints = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// PrivateEndpoints proto is used to provide paths for users to send +// requests privately. +// To send request via private service access, use predict_http_uri, +// explain_http_uri or health_http_uri. To send request via private service +// connect, use service_attachment. +message PrivateEndpoints { + // Output only. Http(s) path to send prediction requests. + string predict_http_uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Http(s) path to send explain requests. + string explain_http_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Http(s) path to send health check requests. + string health_http_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the service attachment resource. Populated if private service + // connect is enabled. + string service_attachment = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Configuration for logging request-response to a BigQuery table. +message PredictRequestResponseLoggingConfig { + // If logging is enabled or not. + bool enabled = 1; + + // Percentage of requests to be logged, expressed as a fraction in + // range(0,1]. + double sampling_rate = 2; + + // BigQuery table for logging. + // If only given a project, a new dataset will be created with name + // `logging__` where + // will be made BigQuery-dataset-name compatible (e.g. + // most special characters will become underscores). If no table name is + // given, a new table will be created with name `request_response_logging` + BigQueryDestination bigquery_destination = 3; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto new file mode 100644 index 00000000..e30077dc --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto @@ -0,0 +1,315 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/endpoint.proto"; +import "google/cloud/aiplatform/v1beta1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "EndpointServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A service for managing Vertex AI's Endpoints. +service EndpointService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates an Endpoint. + rpc CreateEndpoint(CreateEndpointRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/endpoints" + body: "endpoint" + }; + option (google.api.method_signature) = "parent,endpoint"; + option (google.api.method_signature) = "parent,endpoint,endpoint_id"; + option (google.longrunning.operation_info) = { + response_type: "Endpoint" + metadata_type: "CreateEndpointOperationMetadata" + }; + } + + // Gets an Endpoint. + rpc GetEndpoint(GetEndpointRequest) returns (Endpoint) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/endpoints/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Endpoints in a Location. + rpc ListEndpoints(ListEndpointsRequest) returns (ListEndpointsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/endpoints" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates an Endpoint. + rpc UpdateEndpoint(UpdateEndpointRequest) returns (Endpoint) { + option (google.api.http) = { + patch: "/v1beta1/{endpoint.name=projects/*/locations/*/endpoints/*}" + body: "endpoint" + }; + option (google.api.method_signature) = "endpoint,update_mask"; + } + + // Deletes an Endpoint. + rpc DeleteEndpoint(DeleteEndpointRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/endpoints/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Deploys a Model into this Endpoint, creating a DeployedModel within it. + rpc DeployModel(DeployModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:deployModel" + body: "*" + }; + option (google.api.method_signature) = "endpoint,deployed_model,traffic_split"; + option (google.longrunning.operation_info) = { + response_type: "DeployModelResponse" + metadata_type: "DeployModelOperationMetadata" + }; + } + + // Undeploys a Model from an Endpoint, removing a DeployedModel from it, and + // freeing all resources it's using. + rpc UndeployModel(UndeployModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:undeployModel" + body: "*" + }; + option (google.api.method_signature) = "endpoint,deployed_model_id,traffic_split"; + option (google.longrunning.operation_info) = { + response_type: "UndeployModelResponse" + metadata_type: "UndeployModelOperationMetadata" + }; + } +} + +// Request message for [EndpointService.CreateEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.CreateEndpoint]. +message CreateEndpointRequest { + // Required. The resource name of the Location to create the Endpoint in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The Endpoint to create. + Endpoint endpoint = 2 [(google.api.field_behavior) = REQUIRED]; + + // Immutable. The ID to use for endpoint, which will become the final + // component of the endpoint resource name. + // If not provided, Vertex AI will generate a value for this ID. + // + // This value should be 1-10 characters, and valid characters are /[0-9]/. + // When using HTTP/JSON, this field is populated based on a query string + // argument, such as `?endpoint_id=12345`. This is the fallback for fields + // that are not included in either the URI or the body. + string endpoint_id = 4 [(google.api.field_behavior) = IMMUTABLE]; +} + +// Runtime operation information for [EndpointService.CreateEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.CreateEndpoint]. +message CreateEndpointOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [EndpointService.GetEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.GetEndpoint] +message GetEndpointRequest { + // Required. The name of the Endpoint resource. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; +} + +// Request message for [EndpointService.ListEndpoints][google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints]. +message ListEndpointsRequest { + // Required. The resource name of the Location from which to list the Endpoints. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. An expression for filtering the results of the request. For field names + // both snake_case and camelCase are supported. + // + // * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID, + // i.e. the last segment of the Endpoint's [resource name][google.cloud.aiplatform.v1beta1.Endpoint.name]. + // * `display_name` supports = and, != + // * `labels` supports general map functions that is: + // * `labels.key=value` - key:value equality + // * `labels.key:* or labels:key - key existence + // * A key including a space must be quoted. `labels."a key"`. + // + // Some examples: + // * `endpoint=1` + // * `displayName="myDisplayName"` + // * `labels.myKey="myValue"` + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page size. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page token. + // Typically obtained via + // [ListEndpointsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListEndpointsResponse.next_page_token] of the previous + // [EndpointService.ListEndpoints][google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints] call. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [EndpointService.ListEndpoints][google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints]. +message ListEndpointsResponse { + // List of Endpoints in the requested page. + repeated Endpoint endpoints = 1; + + // A token to retrieve the next page of results. + // Pass to [ListEndpointsRequest.page_token][google.cloud.aiplatform.v1beta1.ListEndpointsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.UpdateEndpoint]. +message UpdateEndpointRequest { + // Required. The Endpoint which replaces the resource on the server. + Endpoint endpoint = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. See [google.protobuf.FieldMask][google.protobuf.FieldMask]. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [EndpointService.DeleteEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.DeleteEndpoint]. +message DeleteEndpointRequest { + // Required. The name of the Endpoint resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; +} + +// Request message for [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel]. +message DeployModelRequest { + // Required. The name of the Endpoint resource into which to deploy a Model. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Required. The DeployedModel to be created within the Endpoint. Note that + // [Endpoint.traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] must be updated for the DeployedModel to start + // receiving traffic, either as part of this call, or via + // [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.UpdateEndpoint]. + DeployedModel deployed_model = 2 [(google.api.field_behavior) = REQUIRED]; + + // A map from a DeployedModel's ID to the percentage of this Endpoint's + // traffic that should be forwarded to that DeployedModel. + // + // If this field is non-empty, then the Endpoint's + // [traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] will be overwritten with it. + // To refer to the ID of the just being deployed Model, a "0" should be used, + // and the actual ID of the new DeployedModel will be filled in its place by + // this method. The traffic percentage values must add up to 100. + // + // If this field is empty, then the Endpoint's + // [traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] is not updated. + map traffic_split = 3; +} + +// Response message for [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel]. +message DeployModelResponse { + // The DeployedModel that had been deployed in the Endpoint. + DeployedModel deployed_model = 1; +} + +// Runtime operation information for [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel]. +message DeployModelOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [EndpointService.UndeployModel][google.cloud.aiplatform.v1beta1.EndpointService.UndeployModel]. +message UndeployModelRequest { + // Required. The name of the Endpoint resource from which to undeploy a Model. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Required. The ID of the DeployedModel to be undeployed from the Endpoint. + string deployed_model_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // If this field is provided, then the Endpoint's + // [traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] will be overwritten with it. If + // last DeployedModel is being undeployed from the Endpoint, the + // [Endpoint.traffic_split] will always end up empty when this call returns. + // A DeployedModel will be successfully undeployed only if it doesn't have + // any traffic assigned to it when this method executes, or if this field + // unassigns any traffic to it. + map traffic_split = 3; +} + +// Response message for [EndpointService.UndeployModel][google.cloud.aiplatform.v1beta1.EndpointService.UndeployModel]. +message UndeployModelResponse { + +} + +// Runtime operation information for [EndpointService.UndeployModel][google.cloud.aiplatform.v1beta1.EndpointService.UndeployModel]. +message UndeployModelOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/entity_type.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/entity_type.proto new file mode 100644 index 00000000..14f762ba --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/entity_type.proto @@ -0,0 +1,86 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "EntityTypeProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// An entity type is a type of object in a system that needs to be modeled and +// have stored information about. For example, driver is an entity type, and +// driver0 is an instance of an entity type driver. +message EntityType { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/EntityType" + pattern: "projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}" + }; + + // Immutable. Name of the EntityType. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + // + // The last part entity_type is assigned by the client. The entity_type can be + // up to 64 characters long and can consist only of ASCII Latin letters A-Z + // and a-z and underscore(_), and ASCII digits 0-9 starting with a letter. The + // value will be unique given a featurestore. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Optional. Description of the EntityType. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when this EntityType was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this EntityType was most recently updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The labels with user-defined metadata to organize your EntityTypes. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + // No more than 64 user labels can be associated with one EntityType (System + // labels are excluded)." + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Used to perform a consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The default monitoring configuration for all Features with value type + // ([Feature.ValueType][google.cloud.aiplatform.v1beta1.Feature.ValueType]) BOOL, STRING, DOUBLE or INT64 under this + // EntityType. + // + // If this is populated with + // [FeaturestoreMonitoringConfig.monitoring_interval] specified, snapshot + // analysis monitoring is enabled. Otherwise, snapshot analysis monitoring is + // disabled. + FeaturestoreMonitoringConfig monitoring_config = 8 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/env_var.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/env_var.proto new file mode 100644 index 00000000..5e1d677b --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/env_var.proto @@ -0,0 +1,42 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "EnvVarProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Represents an environment variable present in a Container or Python Module. +message EnvVar { + // Required. Name of the environment variable. Must be a valid C identifier. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Variables that reference a $(VAR_NAME) are expanded + // using the previous defined environment variables in the container and + // any service environment variables. If a variable cannot be resolved, + // the reference in the input string will be unchanged. The $(VAR_NAME) + // syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped + // references will never be expanded, regardless of whether the variable + // exists or not. + string value = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/event.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/event.proto new file mode 100644 index 00000000..5cbb25c8 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/event.proto @@ -0,0 +1,80 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "EventProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// An edge describing the relationship between an Artifact and an Execution in +// a lineage graph. +message Event { + // Describes whether an Event's Artifact is the Execution's input or output. + enum Type { + // Unspecified whether input or output of the Execution. + TYPE_UNSPECIFIED = 0; + + // An input of the Execution. + INPUT = 1; + + // An output of the Execution. + OUTPUT = 2; + } + + // Required. The relative resource name of the Artifact in the Event. + string artifact = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Artifact" + } + ]; + + // Output only. The relative resource name of the Execution in the Event. + string execution = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Execution" + } + ]; + + // Output only. Time the Event occurred. + google.protobuf.Timestamp event_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The type of the Event. + Type type = 4 [(google.api.field_behavior) = REQUIRED]; + + // The labels with user-defined metadata to annotate Events. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one Event (System + // labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. + map labels = 5; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/execution.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/execution.proto new file mode 100644 index 00000000..74395db9 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/execution.proto @@ -0,0 +1,115 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ExecutionProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Instance of a general execution. +message Execution { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Execution" + pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}" + }; + + // Describes the state of the Execution. + enum State { + // Unspecified Execution state + STATE_UNSPECIFIED = 0; + + // The Execution is new + NEW = 1; + + // The Execution is running + RUNNING = 2; + + // The Execution has finished running + COMPLETE = 3; + + // The Execution has failed + FAILED = 4; + + // The Execution completed through Cache hit. + CACHED = 5; + + // The Execution was cancelled. + CANCELLED = 6; + } + + // Output only. The resource name of the Execution. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User provided display name of the Execution. + // May be up to 128 Unicode characters. + string display_name = 2; + + // The state of this Execution. This is a property of the Execution, and does + // not imply or capture any ongoing process. This property is managed by + // clients (such as Vertex AI Pipelines) and the system does not prescribe + // or check the validity of state transitions. + State state = 6; + + // An eTag used to perform consistent read-modify-write updates. If not set, a + // blind "overwrite" update happens. + string etag = 9; + + // The labels with user-defined metadata to organize your Executions. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one Execution (System + // labels are excluded). + map labels = 10; + + // Output only. Timestamp when this Execution was created. + google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Execution was last updated. + google.protobuf.Timestamp update_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The title of the schema describing the metadata. + // + // Schema title and version is expected to be registered in earlier Create + // Schema calls. And both are used together as unique identifiers to identify + // schemas within the local metadata store. + string schema_title = 13; + + // The version of the schema in `schema_title` to use. + // + // Schema title and version is expected to be registered in earlier Create + // Schema calls. And both are used together as unique identifiers to identify + // schemas within the local metadata store. + string schema_version = 14; + + // Properties of the Execution. + // The size of this field should not exceed 200KB. + google.protobuf.Struct metadata = 15; + + // Description of the Execution + string description = 16; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto new file mode 100644 index 00000000..11e4c6c5 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto @@ -0,0 +1,520 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/cloud/aiplatform/v1beta1/explanation_metadata.proto"; +import "google/cloud/aiplatform/v1beta1/io.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ExplanationProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Explanation of a prediction (provided in [PredictResponse.predictions][google.cloud.aiplatform.v1beta1.PredictResponse.predictions]) +// produced by the Model on a given [instance][google.cloud.aiplatform.v1beta1.ExplainRequest.instances]. +message Explanation { + // Output only. Feature attributions grouped by predicted outputs. + // + // For Models that predict only one output, such as regression Models that + // predict only one score, there is only one attibution that explains the + // predicted output. For Models that predict multiple outputs, such as + // multiclass Models that predict multiple classes, each element explains one + // specific item. [Attribution.output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index] can be used to identify which + // output this attribution is explaining. + // + // If users set [ExplanationParameters.top_k][google.cloud.aiplatform.v1beta1.ExplanationParameters.top_k], the attributions are sorted + // by [instance_output_value][Attributions.instance_output_value] in + // descending order. If [ExplanationParameters.output_indices][google.cloud.aiplatform.v1beta1.ExplanationParameters.output_indices] is specified, + // the attributions are stored by [Attribution.output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index] in the same + // order as they appear in the output_indices. + repeated Attribution attributions = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of the nearest neighbors for example-based explanations. + // + // For models deployed with the examples explanations feature enabled, the + // attributions field is empty and instead the neighbors field is populated. + repeated Neighbor neighbors = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Aggregated explanation metrics for a Model over a set of instances. +message ModelExplanation { + // Output only. Aggregated attributions explaining the Model's prediction outputs over the + // set of instances. The attributions are grouped by outputs. + // + // For Models that predict only one output, such as regression Models that + // predict only one score, there is only one attibution that explains the + // predicted output. For Models that predict multiple outputs, such as + // multiclass Models that predict multiple classes, each element explains one + // specific item. [Attribution.output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index] can be used to identify which + // output this attribution is explaining. + // + // The [baselineOutputValue][google.cloud.aiplatform.v1beta1.Attribution.baseline_output_value], + // [instanceOutputValue][google.cloud.aiplatform.v1beta1.Attribution.instance_output_value] and + // [featureAttributions][google.cloud.aiplatform.v1beta1.Attribution.feature_attributions] fields are + // averaged over the test data. + // + // NOTE: Currently AutoML tabular classification Models produce only one + // attribution, which averages attributions over all the classes it predicts. + // [Attribution.approximation_error][google.cloud.aiplatform.v1beta1.Attribution.approximation_error] is not populated. + repeated Attribution mean_attributions = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Attribution that explains a particular prediction output. +message Attribution { + // Output only. Model predicted output if the input instance is constructed from the + // baselines of all the features defined in [ExplanationMetadata.inputs][google.cloud.aiplatform.v1beta1.ExplanationMetadata.inputs]. + // The field name of the output is determined by the key in + // [ExplanationMetadata.outputs][google.cloud.aiplatform.v1beta1.ExplanationMetadata.outputs]. + // + // If the Model's predicted output has multiple dimensions (rank > 1), this is + // the value in the output located by [output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index]. + // + // If there are multiple baselines, their output values are averaged. + double baseline_output_value = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Model predicted output on the corresponding [explanation + // instance][ExplainRequest.instances]. The field name of the output is + // determined by the key in [ExplanationMetadata.outputs][google.cloud.aiplatform.v1beta1.ExplanationMetadata.outputs]. + // + // If the Model predicted output has multiple dimensions, this is the value in + // the output located by [output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index]. + double instance_output_value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Attributions of each explained feature. Features are extracted from + // the [prediction instances][google.cloud.aiplatform.v1beta1.ExplainRequest.instances] according to + // [explanation metadata for inputs][google.cloud.aiplatform.v1beta1.ExplanationMetadata.inputs]. + // + // The value is a struct, whose keys are the name of the feature. The values + // are how much the feature in the [instance][google.cloud.aiplatform.v1beta1.ExplainRequest.instances] + // contributed to the predicted result. + // + // The format of the value is determined by the feature's input format: + // + // * If the feature is a scalar value, the attribution value is a + // [floating number][google.protobuf.Value.number_value]. + // + // * If the feature is an array of scalar values, the attribution value is + // an [array][google.protobuf.Value.list_value]. + // + // * If the feature is a struct, the attribution value is a + // [struct][google.protobuf.Value.struct_value]. The keys in the + // attribution value struct are the same as the keys in the feature + // struct. The formats of the values in the attribution struct are + // determined by the formats of the values in the feature struct. + // + // The [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.aiplatform.v1beta1.ExplanationMetadata.feature_attributions_schema_uri] field, + // pointed to by the [ExplanationSpec][google.cloud.aiplatform.v1beta1.ExplanationSpec] field of the + // [Endpoint.deployed_models][google.cloud.aiplatform.v1beta1.Endpoint.deployed_models] object, points to the schema file that + // describes the features and their attribution values (if it is populated). + google.protobuf.Value feature_attributions = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The index that locates the explained prediction output. + // + // If the prediction output is a scalar value, output_index is not populated. + // If the prediction output has multiple dimensions, the length of the + // output_index list is the same as the number of dimensions of the output. + // The i-th element in output_index is the element index of the i-th dimension + // of the output vector. Indices start from 0. + repeated int32 output_index = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The display name of the output identified by [output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index]. For example, + // the predicted class name by a multi-classification Model. + // + // This field is only populated iff the Model predicts display names as a + // separate field along with the explained output. The predicted display name + // must has the same shape of the explained output, and can be located using + // output_index. + string output_display_name = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Error of [feature_attributions][google.cloud.aiplatform.v1beta1.Attribution.feature_attributions] caused by approximation used in the + // explanation method. Lower value means more precise attributions. + // + // * For Sampled Shapley + // [attribution][google.cloud.aiplatform.v1beta1.ExplanationParameters.sampled_shapley_attribution], + // increasing [path_count][google.cloud.aiplatform.v1beta1.SampledShapleyAttribution.path_count] might reduce + // the error. + // * For Integrated Gradients + // [attribution][google.cloud.aiplatform.v1beta1.ExplanationParameters.integrated_gradients_attribution], + // increasing [step_count][google.cloud.aiplatform.v1beta1.IntegratedGradientsAttribution.step_count] might + // reduce the error. + // * For [XRAI attribution][google.cloud.aiplatform.v1beta1.ExplanationParameters.xrai_attribution], + // increasing + // [step_count][google.cloud.aiplatform.v1beta1.XraiAttribution.step_count] might reduce the error. + // + // See [this introduction](/vertex-ai/docs/explainable-ai/overview) + // for more information. + double approximation_error = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the explain output. Specified as the key in + // [ExplanationMetadata.outputs][google.cloud.aiplatform.v1beta1.ExplanationMetadata.outputs]. + string output_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Neighbors for example-based explanations. +message Neighbor { + // Output only. The neighbor id. + string neighbor_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The neighbor distance. + double neighbor_distance = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Specification of Model explanation. +message ExplanationSpec { + // Required. Parameters that configure explaining of the Model's predictions. + ExplanationParameters parameters = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Metadata describing the Model's input and output for explanation. + ExplanationMetadata metadata = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Parameters to configure explaining for Model's predictions. +message ExplanationParameters { + oneof method { + // An attribution method that approximates Shapley values for features that + // contribute to the label being predicted. A sampling strategy is used to + // approximate the value rather than considering all subsets of features. + // Refer to this paper for model details: https://arxiv.org/abs/1306.4265. + SampledShapleyAttribution sampled_shapley_attribution = 1; + + // An attribution method that computes Aumann-Shapley values taking + // advantage of the model's fully differentiable structure. Refer to this + // paper for more details: https://arxiv.org/abs/1703.01365 + IntegratedGradientsAttribution integrated_gradients_attribution = 2; + + // An attribution method that redistributes Integrated Gradients + // attribution to segmented regions, taking advantage of the model's fully + // differentiable structure. Refer to this paper for + // more details: https://arxiv.org/abs/1906.02825 + // + // XRAI currently performs better on natural images, like a picture of a + // house or an animal. If the images are taken in artificial environments, + // like a lab or manufacturing line, or from diagnostic equipment, like + // x-rays or quality-control cameras, use Integrated Gradients instead. + XraiAttribution xrai_attribution = 3; + + // Example-based explanations that returns the nearest neighbors from the + // provided dataset. + Examples examples = 7; + } + + // If populated, returns attributions for top K indices of outputs + // (defaults to 1). Only applies to Models that predicts more than one outputs + // (e,g, multi-class Models). When set to -1, returns explanations for all + // outputs. + int32 top_k = 4; + + // If populated, only returns attributions that have + // [output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index] contained in output_indices. It + // must be an ndarray of integers, with the same shape of the output it's + // explaining. + // + // 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 populated, returns the argmax + // index of the outputs. + // + // Only applicable to Models that predict multiple outputs (e,g, multi-class + // Models that predict multiple classes). + google.protobuf.ListValue output_indices = 5; +} + +// An attribution method that approximates Shapley values for features that +// contribute to the label being predicted. A sampling strategy is used to +// approximate the value rather than considering all subsets of features. +message SampledShapleyAttribution { + // Required. The number of feature permutations to consider when approximating the + // Shapley values. + // + // Valid range of its value is [1, 50], inclusively. + int32 path_count = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// An attribution method that computes the Aumann-Shapley value taking advantage +// of the model's fully differentiable structure. Refer to this paper for +// more details: https://arxiv.org/abs/1703.01365 +message IntegratedGradientsAttribution { + // Required. The number of steps for approximating the path integral. + // A good value to start is 50 and gradually increase until the + // sum to diff property is within the desired error range. + // + // Valid range of its value is [1, 100], inclusively. + int32 step_count = 1 [(google.api.field_behavior) = REQUIRED]; + + // Config for SmoothGrad approximation of gradients. + // + // When enabled, the gradients are approximated by averaging the gradients + // from noisy samples in the vicinity of the inputs. Adding + // noise can help improve the computed gradients. Refer to this paper for more + // details: https://arxiv.org/pdf/1706.03825.pdf + SmoothGradConfig smooth_grad_config = 2; + + // Config for IG with blur baseline. + // + // When enabled, a linear path from the maximally blurred image to the input + // image is created. Using a blurred baseline instead of zero (black image) is + // motivated by the BlurIG approach explained here: + // https://arxiv.org/abs/2004.03383 + BlurBaselineConfig blur_baseline_config = 3; +} + +// An explanation method that redistributes Integrated Gradients +// attributions to segmented regions, taking advantage of the model's fully +// differentiable structure. Refer to this paper for more details: +// https://arxiv.org/abs/1906.02825 +// +// Supported only by image Models. +message XraiAttribution { + // Required. The number of steps for approximating the path integral. + // A good value to start is 50 and gradually increase until the + // sum to diff property is met within the desired error range. + // + // Valid range of its value is [1, 100], inclusively. + int32 step_count = 1 [(google.api.field_behavior) = REQUIRED]; + + // Config for SmoothGrad approximation of gradients. + // + // When enabled, the gradients are approximated by averaging the gradients + // from noisy samples in the vicinity of the inputs. Adding + // noise can help improve the computed gradients. Refer to this paper for more + // details: https://arxiv.org/pdf/1706.03825.pdf + SmoothGradConfig smooth_grad_config = 2; + + // Config for XRAI with blur baseline. + // + // When enabled, a linear path from the maximally blurred image to the input + // image is created. Using a blurred baseline instead of zero (black image) is + // motivated by the BlurIG approach explained here: + // https://arxiv.org/abs/2004.03383 + BlurBaselineConfig blur_baseline_config = 3; +} + +// Config for SmoothGrad approximation of gradients. +// +// When enabled, the gradients are approximated by averaging the gradients from +// noisy samples in the vicinity of the inputs. Adding noise can help improve +// the computed gradients. Refer to this paper for more details: +// https://arxiv.org/pdf/1706.03825.pdf +message SmoothGradConfig { + // Represents the standard deviation of the gaussian kernel + // that will be used to add noise to the interpolated inputs + // prior to computing gradients. + oneof GradientNoiseSigma { + // This is a single float value and will be used to add noise to all the + // features. Use this field when all features are normalized to have the + // same distribution: scale to range [0, 1], [-1, 1] or z-scoring, where + // features are normalized to have 0-mean and 1-variance. Learn more about + // [normalization](https://developers.google.com/machine-learning/data-prep/transform/normalization). + // + // For best results the recommended value is about 10% - 20% of the standard + // deviation of the input feature. Refer to section 3.2 of the SmoothGrad + // paper: https://arxiv.org/pdf/1706.03825.pdf. Defaults to 0.1. + // + // If the distribution is different per feature, set + // [feature_noise_sigma][google.cloud.aiplatform.v1beta1.SmoothGradConfig.feature_noise_sigma] instead + // for each feature. + float noise_sigma = 1; + + // This is similar to [noise_sigma][google.cloud.aiplatform.v1beta1.SmoothGradConfig.noise_sigma], but + // provides additional flexibility. A separate noise sigma can be provided + // for each feature, which is useful if their distributions are different. + // No noise is added to features that are not set. If this field is unset, + // [noise_sigma][google.cloud.aiplatform.v1beta1.SmoothGradConfig.noise_sigma] will be used for all + // features. + FeatureNoiseSigma feature_noise_sigma = 2; + } + + // The number of gradient samples to use for + // approximation. The higher this number, the more accurate the gradient + // is, but the runtime complexity increases by this factor as well. + // Valid range of its value is [1, 50]. Defaults to 3. + int32 noisy_sample_count = 3; +} + +// Noise sigma by features. Noise sigma represents the standard deviation of the +// gaussian kernel that will be used to add noise to interpolated inputs prior +// to computing gradients. +message FeatureNoiseSigma { + // Noise sigma for a single feature. + message NoiseSigmaForFeature { + // The name of the input feature for which noise sigma is provided. The + // features are defined in + // [explanation metadata inputs][google.cloud.aiplatform.v1beta1.ExplanationMetadata.inputs]. + string name = 1; + + // This represents the standard deviation of the Gaussian kernel that will + // be used to add noise to the feature prior to computing gradients. Similar + // to [noise_sigma][google.cloud.aiplatform.v1beta1.SmoothGradConfig.noise_sigma] but represents the + // noise added to the current feature. Defaults to 0.1. + float sigma = 2; + } + + // Noise sigma per feature. No noise is added to features that are not set. + repeated NoiseSigmaForFeature noise_sigma = 1; +} + +// Config for blur baseline. +// +// When enabled, a linear path from the maximally blurred image to the input +// image is created. Using a blurred baseline instead of zero (black image) is +// motivated by the BlurIG approach explained here: +// https://arxiv.org/abs/2004.03383 +message BlurBaselineConfig { + // The standard deviation of the blur kernel for the blurred baseline. The + // same blurring parameter is used for both the height and the width + // dimension. If not set, the method defaults to the zero (i.e. black for + // images) baseline. + float max_blur_sigma = 1; +} + +// Example-based explainability that returns the nearest neighbors from the +// provided dataset. +message Examples { + oneof config { + // The configuration for the generated index, the semantics are the same as + // [metadata][google.cloud.aiplatform.v1beta1.Index.metadata] and should match NearestNeighborSearchConfig. + google.protobuf.Value nearest_neighbor_search_config = 2; + + // Preset config based on the desired query speed-precision trade-off + // and modality + Preset preset = 4; + } + + // The Cloud Storage location for the input instances. + GcsSource gcs_source = 1; + + // The number of neighbors to return. + int32 neighbor_count = 3; +} + +// Preset configuration for example-based explanations +message Preset { + // Preset option controlling parameters for query speed-precision trade-off + enum Query { + // More precise neighbors as a trade-off against slower response. + // This is also the default value (field-number 0). + PRECISE = 0; + + // Faster response as a trade-off against less precise neighbors. + FAST = 1; + } + + // Preset option controlling parameters for different modalities + enum Modality { + // Should not be set. Added as a recommended best practice for enums + MODALITY_UNSPECIFIED = 0; + + // IMAGE modality + IMAGE = 1; + + // TEXT modality + TEXT = 2; + + // TABULAR modality + TABULAR = 3; + } + + // Preset option controlling parameters for query speed-precision trade-off + optional Query query = 1; + + // Preset option controlling parameters for different modalities + Modality modality = 2; +} + +// The [ExplanationSpec][google.cloud.aiplatform.v1beta1.ExplanationSpec] entries that can be overridden at +// [online explanation][google.cloud.aiplatform.v1beta1.PredictionService.Explain] time. +message ExplanationSpecOverride { + // The parameters to be overridden. Note that the + // [method][google.cloud.aiplatform.v1beta1.ExplanationParameters.method] cannot be changed. If not specified, + // no parameter is overridden. + ExplanationParameters parameters = 1; + + // The metadata to be overridden. If not specified, no metadata is overridden. + ExplanationMetadataOverride metadata = 2; + + // The example-based explanations parameter overrides. + ExamplesOverride examples_override = 3; +} + +// The [ExplanationMetadata][google.cloud.aiplatform.v1beta1.ExplanationMetadata] entries that can be overridden at +// [online explanation][google.cloud.aiplatform.v1beta1.PredictionService.Explain] time. +message ExplanationMetadataOverride { + // The [input metadata][google.cloud.aiplatform.v1beta1.ExplanationMetadata.InputMetadata] entries to be + // overridden. + message InputMetadataOverride { + // Baseline inputs for this feature. + // + // This overrides the `input_baseline` field of the + // [ExplanationMetadata.InputMetadata][google.cloud.aiplatform.v1beta1.ExplanationMetadata.InputMetadata] + // object of the corresponding feature's input metadata. If it's not + // specified, the original baselines are not overridden. + repeated google.protobuf.Value input_baselines = 1; + } + + // Required. Overrides the [input metadata][google.cloud.aiplatform.v1beta1.ExplanationMetadata.inputs] of the features. + // The key is the name of the feature to be overridden. The keys specified + // here must exist in the input metadata to be overridden. If a feature is + // not specified here, the corresponding feature's input metadata is not + // overridden. + map inputs = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Overrides for example-based explanations. +message ExamplesOverride { + // Data format enum. + enum DataFormat { + // Unspecified format. Must not be used. + DATA_FORMAT_UNSPECIFIED = 0; + + // Provided data is a set of model inputs. + INSTANCES = 1; + + // Provided data is a set of embeddings. + EMBEDDINGS = 2; + } + + // The number of neighbors to return. + int32 neighbor_count = 1; + + // The number of neighbors to return that have the same crowding tag. + int32 crowding_count = 2; + + // Restrict the resulting nearest neighbors to respect these constraints. + repeated ExamplesRestrictionsNamespace restrictions = 3; + + // If true, return the embeddings instead of neighbors. + bool return_embeddings = 4; + + // The format of the data being provided with each call. + DataFormat data_format = 5; +} + +// Restrictions namespace for example-based explanations overrides. +message ExamplesRestrictionsNamespace { + // The namespace name. + string namespace_name = 1; + + // The list of allowed tags. + repeated string allow = 2; + + // The list of deny tags. + repeated string deny = 3; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto new file mode 100644 index 00000000..ef962a51 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto @@ -0,0 +1,398 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ExplanationMetadataProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Metadata describing the Model's input and output for explanation. +message ExplanationMetadata { + // Metadata of the input of a feature. + // + // Fields other than [InputMetadata.input_baselines][google.cloud.aiplatform.v1beta1.ExplanationMetadata.InputMetadata.input_baselines] are applicable only + // for Models that are using Vertex AI-provided images for Tensorflow. + message InputMetadata { + // Domain details of the input feature value. Provides numeric information + // about the feature, such as its range (min, max). If the feature has been + // pre-processed, for example with z-scoring, then it provides information + // about how to recover the original feature. For example, if the input + // feature is an image and it has been pre-processed to obtain 0-mean and + // stddev = 1 values, then original_mean, and original_stddev refer to the + // mean and stddev of the original feature (e.g. image tensor) from which + // input feature (with mean = 0 and stddev = 1) was obtained. + message FeatureValueDomain { + // The minimum permissible value for this feature. + float min_value = 1; + + // The maximum permissible value for this feature. + float max_value = 2; + + // If this input feature has been normalized to a mean value of 0, + // the original_mean specifies the mean value of the domain prior to + // normalization. + float original_mean = 3; + + // If this input feature has been normalized to a standard deviation of + // 1.0, the original_stddev specifies the standard deviation of the domain + // prior to normalization. + float original_stddev = 4; + } + + // Visualization configurations for image explanation. + message Visualization { + // Type of the image visualization. Only applicable to + // [Integrated Gradients attribution][google.cloud.aiplatform.v1beta1.ExplanationParameters.integrated_gradients_attribution]. + enum Type { + // Should not be used. + TYPE_UNSPECIFIED = 0; + + // Shows which pixel contributed to the image prediction. + PIXELS = 1; + + // Shows which region contributed to the image prediction by outlining + // the region. + OUTLINES = 2; + } + + // Whether to only highlight pixels with positive contributions, negative + // or both. Defaults to POSITIVE. + enum Polarity { + // Default value. This is the same as POSITIVE. + POLARITY_UNSPECIFIED = 0; + + // Highlights the pixels/outlines that were most influential to the + // model's prediction. + POSITIVE = 1; + + // Setting polarity to negative highlights areas that does not lead to + // the models's current prediction. + NEGATIVE = 2; + + // Shows both positive and negative attributions. + BOTH = 3; + } + + // The color scheme used for highlighting areas. + enum ColorMap { + // Should not be used. + COLOR_MAP_UNSPECIFIED = 0; + + // Positive: green. Negative: pink. + PINK_GREEN = 1; + + // Viridis color map: A perceptually uniform color mapping which is + // easier to see by those with colorblindness and progresses from yellow + // to green to blue. Positive: yellow. Negative: blue. + VIRIDIS = 2; + + // Positive: red. Negative: red. + RED = 3; + + // Positive: green. Negative: green. + GREEN = 4; + + // Positive: green. Negative: red. + RED_GREEN = 6; + + // PiYG palette. + PINK_WHITE_GREEN = 5; + } + + // How the original image is displayed in the visualization. + enum OverlayType { + // Default value. This is the same as NONE. + OVERLAY_TYPE_UNSPECIFIED = 0; + + // No overlay. + NONE = 1; + + // The attributions are shown on top of the original image. + ORIGINAL = 2; + + // The attributions are shown on top of grayscaled version of the + // original image. + GRAYSCALE = 3; + + // The attributions are used as a mask to reveal predictive parts of + // the image and hide the un-predictive parts. + MASK_BLACK = 4; + } + + // Type of the image visualization. Only applicable to + // [Integrated Gradients attribution][google.cloud.aiplatform.v1beta1.ExplanationParameters.integrated_gradients_attribution]. + // OUTLINES shows regions of attribution, while PIXELS shows per-pixel + // attribution. Defaults to OUTLINES. + Type type = 1; + + // Whether to only highlight pixels with positive contributions, negative + // or both. Defaults to POSITIVE. + Polarity polarity = 2; + + // The color scheme used for the highlighted areas. + // + // Defaults to PINK_GREEN for + // [Integrated Gradients attribution][google.cloud.aiplatform.v1beta1.ExplanationParameters.integrated_gradients_attribution], + // which shows positive attributions in green and negative in pink. + // + // Defaults to VIRIDIS for + // [XRAI attribution][google.cloud.aiplatform.v1beta1.ExplanationParameters.xrai_attribution], which + // highlights the most influential regions in yellow and the least + // influential in blue. + ColorMap color_map = 3; + + // Excludes attributions above the specified percentile from the + // highlighted areas. Using the clip_percent_upperbound and + // clip_percent_lowerbound together can be useful for filtering out noise + // and making it easier to see areas of strong attribution. Defaults to + // 99.9. + float clip_percent_upperbound = 4; + + // Excludes attributions below the specified percentile, from the + // highlighted areas. Defaults to 62. + float clip_percent_lowerbound = 5; + + // How the original image is displayed in the visualization. + // Adjusting the overlay can help increase visual clarity if the original + // image makes it difficult to view the visualization. Defaults to NONE. + OverlayType overlay_type = 6; + } + + // Defines how a feature is encoded. Defaults to IDENTITY. + enum Encoding { + // Default value. This is the same as IDENTITY. + ENCODING_UNSPECIFIED = 0; + + // The tensor represents one feature. + IDENTITY = 1; + + // The tensor represents a bag of features where each index maps to + // a feature. [InputMetadata.index_feature_mapping][google.cloud.aiplatform.v1beta1.ExplanationMetadata.InputMetadata.index_feature_mapping] must be provided for + // this encoding. For example: + // ``` + // input = [27, 6.0, 150] + // index_feature_mapping = ["age", "height", "weight"] + // ``` + BAG_OF_FEATURES = 2; + + // The tensor represents a bag of features where each index maps to a + // feature. Zero values in the tensor indicates feature being + // non-existent. [InputMetadata.index_feature_mapping][google.cloud.aiplatform.v1beta1.ExplanationMetadata.InputMetadata.index_feature_mapping] must be provided + // for this encoding. For example: + // ``` + // input = [2, 0, 5, 0, 1] + // index_feature_mapping = ["a", "b", "c", "d", "e"] + // ``` + BAG_OF_FEATURES_SPARSE = 3; + + // The tensor is a list of binaries representing whether a feature exists + // or not (1 indicates existence). [InputMetadata.index_feature_mapping][google.cloud.aiplatform.v1beta1.ExplanationMetadata.InputMetadata.index_feature_mapping] + // must be provided for this encoding. For example: + // ``` + // input = [1, 0, 1, 0, 1] + // index_feature_mapping = ["a", "b", "c", "d", "e"] + // ``` + INDICATOR = 4; + + // The tensor is encoded into a 1-dimensional array represented by an + // encoded tensor. [InputMetadata.encoded_tensor_name][google.cloud.aiplatform.v1beta1.ExplanationMetadata.InputMetadata.encoded_tensor_name] must be provided + // for this encoding. For example: + // ``` + // input = ["This", "is", "a", "test", "."] + // encoded = [0.1, 0.2, 0.3, 0.4, 0.5] + // ``` + COMBINED_EMBEDDING = 5; + + // Select this encoding when the input tensor is encoded into a + // 2-dimensional array represented by an encoded tensor. + // [InputMetadata.encoded_tensor_name][google.cloud.aiplatform.v1beta1.ExplanationMetadata.InputMetadata.encoded_tensor_name] must be provided for this + // encoding. The first dimension of the encoded tensor's shape is the same + // as the input tensor's shape. For example: + // ``` + // input = ["This", "is", "a", "test", "."] + // encoded = [[0.1, 0.2, 0.3, 0.4, 0.5], + // [0.2, 0.1, 0.4, 0.3, 0.5], + // [0.5, 0.1, 0.3, 0.5, 0.4], + // [0.5, 0.3, 0.1, 0.2, 0.4], + // [0.4, 0.3, 0.2, 0.5, 0.1]] + // ``` + CONCAT_EMBEDDING = 6; + } + + // Baseline inputs for this feature. + // + // If no baseline is specified, Vertex AI chooses the baseline for this + // feature. If multiple baselines are specified, Vertex AI returns the + // average attributions across them in [Attribution.feature_attributions][google.cloud.aiplatform.v1beta1.Attribution.feature_attributions]. + // + // For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape + // of each baseline must match the shape of the input tensor. If a scalar is + // provided, we broadcast to the same shape as the input tensor. + // + // For custom images, the element of the baselines must be in the same + // format as the feature's input in the + // [instance][google.cloud.aiplatform.v1beta1.ExplainRequest.instances][]. The schema of any single instance + // may be specified via Endpoint's DeployedModels' + // [Model's][google.cloud.aiplatform.v1beta1.DeployedModel.model] + // [PredictSchemata's][google.cloud.aiplatform.v1beta1.Model.predict_schemata] + // [instance_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri]. + repeated google.protobuf.Value input_baselines = 1; + + // Name of the input tensor for this feature. Required and is only + // applicable to Vertex AI-provided images for Tensorflow. + string input_tensor_name = 2; + + // Defines how the feature is encoded into the input tensor. Defaults to + // IDENTITY. + Encoding encoding = 3; + + // Modality of the feature. Valid values are: numeric, image. Defaults to + // numeric. + string modality = 4; + + // The domain details of the input feature value. Like min/max, original + // mean or standard deviation if normalized. + FeatureValueDomain feature_value_domain = 5; + + // Specifies the index of the values of the input tensor. + // Required when the input tensor is a sparse representation. Refer to + // Tensorflow documentation for more details: + // https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor. + string indices_tensor_name = 6; + + // Specifies the shape of the values of the input if the input is a sparse + // representation. Refer to Tensorflow documentation for more details: + // https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor. + string dense_shape_tensor_name = 7; + + // A list of feature names for each index in the input tensor. + // Required when the input [InputMetadata.encoding][google.cloud.aiplatform.v1beta1.ExplanationMetadata.InputMetadata.encoding] is BAG_OF_FEATURES, + // BAG_OF_FEATURES_SPARSE, INDICATOR. + repeated string index_feature_mapping = 8; + + // Encoded tensor is a transformation of the input tensor. Must be provided + // if choosing + // [Integrated Gradients attribution][google.cloud.aiplatform.v1beta1.ExplanationParameters.integrated_gradients_attribution] + // or [XRAI attribution][google.cloud.aiplatform.v1beta1.ExplanationParameters.xrai_attribution] and the + // input tensor is not differentiable. + // + // An encoded tensor is generated if the input tensor is encoded by a lookup + // table. + string encoded_tensor_name = 9; + + // A list of baselines for the encoded tensor. + // + // The shape of each baseline should match the shape of the encoded tensor. + // If a scalar is provided, Vertex AI broadcasts to the same shape as the + // encoded tensor. + repeated google.protobuf.Value encoded_baselines = 10; + + // Visualization configurations for image explanation. + Visualization visualization = 11; + + // Name of the group that the input belongs to. Features with the same group + // name will be treated as one feature when computing attributions. Features + // grouped together can have different shapes in value. If provided, there + // will be one single attribution generated in + // [Attribution.feature_attributions][google.cloud.aiplatform.v1beta1.Attribution.feature_attributions], keyed by the group name. + string group_name = 12; + } + + // Metadata of the prediction output to be explained. + message OutputMetadata { + // Defines how to map [Attribution.output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index] to + // [Attribution.output_display_name][google.cloud.aiplatform.v1beta1.Attribution.output_display_name]. + // + // If neither of the fields are specified, + // [Attribution.output_display_name][google.cloud.aiplatform.v1beta1.Attribution.output_display_name] will not be populated. + oneof display_name_mapping { + // Static mapping between the index and display name. + // + // Use this if the outputs are a deterministic n-dimensional array, e.g. a + // list of scores of all the classes in a pre-defined order for a + // multi-classification Model. It's not feasible if the outputs are + // non-deterministic, e.g. the Model produces top-k classes or sort the + // outputs by their values. + // + // The shape of the value must be an n-dimensional array of strings. The + // number of dimensions must match that of the outputs to be explained. + // The [Attribution.output_display_name][google.cloud.aiplatform.v1beta1.Attribution.output_display_name] is populated by locating in the + // mapping with [Attribution.output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index]. + google.protobuf.Value index_display_name_mapping = 1; + + // Specify a field name in the prediction to look for the display name. + // + // Use this if the prediction contains the display names for the outputs. + // + // The display names in the prediction must have the same shape of the + // outputs, so that it can be located by [Attribution.output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index] for + // a specific output. + string display_name_mapping_key = 2; + } + + // Name of the output tensor. Required and is only applicable to Vertex + // AI provided images for Tensorflow. + string output_tensor_name = 3; + } + + // Required. Map from feature names to feature input metadata. Keys are the name of the + // features. Values are the specification of the feature. + // + // An empty InputMetadata is valid. It describes a text feature which has the + // name specified as the key in [ExplanationMetadata.inputs][google.cloud.aiplatform.v1beta1.ExplanationMetadata.inputs]. The baseline + // of the empty feature is chosen by Vertex AI. + // + // For Vertex AI-provided Tensorflow images, the key can be any friendly + // name of the feature. Once specified, + // [featureAttributions][google.cloud.aiplatform.v1beta1.Attribution.feature_attributions] are keyed by + // this key (if not grouped with another feature). + // + // For custom images, the key must match with the key in + // [instance][google.cloud.aiplatform.v1beta1.ExplainRequest.instances]. + map inputs = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Map from output names to output metadata. + // + // For Vertex AI-provided Tensorflow images, keys can be any user defined + // string that consists of any UTF-8 characters. + // + // For custom images, keys are the name of the output field in the prediction + // to be explained. + // + // Currently only one key is allowed. + map outputs = 2 [(google.api.field_behavior) = REQUIRED]; + + // Points to a YAML file stored on Google Cloud Storage describing the format + // of the [feature attributions][google.cloud.aiplatform.v1beta1.Attribution.feature_attributions]. + // The schema is defined as an OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + // AutoML tabular Models always have this field populated by Vertex AI. + // Note: The URI given on output may be different, including the URI scheme, + // than the one given on input. The output URI will point to a location where + // the user only has a read access. + string feature_attributions_schema_uri = 3; + + // Name of the source to generate embeddings for example based explanations. + string latent_space_source = 5; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto new file mode 100644 index 00000000..cf67cf3e --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto @@ -0,0 +1,178 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto"; +import "google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "FeatureProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Feature Metadata information that describes an attribute of an entity type. +// For example, apple is an entity type, and color is a feature that describes +// apple. +message Feature { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Feature" + pattern: "projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}" + }; + + // A list of historical [Snapshot + // Analysis][FeaturestoreMonitoringConfig.SnapshotAnalysis] or [Import Feature + // Analysis] [FeaturestoreMonitoringConfig.ImportFeatureAnalysis] stats + // requested by user, sorted by [FeatureStatsAnomaly.start_time][google.cloud.aiplatform.v1beta1.FeatureStatsAnomaly.start_time] descending. + message MonitoringStatsAnomaly { + // If the objective in the request is both + // Import Feature Analysis and Snapshot Analysis, this objective could be + // one of them. Otherwise, this objective should be the same as the + // objective in the request. + enum Objective { + // If it's OBJECTIVE_UNSPECIFIED, monitoring_stats will be empty. + OBJECTIVE_UNSPECIFIED = 0; + + // Stats are generated by Import Feature Analysis. + IMPORT_FEATURE_ANALYSIS = 1; + + // Stats are generated by Snapshot Analysis. + SNAPSHOT_ANALYSIS = 2; + } + + // Output only. The objective for each stats. + Objective objective = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The stats and anomalies generated at specific timestamp. + FeatureStatsAnomaly feature_stats_anomaly = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // An enum representing the value type of a feature. + enum ValueType { + // The value type is unspecified. + VALUE_TYPE_UNSPECIFIED = 0; + + // Used for Feature that is a boolean. + BOOL = 1; + + // Used for Feature that is a list of boolean. + BOOL_ARRAY = 2; + + // Used for Feature that is double. + DOUBLE = 3; + + // Used for Feature that is a list of double. + DOUBLE_ARRAY = 4; + + // Used for Feature that is INT64. + INT64 = 9; + + // Used for Feature that is a list of INT64. + INT64_ARRAY = 10; + + // Used for Feature that is string. + STRING = 11; + + // Used for Feature that is a list of String. + STRING_ARRAY = 12; + + // Used for Feature that is bytes. + BYTES = 13; + } + + // Immutable. Name of the Feature. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + // + // The last part feature is assigned by the client. The feature can be up to + // 64 characters long and can consist only of ASCII Latin letters A-Z and a-z, + // underscore(_), and ASCII digits 0-9 starting with a letter. The value will + // be unique given an entity type. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Description of the Feature. + string description = 2; + + // Required. Immutable. Type of Feature value. + ValueType value_type = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Timestamp when this EntityType was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this EntityType was most recently updated. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The labels with user-defined metadata to organize your Features. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + // No more than 64 user labels can be associated with one Feature (System + // labels are excluded)." + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Used to perform a consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 7; + + // Optional. Deprecated: The custom monitoring configuration for this Feature, if not + // set, use the monitoring_config defined for the EntityType this Feature + // belongs to. + // Only Features with type ([Feature.ValueType][google.cloud.aiplatform.v1beta1.Feature.ValueType]) BOOL, STRING, DOUBLE or + // INT64 can enable monitoring. + // + // If this is populated with + // [FeaturestoreMonitoringConfig.disabled][] = true, snapshot analysis + // monitoring is disabled; if + // [FeaturestoreMonitoringConfig.monitoring_interval][] specified, snapshot + // analysis monitoring is enabled. Otherwise, snapshot analysis monitoring + // config is same as the EntityType's this Feature belongs to. + FeaturestoreMonitoringConfig monitoring_config = 9 [ + deprecated = true, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. If not set, use the monitoring_config defined for the EntityType this + // Feature belongs to. + // Only Features with type ([Feature.ValueType][google.cloud.aiplatform.v1beta1.Feature.ValueType]) BOOL, STRING, DOUBLE or + // INT64 can enable monitoring. + // + // If set to true, all types of data monitoring are disabled despite the + // config on EntityType. + bool disable_monitoring = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. A list of historical [Snapshot + // Analysis][FeaturestoreMonitoringConfig.SnapshotAnalysis] + // stats requested by user, sorted by [FeatureStatsAnomaly.start_time][google.cloud.aiplatform.v1beta1.FeatureStatsAnomaly.start_time] + // descending. + repeated FeatureStatsAnomaly monitoring_stats = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The list of historical stats and anomalies with specified objectives. + repeated MonitoringStatsAnomaly monitoring_stats_anomalies = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto new file mode 100644 index 00000000..30ffbd95 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto @@ -0,0 +1,86 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "FeatureMonitoringStatsProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Stats and Anomaly generated at specific timestamp for specific Feature. +// The start_time and end_time are used to define the time range of the dataset +// that current stats belongs to, e.g. prediction traffic is bucketed into +// prediction datasets by time window. If the Dataset is not defined by time +// window, start_time = end_time. Timestamp of the stats and anomalies always +// refers to end_time. Raw stats and anomalies are stored in stats_uri or +// anomaly_uri in the tensorflow defined protos. Field data_stats contains +// almost identical information with the raw stats in Vertex AI +// defined proto, for UI to display. +message FeatureStatsAnomaly { + // Feature importance score, only populated when cross-feature monitoring is + // enabled. For now only used to represent feature attribution score within + // range [0, 1] for + // [ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_SKEW][google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_SKEW] and + // [ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_DRIFT][google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_DRIFT]. + double score = 1; + + // Path of the stats file for current feature values in Cloud Storage bucket. + // Format: gs:////stats. + // Example: gs://monitoring_bucket/feature_name/stats. + // Stats are stored as binary format with Protobuf message + // [tensorflow.metadata.v0.FeatureNameStatistics](https://github.com/tensorflow/metadata/blob/master/tensorflow_metadata/proto/v0/statistics.proto). + string stats_uri = 3; + + // Path of the anomaly file for current feature values in Cloud Storage + // bucket. + // Format: gs:////anomalies. + // Example: gs://monitoring_bucket/feature_name/anomalies. + // Stats are stored as binary format with Protobuf message + // Anoamlies are stored as binary format with Protobuf message + // [tensorflow.metadata.v0.AnomalyInfo] + // (https://github.com/tensorflow/metadata/blob/master/tensorflow_metadata/proto/v0/anomalies.proto). + string anomaly_uri = 4; + + // Deviation from the current stats to baseline stats. + // 1. For categorical feature, the distribution distance is calculated by + // L-inifinity norm. + // 2. For numerical feature, the distribution distance is calculated by + // Jensen–Shannon divergence. + double distribution_deviation = 5; + + // This is the threshold used when detecting anomalies. + // The threshold can be changed by user, so this one might be different from + // [ThresholdConfig.value][google.cloud.aiplatform.v1beta1.ThresholdConfig.value]. + double anomaly_detection_threshold = 9; + + // The start timestamp of window where stats were generated. + // For objectives where time window doesn't make sense (e.g. Featurestore + // Snapshot Monitoring), start_time is only used to indicate the monitoring + // intervals, so it always equals to (end_time - monitoring_interval). + google.protobuf.Timestamp start_time = 7; + + // The end timestamp of window where stats were generated. + // For objectives where time window doesn't make sense (e.g. Featurestore + // Snapshot Monitoring), end_time indicates the timestamp of the data used to + // generate stats (e.g. timestamp we take snapshots for feature values). + google.protobuf.Timestamp end_time = 8; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_selector.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_selector.proto new file mode 100644 index 00000000..907f14e2 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_selector.proto @@ -0,0 +1,44 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "FeatureSelectorProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Matcher for Features of an EntityType by Feature ID. +message IdMatcher { + // Required. The following are accepted as `ids`: + // + // * A single-element list containing only `*`, which selects all Features + // in the target EntityType, or + // * A list containing only Feature IDs, which selects only Features with + // those IDs in the target EntityType. + repeated string ids = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Selector for Features of an EntityType. +message FeatureSelector { + // Required. Matches Features based on ID. + IdMatcher id_matcher = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore.proto new file mode 100644 index 00000000..f5ece8f2 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore.proto @@ -0,0 +1,129 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "FeaturestoreProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Vertex AI Feature Store provides a centralized repository for organizing, +// storing, and serving ML features. The Featurestore is a top-level container +// for your features and their values. +message Featurestore { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Featurestore" + pattern: "projects/{project}/locations/{location}/featurestores/{featurestore}" + }; + + // OnlineServingConfig specifies the details for provisioning online serving + // resources. + message OnlineServingConfig { + // Online serving scaling configuration. If min_node_count and + // max_node_count are set to the same value, the cluster will be configured + // with the fixed number of node (no auto-scaling). + message Scaling { + // Required. The minimum number of nodes to scale down to. Must be greater than or + // equal to 1. + int32 min_node_count = 1 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of nodes to scale up to. Must be greater than + // min_node_count, and less than or equal to 10 times of 'min_node_count'. + int32 max_node_count = 2; + } + + // The number of nodes for the online store. The number of nodes doesn't + // scale automatically, but you can manually update the number of + // nodes. If set to 0, the featurestore will not have an + // online store and cannot be used for online serving. + int32 fixed_node_count = 2; + + // Online serving scaling configuration. + // Only one of `fixed_node_count` and `scaling` can be set. Setting one will + // reset the other. + Scaling scaling = 4; + } + + // Possible states a featurestore can have. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // State when the featurestore configuration is not being updated and the + // fields reflect the current configuration of the featurestore. The + // featurestore is usable in this state. + STABLE = 1; + + // The state of the featurestore configuration when it is being updated. + // During an update, the fields reflect either the original configuration + // or the updated configuration of the featurestore. For example, + // `online_serving_config.fixed_node_count` can take minutes to update. + // While the update is in progress, the featurestore is in the UPDATING + // state, and the value of `fixed_node_count` can be the original value or + // the updated value, depending on the progress of the operation. Until the + // update completes, the actual number of nodes can still be the original + // value of `fixed_node_count`. The featurestore is still usable in this + // state. + UPDATING = 2; + } + + // Output only. Name of the Featurestore. Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Featurestore was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Featurestore was last updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The labels with user-defined metadata to organize your Featurestore. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + // No more than 64 user labels can be associated with one Featurestore(System + // labels are excluded)." + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Config for online storage resources. If unset, the featurestore will + // not have an online store and cannot be used for online serving. + OnlineServingConfig online_serving_config = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. State of the featurestore. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Customer-managed encryption key spec for data storage. If set, both of the + // online and offline data storage will be secured by this key. + EncryptionSpec encryption_spec = 10 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto new file mode 100644 index 00000000..fefe9e77 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto @@ -0,0 +1,155 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "FeaturestoreMonitoringProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Configuration of how features in Featurestore are monitored. +message FeaturestoreMonitoringConfig { + // Configuration of the Featurestore's Snapshot Analysis Based Monitoring. + // This type of analysis generates statistics for each Feature based on a + // snapshot of the latest feature value of each entities every + // monitoring_interval. + message SnapshotAnalysis { + // The monitoring schedule for snapshot analysis. + // For EntityType-level config: + // unset / disabled = true indicates disabled by + // default for Features under it; otherwise by default enable snapshot + // analysis monitoring with monitoring_interval for Features under it. + // Feature-level config: + // disabled = true indicates disabled regardless of the EntityType-level + // config; unset monitoring_interval indicates going with EntityType-level + // config; otherwise run snapshot analysis monitoring with + // monitoring_interval regardless of the EntityType-level config. + // Explicitly Disable the snapshot analysis based monitoring. + bool disabled = 1; + + // Configuration of the snapshot analysis based monitoring pipeline running + // interval. The value is rolled up to full day. + google.protobuf.Duration monitoring_interval = 2 [deprecated = true]; + + // Configuration of the snapshot analysis based monitoring pipeline + // running interval. The value indicates number of days. + // If both + // [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days] + // and [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval] + // are set when creating/updating EntityTypes/Features, + // [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days] + // will be used. + int32 monitoring_interval_days = 3; + + // Customized export features time window for snapshot analysis. Unit is one + // day. Default value is 3 weeks. Minimum value is 1 day. Maximum value is + // 4000 days. + int32 staleness_days = 4; + } + + // Configuration of the Featurestore's ImportFeature Analysis Based + // Monitoring. This type of analysis generates statistics for values of each + // Feature imported by every [ImportFeatureValues][] operation. + message ImportFeaturesAnalysis { + // The state defines whether to enable ImportFeature analysis. + enum State { + // Should not be used. + STATE_UNSPECIFIED = 0; + + // The default behavior of whether to enable the monitoring. + // EntityType-level config: disabled. + // Feature-level config: inherited from the configuration of EntityType + // this Feature belongs to. + DEFAULT = 1; + + // Explicitly enables import features analysis. + // EntityType-level config: by default enables import features analysis + // for all Features under it. Feature-level config: enables import + // features analysis regardless of the EntityType-level config. + ENABLED = 2; + + // Explicitly disables import features analysis. + // EntityType-level config: by default disables import features analysis + // for all Features under it. Feature-level config: disables import + // features analysis regardless of the EntityType-level config. + DISABLED = 3; + } + + // Defines the baseline to do anomaly detection for feature values imported + // by each [ImportFeatureValues][] operation. + enum Baseline { + // Should not be used. + BASELINE_UNSPECIFIED = 0; + + // Choose the later one statistics generated by either most recent + // snapshot analysis or previous import features analysis. If non of them + // exists, skip anomaly detection and only generate a statistics. + LATEST_STATS = 1; + + // Use the statistics generated by the most recent snapshot analysis if + // exists. + MOST_RECENT_SNAPSHOT_STATS = 2; + + // Use the statistics generated by the previous import features analysis + // if exists. + PREVIOUS_IMPORT_FEATURES_STATS = 3; + } + + // Whether to enable / disable / inherite default hebavior for import + // features analysis. + State state = 1; + + // The baseline used to do anomaly detection for the statistics generated by + // import features analysis. + Baseline anomaly_detection_baseline = 2; + } + + // The config for Featurestore Monitoring threshold. + message ThresholdConfig { + oneof threshold { + // Specify a threshold value that can trigger the alert. + // 1. For categorical feature, the distribution distance is calculated by + // L-inifinity norm. + // 2. For numerical feature, the distribution distance is calculated by + // Jensen–Shannon divergence. Each feature must have a non-zero threshold + // if they need to be monitored. Otherwise no alert will be triggered for + // that feature. + double value = 1; + } + } + + // The config for Snapshot Analysis Based Feature Monitoring. + SnapshotAnalysis snapshot_analysis = 1; + + // The config for ImportFeatures Analysis Based Feature Monitoring. + ImportFeaturesAnalysis import_features_analysis = 2; + + // Threshold for numerical features of anomaly detection. + // This is shared by all objectives of Featurestore Monitoring for numerical + // features (i.e. Features with type ([Feature.ValueType][google.cloud.aiplatform.v1beta1.Feature.ValueType]) DOUBLE or INT64). + ThresholdConfig numerical_threshold_config = 3; + + // Threshold for categorical features of anomaly detection. + // This is shared by all types of Featurestore Monitoring for categorical + // features (i.e. Features with type ([Feature.ValueType][google.cloud.aiplatform.v1beta1.Feature.ValueType]) BOOL or STRING). + ThresholdConfig categorical_threshold_config = 4; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto new file mode 100644 index 00000000..a8c5e991 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto @@ -0,0 +1,225 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/feature_selector.proto"; +import "google/cloud/aiplatform/v1beta1/types.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "FeaturestoreOnlineServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A service for serving online feature values. +service FeaturestoreOnlineServingService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Reads Feature values of a specific entity of an EntityType. For reading + // feature values of multiple entities of an EntityType, please use + // StreamingReadFeatureValues. + rpc ReadFeatureValues(ReadFeatureValuesRequest) returns (ReadFeatureValuesResponse) { + option (google.api.http) = { + post: "/v1beta1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:readFeatureValues" + body: "*" + }; + option (google.api.method_signature) = "entity_type"; + } + + // Reads Feature values for multiple entities. Depending on their size, data + // for different entities may be broken + // up across multiple responses. + rpc StreamingReadFeatureValues(StreamingReadFeatureValuesRequest) returns (stream ReadFeatureValuesResponse) { + option (google.api.http) = { + post: "/v1beta1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:streamingReadFeatureValues" + body: "*" + }; + option (google.api.method_signature) = "entity_type"; + } +} + +// Request message for [FeaturestoreOnlineServingService.ReadFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.ReadFeatureValues]. +message ReadFeatureValuesRequest { + // Required. The resource name of the EntityType for the entity being read. + // 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`. + string entity_type = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + } + ]; + + // Required. ID for a specific entity. For example, + // for a machine learning model predicting user clicks on a website, an entity + // ID could be `user_123`. + string entity_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Selector choosing Features of the target EntityType. + FeatureSelector feature_selector = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [FeaturestoreOnlineServingService.ReadFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.ReadFeatureValues]. +message ReadFeatureValuesResponse { + // Metadata for requested Features. + message FeatureDescriptor { + // Feature ID. + string id = 1; + } + + // Response header with metadata for the requested + // [ReadFeatureValuesRequest.entity_type][google.cloud.aiplatform.v1beta1.ReadFeatureValuesRequest.entity_type] and Features. + message Header { + // The resource name of the EntityType from the + // [ReadFeatureValuesRequest][google.cloud.aiplatform.v1beta1.ReadFeatureValuesRequest]. Value format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}`. + string entity_type = 1 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + }]; + + // List of Feature metadata corresponding to each piece of + // [ReadFeatureValuesResponse.data][]. + repeated FeatureDescriptor feature_descriptors = 2; + } + + // Entity view with Feature values. + message EntityView { + // Container to hold value(s), successive in time, for one Feature from the + // request. + message Data { + oneof data { + // Feature value if a single value is requested. + FeatureValue value = 1; + + // Feature values list if values, successive in time, are requested. + // If the requested number of values is greater than the number of + // existing Feature values, nonexistent values are omitted instead of + // being returned as empty. + FeatureValueList values = 2; + } + } + + // ID of the requested entity. + string entity_id = 1; + + // Each piece of data holds the k + // requested values for one requested Feature. If no values + // for the requested Feature exist, the corresponding cell will be empty. + // This has the same size and is in the same order as the features from the + // header [ReadFeatureValuesResponse.header][google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse.header]. + repeated Data data = 2; + } + + // Response header. + Header header = 1; + + // Entity view with Feature values. This may be the entity in the + // Featurestore if values for all Features were requested, or a projection + // of the entity in the Featurestore if values for only some Features were + // requested. + EntityView entity_view = 2; +} + +// Request message for +// [FeaturestoreOnlineServingService.StreamingFeatureValuesRead][]. +message StreamingReadFeatureValuesRequest { + // Required. The resource name of the entities' type. + // 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`. + string entity_type = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + } + ]; + + // Required. IDs of entities to read Feature values of. The maximum number of IDs is + // 100. For example, for a machine learning model predicting user clicks on a + // website, an entity ID could be `user_123`. + repeated string entity_ids = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Selector choosing Features of the target EntityType. Feature IDs will be + // deduplicated. + FeatureSelector feature_selector = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Value for a feature. +// (-- NEXT ID: 15 --) +message FeatureValue { + // Metadata of feature value. + message Metadata { + // Feature generation timestamp. Typically, it is provided by user at + // feature ingestion time. If not, feature store + // will use the system timestamp when the data is ingested into feature + // store. For streaming ingestion, the time, aligned by days, must be no + // older than five years (1825 days) and no later than one year (366 days) + // in the future. + google.protobuf.Timestamp generate_time = 1; + } + + // Value for the feature. + oneof value { + // Bool type feature value. + bool bool_value = 1; + + // Double type feature value. + double double_value = 2; + + // Int64 feature value. + int64 int64_value = 5; + + // String feature value. + string string_value = 6; + + // A list of bool type feature value. + BoolArray bool_array_value = 7; + + // A list of double type feature value. + DoubleArray double_array_value = 8; + + // A list of int64 type feature value. + Int64Array int64_array_value = 11; + + // A list of string type feature value. + StringArray string_array_value = 12; + + // Bytes feature value. + bytes bytes_value = 13; + } + + // Metadata of feature value. + Metadata metadata = 14; +} + +// Container for list of values. +message FeatureValueList { + // A list of feature values. All of them should be the same data type. + repeated FeatureValue values = 1; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto new file mode 100644 index 00000000..0ea0241b --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto @@ -0,0 +1,1225 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/entity_type.proto"; +import "google/cloud/aiplatform/v1beta1/feature.proto"; +import "google/cloud/aiplatform/v1beta1/feature_selector.proto"; +import "google/cloud/aiplatform/v1beta1/featurestore.proto"; +import "google/cloud/aiplatform/v1beta1/io.proto"; +import "google/cloud/aiplatform/v1beta1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "FeaturestoreServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// The service that handles CRUD and List for resources for Featurestore. +service FeaturestoreService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a new Featurestore in a given project and location. + rpc CreateFeaturestore(CreateFeaturestoreRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/featurestores" + body: "featurestore" + }; + option (google.api.method_signature) = "parent,featurestore"; + option (google.api.method_signature) = "parent,featurestore,featurestore_id"; + option (google.longrunning.operation_info) = { + response_type: "Featurestore" + metadata_type: "CreateFeaturestoreOperationMetadata" + }; + } + + // Gets details of a single Featurestore. + rpc GetFeaturestore(GetFeaturestoreRequest) returns (Featurestore) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/featurestores/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Featurestores in a given project and location. + rpc ListFeaturestores(ListFeaturestoresRequest) returns (ListFeaturestoresResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/featurestores" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the parameters of a single Featurestore. + rpc UpdateFeaturestore(UpdateFeaturestoreRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{featurestore.name=projects/*/locations/*/featurestores/*}" + body: "featurestore" + }; + option (google.api.method_signature) = "featurestore,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Featurestore" + metadata_type: "UpdateFeaturestoreOperationMetadata" + }; + } + + // Deletes a single Featurestore. The Featurestore must not contain any + // EntityTypes or `force` must be set to true for the request to succeed. + rpc DeleteFeaturestore(DeleteFeaturestoreRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/featurestores/*}" + }; + option (google.api.method_signature) = "name"; + option (google.api.method_signature) = "name,force"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Creates a new EntityType in a given Featurestore. + rpc CreateEntityType(CreateEntityTypeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/featurestores/*}/entityTypes" + body: "entity_type" + }; + option (google.api.method_signature) = "parent,entity_type"; + option (google.api.method_signature) = "parent,entity_type,entity_type_id"; + option (google.longrunning.operation_info) = { + response_type: "EntityType" + metadata_type: "CreateEntityTypeOperationMetadata" + }; + } + + // Gets details of a single EntityType. + rpc GetEntityType(GetEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists EntityTypes in a given Featurestore. + rpc ListEntityTypes(ListEntityTypesRequest) returns (ListEntityTypesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/featurestores/*}/entityTypes" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the parameters of a single EntityType. + rpc UpdateEntityType(UpdateEntityTypeRequest) returns (EntityType) { + option (google.api.http) = { + patch: "/v1beta1/{entity_type.name=projects/*/locations/*/featurestores/*/entityTypes/*}" + body: "entity_type" + }; + option (google.api.method_signature) = "entity_type,update_mask"; + } + + // Deletes a single EntityType. The EntityType must not have any Features + // or `force` must be set to true for the request to succeed. + rpc DeleteEntityType(DeleteEntityTypeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}" + }; + option (google.api.method_signature) = "name"; + option (google.api.method_signature) = "name,force"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Creates a new Feature in a given EntityType. + rpc CreateFeature(CreateFeatureRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/featurestores/*/entityTypes/*}/features" + body: "feature" + }; + option (google.api.method_signature) = "parent,feature"; + option (google.api.method_signature) = "parent,feature,feature_id"; + option (google.longrunning.operation_info) = { + response_type: "Feature" + metadata_type: "CreateFeatureOperationMetadata" + }; + } + + // Creates a batch of Features in a given EntityType. + rpc BatchCreateFeatures(BatchCreateFeaturesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/featurestores/*/entityTypes/*}/features:batchCreate" + body: "*" + }; + option (google.api.method_signature) = "parent,requests"; + option (google.longrunning.operation_info) = { + response_type: "BatchCreateFeaturesResponse" + metadata_type: "BatchCreateFeaturesOperationMetadata" + }; + } + + // Gets details of a single Feature. + rpc GetFeature(GetFeatureRequest) returns (Feature) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Features in a given EntityType. + rpc ListFeatures(ListFeaturesRequest) returns (ListFeaturesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/featurestores/*/entityTypes/*}/features" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the parameters of a single Feature. + rpc UpdateFeature(UpdateFeatureRequest) returns (Feature) { + option (google.api.http) = { + patch: "/v1beta1/{feature.name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}" + body: "feature" + }; + option (google.api.method_signature) = "feature,update_mask"; + } + + // Deletes a single Feature. + rpc DeleteFeature(DeleteFeatureRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Imports Feature values into the Featurestore from a source storage. + // + // The progress of the import is tracked by the returned operation. The + // imported features are guaranteed to be visible to subsequent read + // operations after the operation is marked as successfully done. + // + // If an import operation fails, the Feature values returned from + // reads and exports may be inconsistent. If consistency is + // required, the caller must retry the same import request again and wait till + // the new operation returned is marked as successfully done. + // + // There are also scenarios where the caller can cause inconsistency. + // + // - Source data for import contains multiple distinct Feature values for + // the same entity ID and timestamp. + // - Source is modified during an import. This includes adding, updating, or + // removing source data and/or metadata. Examples of updating metadata + // include but are not limited to changing storage location, storage class, + // or retention policy. + // - Online serving cluster is under-provisioned. + rpc ImportFeatureValues(ImportFeatureValuesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:importFeatureValues" + body: "*" + }; + option (google.api.method_signature) = "entity_type"; + option (google.longrunning.operation_info) = { + response_type: "ImportFeatureValuesResponse" + metadata_type: "ImportFeatureValuesOperationMetadata" + }; + } + + // Batch reads Feature values from a Featurestore. + // + // This API enables batch reading Feature values, where each read + // instance in the batch may read Feature values of entities from one or + // more EntityTypes. Point-in-time correctness is guaranteed for Feature + // values of each read instance as of each instance's read timestamp. + rpc BatchReadFeatureValues(BatchReadFeatureValuesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{featurestore=projects/*/locations/*/featurestores/*}:batchReadFeatureValues" + body: "*" + }; + option (google.api.method_signature) = "featurestore"; + option (google.longrunning.operation_info) = { + response_type: "BatchReadFeatureValuesResponse" + metadata_type: "BatchReadFeatureValuesOperationMetadata" + }; + } + + // Exports Feature values from all the entities of a target EntityType. + rpc ExportFeatureValues(ExportFeatureValuesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:exportFeatureValues" + body: "*" + }; + option (google.api.method_signature) = "entity_type"; + option (google.longrunning.operation_info) = { + response_type: "ExportFeatureValuesResponse" + metadata_type: "ExportFeatureValuesOperationMetadata" + }; + } + + // Searches Features matching a query in a given project. + rpc SearchFeatures(SearchFeaturesRequest) returns (SearchFeaturesResponse) { + option (google.api.http) = { + get: "/v1beta1/{location=projects/*/locations/*}/featurestores:searchFeatures" + }; + option (google.api.method_signature) = "location"; + option (google.api.method_signature) = "location,query"; + } +} + +// Request message for [FeaturestoreService.CreateFeaturestore][google.cloud.aiplatform.v1beta1.FeaturestoreService.CreateFeaturestore]. +message CreateFeaturestoreRequest { + // Required. The resource name of the Location to create Featurestores. + // Format: + // `projects/{project}/locations/{location}'` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Featurestore" + } + ]; + + // Required. The Featurestore to create. + Featurestore featurestore = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for this Featurestore, which will become the final component + // of the Featurestore's resource name. + // + // This value may be up to 60 characters, and valid characters are + // `[a-z0-9_]`. The first character cannot be a number. + // + // The value must be unique within the project and location. + string featurestore_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [FeaturestoreService.GetFeaturestore][google.cloud.aiplatform.v1beta1.FeaturestoreService.GetFeaturestore]. +message GetFeaturestoreRequest { + // Required. The name of the Featurestore resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Featurestore" + } + ]; +} + +// Request message for [FeaturestoreService.ListFeaturestores][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores]. +message ListFeaturestoresRequest { + // Required. The resource name of the Location to list Featurestores. + // Format: + // `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Featurestore" + } + ]; + + // Lists the featurestores that match the filter expression. The following + // fields are supported: + // + // * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + // Values must be + // in RFC 3339 format. + // * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + // Values must be + // in RFC 3339 format. + // * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, + // `<=`, and `>=` comparisons. + // * `labels`: Supports key-value equality and key presence. + // + // Examples: + // + // * `create_time > "2020-01-01" OR update_time > "2020-01-01"` + // Featurestores created or updated after 2020-01-01. + // * `labels.env = "prod"` + // Featurestores with label "env" set to "prod". + string filter = 2; + + // The maximum number of Featurestores to return. The service may return fewer + // than this value. If unspecified, at most 100 Featurestores will be + // returned. The maximum value is 100; any value greater than 100 will be + // coerced to 100. + int32 page_size = 3; + + // A page token, received from a previous + // [FeaturestoreService.ListFeaturestores][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [FeaturestoreService.ListFeaturestores][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores] must + // match the call that provided the page token. + string page_token = 4; + + // A comma-separated list of fields to order by, sorted in ascending order. + // Use "desc" after a field name for descending. + // Supported Fields: + // + // * `create_time` + // * `update_time` + // * `online_serving_config.fixed_node_count` + string order_by = 5; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 6; +} + +// Response message for [FeaturestoreService.ListFeaturestores][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores]. +message ListFeaturestoresResponse { + // The Featurestores matching the request. + repeated Featurestore featurestores = 1; + + // A token, which can be sent as [ListFeaturestoresRequest.page_token][google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest.page_token] to + // retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [FeaturestoreService.UpdateFeaturestore][google.cloud.aiplatform.v1beta1.FeaturestoreService.UpdateFeaturestore]. +message UpdateFeaturestoreRequest { + // Required. The Featurestore's `name` field is used to identify the Featurestore to be + // updated. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}` + Featurestore featurestore = 1 [(google.api.field_behavior) = REQUIRED]; + + // Field mask is used to specify the fields to be overwritten in the + // Featurestore resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then only the non-empty fields present in the + // request will be overwritten. Set the update_mask to `*` to override all + // fields. + // + // Updatable fields: + // + // * `labels` + // * `online_serving_config.fixed_node_count` + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for [FeaturestoreService.DeleteFeaturestore][google.cloud.aiplatform.v1beta1.FeaturestoreService.DeleteFeaturestore]. +message DeleteFeaturestoreRequest { + // Required. The name of the Featurestore to be deleted. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Featurestore" + } + ]; + + // If set to true, any EntityTypes and Features for this Featurestore will + // also be deleted. (Otherwise, the request will only work if the Featurestore + // has no EntityTypes.) + bool force = 2; +} + +// Request message for [FeaturestoreService.ImportFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreService.ImportFeatureValues]. +message ImportFeatureValuesRequest { + // Defines the Feature value(s) to import. + message FeatureSpec { + // Required. ID of the Feature to import values of. This Feature must exist in the + // target EntityType, or the request will fail. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Source column to get the Feature values from. If not set, uses the column + // with the same name as the Feature ID. + string source_field = 2; + } + + // Details about the source data, including the location of the storage and + // the format. + oneof source { + AvroSource avro_source = 2; + + BigQuerySource bigquery_source = 3; + + CsvSource csv_source = 4; + } + + // Source of Feature timestamp for all Feature values of each entity. + // Timestamps must be millisecond-aligned. + oneof feature_time_source { + // Source column that holds the Feature timestamp for all Feature + // values in each entity. + string feature_time_field = 6; + + // Single Feature timestamp for all entities being imported. The + // timestamp must not have higher than millisecond precision. + google.protobuf.Timestamp feature_time = 7; + } + + // Required. The resource name of the EntityType grouping the Features for which values + // are being imported. Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}` + string entity_type = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + } + ]; + + // Source column that holds entity IDs. If not provided, entity IDs are + // extracted from the column named `entity_id`. + string entity_id_field = 5; + + // Required. Specifications defining which Feature values to import from the entity. The + // request fails if no feature_specs are provided, and having multiple + // feature_specs for one Feature is not allowed. + repeated FeatureSpec feature_specs = 8 [(google.api.field_behavior) = REQUIRED]; + + // If set, data will not be imported for online serving. This + // is typically used for backfilling, where Feature generation timestamps are + // not in the timestamp range needed for online serving. + bool disable_online_serving = 9; + + // Specifies the number of workers that are used to write data to the + // Featurestore. Consider the online serving capacity that you require to + // achieve the desired import throughput without interfering with online + // serving. The value must be positive, and less than or equal to 100. + // If not set, defaults to using 1 worker. The low count ensures minimal + // impact on online serving performance. + int32 worker_count = 11; + + // If true, API doesn't start ingestion analysis pipeline. + bool disable_ingestion_analysis = 12; +} + +// Response message for [FeaturestoreService.ImportFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreService.ImportFeatureValues]. +message ImportFeatureValuesResponse { + // Number of entities that have been imported by the operation. + int64 imported_entity_count = 1; + + // Number of Feature values that have been imported by the operation. + int64 imported_feature_value_count = 2; + + // The number of rows in input source that weren't imported due to either + // * Not having any featureValues. + // * Having a null entityId. + // * Having a null timestamp. + // * Not being parsable (applicable for CSV sources). + int64 invalid_row_count = 6; +} + +// Request message for [FeaturestoreService.BatchReadFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreService.BatchReadFeatureValues]. +message BatchReadFeatureValuesRequest { + // Describe pass-through fields in read_instance source. + message PassThroughField { + // Required. The name of the field in the CSV header or the name of the column in + // BigQuery table. The naming restriction is the same as [Feature.name][google.cloud.aiplatform.v1beta1.Feature.name]. + string field_name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Selects Features of an EntityType to read values of and specifies read + // settings. + message EntityTypeSpec { + // Required. ID of the EntityType to select Features. The EntityType id is the + // [entity_type_id][google.cloud.aiplatform.v1beta1.CreateEntityTypeRequest.entity_type_id] specified + // during EntityType creation. + string entity_type_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Selectors choosing which Feature values to read from the EntityType. + FeatureSelector feature_selector = 2 [(google.api.field_behavior) = REQUIRED]; + + // Per-Feature settings for the batch read. + repeated DestinationFeatureSetting settings = 3; + } + + oneof read_option { + // Each read instance consists of exactly one read timestamp and one or more + // entity IDs identifying entities of the corresponding EntityTypes whose + // Features are requested. + // + // Each output instance contains Feature values of requested entities + // concatenated together as of the read time. + // + // An example read instance may be `foo_entity_id, bar_entity_id, + // 2020-01-01T10:00:00.123Z`. + // + // An example output instance may be `foo_entity_id, bar_entity_id, + // 2020-01-01T10:00:00.123Z, foo_entity_feature1_value, + // bar_entity_feature2_value`. + // + // Timestamp in each read instance must be millisecond-aligned. + // + // `csv_read_instances` are read instances stored in a plain-text CSV file. + // The header should be: + // [ENTITY_TYPE_ID1], [ENTITY_TYPE_ID2], ..., timestamp + // + // The columns can be in any order. + // + // Values in the timestamp column must use the RFC 3339 format, e.g. + // `2012-07-30T10:43:17.123Z`. + CsvSource csv_read_instances = 3; + + // Similar to csv_read_instances, but from BigQuery source. + BigQuerySource bigquery_read_instances = 5; + } + + // Required. The resource name of the Featurestore from which to query Feature values. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}` + string featurestore = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Featurestore" + } + ]; + + // Required. Specifies output location and format. + FeatureValueDestination destination = 4 [(google.api.field_behavior) = REQUIRED]; + + // When not empty, the specified fields in the *_read_instances source will be + // joined as-is in the output, in addition to those fields from the + // Featurestore Entity. + // + // For BigQuery source, the type of the pass-through values will be + // automatically inferred. For CSV source, the pass-through values will be + // passed as opaque bytes. + repeated PassThroughField pass_through_fields = 8; + + // Required. Specifies EntityType grouping Features to read values of and settings. + // Each EntityType referenced in + // [BatchReadFeatureValuesRequest.entity_type_specs] must have a column + // specifying entity IDs in the EntityType in + // [BatchReadFeatureValuesRequest.request][] . + repeated EntityTypeSpec entity_type_specs = 7 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [FeaturestoreService.ExportFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreService.ExportFeatureValues]. +message ExportFeatureValuesRequest { + // Describes exporting the latest Feature values of all entities of the + // EntityType between [start_time, snapshot_time]. + message SnapshotExport { + // Exports Feature values as of this timestamp. If not set, + // retrieve values as of now. Timestamp, if present, must not have higher + // than millisecond precision. + google.protobuf.Timestamp snapshot_time = 1; + + // Excludes Feature values with feature generation timestamp before this + // timestamp. If not set, retrieve oldest values kept in Feature Store. + // Timestamp, if present, must not have higher than millisecond precision. + google.protobuf.Timestamp start_time = 2; + } + + // Describes exporting all historical Feature values of all entities of the + // EntityType between [start_time, end_time]. + message FullExport { + // Excludes Feature values with feature generation timestamp before this + // timestamp. If not set, retrieve oldest values kept in Feature Store. + // Timestamp, if present, must not have higher than millisecond precision. + google.protobuf.Timestamp start_time = 2; + + // Exports Feature values as of this timestamp. If not set, + // retrieve values as of now. Timestamp, if present, must not have higher + // than millisecond precision. + google.protobuf.Timestamp end_time = 1; + } + + // Required. The mode in which Feature values are exported. + oneof mode { + // Exports the latest Feature values of all entities of the EntityType + // within a time range. + SnapshotExport snapshot_export = 3; + + // Exports all historical values of all entities of the EntityType within a + // time range + FullExport full_export = 7; + } + + // Required. The resource name of the EntityType from which to export Feature values. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + string entity_type = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + } + ]; + + // Required. Specifies destination location and format. + FeatureValueDestination destination = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. Selects Features to export values of. + FeatureSelector feature_selector = 5 [(google.api.field_behavior) = REQUIRED]; + + // Per-Feature export settings. + repeated DestinationFeatureSetting settings = 6; +} + +message DestinationFeatureSetting { + // Required. The ID of the Feature to apply the setting to. + string feature_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Specify the field name in the export destination. If not specified, + // Feature ID is used. + string destination_field = 2; +} + +// A destination location for Feature values and format. +message FeatureValueDestination { + oneof destination { + // Output in BigQuery format. + // [BigQueryDestination.output_uri][google.cloud.aiplatform.v1beta1.BigQueryDestination.output_uri] in + // [FeatureValueDestination.bigquery_destination][google.cloud.aiplatform.v1beta1.FeatureValueDestination.bigquery_destination] must refer to a table. + BigQueryDestination bigquery_destination = 1; + + // Output in TFRecord format. + // + // Below are the mapping from Feature value type + // in Featurestore to Feature value type in TFRecord: + // + // Value type in Featurestore | Value type in TFRecord + // DOUBLE, DOUBLE_ARRAY | FLOAT_LIST + // INT64, INT64_ARRAY | INT64_LIST + // STRING, STRING_ARRAY, BYTES | BYTES_LIST + // true -> byte_string("true"), false -> byte_string("false") + // BOOL, BOOL_ARRAY (true, false) | BYTES_LIST + TFRecordDestination tfrecord_destination = 2; + + // Output in CSV format. Array Feature value types are not allowed in CSV + // format. + CsvDestination csv_destination = 3; + } +} + +// Response message for [FeaturestoreService.ExportFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreService.ExportFeatureValues]. +message ExportFeatureValuesResponse { + +} + +// Response message for [FeaturestoreService.BatchReadFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreService.BatchReadFeatureValues]. +message BatchReadFeatureValuesResponse { + +} + +// Request message for [FeaturestoreService.CreateEntityType][google.cloud.aiplatform.v1beta1.FeaturestoreService.CreateEntityType]. +message CreateEntityTypeRequest { + // Required. The resource name of the Featurestore to create EntityTypes. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Featurestore" + } + ]; + + // The EntityType to create. + EntityType entity_type = 2; + + // Required. The ID to use for the EntityType, which will become the final component of + // the EntityType's resource name. + // + // This value may be up to 60 characters, and valid characters are + // `[a-z0-9_]`. The first character cannot be a number. + // + // The value must be unique within a featurestore. + string entity_type_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [FeaturestoreService.GetEntityType][google.cloud.aiplatform.v1beta1.FeaturestoreService.GetEntityType]. +message GetEntityTypeRequest { + // Required. The name of the EntityType resource. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + } + ]; +} + +// Request message for [FeaturestoreService.ListEntityTypes][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes]. +message ListEntityTypesRequest { + // Required. The resource name of the Featurestore to list EntityTypes. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/EntityType" + } + ]; + + // Lists the EntityTypes that match the filter expression. The following + // filters are supported: + // + // * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + // Values must be in RFC 3339 format. + // * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + // Values must be in RFC 3339 format. + // * `labels`: Supports key-value equality as well as key presence. + // + // Examples: + // + // * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + // update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + // or updated after 2020-01-31T15:30:00.000000Z. + // * `labels.active = yes AND labels.env = prod` --> EntityTypes having both + // (active: yes) and (env: prod) labels. + // * `labels.env: *` --> Any EntityType which has a label with 'env' as the + // key. + string filter = 2; + + // The maximum number of EntityTypes to return. The service may return fewer + // than this value. If unspecified, at most 1000 EntityTypes will be returned. + // The maximum value is 1000; any value greater than 1000 will be coerced to + // 1000. + int32 page_size = 3; + + // A page token, received from a previous + // [FeaturestoreService.ListEntityTypes][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [FeaturestoreService.ListEntityTypes][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes] must + // match the call that provided the page token. + string page_token = 4; + + // A comma-separated list of fields to order by, sorted in ascending order. + // Use "desc" after a field name for descending. + // + // Supported fields: + // + // * `entity_type_id` + // * `create_time` + // * `update_time` + string order_by = 5; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 6; +} + +// Response message for [FeaturestoreService.ListEntityTypes][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes]. +message ListEntityTypesResponse { + // The EntityTypes matching the request. + repeated EntityType entity_types = 1; + + // A token, which can be sent as [ListEntityTypesRequest.page_token][google.cloud.aiplatform.v1beta1.ListEntityTypesRequest.page_token] to + // retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [FeaturestoreService.UpdateEntityType][google.cloud.aiplatform.v1beta1.FeaturestoreService.UpdateEntityType]. +message UpdateEntityTypeRequest { + // Required. The EntityType's `name` field is used to identify the EntityType to be + // updated. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + EntityType entity_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Field mask is used to specify the fields to be overwritten in the + // EntityType resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then only the non-empty fields present in the + // request will be overwritten. Set the update_mask to `*` to override all + // fields. + // + // Updatable fields: + // + // * `description` + // * `labels` + // * `monitoring_config.snapshot_analysis.disabled` + // * `monitoring_config.snapshot_analysis.monitoring_interval_days` + // * `monitoring_config.snapshot_analysis.staleness_days` + // * `monitoring_config.import_features_analysis.state` + // * `monitoring_config.import_features_analysis.anomaly_detection_baseline` + // * `monitoring_config.numerical_threshold_config.value` + // * `monitoring_config.categorical_threshold_config.value` + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for [FeaturestoreService.DeleteEntityTypes][]. +message DeleteEntityTypeRequest { + // Required. The name of the EntityType to be deleted. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + } + ]; + + // If set to true, any Features for this EntityType will also be deleted. + // (Otherwise, the request will only work if the EntityType has no Features.) + bool force = 2; +} + +// Request message for [FeaturestoreService.CreateFeature][google.cloud.aiplatform.v1beta1.FeaturestoreService.CreateFeature]. +message CreateFeatureRequest { + // Required. The resource name of the EntityType to create a Feature. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + } + ]; + + // Required. The Feature to create. + Feature feature = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the Feature, which will become the final component of + // the Feature's resource name. + // + // This value may be up to 60 characters, and valid characters are + // `[a-z0-9_]`. The first character cannot be a number. + // + // The value must be unique within an EntityType. + string feature_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [FeaturestoreService.BatchCreateFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.BatchCreateFeatures]. +message BatchCreateFeaturesRequest { + // Required. The resource name of the EntityType to create the batch of Features under. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + } + ]; + + // Required. The request message specifying the Features to create. All Features must be + // created under the same parent EntityType. The `parent` field in each child + // request message can be omitted. If `parent` is set in a child request, then + // the value must match the `parent` value in this request message. + repeated CreateFeatureRequest requests = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [FeaturestoreService.BatchCreateFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.BatchCreateFeatures]. +message BatchCreateFeaturesResponse { + // The Features created. + repeated Feature features = 1; +} + +// Request message for [FeaturestoreService.GetFeature][google.cloud.aiplatform.v1beta1.FeaturestoreService.GetFeature]. +message GetFeatureRequest { + // Required. The name of the Feature resource. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Feature" + } + ]; +} + +// Request message for [FeaturestoreService.ListFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures]. +message ListFeaturesRequest { + // Required. The resource name of the Location to list Features. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Feature" + } + ]; + + // Lists the Features that match the filter expression. The following + // filters are supported: + // + // * `value_type`: Supports = and != comparisons. + // * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + // be in RFC 3339 format. + // * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + // be in RFC 3339 format. + // * `labels`: Supports key-value equality as well as key presence. + // + // Examples: + // + // * `value_type = DOUBLE` --> Features whose type is DOUBLE. + // * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + // update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + // or updated after 2020-01-31T15:30:00.000000Z. + // * `labels.active = yes AND labels.env = prod` --> Features having both + // (active: yes) and (env: prod) labels. + // * `labels.env: *` --> Any Feature which has a label with 'env' as the + // key. + string filter = 2; + + // The maximum number of Features to return. The service may return fewer + // than this value. If unspecified, at most 1000 Features will be returned. + // The maximum value is 1000; any value greater than 1000 will be coerced to + // 1000. + int32 page_size = 3; + + // A page token, received from a previous + // [FeaturestoreService.ListFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [FeaturestoreService.ListFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures] must + // match the call that provided the page token. + string page_token = 4; + + // A comma-separated list of fields to order by, sorted in ascending order. + // Use "desc" after a field name for descending. + // Supported fields: + // + // * `feature_id` + // * `value_type` + // * `create_time` + // * `update_time` + string order_by = 5; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 6; + + // If set, return the most recent [ListFeaturesRequest.latest_stats_count][google.cloud.aiplatform.v1beta1.ListFeaturesRequest.latest_stats_count] + // of stats for each Feature in response. Valid value is [0, 10]. If number of + // stats exists < [ListFeaturesRequest.latest_stats_count][google.cloud.aiplatform.v1beta1.ListFeaturesRequest.latest_stats_count], return all + // existing stats. + int32 latest_stats_count = 7; +} + +// Response message for [FeaturestoreService.ListFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures]. +message ListFeaturesResponse { + // The Features matching the request. + repeated Feature features = 1; + + // A token, which can be sent as [ListFeaturesRequest.page_token][google.cloud.aiplatform.v1beta1.ListFeaturesRequest.page_token] to + // retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [FeaturestoreService.SearchFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures]. +message SearchFeaturesRequest { + // Required. The resource name of the Location to search Features. + // Format: + // `projects/{project}/locations/{location}` + string location = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Query string that is a conjunction of field-restricted queries and/or + // field-restricted filters. Field-restricted queries and filters can be + // combined using `AND` to form a conjunction. + // + // A field query is in the form FIELD:QUERY. This implicitly checks if QUERY + // exists as a substring within Feature's FIELD. The QUERY + // and the FIELD are converted to a sequence of words (i.e. tokens) for + // comparison. This is done by: + // + // * Removing leading/trailing whitespace and tokenizing the search value. + // Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore + // `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated + // as a wildcard that matches characters within a token. + // * Ignoring case. + // * Prepending an asterisk to the first and appending an asterisk to the + // last token in QUERY. + // + // A QUERY must be either a singular token or a phrase. A phrase is one or + // multiple words enclosed in double quotation marks ("). With phrases, the + // order of the words is important. Words in the phrase must be matching in + // order and consecutively. + // + // Supported FIELDs for field-restricted queries: + // + // * `feature_id` + // * `description` + // * `entity_type_id` + // + // Examples: + // + // * `feature_id: foo` --> Matches a Feature with ID containing the substring + // `foo` (eg. `foo`, `foofeature`, `barfoo`). + // * `feature_id: foo*feature` --> Matches a Feature with ID containing the + // substring `foo*feature` (eg. `foobarfeature`). + // * `feature_id: foo AND description: bar` --> Matches a Feature with ID + // containing the substring `foo` and description containing the substring + // `bar`. + // + // + // Besides field queries, the following exact-match filters are + // supported. The exact-match filters do not support wildcards. Unlike + // field-restricted queries, exact-match filters are case-sensitive. + // + // * `feature_id`: Supports = comparisons. + // * `description`: Supports = comparisons. Multi-token filters should be + // enclosed in quotes. + // * `entity_type_id`: Supports = comparisons. + // * `value_type`: Supports = and != comparisons. + // * `labels`: Supports key-value equality as well as key presence. + // * `featurestore_id`: Supports = comparisons. + // + // Examples: + // * `description = "foo bar"` --> Any Feature with description exactly equal + // to `foo bar` + // * `value_type = DOUBLE` --> Features whose type is DOUBLE. + // * `labels.active = yes AND labels.env = prod` --> Features having both + // (active: yes) and (env: prod) labels. + // * `labels.env: *` --> Any Feature which has a label with `env` as the + // key. + string query = 3; + + // The maximum number of Features to return. The service may return fewer + // than this value. If unspecified, at most 100 Features will be returned. + // The maximum value is 100; any value greater than 100 will be coerced to + // 100. + int32 page_size = 4; + + // A page token, received from a previous + // [FeaturestoreService.SearchFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [FeaturestoreService.SearchFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures], except `page_size`, must + // match the call that provided the page token. + string page_token = 5; +} + +// Response message for [FeaturestoreService.SearchFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures]. +message SearchFeaturesResponse { + // The Features matching the request. + // + // Fields returned: + // + // * `name` + // * `description` + // * `labels` + // * `create_time` + // * `update_time` + repeated Feature features = 1; + + // A token, which can be sent as [SearchFeaturesRequest.page_token][google.cloud.aiplatform.v1beta1.SearchFeaturesRequest.page_token] to + // retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [FeaturestoreService.UpdateFeature][google.cloud.aiplatform.v1beta1.FeaturestoreService.UpdateFeature]. +message UpdateFeatureRequest { + // Required. The Feature's `name` field is used to identify the Feature to be + // updated. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + Feature feature = 1 [(google.api.field_behavior) = REQUIRED]; + + // Field mask is used to specify the fields to be overwritten in the + // Features resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then only the non-empty fields present in the + // request will be overwritten. Set the update_mask to `*` to override all + // fields. + // + // Updatable fields: + // + // * `description` + // * `labels` + // * `disable_monitoring` + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for [FeaturestoreService.DeleteFeature][google.cloud.aiplatform.v1beta1.FeaturestoreService.DeleteFeature]. +message DeleteFeatureRequest { + // Required. The name of the Features to be deleted. + // Format: + // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Feature" + } + ]; +} + +// Details of operations that perform create Featurestore. +message CreateFeaturestoreOperationMetadata { + // Operation metadata for Featurestore. + GenericOperationMetadata generic_metadata = 1; +} + +// Details of operations that perform update Featurestore. +message UpdateFeaturestoreOperationMetadata { + // Operation metadata for Featurestore. + GenericOperationMetadata generic_metadata = 1; +} + +// Details of operations that perform import Feature values. +message ImportFeatureValuesOperationMetadata { + // Operation metadata for Featurestore import Feature values. + GenericOperationMetadata generic_metadata = 1; + + // Number of entities that have been imported by the operation. + int64 imported_entity_count = 2; + + // Number of Feature values that have been imported by the operation. + int64 imported_feature_value_count = 3; + + // The number of rows in input source that weren't imported due to either + // * Not having any featureValues. + // * Having a null entityId. + // * Having a null timestamp. + // * Not being parsable (applicable for CSV sources). + int64 invalid_row_count = 6; +} + +// Details of operations that exports Features values. +message ExportFeatureValuesOperationMetadata { + // Operation metadata for Featurestore export Feature values. + GenericOperationMetadata generic_metadata = 1; +} + +// Details of operations that batch reads Feature values. +message BatchReadFeatureValuesOperationMetadata { + // Operation metadata for Featurestore batch read Features values. + GenericOperationMetadata generic_metadata = 1; +} + +// Details of operations that perform create EntityType. +message CreateEntityTypeOperationMetadata { + // Operation metadata for EntityType. + GenericOperationMetadata generic_metadata = 1; +} + +// Details of operations that perform create Feature. +message CreateFeatureOperationMetadata { + // Operation metadata for Feature. + GenericOperationMetadata generic_metadata = 1; +} + +// Details of operations that perform batch create Features. +message BatchCreateFeaturesOperationMetadata { + // Operation metadata for Feature. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto new file mode 100644 index 00000000..4e994e1e --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto @@ -0,0 +1,110 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/custom_job.proto"; +import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1beta1/job_state.proto"; +import "google/cloud/aiplatform/v1beta1/study.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "HyperparameterTuningJobProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Represents a HyperparameterTuningJob. A HyperparameterTuningJob +// has a Study specification and multiple CustomJobs with identical +// CustomJob specification. +message HyperparameterTuningJob { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/HyperparameterTuningJob" + pattern: "projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}" + }; + + // Output only. Resource name of the HyperparameterTuningJob. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the HyperparameterTuningJob. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Study configuration of the HyperparameterTuningJob. + StudySpec study_spec = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The desired total number of Trials. + int32 max_trial_count = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. The desired number of Trials to run in parallel. + int32 parallel_trial_count = 6 [(google.api.field_behavior) = REQUIRED]; + + // The number of failed Trials that need to be seen before failing + // the HyperparameterTuningJob. + // + // If set to 0, Vertex AI decides how many Trials must fail + // before the whole job fails. + int32 max_failed_trial_count = 7; + + // Required. The spec of a trial job. The same spec applies to the CustomJobs created + // in all the trials. + CustomJobSpec trial_job_spec = 8 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Trials of the HyperparameterTuningJob. + repeated Trial trials = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The detailed state of the job. + JobState state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the HyperparameterTuningJob was created. + google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the HyperparameterTuningJob for the first time entered the + // `JOB_STATE_RUNNING` state. + google.protobuf.Timestamp start_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the HyperparameterTuningJob entered any of the following states: + // `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. + google.protobuf.Timestamp end_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the HyperparameterTuningJob was most recently updated. + google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Only populated when job's state is JOB_STATE_FAILED or + // JOB_STATE_CANCELLED. + google.rpc.Status error = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize HyperparameterTuningJobs. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 16; + + // Customer-managed encryption key options for a HyperparameterTuningJob. + // If this is set, then all resources created by the HyperparameterTuningJob + // will be encrypted with the provided encryption key. + EncryptionSpec encryption_spec = 17; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index.proto new file mode 100644 index 00000000..ea9bc6d1 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index.proto @@ -0,0 +1,96 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/deployed_index_ref.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "IndexProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A representation of a collection of database items organized in a way that +// allows for approximate nearest neighbor (a.k.a ANN) algorithms search. +message Index { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Index" + pattern: "projects/{project}/locations/{location}/indexes/{index}" + }; + + // Output only. The resource name of the Index. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the Index. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the Index. + string description = 3; + + // Immutable. Points to a YAML file stored on Google Cloud Storage describing additional + // information about the Index, that is specific to it. Unset if the Index + // does not have any additional information. + // The schema is defined as an OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + // Note: The URI given on output will be immutable and probably different, + // including the URI scheme, than the one given on input. The output URI will + // point to a location where the user only has a read access. + string metadata_schema_uri = 4 [(google.api.field_behavior) = IMMUTABLE]; + + // An additional information about the Index; the schema of the metadata can + // be found in [metadata_schema][google.cloud.aiplatform.v1beta1.Index.metadata_schema_uri]. + google.protobuf.Value metadata = 6; + + // Output only. The pointers to DeployedIndexes created from this Index. + // An Index can be only deleted if all its DeployedIndexes had been undeployed + // first. + repeated DeployedIndexRef deployed_indexes = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 8; + + // The labels with user-defined metadata to organize your Indexes. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 9; + + // Output only. Timestamp when this Index was created. + google.protobuf.Timestamp create_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Index was most recently updated. + // This also includes any update to the contents of the Index. + // Note that Operations working on this Index may have their + // [Operations.metadata.generic_metadata.update_time] + // [google.cloud.aiplatform.v1beta1.GenericOperationMetadata.update_time] a little after the value of this + // timestamp, yet that does not mean their results are not already reflected + // in the Index. Result of any successfully completed Operation on the Index + // is reflected in it. + google.protobuf.Timestamp update_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto new file mode 100644 index 00000000..3f8fa62b --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto @@ -0,0 +1,245 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/machine_resources.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "IndexEndpointProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Indexes are deployed into it. An IndexEndpoint can have multiple +// DeployedIndexes. +message IndexEndpoint { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/IndexEndpoint" + pattern: "projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}" + }; + + // Output only. The resource name of the IndexEndpoint. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the IndexEndpoint. + // The name can be up to 128 characters long and can consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the IndexEndpoint. + string description = 3; + + // Output only. The indexes deployed in this endpoint. + repeated DeployedIndex deployed_indexes = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 5; + + // The labels with user-defined metadata to organize your IndexEndpoints. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 6; + + // Output only. Timestamp when this IndexEndpoint was created. + google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this IndexEndpoint was last updated. + // This timestamp is not updated when the endpoint's DeployedIndexes are + // updated, e.g. due to updates of the original Indexes they are the + // deployments of. + google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The full name of the Google Compute Engine + // [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) + // to which the IndexEndpoint should be peered. + // + // Private services access must already be configured for the network. If left + // unspecified, the Endpoint is not peered with any network. + // + // [network][google.cloud.aiplatform.v1beta1.IndexEndpoint.network] and + // [private_service_connect_config][google.cloud.aiplatform.v1beta1.IndexEndpoint.private_service_connect_config] + // are mutually exclusive. + // + // [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert): + // projects/{project}/global/networks/{network}. + // Where {project} is a project number, as in '12345', and {network} is + // network name. + string network = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deprecated: If true, expose the IndexEndpoint via private service connect. + // + // Only one of the fields, [network][google.cloud.aiplatform.v1beta1.IndexEndpoint.network] or + // [enable_private_service_connect][google.cloud.aiplatform.v1beta1.IndexEndpoint.enable_private_service_connect], + // can be set. + bool enable_private_service_connect = 10 [ + deprecated = true, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// A deployment of an Index. IndexEndpoints contain one or more DeployedIndexes. +message DeployedIndex { + // Required. The user specified ID of the DeployedIndex. + // The ID can be up to 128 characters long and must start with a letter and + // only contain letters, numbers, and underscores. + // The ID must be unique within the project it is created in. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the Index this is the deployment of. + // We may refer to this Index as the DeployedIndex's "original" Index. + string index = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Index" + } + ]; + + // The display name of the DeployedIndex. If not provided upon creation, + // the Index's display_name is used. + string display_name = 3; + + // Output only. Timestamp when the DeployedIndex was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Provides paths for users to send requests directly to the deployed index + // services running on Cloud via private services access. This field is + // populated if [network][google.cloud.aiplatform.v1beta1.IndexEndpoint.network] is configured. + IndexPrivateEndpoints private_endpoints = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The DeployedIndex may depend on various data on its original Index. + // Additionally when certain changes to the original Index are being done + // (e.g. when what the Index contains is being changed) the DeployedIndex may + // be asynchronously updated in the background to reflect this changes. + // If this timestamp's value is at least the [Index.update_time][google.cloud.aiplatform.v1beta1.Index.update_time] of the + // original Index, it means that this DeployedIndex and the original Index are + // in sync. If this timestamp is older, then to see which updates this + // DeployedIndex already contains (and which not), one must + // [list][Operations.ListOperations] [Operations][Operation] + // [working][Operation.name] on the original Index. Only + // the successfully completed Operations with + // [Operations.metadata.generic_metadata.update_time] + // [google.cloud.aiplatform.v1beta1.GenericOperationMetadata.update_time] + // equal or before this sync time are contained in this DeployedIndex. + google.protobuf.Timestamp index_sync_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A description of resources that the DeployedIndex uses, which to large + // degree are decided by Vertex AI, and optionally allows only a modest + // additional configuration. + // If min_replica_count is not set, the default value is 2 (we don't provide + // SLA when min_replica_count=1). If max_replica_count is not set, the + // default value is min_replica_count. The max allowed replica count is + // 1000. + AutomaticResources automatic_resources = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A description of resources that are dedicated to the DeployedIndex, and + // that need a higher degree of manual configuration. + // If min_replica_count is not set, the default value is 2 (we don't provide + // SLA when min_replica_count=1). If max_replica_count is not set, the + // default value is min_replica_count. The max allowed replica count is + // 1000. + // + // Available machine types: + // n1-standard-16 + // n1-standard-32 + DedicatedResources dedicated_resources = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, private endpoint's access logs are sent to StackDriver Logging. + // + // These logs are like standard server access logs, containing + // information like timestamp and latency for each MatchRequest. + // + // Note that Stackdriver logs may incur a cost, especially if the deployed + // index receives a high queries per second rate (QPS). + // Estimate your costs before enabling this option. + bool enable_access_logging = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the authentication is enabled for the private endpoint. + DeployedIndexAuthConfig deployed_index_auth_config = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of reserved ip ranges under the VPC network that can be + // used for this DeployedIndex. + // + // If set, we will deploy the index within the provided ip ranges. Otherwise, + // the index might be deployed to any ip ranges under the provided VPC + // network. + // + // The value sohuld be the name of the address + // (https://cloud.google.com/compute/docs/reference/rest/v1/addresses) + // Example: 'vertex-ai-ip-range'. + repeated string reserved_ip_ranges = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The deployment group can be no longer than 64 characters (eg: + // 'test', 'prod'). If not set, we will use the 'default' deployment group. + // + // Creating `deployment_groups` with `reserved_ip_ranges` is a recommended + // practice when the peered network has multiple peering ranges. This creates + // your deployments from predictable IP spaces for easier traffic + // administration. Also, one deployment_group (except 'default') can only be + // used with the same reserved_ip_ranges which means if the deployment_group + // has been used with reserved_ip_ranges: [a, b, c], using it with [a, b] or + // [d, e] is disallowed. + // + // Note: we only support up to 5 deployment groups(not including 'default'). + string deployment_group = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// Used to set up the auth on the DeployedIndex's private endpoint. +message DeployedIndexAuthConfig { + // Configuration for an authentication provider, including support for + // [JSON Web Token + // (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). + message AuthProvider { + // The list of JWT + // [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + // that are allowed to access. A JWT containing any of these audiences will + // be accepted. + repeated string audiences = 1; + + // A list of allowed JWT issuers. Each entry must be a valid Google + // service account, in the following format: + // + // `service-account-name@project-id.iam.gserviceaccount.com` + repeated string allowed_issuers = 2; + } + + // Defines the authentication provider that the DeployedIndex uses. + AuthProvider auth_provider = 1; +} + +// IndexPrivateEndpoints proto is used to provide paths for users to send +// requests via private endpoints (e.g. private service access, private service +// connect). +// To send request via private service access, use match_grpc_address. +// To send request via private service connect, use service_attachment. +message IndexPrivateEndpoints { + // Output only. The ip address used to send match gRPC requests. + string match_grpc_address = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the service attachment resource. Populated if private service + // connect is enabled. + string service_attachment = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto new file mode 100644 index 00000000..c688741f --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto @@ -0,0 +1,335 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/index_endpoint.proto"; +import "google/cloud/aiplatform/v1beta1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "IndexEndpointServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A service for managing Vertex AI's IndexEndpoints. +service IndexEndpointService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates an IndexEndpoint. + rpc CreateIndexEndpoint(CreateIndexEndpointRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/indexEndpoints" + body: "index_endpoint" + }; + option (google.api.method_signature) = "parent,index_endpoint"; + option (google.longrunning.operation_info) = { + response_type: "IndexEndpoint" + metadata_type: "CreateIndexEndpointOperationMetadata" + }; + } + + // Gets an IndexEndpoint. + rpc GetIndexEndpoint(GetIndexEndpointRequest) returns (IndexEndpoint) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists IndexEndpoints in a Location. + rpc ListIndexEndpoints(ListIndexEndpointsRequest) returns (ListIndexEndpointsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/indexEndpoints" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates an IndexEndpoint. + rpc UpdateIndexEndpoint(UpdateIndexEndpointRequest) returns (IndexEndpoint) { + option (google.api.http) = { + patch: "/v1beta1/{index_endpoint.name=projects/*/locations/*/indexEndpoints/*}" + body: "index_endpoint" + }; + option (google.api.method_signature) = "index_endpoint,update_mask"; + } + + // Deletes an IndexEndpoint. + rpc DeleteIndexEndpoint(DeleteIndexEndpointRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Deploys an Index into this IndexEndpoint, creating a DeployedIndex within + // it. + // Only non-empty Indexes can be deployed. + rpc DeployIndex(DeployIndexRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:deployIndex" + body: "*" + }; + option (google.api.method_signature) = "index_endpoint,deployed_index"; + option (google.longrunning.operation_info) = { + response_type: "DeployIndexResponse" + metadata_type: "DeployIndexOperationMetadata" + }; + } + + // Undeploys an Index from an IndexEndpoint, removing a DeployedIndex from it, + // and freeing all resources it's using. + rpc UndeployIndex(UndeployIndexRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:undeployIndex" + body: "*" + }; + option (google.api.method_signature) = "index_endpoint,deployed_index_id"; + option (google.longrunning.operation_info) = { + response_type: "UndeployIndexResponse" + metadata_type: "UndeployIndexOperationMetadata" + }; + } + + // Update an existing DeployedIndex under an IndexEndpoint. + rpc MutateDeployedIndex(MutateDeployedIndexRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:mutateDeployedIndex" + body: "deployed_index" + }; + option (google.api.method_signature) = "index_endpoint,deployed_index"; + option (google.longrunning.operation_info) = { + response_type: "MutateDeployedIndexResponse" + metadata_type: "MutateDeployedIndexOperationMetadata" + }; + } +} + +// Request message for [IndexEndpointService.CreateIndexEndpoint][google.cloud.aiplatform.v1beta1.IndexEndpointService.CreateIndexEndpoint]. +message CreateIndexEndpointRequest { + // Required. The resource name of the Location to create the IndexEndpoint in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The IndexEndpoint to create. + IndexEndpoint index_endpoint = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Runtime operation information for +// [IndexEndpointService.CreateIndexEndpoint][google.cloud.aiplatform.v1beta1.IndexEndpointService.CreateIndexEndpoint]. +message CreateIndexEndpointOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [IndexEndpointService.GetIndexEndpoint][google.cloud.aiplatform.v1beta1.IndexEndpointService.GetIndexEndpoint] +message GetIndexEndpointRequest { + // Required. The name of the IndexEndpoint resource. + // Format: + // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/IndexEndpoint" + } + ]; +} + +// Request message for [IndexEndpointService.ListIndexEndpoints][google.cloud.aiplatform.v1beta1.IndexEndpointService.ListIndexEndpoints]. +message ListIndexEndpointsRequest { + // Required. The resource name of the Location from which to list the IndexEndpoints. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. An expression for filtering the results of the request. For field names + // both snake_case and camelCase are supported. + // + // * `index_endpoint` supports = and !=. `index_endpoint` represents the + // IndexEndpoint ID, ie. the last segment of the IndexEndpoint's + // [resourcename][google.cloud.aiplatform.v1beta1.IndexEndpoint.name]. + // * `display_name` supports =, != and regex() + // (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) + // * `labels` supports general map functions that is: + // `labels.key=value` - key:value equality + // `labels.key:* or labels:key - key existence + // A key including a space must be quoted. `labels."a key"`. + // + // Some examples: + // * `index_endpoint="1"` + // * `display_name="myDisplayName"` + // * `regex(display_name, "^A") -> The display name starts with an A. + // * `labels.myKey="myValue"` + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page size. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page token. + // Typically obtained via + // [ListIndexEndpointsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListIndexEndpointsResponse.next_page_token] of the previous + // [IndexEndpointService.ListIndexEndpoints][google.cloud.aiplatform.v1beta1.IndexEndpointService.ListIndexEndpoints] call. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [IndexEndpointService.ListIndexEndpoints][google.cloud.aiplatform.v1beta1.IndexEndpointService.ListIndexEndpoints]. +message ListIndexEndpointsResponse { + // List of IndexEndpoints in the requested page. + repeated IndexEndpoint index_endpoints = 1; + + // A token to retrieve next page of results. + // Pass to [ListIndexEndpointsRequest.page_token][google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [IndexEndpointService.UpdateIndexEndpoint][google.cloud.aiplatform.v1beta1.IndexEndpointService.UpdateIndexEndpoint]. +message UpdateIndexEndpointRequest { + // Required. The IndexEndpoint which replaces the resource on the server. + IndexEndpoint index_endpoint = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. See [google.protobuf.FieldMask][google.protobuf.FieldMask]. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [IndexEndpointService.DeleteIndexEndpoint][google.cloud.aiplatform.v1beta1.IndexEndpointService.DeleteIndexEndpoint]. +message DeleteIndexEndpointRequest { + // Required. The name of the IndexEndpoint resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/IndexEndpoint" + } + ]; +} + +// Request message for [IndexEndpointService.DeployIndex][google.cloud.aiplatform.v1beta1.IndexEndpointService.DeployIndex]. +message DeployIndexRequest { + // Required. The name of the IndexEndpoint resource into which to deploy an Index. + // Format: + // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + string index_endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/IndexEndpoint" + } + ]; + + // Required. The DeployedIndex to be created within the IndexEndpoint. + DeployedIndex deployed_index = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [IndexEndpointService.DeployIndex][google.cloud.aiplatform.v1beta1.IndexEndpointService.DeployIndex]. +message DeployIndexResponse { + // The DeployedIndex that had been deployed in the IndexEndpoint. + DeployedIndex deployed_index = 1; +} + +// Runtime operation information for [IndexEndpointService.DeployIndex][google.cloud.aiplatform.v1beta1.IndexEndpointService.DeployIndex]. +message DeployIndexOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; + + // The unique index id specified by user + string deployed_index_id = 2; +} + +// Request message for [IndexEndpointService.UndeployIndex][google.cloud.aiplatform.v1beta1.IndexEndpointService.UndeployIndex]. +message UndeployIndexRequest { + // Required. The name of the IndexEndpoint resource from which to undeploy an Index. + // Format: + // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + string index_endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/IndexEndpoint" + } + ]; + + // Required. The ID of the DeployedIndex to be undeployed from the IndexEndpoint. + string deployed_index_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [IndexEndpointService.UndeployIndex][google.cloud.aiplatform.v1beta1.IndexEndpointService.UndeployIndex]. +message UndeployIndexResponse { + +} + +// Runtime operation information for [IndexEndpointService.UndeployIndex][google.cloud.aiplatform.v1beta1.IndexEndpointService.UndeployIndex]. +message UndeployIndexOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [IndexEndpointService.MutateDeployedIndex][google.cloud.aiplatform.v1beta1.IndexEndpointService.MutateDeployedIndex]. +message MutateDeployedIndexRequest { + // Required. The name of the IndexEndpoint resource into which to deploy an Index. + // Format: + // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + string index_endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/IndexEndpoint" + } + ]; + + // Required. The DeployedIndex to be updated within the IndexEndpoint. + // Currently, the updatable fields are [DeployedIndex][automatic_resources] + // and [DeployedIndex][dedicated_resources] + DeployedIndex deployed_index = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [IndexEndpointService.MutateDeployedIndex][google.cloud.aiplatform.v1beta1.IndexEndpointService.MutateDeployedIndex]. +message MutateDeployedIndexResponse { + // The DeployedIndex that had been updated in the IndexEndpoint. + DeployedIndex deployed_index = 1; +} + +// Runtime operation information for +// [IndexEndpointService.MutateDeployedIndex][google.cloud.aiplatform.v1beta1.IndexEndpointService.MutateDeployedIndex]. +message MutateDeployedIndexOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; + + // The unique index id specified by user + string deployed_index_id = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_service.proto new file mode 100644 index 00000000..db6aaaa0 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_service.proto @@ -0,0 +1,277 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/index.proto"; +import "google/cloud/aiplatform/v1beta1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "IndexServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A service for creating and managing Vertex AI's Index resources. +service IndexService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates an Index. + rpc CreateIndex(CreateIndexRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/indexes" + body: "index" + }; + option (google.api.method_signature) = "parent,index"; + option (google.longrunning.operation_info) = { + response_type: "Index" + metadata_type: "CreateIndexOperationMetadata" + }; + } + + // Gets an Index. + rpc GetIndex(GetIndexRequest) returns (Index) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/indexes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Indexes in a Location. + rpc ListIndexes(ListIndexesRequest) returns (ListIndexesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/indexes" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates an Index. + rpc UpdateIndex(UpdateIndexRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{index.name=projects/*/locations/*/indexes/*}" + body: "index" + }; + option (google.api.method_signature) = "index,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Index" + metadata_type: "UpdateIndexOperationMetadata" + }; + } + + // Deletes an Index. + // An Index can only be deleted when all its + // [DeployedIndexes][google.cloud.aiplatform.v1beta1.Index.deployed_indexes] had been undeployed. + rpc DeleteIndex(DeleteIndexRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/indexes/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } +} + +// Request message for [IndexService.CreateIndex][google.cloud.aiplatform.v1beta1.IndexService.CreateIndex]. +message CreateIndexRequest { + // Required. The resource name of the Location to create the Index in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The Index to create. + Index index = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Runtime operation information for [IndexService.CreateIndex][google.cloud.aiplatform.v1beta1.IndexService.CreateIndex]. +message CreateIndexOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; + + // The operation metadata with regard to Matching Engine Index operation. + NearestNeighborSearchOperationMetadata nearest_neighbor_search_operation_metadata = 2; +} + +// Request message for [IndexService.GetIndex][google.cloud.aiplatform.v1beta1.IndexService.GetIndex] +message GetIndexRequest { + // Required. The name of the Index resource. + // Format: + // `projects/{project}/locations/{location}/indexes/{index}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Index" + } + ]; +} + +// Request message for [IndexService.ListIndexes][google.cloud.aiplatform.v1beta1.IndexService.ListIndexes]. +message ListIndexesRequest { + // Required. The resource name of the Location from which to list the Indexes. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The standard list filter. + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListIndexesResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListIndexesResponse.next_page_token] of the previous + // [IndexService.ListIndexes][google.cloud.aiplatform.v1beta1.IndexService.ListIndexes] call. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for [IndexService.ListIndexes][google.cloud.aiplatform.v1beta1.IndexService.ListIndexes]. +message ListIndexesResponse { + // List of indexes in the requested page. + repeated Index indexes = 1; + + // A token to retrieve next page of results. + // Pass to [ListIndexesRequest.page_token][google.cloud.aiplatform.v1beta1.ListIndexesRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [IndexService.UpdateIndex][google.cloud.aiplatform.v1beta1.IndexService.UpdateIndex]. +message UpdateIndexRequest { + // Required. The Index which updates the resource on the server. + Index index = 1 [(google.api.field_behavior) = REQUIRED]; + + // The update mask applies to the resource. + // For the `FieldMask` definition, see [google.protobuf.FieldMask][google.protobuf.FieldMask]. + google.protobuf.FieldMask update_mask = 2; +} + +// Runtime operation information for [IndexService.UpdateIndex][google.cloud.aiplatform.v1beta1.IndexService.UpdateIndex]. +message UpdateIndexOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; + + // The operation metadata with regard to Matching Engine Index operation. + NearestNeighborSearchOperationMetadata nearest_neighbor_search_operation_metadata = 2; +} + +// Request message for [IndexService.DeleteIndex][google.cloud.aiplatform.v1beta1.IndexService.DeleteIndex]. +message DeleteIndexRequest { + // Required. The name of the Index resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/indexes/{index}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Index" + } + ]; +} + +// Runtime operation metadata with regard to Matching Engine Index. +message NearestNeighborSearchOperationMetadata { + message RecordError { + enum RecordErrorType { + // Default, shall not be used. + ERROR_TYPE_UNSPECIFIED = 0; + + // The record is empty. + EMPTY_LINE = 1; + + // Invalid json format. + INVALID_JSON_SYNTAX = 2; + + // Invalid csv format. + INVALID_CSV_SYNTAX = 3; + + // Invalid avro format. + INVALID_AVRO_SYNTAX = 4; + + // The embedding id is not valid. + INVALID_EMBEDDING_ID = 5; + + // The size of the embedding vectors does not match with the specified + // dimension. + EMBEDDING_SIZE_MISMATCH = 6; + + // The `namespace` field is missing. + NAMESPACE_MISSING = 7; + } + + // The error type of this record. + RecordErrorType error_type = 1; + + // A human-readable message that is shown to the user to help them fix the + // error. Note that this message may change from time to time, your code + // should check against error_type as the source of truth. + string error_message = 2; + + // Cloud Storage URI pointing to the original file in user's bucket. + string source_gcs_uri = 3; + + // Empty if the embedding id is failed to parse. + string embedding_id = 4; + + // The original content of this record. + string raw_record = 5; + } + + message ContentValidationStats { + // Cloud Storage URI pointing to the original file in user's bucket. + string source_gcs_uri = 1; + + // Number of records in this file that were successfully processed. + int64 valid_record_count = 2; + + // Number of records in this file we skipped due to validate errors. + int64 invalid_record_count = 3; + + // The detail information of the partial failures encountered for those + // invalid records that couldn't be parsed. + // Up to 50 partial errors will be reported. + repeated RecordError partial_errors = 4; + } + + // The validation stats of the content (per file) to be inserted or + // updated on the Matching Engine Index resource. Populated if + // contentsDeltaUri is provided as part of [Index.metadata][google.cloud.aiplatform.v1beta1.Index.metadata]. Please note + // that, currently for those files that are broken or has unsupported file + // format, we will not have the stats for those files. + repeated ContentValidationStats content_validation_stats = 1; + + // The ingested data size in bytes. + int64 data_bytes_count = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/io.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/io.proto new file mode 100644 index 00000000..f571bb62 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/io.proto @@ -0,0 +1,108 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "IoProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// The storage details for Avro input content. +message AvroSource { + // Required. Google Cloud Storage location. + GcsSource gcs_source = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The storage details for CSV input content. +message CsvSource { + // Required. Google Cloud Storage location. + GcsSource gcs_source = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The Google Cloud Storage location for the input content. +message GcsSource { + // Required. Google Cloud Storage URI(-s) to the input file(s). May contain + // wildcards. For more information on wildcards, see + // https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames. + repeated string uris = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The Google Cloud Storage location where the output is to be written to. +message GcsDestination { + // Required. Google Cloud Storage URI to output directory. If the uri doesn't end with + // '/', a '/' will be automatically appended. The directory is created if it + // doesn't exist. + string output_uri_prefix = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The BigQuery location for the input content. +message BigQuerySource { + // Required. BigQuery URI to a table, up to 2000 characters long. + // Accepted forms: + // + // * BigQuery path. For example: `bq://projectId.bqDatasetId.bqTableId`. + string input_uri = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The BigQuery location for the output content. +message BigQueryDestination { + // Required. BigQuery URI to a project or table, up to 2000 characters long. + // + // When only the project is specified, the Dataset and Table is created. + // When the full table reference is specified, the Dataset must exist and + // table must not exist. + // + // Accepted forms: + // + // * BigQuery path. For example: + // `bq://projectId` or `bq://projectId.bqDatasetId` or + // `bq://projectId.bqDatasetId.bqTableId`. + string output_uri = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The storage details for CSV output content. +message CsvDestination { + // Required. Google Cloud Storage location. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The storage details for TFRecord output content. +message TFRecordDestination { + // Required. Google Cloud Storage location. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The Container Registry location for the container image. +message ContainerRegistryDestination { + // Required. Container Registry URI of a container image. + // Only Google Container Registry and Artifact Registry are supported now. + // Accepted forms: + // + // * Google Container Registry path. For example: + // `gcr.io/projectId/imageName:tag`. + // + // * Artifact Registry path. For example: + // `us-central1-docker.pkg.dev/projectId/repoName/imageName:tag`. + // + // If a tag is not specified, "latest" will be used as the default tag. + string output_uri = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_service.proto new file mode 100644 index 00000000..6929a1e9 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_service.proto @@ -0,0 +1,1003 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/batch_prediction_job.proto"; +import "google/cloud/aiplatform/v1beta1/custom_job.proto"; +import "google/cloud/aiplatform/v1beta1/data_labeling_job.proto"; +import "google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto"; +import "google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto"; +import "google/cloud/aiplatform/v1beta1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "JobServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A service for creating and managing Vertex AI's jobs. +service JobService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a CustomJob. A created CustomJob right away + // will be attempted to be run. + rpc CreateCustomJob(CreateCustomJobRequest) returns (CustomJob) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/customJobs" + body: "custom_job" + }; + option (google.api.method_signature) = "parent,custom_job"; + } + + // Gets a CustomJob. + rpc GetCustomJob(GetCustomJobRequest) returns (CustomJob) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/customJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists CustomJobs in a Location. + rpc ListCustomJobs(ListCustomJobsRequest) returns (ListCustomJobsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/customJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a CustomJob. + rpc DeleteCustomJob(DeleteCustomJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/customJobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Cancels a CustomJob. + // Starts asynchronous cancellation on the CustomJob. The server + // makes a best effort to cancel the job, but success is not + // guaranteed. Clients can use [JobService.GetCustomJob][google.cloud.aiplatform.v1beta1.JobService.GetCustomJob] or + // other methods to check whether the cancellation succeeded or whether the + // job completed despite cancellation. On successful cancellation, + // the CustomJob is not deleted; instead it becomes a job with + // a [CustomJob.error][google.cloud.aiplatform.v1beta1.CustomJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`, and [CustomJob.state][google.cloud.aiplatform.v1beta1.CustomJob.state] is set to + // `CANCELLED`. + rpc CancelCustomJob(CancelCustomJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/customJobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a DataLabelingJob. + rpc CreateDataLabelingJob(CreateDataLabelingJobRequest) returns (DataLabelingJob) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/dataLabelingJobs" + body: "data_labeling_job" + }; + option (google.api.method_signature) = "parent,data_labeling_job"; + } + + // Gets a DataLabelingJob. + rpc GetDataLabelingJob(GetDataLabelingJobRequest) returns (DataLabelingJob) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists DataLabelingJobs in a Location. + rpc ListDataLabelingJobs(ListDataLabelingJobsRequest) returns (ListDataLabelingJobsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/dataLabelingJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a DataLabelingJob. + rpc DeleteDataLabelingJob(DeleteDataLabelingJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Cancels a DataLabelingJob. Success of cancellation is not guaranteed. + rpc CancelDataLabelingJob(CancelDataLabelingJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a HyperparameterTuningJob + rpc CreateHyperparameterTuningJob(CreateHyperparameterTuningJobRequest) returns (HyperparameterTuningJob) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/hyperparameterTuningJobs" + body: "hyperparameter_tuning_job" + }; + option (google.api.method_signature) = "parent,hyperparameter_tuning_job"; + } + + // Gets a HyperparameterTuningJob + rpc GetHyperparameterTuningJob(GetHyperparameterTuningJobRequest) returns (HyperparameterTuningJob) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists HyperparameterTuningJobs in a Location. + rpc ListHyperparameterTuningJobs(ListHyperparameterTuningJobsRequest) returns (ListHyperparameterTuningJobsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/hyperparameterTuningJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a HyperparameterTuningJob. + rpc DeleteHyperparameterTuningJob(DeleteHyperparameterTuningJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Cancels a HyperparameterTuningJob. + // Starts asynchronous cancellation on the HyperparameterTuningJob. The server + // makes a best effort to cancel the job, but success is not + // guaranteed. Clients can use [JobService.GetHyperparameterTuningJob][google.cloud.aiplatform.v1beta1.JobService.GetHyperparameterTuningJob] or + // other methods to check whether the cancellation succeeded or whether the + // job completed despite cancellation. On successful cancellation, + // the HyperparameterTuningJob is not deleted; instead it becomes a job with + // a [HyperparameterTuningJob.error][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] + // of 1, corresponding to `Code.CANCELLED`, and + // [HyperparameterTuningJob.state][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.state] is set to `CANCELLED`. + rpc CancelHyperparameterTuningJob(CancelHyperparameterTuningJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a BatchPredictionJob. A BatchPredictionJob once created will + // right away be attempted to start. + rpc CreateBatchPredictionJob(CreateBatchPredictionJobRequest) returns (BatchPredictionJob) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/batchPredictionJobs" + body: "batch_prediction_job" + }; + option (google.api.method_signature) = "parent,batch_prediction_job"; + } + + // Gets a BatchPredictionJob + rpc GetBatchPredictionJob(GetBatchPredictionJobRequest) returns (BatchPredictionJob) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/batchPredictionJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists BatchPredictionJobs in a Location. + rpc ListBatchPredictionJobs(ListBatchPredictionJobsRequest) returns (ListBatchPredictionJobsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/batchPredictionJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a BatchPredictionJob. Can only be called on jobs that already + // finished. + rpc DeleteBatchPredictionJob(DeleteBatchPredictionJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/batchPredictionJobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Cancels a BatchPredictionJob. + // + // Starts asynchronous cancellation on the BatchPredictionJob. The server + // makes the best effort to cancel the job, but success is not + // guaranteed. Clients can use [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1beta1.JobService.GetBatchPredictionJob] or + // other methods to check whether the cancellation succeeded or whether the + // job completed despite cancellation. On a successful cancellation, + // the BatchPredictionJob is not deleted;instead its + // [BatchPredictionJob.state][google.cloud.aiplatform.v1beta1.BatchPredictionJob.state] is set to `CANCELLED`. Any files already + // outputted by the job are not deleted. + rpc CancelBatchPredictionJob(CancelBatchPredictionJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/batchPredictionJobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a ModelDeploymentMonitoringJob. It will run periodically on a + // configured interval. + rpc CreateModelDeploymentMonitoringJob(CreateModelDeploymentMonitoringJobRequest) returns (ModelDeploymentMonitoringJob) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/modelDeploymentMonitoringJobs" + body: "model_deployment_monitoring_job" + }; + option (google.api.method_signature) = "parent,model_deployment_monitoring_job"; + } + + // Searches Model Monitoring Statistics generated within a given time window. + rpc SearchModelDeploymentMonitoringStatsAnomalies(SearchModelDeploymentMonitoringStatsAnomaliesRequest) returns (SearchModelDeploymentMonitoringStatsAnomaliesResponse) { + option (google.api.http) = { + post: "/v1beta1/{model_deployment_monitoring_job=projects/*/locations/*/modelDeploymentMonitoringJobs/*}:searchModelDeploymentMonitoringStatsAnomalies" + body: "*" + }; + option (google.api.method_signature) = "model_deployment_monitoring_job,deployed_model_id"; + } + + // Gets a ModelDeploymentMonitoringJob. + rpc GetModelDeploymentMonitoringJob(GetModelDeploymentMonitoringJobRequest) returns (ModelDeploymentMonitoringJob) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists ModelDeploymentMonitoringJobs in a Location. + rpc ListModelDeploymentMonitoringJobs(ListModelDeploymentMonitoringJobsRequest) returns (ListModelDeploymentMonitoringJobsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/modelDeploymentMonitoringJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a ModelDeploymentMonitoringJob. + rpc UpdateModelDeploymentMonitoringJob(UpdateModelDeploymentMonitoringJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{model_deployment_monitoring_job.name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}" + body: "model_deployment_monitoring_job" + }; + option (google.api.method_signature) = "model_deployment_monitoring_job,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "ModelDeploymentMonitoringJob" + metadata_type: "UpdateModelDeploymentMonitoringJobOperationMetadata" + }; + } + + // Deletes a ModelDeploymentMonitoringJob. + rpc DeleteModelDeploymentMonitoringJob(DeleteModelDeploymentMonitoringJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Pauses a ModelDeploymentMonitoringJob. If the job is running, the server + // makes a best effort to cancel the job. Will mark + // [ModelDeploymentMonitoringJob.state][google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob.state] to 'PAUSED'. + rpc PauseModelDeploymentMonitoringJob(PauseModelDeploymentMonitoringJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}:pause" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Resumes a paused ModelDeploymentMonitoringJob. It will start to run from + // next scheduled time. A deleted ModelDeploymentMonitoringJob can't be + // resumed. + rpc ResumeModelDeploymentMonitoringJob(ResumeModelDeploymentMonitoringJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}:resume" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for [JobService.CreateCustomJob][google.cloud.aiplatform.v1beta1.JobService.CreateCustomJob]. +message CreateCustomJobRequest { + // Required. The resource name of the Location to create the CustomJob in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The CustomJob to create. + CustomJob custom_job = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [JobService.GetCustomJob][google.cloud.aiplatform.v1beta1.JobService.GetCustomJob]. +message GetCustomJobRequest { + // Required. The name of the CustomJob resource. + // Format: + // `projects/{project}/locations/{location}/customJobs/{custom_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/CustomJob" + } + ]; +} + +// Request message for [JobService.ListCustomJobs][google.cloud.aiplatform.v1beta1.JobService.ListCustomJobs]. +message ListCustomJobsRequest { + // Required. The resource name of the Location to list the CustomJobs from. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The standard list filter. + // + // Supported fields: + // + // * `display_name` supports = and !=. + // + // * `state` supports = and !=. + // + // Some examples of using the filter are: + // + // * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + // + // * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + // + // * `NOT display_name="my_job"` + // + // * `state="JOB_STATE_FAILED"` + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListCustomJobsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListCustomJobsResponse.next_page_token] of the previous + // [JobService.ListCustomJobs][google.cloud.aiplatform.v1beta1.JobService.ListCustomJobs] call. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for [JobService.ListCustomJobs][google.cloud.aiplatform.v1beta1.JobService.ListCustomJobs] +message ListCustomJobsResponse { + // List of CustomJobs in the requested page. + repeated CustomJob custom_jobs = 1; + + // A token to retrieve the next page of results. + // Pass to [ListCustomJobsRequest.page_token][google.cloud.aiplatform.v1beta1.ListCustomJobsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [JobService.DeleteCustomJob][google.cloud.aiplatform.v1beta1.JobService.DeleteCustomJob]. +message DeleteCustomJobRequest { + // Required. The name of the CustomJob resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/customJobs/{custom_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/CustomJob" + } + ]; +} + +// Request message for [JobService.CancelCustomJob][google.cloud.aiplatform.v1beta1.JobService.CancelCustomJob]. +message CancelCustomJobRequest { + // Required. The name of the CustomJob to cancel. + // Format: + // `projects/{project}/locations/{location}/customJobs/{custom_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/CustomJob" + } + ]; +} + +// Request message for [JobService.CreateDataLabelingJob][google.cloud.aiplatform.v1beta1.JobService.CreateDataLabelingJob]. +message CreateDataLabelingJobRequest { + // Required. The parent of the DataLabelingJob. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The DataLabelingJob to create. + DataLabelingJob data_labeling_job = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [JobService.GetDataLabelingJob][google.cloud.aiplatform.v1beta1.JobService.GetDataLabelingJob]. +message GetDataLabelingJobRequest { + // Required. The name of the DataLabelingJob. + // Format: + // `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/DataLabelingJob" + } + ]; +} + +// Request message for [JobService.ListDataLabelingJobs][google.cloud.aiplatform.v1beta1.JobService.ListDataLabelingJobs]. +message ListDataLabelingJobsRequest { + // Required. The parent of the DataLabelingJob. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The standard list filter. + // + // Supported fields: + // + // * `display_name` supports = and !=. + // + // * `state` supports = and !=. + // + // Some examples of using the filter are: + // + // * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + // + // * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + // + // * `NOT display_name="my_job"` + // + // * `state="JOB_STATE_FAILED"` + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + string page_token = 4; + + // Mask specifying which fields to read. FieldMask represents a set of + // symbolic field paths. For example, the mask can be `paths: "name"`. The + // "name" here is a field in DataLabelingJob. + // If this field is not set, all fields of the DataLabelingJob are returned. + google.protobuf.FieldMask read_mask = 5; + + // A comma-separated list of fields to order by, sorted in ascending order by + // default. + // Use `desc` after a field name for descending. + string order_by = 6; +} + +// Response message for [JobService.ListDataLabelingJobs][google.cloud.aiplatform.v1beta1.JobService.ListDataLabelingJobs]. +message ListDataLabelingJobsResponse { + // A list of DataLabelingJobs that matches the specified filter in the + // request. + repeated DataLabelingJob data_labeling_jobs = 1; + + // The standard List next-page token. + string next_page_token = 2; +} + +// Request message for [JobService.DeleteDataLabelingJob][google.cloud.aiplatform.v1beta1.JobService.DeleteDataLabelingJob]. +message DeleteDataLabelingJobRequest { + // Required. The name of the DataLabelingJob to be deleted. + // Format: + // `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/DataLabelingJob" + } + ]; +} + +// Request message for [JobService.CancelDataLabelingJob][google.cloud.aiplatform.v1beta1.JobService.CancelDataLabelingJob]. +message CancelDataLabelingJobRequest { + // Required. The name of the DataLabelingJob. + // Format: + // `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/DataLabelingJob" + } + ]; +} + +// Request message for [JobService.CreateHyperparameterTuningJob][google.cloud.aiplatform.v1beta1.JobService.CreateHyperparameterTuningJob]. +message CreateHyperparameterTuningJobRequest { + // Required. The resource name of the Location to create the HyperparameterTuningJob in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The HyperparameterTuningJob to create. + HyperparameterTuningJob hyperparameter_tuning_job = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [JobService.GetHyperparameterTuningJob][google.cloud.aiplatform.v1beta1.JobService.GetHyperparameterTuningJob]. +message GetHyperparameterTuningJobRequest { + // Required. The name of the HyperparameterTuningJob resource. + // Format: + // `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/HyperparameterTuningJob" + } + ]; +} + +// Request message for [JobService.ListHyperparameterTuningJobs][google.cloud.aiplatform.v1beta1.JobService.ListHyperparameterTuningJobs]. +message ListHyperparameterTuningJobsRequest { + // Required. The resource name of the Location to list the HyperparameterTuningJobs + // from. Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The standard list filter. + // + // Supported fields: + // + // * `display_name` supports = and !=. + // + // * `state` supports = and !=. + // + // Some examples of using the filter are: + // + // * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + // + // * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + // + // * `NOT display_name="my_job"` + // + // * `state="JOB_STATE_FAILED"` + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListHyperparameterTuningJobsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsResponse.next_page_token] of the previous + // [JobService.ListHyperparameterTuningJobs][google.cloud.aiplatform.v1beta1.JobService.ListHyperparameterTuningJobs] call. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for [JobService.ListHyperparameterTuningJobs][google.cloud.aiplatform.v1beta1.JobService.ListHyperparameterTuningJobs] +message ListHyperparameterTuningJobsResponse { + // List of HyperparameterTuningJobs in the requested page. + // [HyperparameterTuningJob.trials][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.trials] of the jobs will be not be returned. + repeated HyperparameterTuningJob hyperparameter_tuning_jobs = 1; + + // A token to retrieve the next page of results. + // Pass to [ListHyperparameterTuningJobsRequest.page_token][google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest.page_token] to obtain that + // page. + string next_page_token = 2; +} + +// Request message for [JobService.DeleteHyperparameterTuningJob][google.cloud.aiplatform.v1beta1.JobService.DeleteHyperparameterTuningJob]. +message DeleteHyperparameterTuningJobRequest { + // Required. The name of the HyperparameterTuningJob resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/HyperparameterTuningJob" + } + ]; +} + +// Request message for [JobService.CancelHyperparameterTuningJob][google.cloud.aiplatform.v1beta1.JobService.CancelHyperparameterTuningJob]. +message CancelHyperparameterTuningJobRequest { + // Required. The name of the HyperparameterTuningJob to cancel. + // Format: + // `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/HyperparameterTuningJob" + } + ]; +} + +// Request message for [JobService.CreateBatchPredictionJob][google.cloud.aiplatform.v1beta1.JobService.CreateBatchPredictionJob]. +message CreateBatchPredictionJobRequest { + // Required. The resource name of the Location to create the BatchPredictionJob in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The BatchPredictionJob to create. + BatchPredictionJob batch_prediction_job = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1beta1.JobService.GetBatchPredictionJob]. +message GetBatchPredictionJobRequest { + // Required. The name of the BatchPredictionJob resource. + // Format: + // `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/BatchPredictionJob" + } + ]; +} + +// Request message for [JobService.ListBatchPredictionJobs][google.cloud.aiplatform.v1beta1.JobService.ListBatchPredictionJobs]. +message ListBatchPredictionJobsRequest { + // Required. The resource name of the Location to list the BatchPredictionJobs + // from. Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The standard list filter. + // + // Supported fields: + // + // * `display_name` supports = and !=. + // + // * `state` supports = and !=. + // + // * `model_display_name` supports = and != + // + // Some examples of using the filter are: + // + // * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + // + // * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + // + // * `NOT display_name="my_job"` + // + // * `state="JOB_STATE_FAILED"` + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListBatchPredictionJobsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsResponse.next_page_token] of the previous + // [JobService.ListBatchPredictionJobs][google.cloud.aiplatform.v1beta1.JobService.ListBatchPredictionJobs] call. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for [JobService.ListBatchPredictionJobs][google.cloud.aiplatform.v1beta1.JobService.ListBatchPredictionJobs] +message ListBatchPredictionJobsResponse { + // List of BatchPredictionJobs in the requested page. + repeated BatchPredictionJob batch_prediction_jobs = 1; + + // A token to retrieve the next page of results. + // Pass to [ListBatchPredictionJobsRequest.page_token][google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest.page_token] to obtain that + // page. + string next_page_token = 2; +} + +// Request message for [JobService.DeleteBatchPredictionJob][google.cloud.aiplatform.v1beta1.JobService.DeleteBatchPredictionJob]. +message DeleteBatchPredictionJobRequest { + // Required. The name of the BatchPredictionJob resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/BatchPredictionJob" + } + ]; +} + +// Request message for [JobService.CancelBatchPredictionJob][google.cloud.aiplatform.v1beta1.JobService.CancelBatchPredictionJob]. +message CancelBatchPredictionJobRequest { + // Required. The name of the BatchPredictionJob to cancel. + // Format: + // `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/BatchPredictionJob" + } + ]; +} + +// Request message for +// [JobService.CreateModelDeploymentMonitoringJob][google.cloud.aiplatform.v1beta1.JobService.CreateModelDeploymentMonitoringJob]. +message CreateModelDeploymentMonitoringJobRequest { + // Required. The parent of the ModelDeploymentMonitoringJob. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The ModelDeploymentMonitoringJob to create + ModelDeploymentMonitoringJob model_deployment_monitoring_job = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [JobService.SearchModelDeploymentMonitoringStatsAnomalies][google.cloud.aiplatform.v1beta1.JobService.SearchModelDeploymentMonitoringStatsAnomalies]. +message SearchModelDeploymentMonitoringStatsAnomaliesRequest { + // Stats requested for specific objective. + message StatsAnomaliesObjective { + ModelDeploymentMonitoringObjectiveType type = 1; + + // If set, all attribution scores between + // [SearchModelDeploymentMonitoringStatsAnomaliesRequest.start_time][google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest.start_time] and + // [SearchModelDeploymentMonitoringStatsAnomaliesRequest.end_time][google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest.end_time] are + // fetched, and page token doesn't take affect in this case. + // Only used to retrieve attribution score for the top Features which has + // the highest attribution score in the latest monitoring run. + int32 top_feature_count = 4; + } + + // Required. ModelDeploymentMonitoring Job resource name. + // Format: + // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + string model_deployment_monitoring_job = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" + } + ]; + + // Required. The DeployedModel ID of the + // [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. + string deployed_model_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // The feature display name. If specified, only return the stats belonging to + // this feature. Format: + // [ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name][google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name], + // example: "user_destination". + string feature_display_name = 3; + + // Required. Objectives of the stats to retrieve. + repeated StatsAnomaliesObjective objectives = 4 [(google.api.field_behavior) = REQUIRED]; + + // The standard list page size. + int32 page_size = 5; + + // A page token received from a previous + // [JobService.SearchModelDeploymentMonitoringStatsAnomalies][google.cloud.aiplatform.v1beta1.JobService.SearchModelDeploymentMonitoringStatsAnomalies] + // call. + string page_token = 6; + + // The earliest timestamp of stats being generated. + // If not set, indicates fetching stats till the earliest possible one. + google.protobuf.Timestamp start_time = 7; + + // The latest timestamp of stats being generated. + // If not set, indicates feching stats till the latest possible one. + google.protobuf.Timestamp end_time = 8; +} + +// Response message for +// [JobService.SearchModelDeploymentMonitoringStatsAnomalies][google.cloud.aiplatform.v1beta1.JobService.SearchModelDeploymentMonitoringStatsAnomalies]. +message SearchModelDeploymentMonitoringStatsAnomaliesResponse { + // Stats retrieved for requested objectives. + // There are at most 1000 + // [ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.prediction_stats][google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.prediction_stats] + // in the response. + repeated ModelMonitoringStatsAnomalies monitoring_stats = 1; + + // The page token that can be used by the next + // [JobService.SearchModelDeploymentMonitoringStatsAnomalies][google.cloud.aiplatform.v1beta1.JobService.SearchModelDeploymentMonitoringStatsAnomalies] + // call. + string next_page_token = 2; +} + +// Request message for +// [JobService.GetModelDeploymentMonitoringJob][google.cloud.aiplatform.v1beta1.JobService.GetModelDeploymentMonitoringJob]. +message GetModelDeploymentMonitoringJobRequest { + // Required. The resource name of the ModelDeploymentMonitoringJob. + // Format: + // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" + } + ]; +} + +// Request message for +// [JobService.ListModelDeploymentMonitoringJobs][google.cloud.aiplatform.v1beta1.JobService.ListModelDeploymentMonitoringJobs]. +message ListModelDeploymentMonitoringJobsRequest { + // Required. The parent of the ModelDeploymentMonitoringJob. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The standard list filter. + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + string page_token = 4; + + // Mask specifying which fields to read + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for +// [JobService.ListModelDeploymentMonitoringJobs][google.cloud.aiplatform.v1beta1.JobService.ListModelDeploymentMonitoringJobs]. +message ListModelDeploymentMonitoringJobsResponse { + // A list of ModelDeploymentMonitoringJobs that matches the specified filter + // in the request. + repeated ModelDeploymentMonitoringJob model_deployment_monitoring_jobs = 1; + + // The standard List next-page token. + string next_page_token = 2; +} + +// Request message for +// [JobService.UpdateModelDeploymentMonitoringJob][google.cloud.aiplatform.v1beta1.JobService.UpdateModelDeploymentMonitoringJob]. +message UpdateModelDeploymentMonitoringJobRequest { + // Required. The model monitoring configuration which replaces the resource on the + // server. + ModelDeploymentMonitoringJob model_deployment_monitoring_job = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask is used to specify the fields to be overwritten in the + // ModelDeploymentMonitoringJob resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then only the non-empty fields present in the + // request will be overwritten. Set the update_mask to `*` to override all + // fields. + // For the objective config, the user can either provide the update mask for + // model_deployment_monitoring_objective_configs or any combination of its + // nested fields, such as: + // model_deployment_monitoring_objective_configs.objective_config.training_dataset. + // + // Updatable fields: + // + // * `display_name` + // * `model_deployment_monitoring_schedule_config` + // * `model_monitoring_alert_config` + // * `logging_sampling_strategy` + // * `labels` + // * `log_ttl` + // * `enable_monitoring_pipeline_logs` + // . and + // * `model_deployment_monitoring_objective_configs` + // . or + // * `model_deployment_monitoring_objective_configs.objective_config.training_dataset` + // * `model_deployment_monitoring_objective_configs.objective_config.training_prediction_skew_detection_config` + // * `model_deployment_monitoring_objective_configs.objective_config.prediction_drift_detection_config` + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [JobService.DeleteModelDeploymentMonitoringJob][google.cloud.aiplatform.v1beta1.JobService.DeleteModelDeploymentMonitoringJob]. +message DeleteModelDeploymentMonitoringJobRequest { + // Required. The resource name of the model monitoring job to delete. + // Format: + // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" + } + ]; +} + +// Request message for +// [JobService.PauseModelDeploymentMonitoringJob][google.cloud.aiplatform.v1beta1.JobService.PauseModelDeploymentMonitoringJob]. +message PauseModelDeploymentMonitoringJobRequest { + // Required. The resource name of the ModelDeploymentMonitoringJob to pause. + // Format: + // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" + } + ]; +} + +// Request message for +// [JobService.ResumeModelDeploymentMonitoringJob][google.cloud.aiplatform.v1beta1.JobService.ResumeModelDeploymentMonitoringJob]. +message ResumeModelDeploymentMonitoringJobRequest { + // Required. The resource name of the ModelDeploymentMonitoringJob to resume. + // Format: + // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" + } + ]; +} + +// Runtime operation information for +// [JobService.UpdateModelDeploymentMonitoringJob][google.cloud.aiplatform.v1beta1.JobService.UpdateModelDeploymentMonitoringJob]. +message UpdateModelDeploymentMonitoringJobOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_state.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_state.proto new file mode 100644 index 00000000..14458e2e --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_state.proto @@ -0,0 +1,66 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "JobStateProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Describes the state of a job. +enum JobState { + // The job state is unspecified. + JOB_STATE_UNSPECIFIED = 0; + + // The job has been just created or resumed and processing has not yet begun. + JOB_STATE_QUEUED = 1; + + // The service is preparing to run the job. + JOB_STATE_PENDING = 2; + + // The job is in progress. + JOB_STATE_RUNNING = 3; + + // The job completed successfully. + JOB_STATE_SUCCEEDED = 4; + + // The job failed. + JOB_STATE_FAILED = 5; + + // The job is being cancelled. From this state the job may only go to + // either `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`. + JOB_STATE_CANCELLING = 6; + + // The job has been cancelled. + JOB_STATE_CANCELLED = 7; + + // The job has been stopped, and can be resumed. + JOB_STATE_PAUSED = 8; + + // The job has expired. + JOB_STATE_EXPIRED = 9; + + // The job is being updated. The job is only able to be updated at RUNNING + // state; if the update operation succeeds, job goes back to RUNNING state; if + // the update operation fails, the job goes back to RUNNING state with error + // messages written to [ModelDeploymentMonitoringJob.partial_errors][] field + // if it is a ModelDeploymentMonitoringJob. + JOB_STATE_UPDATING = 10; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto new file mode 100644 index 00000000..ce279717 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto @@ -0,0 +1,42 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/cloud/aiplatform/v1beta1/artifact.proto"; +import "google/cloud/aiplatform/v1beta1/event.proto"; +import "google/cloud/aiplatform/v1beta1/execution.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "LineageSubgraphProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A subgraph of the overall lineage graph. Event edges connect Artifact and +// Execution nodes. +message LineageSubgraph { + // The Artifact nodes in the subgraph. + repeated Artifact artifacts = 1; + + // The Execution nodes in the subgraph. + repeated Execution executions = 2; + + // The Event edges between Artifacts and Executions in the subgraph. + repeated Event events = 3; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto new file mode 100644 index 00000000..fa1d1faa --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto @@ -0,0 +1,204 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/cloud/aiplatform/v1beta1/accelerator_type.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "MachineResourcesProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Specification of a single machine. +message MachineSpec { + // Immutable. The type of the machine. + // + // See the [list of machine types supported for + // prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types) + // + // See the [list of machine types supported for custom + // training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types). + // + // For [DeployedModel][google.cloud.aiplatform.v1beta1.DeployedModel] this field is optional, and the default + // value is `n1-standard-2`. For [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob] or as part of + // [WorkerPoolSpec][google.cloud.aiplatform.v1beta1.WorkerPoolSpec] this field is required. + string machine_type = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The type of accelerator(s) that may be attached to the machine as per + // [accelerator_count][google.cloud.aiplatform.v1beta1.MachineSpec.accelerator_count]. + AcceleratorType accelerator_type = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // The number of accelerators to attach to the machine. + int32 accelerator_count = 3; +} + +// A description of resources that are dedicated to a DeployedModel, and +// that need a higher degree of manual configuration. +message DedicatedResources { + // Required. Immutable. The specification of a single machine used by the prediction. + MachineSpec machine_spec = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The minimum number of machine replicas this DeployedModel will be always + // deployed on. This value must be greater than or equal to 1. + // + // If traffic against the DeployedModel increases, it may dynamically be + // deployed onto more replicas, and as traffic decreases, some of these extra + // replicas may be freed. + int32 min_replica_count = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Immutable. The maximum number of replicas this DeployedModel may be deployed on when + // the traffic against it increases. If the requested value is too large, + // the deployment will error, but if deployment succeeds then the ability + // to scale the model to that many replicas is guaranteed (barring service + // outages). If traffic against the DeployedModel increases beyond what its + // replicas at maximum may handle, a portion of the traffic will be dropped. + // If this value is not provided, will use [min_replica_count][google.cloud.aiplatform.v1beta1.DedicatedResources.min_replica_count] as the + // default value. + // + // The value of this field impacts the charge against Vertex CPU and GPU + // quotas. Specifically, you will be charged for (max_replica_count * + // number of cores in the selected machine type) and (max_replica_count * + // number of GPUs per replica in the selected machine type). + int32 max_replica_count = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The metric specifications that overrides a resource + // utilization metric (CPU utilization, accelerator's duty cycle, and so on) + // target value (default to 60 if not set). At most one entry is allowed per + // metric. + // + // If [machine_spec.accelerator_count][google.cloud.aiplatform.v1beta1.MachineSpec.accelerator_count] is + // above 0, the autoscaling will be based on both CPU utilization and + // accelerator's duty cycle metrics and scale up when either metrics exceeds + // its target value while scale down if both metrics are under their target + // value. The default target value is 60 for both metrics. + // + // If [machine_spec.accelerator_count][google.cloud.aiplatform.v1beta1.MachineSpec.accelerator_count] is + // 0, the autoscaling will be based on CPU utilization metric only with + // default target value 60 if not explicitly set. + // + // For example, in the case of Online Prediction, if you want to override + // target CPU utilization to 80, you should set + // [autoscaling_metric_specs.metric_name][google.cloud.aiplatform.v1beta1.AutoscalingMetricSpec.metric_name] + // to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and + // [autoscaling_metric_specs.target][google.cloud.aiplatform.v1beta1.AutoscalingMetricSpec.target] to `80`. + repeated AutoscalingMetricSpec autoscaling_metric_specs = 4 [(google.api.field_behavior) = IMMUTABLE]; +} + +// A description of resources that to large degree are decided by Vertex AI, +// and require only a modest additional configuration. +// Each Model supporting these resources documents its specific guidelines. +message AutomaticResources { + // Immutable. The minimum number of replicas this DeployedModel will be always deployed + // on. If traffic against it increases, it may dynamically be deployed onto + // more replicas up to [max_replica_count][google.cloud.aiplatform.v1beta1.AutomaticResources.max_replica_count], and as traffic decreases, some + // of these extra replicas may be freed. + // If the requested value is too large, the deployment will error. + int32 min_replica_count = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The maximum number of replicas this DeployedModel may be deployed on when + // the traffic against it increases. If the requested value is too large, + // the deployment will error, but if deployment succeeds then the ability + // to scale the model to that many replicas is guaranteed (barring service + // outages). If traffic against the DeployedModel increases beyond what its + // replicas at maximum may handle, a portion of the traffic will be dropped. + // If this value is not provided, a no upper bound for scaling under heavy + // traffic will be assume, though Vertex AI may be unable to scale beyond + // certain replica number. + int32 max_replica_count = 2 [(google.api.field_behavior) = IMMUTABLE]; +} + +// A description of resources that are used for performing batch operations, are +// dedicated to a Model, and need manual configuration. +message BatchDedicatedResources { + // Required. Immutable. The specification of a single machine. + MachineSpec machine_spec = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Immutable. The number of machine replicas used at the start of the batch operation. + // If not set, Vertex AI decides starting number, not greater than + // [max_replica_count][google.cloud.aiplatform.v1beta1.BatchDedicatedResources.max_replica_count] + int32 starting_replica_count = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The maximum number of machine replicas the batch operation may be scaled + // to. The default value is 10. + int32 max_replica_count = 3 [(google.api.field_behavior) = IMMUTABLE]; +} + +// Statistics information about resource consumption. +message ResourcesConsumed { + // Output only. The number of replica hours used. Note that many replicas may run in + // parallel, and additionally any given work may be queued for some time. + // Therefore this value is not strictly related to wall time. + double replica_hours = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents the spec of disk options. +message DiskSpec { + // Type of the boot disk (default is "pd-ssd"). + // Valid values: "pd-ssd" (Persistent Disk Solid State Drive) or + // "pd-standard" (Persistent Disk Hard Disk Drive). + string boot_disk_type = 1; + + // Size in GB of the boot disk (default is 100GB). + int32 boot_disk_size_gb = 2; +} + +// Represents a mount configuration for Network File System (NFS) to mount. +message NfsMount { + // Required. IP address of the NFS server. + string server = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Source path exported from NFS server. + // Has to start with '/', and combined with the ip address, it indicates + // the source mount path in the form of `server:path` + string path = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Destination mount path. The NFS will be mounted for the user under + // /mnt/nfs/ + string mount_point = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The metric specification that defines the target resource utilization +// (CPU utilization, accelerator's duty cycle, and so on) for calculating the +// desired replica count. +message AutoscalingMetricSpec { + // Required. The resource metric name. + // Supported metrics: + // + // * For Online Prediction: + // * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle` + // * `aiplatform.googleapis.com/prediction/online/cpu/utilization` + string metric_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The target resource utilization in percentage (1% - 100%) for the given + // metric; once the real usage deviates from the target by a certain + // percentage, the machine replicas change. The default value is 60 + // (representing 60%) if not provided. + int32 target = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto new file mode 100644 index 00000000..f8f75fdc --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto @@ -0,0 +1,39 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ManualBatchTuningParametersProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Manual batch tuning parameters. +message ManualBatchTuningParameters { + // Immutable. The number of the records (e.g. instances) of the operation given in + // each batch to a machine replica. Machine type, and size of a single + // record should be considered when setting this parameter, higher value + // speeds up the batch operation's execution, but too high value will result + // in a whole batch not fitting in a machine's memory, and the whole + // operation will fail. + // The default value is 4. + int32 batch_size = 1 [(google.api.field_behavior) = IMMUTABLE]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto new file mode 100644 index 00000000..0623a3ee --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto @@ -0,0 +1,79 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "MetadataSchemaProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Instance of a general MetadataSchema. +message MetadataSchema { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/MetadataSchema" + pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}" + }; + + // Describes the type of the MetadataSchema. + enum MetadataSchemaType { + // Unspecified type for the MetadataSchema. + METADATA_SCHEMA_TYPE_UNSPECIFIED = 0; + + // A type indicating that the MetadataSchema will be used by Artifacts. + ARTIFACT_TYPE = 1; + + // A typee indicating that the MetadataSchema will be used by Executions. + EXECUTION_TYPE = 2; + + // A state indicating that the MetadataSchema will be used by Contexts. + CONTEXT_TYPE = 3; + } + + // Output only. The resource name of the MetadataSchema. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The version of the MetadataSchema. The version's format must match + // the following regular expression: `^[0-9]+[.][0-9]+[.][0-9]+$`, which would + // allow to order/compare different versions. Example: 1.0.0, 1.0.1, etc. + string schema_version = 2; + + // Required. The raw YAML string representation of the MetadataSchema. The combination + // of [MetadataSchema.version] and the schema name given by `title` in + // [MetadataSchema.schema] must be unique within a MetadataStore. + // + // The schema is defined as an OpenAPI 3.0.2 + // [MetadataSchema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject) + string schema = 3 [(google.api.field_behavior) = REQUIRED]; + + // The type of the MetadataSchema. This is a property that identifies which + // metadata types will use the MetadataSchema. + MetadataSchemaType schema_type = 4; + + // Output only. Timestamp when this MetadataSchema was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Description of the Metadata Schema + string description = 6; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto new file mode 100644 index 00000000..afcf68d0 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto @@ -0,0 +1,1257 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/artifact.proto"; +import "google/cloud/aiplatform/v1beta1/context.proto"; +import "google/cloud/aiplatform/v1beta1/event.proto"; +import "google/cloud/aiplatform/v1beta1/execution.proto"; +import "google/cloud/aiplatform/v1beta1/lineage_subgraph.proto"; +import "google/cloud/aiplatform/v1beta1/metadata_schema.proto"; +import "google/cloud/aiplatform/v1beta1/metadata_store.proto"; +import "google/cloud/aiplatform/v1beta1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "MetadataServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Service for reading and writing metadata entries. +service MetadataService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Initializes a MetadataStore, including allocation of resources. + rpc CreateMetadataStore(CreateMetadataStoreRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/metadataStores" + body: "metadata_store" + }; + option (google.api.method_signature) = "parent,metadata_store,metadata_store_id"; + option (google.longrunning.operation_info) = { + response_type: "MetadataStore" + metadata_type: "CreateMetadataStoreOperationMetadata" + }; + } + + // Retrieves a specific MetadataStore. + rpc GetMetadataStore(GetMetadataStoreRequest) returns (MetadataStore) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/metadataStores/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists MetadataStores for a Location. + rpc ListMetadataStores(ListMetadataStoresRequest) returns (ListMetadataStoresResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/metadataStores" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a single MetadataStore and all its child resources (Artifacts, + // Executions, and Contexts). + rpc DeleteMetadataStore(DeleteMetadataStoreRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/metadataStores/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteMetadataStoreOperationMetadata" + }; + } + + // Creates an Artifact associated with a MetadataStore. + rpc CreateArtifact(CreateArtifactRequest) returns (Artifact) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/artifacts" + body: "artifact" + }; + option (google.api.method_signature) = "parent,artifact,artifact_id"; + } + + // Retrieves a specific Artifact. + rpc GetArtifact(GetArtifactRequest) returns (Artifact) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Artifacts in the MetadataStore. + rpc ListArtifacts(ListArtifactsRequest) returns (ListArtifactsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/artifacts" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a stored Artifact. + rpc UpdateArtifact(UpdateArtifactRequest) returns (Artifact) { + option (google.api.http) = { + patch: "/v1beta1/{artifact.name=projects/*/locations/*/metadataStores/*/artifacts/*}" + body: "artifact" + }; + option (google.api.method_signature) = "artifact,update_mask"; + } + + // Deletes an Artifact. + rpc DeleteArtifact(DeleteArtifactRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Purges Artifacts. + rpc PurgeArtifacts(PurgeArtifactsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/artifacts:purge" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "PurgeArtifactsResponse" + metadata_type: "PurgeArtifactsMetadata" + }; + } + + // Creates a Context associated with a MetadataStore. + rpc CreateContext(CreateContextRequest) returns (Context) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/contexts" + body: "context" + }; + option (google.api.method_signature) = "parent,context,context_id"; + } + + // Retrieves a specific Context. + rpc GetContext(GetContextRequest) returns (Context) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Contexts on the MetadataStore. + rpc ListContexts(ListContextsRequest) returns (ListContextsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/contexts" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a stored Context. + rpc UpdateContext(UpdateContextRequest) returns (Context) { + option (google.api.http) = { + patch: "/v1beta1/{context.name=projects/*/locations/*/metadataStores/*/contexts/*}" + body: "context" + }; + option (google.api.method_signature) = "context,update_mask"; + } + + // Deletes a stored Context. + rpc DeleteContext(DeleteContextRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Purges Contexts. + rpc PurgeContexts(PurgeContextsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/contexts:purge" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "PurgeContextsResponse" + metadata_type: "PurgeContextsMetadata" + }; + } + + // Adds a set of Artifacts and Executions to a Context. If any of the + // Artifacts or Executions have already been added to a Context, they are + // simply skipped. + rpc AddContextArtifactsAndExecutions(AddContextArtifactsAndExecutionsRequest) returns (AddContextArtifactsAndExecutionsResponse) { + option (google.api.http) = { + post: "/v1beta1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:addContextArtifactsAndExecutions" + body: "*" + }; + option (google.api.method_signature) = "context,artifacts,executions"; + } + + // Adds a set of Contexts as children to a parent Context. If any of the + // child Contexts have already been added to the parent Context, they are + // simply skipped. If this call would create a cycle or cause any Context to + // have more than 10 parents, the request will fail with an INVALID_ARGUMENT + // error. + rpc AddContextChildren(AddContextChildrenRequest) returns (AddContextChildrenResponse) { + option (google.api.http) = { + post: "/v1beta1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:addContextChildren" + body: "*" + }; + option (google.api.method_signature) = "context,child_contexts"; + } + + // Retrieves Artifacts and Executions within the specified Context, connected + // by Event edges and returned as a LineageSubgraph. + rpc QueryContextLineageSubgraph(QueryContextLineageSubgraphRequest) returns (LineageSubgraph) { + option (google.api.http) = { + get: "/v1beta1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:queryContextLineageSubgraph" + }; + option (google.api.method_signature) = "context"; + } + + // Creates an Execution associated with a MetadataStore. + rpc CreateExecution(CreateExecutionRequest) returns (Execution) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/executions" + body: "execution" + }; + option (google.api.method_signature) = "parent,execution,execution_id"; + } + + // Retrieves a specific Execution. + rpc GetExecution(GetExecutionRequest) returns (Execution) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Executions in the MetadataStore. + rpc ListExecutions(ListExecutionsRequest) returns (ListExecutionsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/executions" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a stored Execution. + rpc UpdateExecution(UpdateExecutionRequest) returns (Execution) { + option (google.api.http) = { + patch: "/v1beta1/{execution.name=projects/*/locations/*/metadataStores/*/executions/*}" + body: "execution" + }; + option (google.api.method_signature) = "execution,update_mask"; + } + + // Deletes an Execution. + rpc DeleteExecution(DeleteExecutionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Purges Executions. + rpc PurgeExecutions(PurgeExecutionsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/executions:purge" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "PurgeExecutionsResponse" + metadata_type: "PurgeExecutionsMetadata" + }; + } + + // Adds Events to the specified Execution. An Event indicates whether an + // Artifact was used as an input or output for an Execution. If an Event + // already exists between the Execution and the Artifact, the Event is + // skipped. + rpc AddExecutionEvents(AddExecutionEventsRequest) returns (AddExecutionEventsResponse) { + option (google.api.http) = { + post: "/v1beta1/{execution=projects/*/locations/*/metadataStores/*/executions/*}:addExecutionEvents" + body: "*" + }; + option (google.api.method_signature) = "execution,events"; + } + + // Obtains the set of input and output Artifacts for this Execution, in the + // form of LineageSubgraph that also contains the Execution and connecting + // Events. + rpc QueryExecutionInputsAndOutputs(QueryExecutionInputsAndOutputsRequest) returns (LineageSubgraph) { + option (google.api.http) = { + get: "/v1beta1/{execution=projects/*/locations/*/metadataStores/*/executions/*}:queryExecutionInputsAndOutputs" + }; + option (google.api.method_signature) = "execution"; + } + + // Creates a MetadataSchema. + rpc CreateMetadataSchema(CreateMetadataSchemaRequest) returns (MetadataSchema) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/metadataSchemas" + body: "metadata_schema" + }; + option (google.api.method_signature) = "parent,metadata_schema,metadata_schema_id"; + } + + // Retrieves a specific MetadataSchema. + rpc GetMetadataSchema(GetMetadataSchemaRequest) returns (MetadataSchema) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/metadataStores/*/metadataSchemas/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists MetadataSchemas. + rpc ListMetadataSchemas(ListMetadataSchemasRequest) returns (ListMetadataSchemasResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/metadataSchemas" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves lineage of an Artifact represented through Artifacts and + // Executions connected by Event edges and returned as a LineageSubgraph. + rpc QueryArtifactLineageSubgraph(QueryArtifactLineageSubgraphRequest) returns (LineageSubgraph) { + option (google.api.http) = { + get: "/v1beta1/{artifact=projects/*/locations/*/metadataStores/*/artifacts/*}:queryArtifactLineageSubgraph" + }; + option (google.api.method_signature) = "artifact"; + } +} + +// Request message for [MetadataService.CreateMetadataStore][google.cloud.aiplatform.v1beta1.MetadataService.CreateMetadataStore]. +message CreateMetadataStoreRequest { + // Required. The resource name of the Location where the MetadataStore should + // be created. + // Format: `projects/{project}/locations/{location}/` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The MetadataStore to create. + MetadataStore metadata_store = 2 [(google.api.field_behavior) = REQUIRED]; + + // The {metadatastore} portion of the resource name with the format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + // If not provided, the MetadataStore's ID will be a UUID generated by the + // service. + // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + // Must be unique across all MetadataStores in the parent Location. + // (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + // if the caller can't view the preexisting MetadataStore.) + string metadata_store_id = 3; +} + +// Details of operations that perform [MetadataService.CreateMetadataStore][google.cloud.aiplatform.v1beta1.MetadataService.CreateMetadataStore]. +message CreateMetadataStoreOperationMetadata { + // Operation metadata for creating a MetadataStore. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [MetadataService.GetMetadataStore][google.cloud.aiplatform.v1beta1.MetadataService.GetMetadataStore]. +message GetMetadataStoreRequest { + // Required. The resource name of the MetadataStore to retrieve. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/MetadataStore" + } + ]; +} + +// Request message for [MetadataService.ListMetadataStores][google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataStores]. +message ListMetadataStoresRequest { + // Required. The Location whose MetadataStores should be listed. + // Format: + // `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of Metadata Stores to return. The service may return + // fewer. + // Must be in range 1-1000, inclusive. Defaults to 100. + int32 page_size = 2; + + // A page token, received from a previous + // [MetadataService.ListMetadataStores][google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataStores] call. Provide this to retrieve the + // subsequent page. + // + // When paginating, all other provided parameters must match the call that + // provided the page token. (Otherwise the request will fail with + // INVALID_ARGUMENT error.) + string page_token = 3; +} + +// Response message for [MetadataService.ListMetadataStores][google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataStores]. +message ListMetadataStoresResponse { + // The MetadataStores found for the Location. + repeated MetadataStore metadata_stores = 1; + + // A token, which can be sent as + // [ListMetadataStoresRequest.page_token][google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest.page_token] to retrieve the next + // page. If this field is not populated, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [MetadataService.DeleteMetadataStore][google.cloud.aiplatform.v1beta1.MetadataService.DeleteMetadataStore]. +message DeleteMetadataStoreRequest { + // Required. The resource name of the MetadataStore to delete. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/MetadataStore" + } + ]; + + // Deprecated: Field is no longer supported. + bool force = 2 [deprecated = true]; +} + +// Details of operations that perform [MetadataService.DeleteMetadataStore][google.cloud.aiplatform.v1beta1.MetadataService.DeleteMetadataStore]. +message DeleteMetadataStoreOperationMetadata { + // Operation metadata for deleting a MetadataStore. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [MetadataService.CreateArtifact][google.cloud.aiplatform.v1beta1.MetadataService.CreateArtifact]. +message CreateArtifactRequest { + // Required. The resource name of the MetadataStore where the Artifact should + // be created. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/MetadataStore" + } + ]; + + // Required. The Artifact to create. + Artifact artifact = 2 [(google.api.field_behavior) = REQUIRED]; + + // The {artifact} portion of the resource name with the format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + // If not provided, the Artifact's ID will be a UUID generated by the service. + // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + // Must be unique across all Artifacts in the parent MetadataStore. (Otherwise + // the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the + // caller can't view the preexisting Artifact.) + string artifact_id = 3; +} + +// Request message for [MetadataService.GetArtifact][google.cloud.aiplatform.v1beta1.MetadataService.GetArtifact]. +message GetArtifactRequest { + // Required. The resource name of the Artifact to retrieve. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Artifact" + } + ]; +} + +// Request message for [MetadataService.ListArtifacts][google.cloud.aiplatform.v1beta1.MetadataService.ListArtifacts]. +message ListArtifactsRequest { + // Required. The MetadataStore whose Artifacts should be listed. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Artifact" + } + ]; + + // The maximum number of Artifacts to return. The service may return fewer. + // Must be in range 1-1000, inclusive. Defaults to 100. + int32 page_size = 2; + + // A page token, received from a previous [MetadataService.ListArtifacts][google.cloud.aiplatform.v1beta1.MetadataService.ListArtifacts] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other provided parameters must match the call that + // provided the page token. (Otherwise the request will fail with + // INVALID_ARGUMENT error.) + string page_token = 3; + + // Filter specifying the boolean condition for the Artifacts to satisfy in + // order to be part of the result set. + // The syntax to define filter query is based on https://google.aip.dev/160. + // The supported set of filters include the following: + // + // * **Attribute filtering**: + // For example: `display_name = "test"`. + // Supported fields include: `name`, `display_name`, `uri`, `state`, + // `schema_title`, `create_time`, and `update_time`. + // Time fields, such as `create_time` and `update_time`, require values + // specified in RFC-3339 format. + // For example: `create_time = "2020-11-19T11:30:00-04:00"` + // * **Metadata field**: + // To filter on metadata fields use traversal operation as follows: + // `metadata..`. + // For example: `metadata.field_1.number_value = 10.0` + // * **Context based filtering**: + // To filter Artifacts based on the contexts to which they belong, use the + // function operator with the full resource name + // `in_context()`. + // For example: + // `in_context("projects//locations//metadataStores//contexts/")` + // + // Each of the above supported filter types can be combined together using + // logical operators (`AND` & `OR`). + // + // For example: `display_name = "test" AND metadata.field1.bool_value = true`. + string filter = 4; +} + +// Response message for [MetadataService.ListArtifacts][google.cloud.aiplatform.v1beta1.MetadataService.ListArtifacts]. +message ListArtifactsResponse { + // The Artifacts retrieved from the MetadataStore. + repeated Artifact artifacts = 1; + + // A token, which can be sent as [ListArtifactsRequest.page_token][google.cloud.aiplatform.v1beta1.ListArtifactsRequest.page_token] + // to retrieve the next page. + // If this field is not populated, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [MetadataService.UpdateArtifact][google.cloud.aiplatform.v1beta1.MetadataService.UpdateArtifact]. +message UpdateArtifactRequest { + // Required. The Artifact containing updates. + // The Artifact's [Artifact.name][google.cloud.aiplatform.v1beta1.Artifact.name] field is used to identify the Artifact to + // be updated. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + Artifact artifact = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A FieldMask indicating which fields should be updated. + // Functionality of this field is not yet supported. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; + + // If set to true, and the [Artifact][google.cloud.aiplatform.v1beta1.Artifact] is not found, a new [Artifact][google.cloud.aiplatform.v1beta1.Artifact] is + // created. + bool allow_missing = 3; +} + +// Request message for [MetadataService.DeleteArtifact][google.cloud.aiplatform.v1beta1.MetadataService.DeleteArtifact]. +message DeleteArtifactRequest { + // Required. The resource name of the Artifact to delete. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Artifact" + } + ]; + + // Optional. The etag of the Artifact to delete. + // If this is provided, it must match the server's etag. Otherwise, the + // request will fail with a FAILED_PRECONDITION. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [MetadataService.PurgeArtifacts][google.cloud.aiplatform.v1beta1.MetadataService.PurgeArtifacts]. +message PurgeArtifactsRequest { + // Required. The metadata store to purge Artifacts from. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Artifact" + } + ]; + + // Required. A required filter matching the Artifacts to be purged. + // E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Flag to indicate to actually perform the purge. + // If `force` is set to false, the method will return a sample of + // Artifact names that would be deleted. + bool force = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [MetadataService.PurgeArtifacts][google.cloud.aiplatform.v1beta1.MetadataService.PurgeArtifacts]. +message PurgeArtifactsResponse { + // The number of Artifacts that this request deleted (or, if `force` is false, + // the number of Artifacts that will be deleted). This can be an estimate. + int64 purge_count = 1; + + // A sample of the Artifact names that will be deleted. + // Only populated if `force` is set to false. The maximum number of samples is + // 100 (it is possible to return fewer). + repeated string purge_sample = 2 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Artifact" + }]; +} + +// Details of operations that perform [MetadataService.PurgeArtifacts][google.cloud.aiplatform.v1beta1.MetadataService.PurgeArtifacts]. +message PurgeArtifactsMetadata { + // Operation metadata for purging Artifacts. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [MetadataService.CreateContext][google.cloud.aiplatform.v1beta1.MetadataService.CreateContext]. +message CreateContextRequest { + // Required. The resource name of the MetadataStore where the Context should be + // created. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/MetadataStore" + } + ]; + + // Required. The Context to create. + Context context = 2 [(google.api.field_behavior) = REQUIRED]; + + // The {context} portion of the resource name with the format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`. + // If not provided, the Context's ID will be a UUID generated by the service. + // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + // Must be unique across all Contexts in the parent MetadataStore. (Otherwise + // the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the + // caller can't view the preexisting Context.) + string context_id = 3; +} + +// Request message for [MetadataService.GetContext][google.cloud.aiplatform.v1beta1.MetadataService.GetContext]. +message GetContextRequest { + // Required. The resource name of the Context to retrieve. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; +} + +// Request message for [MetadataService.ListContexts][google.cloud.aiplatform.v1beta1.MetadataService.ListContexts] +message ListContextsRequest { + // Required. The MetadataStore whose Contexts should be listed. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Context" + } + ]; + + // The maximum number of Contexts to return. The service may return fewer. + // Must be in range 1-1000, inclusive. Defaults to 100. + int32 page_size = 2; + + // A page token, received from a previous [MetadataService.ListContexts][google.cloud.aiplatform.v1beta1.MetadataService.ListContexts] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other provided parameters must match the call that + // provided the page token. (Otherwise the request will fail with + // INVALID_ARGUMENT error.) + string page_token = 3; + + // Filter specifying the boolean condition for the Contexts to satisfy in + // order to be part of the result set. + // The syntax to define filter query is based on https://google.aip.dev/160. + // Following are the supported set of filters: + // + // * **Attribute filtering**: + // For example: `display_name = "test"`. + // Supported fields include: `name`, `display_name`, `schema_title`, + // `create_time`, and `update_time`. + // Time fields, such as `create_time` and `update_time`, require values + // specified in RFC-3339 format. + // For example: `create_time = "2020-11-19T11:30:00-04:00"`. + // * **Metadata field**: + // To filter on metadata fields use traversal operation as follows: + // `metadata..`. + // For example: `metadata.field_1.number_value = 10.0`. + // * **Parent Child filtering**: + // To filter Contexts based on parent-child relationship use the HAS + // operator as follows: + // + // ``` + // parent_contexts: + // "projects//locations//metadataStores//contexts/" + // child_contexts: + // "projects//locations//metadataStores//contexts/" + // ``` + // + // Each of the above supported filters can be combined together using + // logical operators (`AND` & `OR`). + // + // For example: `display_name = "test" AND metadata.field1.bool_value = true`. + string filter = 4; +} + +// Response message for [MetadataService.ListContexts][google.cloud.aiplatform.v1beta1.MetadataService.ListContexts]. +message ListContextsResponse { + // The Contexts retrieved from the MetadataStore. + repeated Context contexts = 1; + + // A token, which can be sent as [ListContextsRequest.page_token][google.cloud.aiplatform.v1beta1.ListContextsRequest.page_token] + // to retrieve the next page. + // If this field is not populated, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [MetadataService.UpdateContext][google.cloud.aiplatform.v1beta1.MetadataService.UpdateContext]. +message UpdateContextRequest { + // Required. The Context containing updates. + // The Context's [Context.name][google.cloud.aiplatform.v1beta1.Context.name] field is used to identify the Context to be + // updated. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + Context context = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A FieldMask indicating which fields should be updated. + // Functionality of this field is not yet supported. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; + + // If set to true, and the [Context][google.cloud.aiplatform.v1beta1.Context] is not found, a new [Context][google.cloud.aiplatform.v1beta1.Context] is + // created. + bool allow_missing = 3; +} + +// Request message for [MetadataService.DeleteContext][google.cloud.aiplatform.v1beta1.MetadataService.DeleteContext]. +message DeleteContextRequest { + // Required. The resource name of the Context to delete. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; + + // The force deletion semantics is still undefined. + // Users should not use this field. + bool force = 2; + + // Optional. The etag of the Context to delete. + // If this is provided, it must match the server's etag. Otherwise, the + // request will fail with a FAILED_PRECONDITION. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [MetadataService.PurgeContexts][google.cloud.aiplatform.v1beta1.MetadataService.PurgeContexts]. +message PurgeContextsRequest { + // Required. The metadata store to purge Contexts from. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Context" + } + ]; + + // Required. A required filter matching the Contexts to be purged. + // E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Flag to indicate to actually perform the purge. + // If `force` is set to false, the method will return a sample of + // Context names that would be deleted. + bool force = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [MetadataService.PurgeContexts][google.cloud.aiplatform.v1beta1.MetadataService.PurgeContexts]. +message PurgeContextsResponse { + // The number of Contexts that this request deleted (or, if `force` is false, + // the number of Contexts that will be deleted). This can be an estimate. + int64 purge_count = 1; + + // A sample of the Context names that will be deleted. + // Only populated if `force` is set to false. The maximum number of samples is + // 100 (it is possible to return fewer). + repeated string purge_sample = 2 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + }]; +} + +// Details of operations that perform [MetadataService.PurgeContexts][google.cloud.aiplatform.v1beta1.MetadataService.PurgeContexts]. +message PurgeContextsMetadata { + // Operation metadata for purging Contexts. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [MetadataService.AddContextArtifactsAndExecutions][google.cloud.aiplatform.v1beta1.MetadataService.AddContextArtifactsAndExecutions]. +message AddContextArtifactsAndExecutionsRequest { + // Required. The resource name of the Context that the Artifacts and Executions + // belong to. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + string context = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; + + // The resource names of the Artifacts to attribute to the Context. + // + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + repeated string artifacts = 2 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Artifact" + }]; + + // The resource names of the Executions to associate with the + // Context. + // + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + repeated string executions = 3 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Execution" + }]; +} + +// Response message for [MetadataService.AddContextArtifactsAndExecutions][google.cloud.aiplatform.v1beta1.MetadataService.AddContextArtifactsAndExecutions]. +message AddContextArtifactsAndExecutionsResponse { + +} + +// Request message for [MetadataService.AddContextChildren][google.cloud.aiplatform.v1beta1.MetadataService.AddContextChildren]. +message AddContextChildrenRequest { + // Required. The resource name of the parent Context. + // + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + string context = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; + + // The resource names of the child Contexts. + repeated string child_contexts = 2 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + }]; +} + +// Response message for [MetadataService.AddContextChildren][google.cloud.aiplatform.v1beta1.MetadataService.AddContextChildren]. +message AddContextChildrenResponse { + +} + +// Request message for [MetadataService.QueryContextLineageSubgraph][google.cloud.aiplatform.v1beta1.MetadataService.QueryContextLineageSubgraph]. +message QueryContextLineageSubgraphRequest { + // Required. The resource name of the Context whose Artifacts and Executions + // should be retrieved as a LineageSubgraph. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + // + // The request may error with FAILED_PRECONDITION if the number of Artifacts, + // the number of Executions, or the number of Events that would be returned + // for the Context exceeds 1000. + string context = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Context" + } + ]; +} + +// Request message for [MetadataService.CreateExecution][google.cloud.aiplatform.v1beta1.MetadataService.CreateExecution]. +message CreateExecutionRequest { + // Required. The resource name of the MetadataStore where the Execution should + // be created. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/MetadataStore" + } + ]; + + // Required. The Execution to create. + Execution execution = 2 [(google.api.field_behavior) = REQUIRED]; + + // The {execution} portion of the resource name with the format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + // If not provided, the Execution's ID will be a UUID generated by the + // service. + // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + // Must be unique across all Executions in the parent MetadataStore. + // (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + // if the caller can't view the preexisting Execution.) + string execution_id = 3; +} + +// Request message for [MetadataService.GetExecution][google.cloud.aiplatform.v1beta1.MetadataService.GetExecution]. +message GetExecutionRequest { + // Required. The resource name of the Execution to retrieve. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Execution" + } + ]; +} + +// Request message for [MetadataService.ListExecutions][google.cloud.aiplatform.v1beta1.MetadataService.ListExecutions]. +message ListExecutionsRequest { + // Required. The MetadataStore whose Executions should be listed. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Execution" + } + ]; + + // The maximum number of Executions to return. The service may return fewer. + // Must be in range 1-1000, inclusive. Defaults to 100. + int32 page_size = 2; + + // A page token, received from a previous [MetadataService.ListExecutions][google.cloud.aiplatform.v1beta1.MetadataService.ListExecutions] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other provided parameters must match the call that + // provided the page token. (Otherwise the request will fail with an + // INVALID_ARGUMENT error.) + string page_token = 3; + + // Filter specifying the boolean condition for the Executions to satisfy in + // order to be part of the result set. + // The syntax to define filter query is based on https://google.aip.dev/160. + // Following are the supported set of filters: + // + // * **Attribute filtering**: + // For example: `display_name = "test"`. + // Supported fields include: `name`, `display_name`, `state`, + // `schema_title`, `create_time`, and `update_time`. + // Time fields, such as `create_time` and `update_time`, require values + // specified in RFC-3339 format. + // For example: `create_time = "2020-11-19T11:30:00-04:00"`. + // * **Metadata field**: + // To filter on metadata fields use traversal operation as follows: + // `metadata..` + // For example: `metadata.field_1.number_value = 10.0` + // * **Context based filtering**: + // To filter Executions based on the contexts to which they belong use + // the function operator with the full resource name: + // `in_context()`. + // For example: + // `in_context("projects//locations//metadataStores//contexts/")` + // + // Each of the above supported filters can be combined together using + // logical operators (`AND` & `OR`). + // For example: `display_name = "test" AND metadata.field1.bool_value = true`. + string filter = 4; +} + +// Response message for [MetadataService.ListExecutions][google.cloud.aiplatform.v1beta1.MetadataService.ListExecutions]. +message ListExecutionsResponse { + // The Executions retrieved from the MetadataStore. + repeated Execution executions = 1; + + // A token, which can be sent as [ListExecutionsRequest.page_token][google.cloud.aiplatform.v1beta1.ListExecutionsRequest.page_token] + // to retrieve the next page. + // If this field is not populated, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [MetadataService.UpdateExecution][google.cloud.aiplatform.v1beta1.MetadataService.UpdateExecution]. +message UpdateExecutionRequest { + // Required. The Execution containing updates. + // The Execution's [Execution.name][google.cloud.aiplatform.v1beta1.Execution.name] field is used to identify the Execution + // to be updated. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + Execution execution = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A FieldMask indicating which fields should be updated. + // Functionality of this field is not yet supported. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; + + // If set to true, and the [Execution][google.cloud.aiplatform.v1beta1.Execution] is not found, a new [Execution][google.cloud.aiplatform.v1beta1.Execution] + // is created. + bool allow_missing = 3; +} + +// Request message for [MetadataService.DeleteExecution][google.cloud.aiplatform.v1beta1.MetadataService.DeleteExecution]. +message DeleteExecutionRequest { + // Required. The resource name of the Execution to delete. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Execution" + } + ]; + + // Optional. The etag of the Execution to delete. + // If this is provided, it must match the server's etag. Otherwise, the + // request will fail with a FAILED_PRECONDITION. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [MetadataService.PurgeExecutions][google.cloud.aiplatform.v1beta1.MetadataService.PurgeExecutions]. +message PurgeExecutionsRequest { + // Required. The metadata store to purge Executions from. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Execution" + } + ]; + + // Required. A required filter matching the Executions to be purged. + // E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Flag to indicate to actually perform the purge. + // If `force` is set to false, the method will return a sample of + // Execution names that would be deleted. + bool force = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [MetadataService.PurgeExecutions][google.cloud.aiplatform.v1beta1.MetadataService.PurgeExecutions]. +message PurgeExecutionsResponse { + // The number of Executions that this request deleted (or, if `force` is + // false, the number of Executions that will be deleted). This can be an + // estimate. + int64 purge_count = 1; + + // A sample of the Execution names that will be deleted. + // Only populated if `force` is set to false. The maximum number of samples is + // 100 (it is possible to return fewer). + repeated string purge_sample = 2 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Execution" + }]; +} + +// Details of operations that perform [MetadataService.PurgeExecutions][google.cloud.aiplatform.v1beta1.MetadataService.PurgeExecutions]. +message PurgeExecutionsMetadata { + // Operation metadata for purging Executions. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [MetadataService.AddExecutionEvents][google.cloud.aiplatform.v1beta1.MetadataService.AddExecutionEvents]. +message AddExecutionEventsRequest { + // Required. The resource name of the Execution that the Events connect + // Artifacts with. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + string execution = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Execution" + } + ]; + + // The Events to create and add. + repeated Event events = 2; +} + +// Response message for [MetadataService.AddExecutionEvents][google.cloud.aiplatform.v1beta1.MetadataService.AddExecutionEvents]. +message AddExecutionEventsResponse { + +} + +// Request message for [MetadataService.QueryExecutionInputsAndOutputs][google.cloud.aiplatform.v1beta1.MetadataService.QueryExecutionInputsAndOutputs]. +message QueryExecutionInputsAndOutputsRequest { + // Required. The resource name of the Execution whose input and output Artifacts should + // be retrieved as a LineageSubgraph. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + string execution = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Execution" + } + ]; +} + +// Request message for [MetadataService.CreateMetadataSchema][google.cloud.aiplatform.v1beta1.MetadataService.CreateMetadataSchema]. +message CreateMetadataSchemaRequest { + // Required. The resource name of the MetadataStore where the MetadataSchema should + // be created. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/MetadataStore" + } + ]; + + // Required. The MetadataSchema to create. + MetadataSchema metadata_schema = 2 [(google.api.field_behavior) = REQUIRED]; + + // The {metadata_schema} portion of the resource name with the format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` + // If not provided, the MetadataStore's ID will be a UUID generated by the + // service. + // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. + // Must be unique across all MetadataSchemas in the parent Location. + // (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + // if the caller can't view the preexisting MetadataSchema.) + string metadata_schema_id = 3; +} + +// Request message for [MetadataService.GetMetadataSchema][google.cloud.aiplatform.v1beta1.MetadataService.GetMetadataSchema]. +message GetMetadataSchemaRequest { + // Required. The resource name of the MetadataSchema to retrieve. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/MetadataSchema" + } + ]; +} + +// Request message for [MetadataService.ListMetadataSchemas][google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataSchemas]. +message ListMetadataSchemasRequest { + // Required. The MetadataStore whose MetadataSchemas should be listed. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/MetadataSchema" + } + ]; + + // The maximum number of MetadataSchemas to return. The service may return + // fewer. + // Must be in range 1-1000, inclusive. Defaults to 100. + int32 page_size = 2; + + // A page token, received from a previous + // [MetadataService.ListMetadataSchemas][google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataSchemas] call. Provide this to retrieve the + // next page. + // + // When paginating, all other provided parameters must match the call that + // provided the page token. (Otherwise the request will fail with + // INVALID_ARGUMENT error.) + string page_token = 3; + + // A query to filter available MetadataSchemas for matching results. + string filter = 4; +} + +// Response message for [MetadataService.ListMetadataSchemas][google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataSchemas]. +message ListMetadataSchemasResponse { + // The MetadataSchemas found for the MetadataStore. + repeated MetadataSchema metadata_schemas = 1; + + // A token, which can be sent as + // [ListMetadataSchemasRequest.page_token][google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest.page_token] to retrieve the next + // page. If this field is not populated, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [MetadataService.QueryArtifactLineageSubgraph][google.cloud.aiplatform.v1beta1.MetadataService.QueryArtifactLineageSubgraph]. +message QueryArtifactLineageSubgraphRequest { + // Required. The resource name of the Artifact whose Lineage needs to be retrieved as a + // LineageSubgraph. + // Format: + // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + // + // The request may error with FAILED_PRECONDITION if the number of Artifacts, + // the number of Executions, or the number of Events that would be returned + // for the Context exceeds 1000. + string artifact = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Artifact" + } + ]; + + // Specifies the size of the lineage graph in terms of number of hops from the + // specified artifact. + // Negative Value: INVALID_ARGUMENT error is returned + // 0: Only input artifact is returned. + // No value: Transitive closure is performed to return the complete graph. + int32 max_hops = 2; + + // Filter specifying the boolean condition for the Artifacts to satisfy in + // order to be part of the Lineage Subgraph. + // The syntax to define filter query is based on https://google.aip.dev/160. + // The supported set of filters include the following: + // + // * **Attribute filtering**: + // For example: `display_name = "test"` + // Supported fields include: `name`, `display_name`, `uri`, `state`, + // `schema_title`, `create_time`, and `update_time`. + // Time fields, such as `create_time` and `update_time`, require values + // specified in RFC-3339 format. + // For example: `create_time = "2020-11-19T11:30:00-04:00"` + // * **Metadata field**: + // To filter on metadata fields use traversal operation as follows: + // `metadata..`. + // For example: `metadata.field_1.number_value = 10.0` + // + // Each of the above supported filter types can be combined together using + // logical operators (`AND` & `OR`). + // + // For example: `display_name = "test" AND metadata.field1.bool_value = true`. + string filter = 3; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_store.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_store.proto new file mode 100644 index 00000000..2d8a19d3 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_store.proto @@ -0,0 +1,65 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "MetadataProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Instance of a metadata store. Contains a set of metadata that can be +// queried. +message MetadataStore { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/MetadataStore" + pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}" + }; + + // Represents state information for a MetadataStore. + message MetadataStoreState { + // The disk utilization of the MetadataStore in bytes. + int64 disk_utilization_bytes = 1; + } + + // Output only. The resource name of the MetadataStore instance. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this MetadataStore was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this MetadataStore was last updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Customer-managed encryption key spec for a Metadata Store. If set, this + // Metadata Store and all sub-resources of this Metadata Store are secured + // using this key. + EncryptionSpec encryption_spec = 5; + + // Description of the MetadataStore. + string description = 6; + + // Output only. State information of the MetadataStore. + MetadataStoreState state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto new file mode 100644 index 00000000..bd8aa730 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto @@ -0,0 +1,150 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "MigratableResourceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; +option (google.api.resource_definition) = { + type: "ml.googleapis.com/Version" + pattern: "projects/{project}/models/{model}/versions/{version}" +}; +option (google.api.resource_definition) = { + type: "automl.googleapis.com/Model" + pattern: "projects/{project}/locations/{location}/models/{model}" +}; +option (google.api.resource_definition) = { + type: "automl.googleapis.com/Dataset" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}" +}; +option (google.api.resource_definition) = { + type: "datalabeling.googleapis.com/Dataset" + pattern: "projects/{project}/datasets/{dataset}" +}; +option (google.api.resource_definition) = { + type: "datalabeling.googleapis.com/AnnotatedDataset" + pattern: "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}" +}; + +// Represents one resource that exists in automl.googleapis.com, +// datalabeling.googleapis.com or ml.googleapis.com. +message MigratableResource { + // Represents one model Version in ml.googleapis.com. + message MlEngineModelVersion { + // The ml.googleapis.com endpoint that this model Version currently lives + // in. + // Example values: + // + // * ml.googleapis.com + // * us-centrall-ml.googleapis.com + // * europe-west4-ml.googleapis.com + // * asia-east1-ml.googleapis.com + string endpoint = 1; + + // Full resource name of ml engine model Version. + // Format: `projects/{project}/models/{model}/versions/{version}`. + string version = 2 [(google.api.resource_reference) = { + type: "ml.googleapis.com/Version" + }]; + } + + // Represents one Model in automl.googleapis.com. + message AutomlModel { + // Full resource name of automl Model. + // Format: + // `projects/{project}/locations/{location}/models/{model}`. + string model = 1 [(google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + }]; + + // The Model's display name in automl.googleapis.com. + string model_display_name = 3; + } + + // Represents one Dataset in automl.googleapis.com. + message AutomlDataset { + // Full resource name of automl Dataset. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}`. + string dataset = 1 [(google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + }]; + + // The Dataset's display name in automl.googleapis.com. + string dataset_display_name = 4; + } + + // Represents one Dataset in datalabeling.googleapis.com. + message DataLabelingDataset { + // Represents one AnnotatedDataset in datalabeling.googleapis.com. + message DataLabelingAnnotatedDataset { + // Full resource name of data labeling AnnotatedDataset. + // Format: + // `projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}`. + string annotated_dataset = 1 [(google.api.resource_reference) = { + type: "datalabeling.googleapis.com/AnnotatedDataset" + }]; + + // The AnnotatedDataset's display name in datalabeling.googleapis.com. + string annotated_dataset_display_name = 3; + } + + // Full resource name of data labeling Dataset. + // Format: + // `projects/{project}/datasets/{dataset}`. + string dataset = 1 [(google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Dataset" + }]; + + // The Dataset's display name in datalabeling.googleapis.com. + string dataset_display_name = 4; + + // The migratable AnnotatedDataset in datalabeling.googleapis.com belongs to + // the data labeling Dataset. + repeated DataLabelingAnnotatedDataset data_labeling_annotated_datasets = 3; + } + + oneof resource { + // Output only. Represents one Version in ml.googleapis.com. + MlEngineModelVersion ml_engine_model_version = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Represents one Model in automl.googleapis.com. + AutomlModel automl_model = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Represents one Dataset in automl.googleapis.com. + AutomlDataset automl_dataset = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Represents one Dataset in datalabeling.googleapis.com. + DataLabelingDataset data_labeling_dataset = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Timestamp when the last migration attempt on this MigratableResource + // started. Will not be set if there's no migration attempt on this + // MigratableResource. + google.protobuf.Timestamp last_migrate_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this MigratableResource was last updated. + google.protobuf.Timestamp last_update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/migration_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/migration_service.proto new file mode 100644 index 00000000..f08ad889 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/migration_service.proto @@ -0,0 +1,314 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/migratable_resource.proto"; +import "google/cloud/aiplatform/v1beta1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "MigrationServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A service that migrates resources from automl.googleapis.com, +// datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. +service MigrationService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Searches all of the resources in automl.googleapis.com, + // datalabeling.googleapis.com and ml.googleapis.com that can be migrated to + // Vertex AI's given location. + rpc SearchMigratableResources(SearchMigratableResourcesRequest) returns (SearchMigratableResourcesResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/migratableResources:search" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Batch migrates resources from ml.googleapis.com, automl.googleapis.com, + // and datalabeling.googleapis.com to Vertex AI. + rpc BatchMigrateResources(BatchMigrateResourcesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/migratableResources:batchMigrate" + body: "*" + }; + option (google.api.method_signature) = "parent,migrate_resource_requests"; + option (google.longrunning.operation_info) = { + response_type: "BatchMigrateResourcesResponse" + metadata_type: "BatchMigrateResourcesOperationMetadata" + }; + } +} + +// Request message for [MigrationService.SearchMigratableResources][google.cloud.aiplatform.v1beta1.MigrationService.SearchMigratableResources]. +message SearchMigratableResourcesRequest { + // Required. The location that the migratable resources should be searched from. + // It's the Vertex AI location that the resources can be migrated to, not + // the resources' original location. + // Format: + // `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The standard page size. + // The default and maximum value is 100. + int32 page_size = 2; + + // The standard page token. + string page_token = 3; + + // A filter for your search. You can use the following types of filters: + // + // * Resource type filters. The following strings filter for a specific type + // of [MigratableResource][google.cloud.aiplatform.v1beta1.MigratableResource]: + // * `ml_engine_model_version:*` + // * `automl_model:*` + // * `automl_dataset:*` + // * `data_labeling_dataset:*` + // * "Migrated or not" filters. The following strings filter for resources + // that either have or have not already been migrated: + // * `last_migrate_time:*` filters for migrated resources. + // * `NOT last_migrate_time:*` filters for not yet migrated resources. + string filter = 4; +} + +// Response message for [MigrationService.SearchMigratableResources][google.cloud.aiplatform.v1beta1.MigrationService.SearchMigratableResources]. +message SearchMigratableResourcesResponse { + // All migratable resources that can be migrated to the + // location specified in the request. + repeated MigratableResource migratable_resources = 1; + + // The standard next-page token. + // The migratable_resources may not fill page_size in + // SearchMigratableResourcesRequest even when there are subsequent pages. + string next_page_token = 2; +} + +// Request message for [MigrationService.BatchMigrateResources][google.cloud.aiplatform.v1beta1.MigrationService.BatchMigrateResources]. +message BatchMigrateResourcesRequest { + // Required. The location of the migrated resource will live in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The request messages specifying the resources to migrate. + // They must be in the same location as the destination. + // Up to 50 resources can be migrated in one batch. + repeated MigrateResourceRequest migrate_resource_requests = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Config of migrating one resource from automl.googleapis.com, +// datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. +message MigrateResourceRequest { + // Config for migrating version in ml.googleapis.com to Vertex AI's Model. + message MigrateMlEngineModelVersionConfig { + // Required. The ml.googleapis.com endpoint that this model version should be migrated + // from. + // Example values: + // + // * ml.googleapis.com + // + // * us-centrall-ml.googleapis.com + // + // * europe-west4-ml.googleapis.com + // + // * asia-east1-ml.googleapis.com + string endpoint = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Full resource name of ml engine model version. + // Format: `projects/{project}/models/{model}/versions/{version}`. + string model_version = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ml.googleapis.com/Version" + } + ]; + + // Required. Display name of the model in Vertex AI. + // System will pick a display name if unspecified. + string model_display_name = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // Config for migrating Model in automl.googleapis.com to Vertex AI's Model. + message MigrateAutomlModelConfig { + // Required. Full resource name of automl Model. + // Format: + // `projects/{project}/locations/{location}/models/{model}`. + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // Optional. Display name of the model in Vertex AI. + // System will pick a display name if unspecified. + string model_display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Config for migrating Dataset in automl.googleapis.com to Vertex AI's + // Dataset. + message MigrateAutomlDatasetConfig { + // Required. Full resource name of automl Dataset. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}`. + string dataset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; + + // Required. Display name of the Dataset in Vertex AI. + // System will pick a display name if unspecified. + string dataset_display_name = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Config for migrating Dataset in datalabeling.googleapis.com to Vertex + // AI's Dataset. + message MigrateDataLabelingDatasetConfig { + // Config for migrating AnnotatedDataset in datalabeling.googleapis.com to + // Vertex AI's SavedQuery. + message MigrateDataLabelingAnnotatedDatasetConfig { + // Required. Full resource name of data labeling AnnotatedDataset. + // Format: + // `projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}`. + string annotated_dataset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/AnnotatedDataset" + } + ]; + } + + // Required. Full resource name of data labeling Dataset. + // Format: + // `projects/{project}/datasets/{dataset}`. + string dataset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datalabeling.googleapis.com/Dataset" + } + ]; + + // Optional. Display name of the Dataset in Vertex AI. + // System will pick a display name if unspecified. + string dataset_display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configs for migrating AnnotatedDataset in datalabeling.googleapis.com to + // Vertex AI's SavedQuery. The specified AnnotatedDatasets have to belong + // to the datalabeling Dataset. + repeated MigrateDataLabelingAnnotatedDatasetConfig migrate_data_labeling_annotated_dataset_configs = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + oneof request { + // Config for migrating Version in ml.googleapis.com to Vertex AI's Model. + MigrateMlEngineModelVersionConfig migrate_ml_engine_model_version_config = 1; + + // Config for migrating Model in automl.googleapis.com to Vertex AI's + // Model. + MigrateAutomlModelConfig migrate_automl_model_config = 2; + + // Config for migrating Dataset in automl.googleapis.com to Vertex AI's + // Dataset. + MigrateAutomlDatasetConfig migrate_automl_dataset_config = 3; + + // Config for migrating Dataset in datalabeling.googleapis.com to + // Vertex AI's Dataset. + MigrateDataLabelingDatasetConfig migrate_data_labeling_dataset_config = 4; + } +} + +// Response message for [MigrationService.BatchMigrateResources][google.cloud.aiplatform.v1beta1.MigrationService.BatchMigrateResources]. +message BatchMigrateResourcesResponse { + // Successfully migrated resources. + repeated MigrateResourceResponse migrate_resource_responses = 1; +} + +// Describes a successfully migrated resource. +message MigrateResourceResponse { + // After migration, the resource name in Vertex AI. + oneof migrated_resource { + // Migrated Dataset's resource name. + string dataset = 1 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + }]; + + // Migrated Model's resource name. + string model = 2 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + }]; + } + + // Before migration, the identifier in ml.googleapis.com, + // automl.googleapis.com or datalabeling.googleapis.com. + MigratableResource migratable_resource = 3; +} + +// Runtime operation information for [MigrationService.BatchMigrateResources][google.cloud.aiplatform.v1beta1.MigrationService.BatchMigrateResources]. +message BatchMigrateResourcesOperationMetadata { + // Represents a partial result in batch migration operation for one + // [MigrateResourceRequest][google.cloud.aiplatform.v1beta1.MigrateResourceRequest]. + message PartialResult { + // If the resource's migration is ongoing, none of the result will be set. + // If the resource's migration is finished, either error or one of the + // migrated resource name will be filled. + oneof result { + // The error result of the migration request in case of failure. + google.rpc.Status error = 2; + + // Migrated model resource name. + string model = 3 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + }]; + + // Migrated dataset resource name. + string dataset = 4 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + }]; + } + + // It's the same as the value in + // [MigrateResourceRequest.migrate_resource_requests][]. + MigrateResourceRequest request = 1; + } + + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; + + // Partial results that reflect the latest migration operation progress. + repeated PartialResult partial_results = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto new file mode 100644 index 00000000..d17275bb --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto @@ -0,0 +1,588 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/deployed_model_ref.proto"; +import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1beta1/env_var.proto"; +import "google/cloud/aiplatform/v1beta1/explanation.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ModelProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A trained machine learning Model. +message Model { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Model" + pattern: "projects/{project}/locations/{location}/models/{model}" + }; + + // Represents export format supported by the Model. + // All formats export to Google Cloud Storage. + message ExportFormat { + // The Model content that can be exported. + enum ExportableContent { + // Should not be used. + EXPORTABLE_CONTENT_UNSPECIFIED = 0; + + // Model artifact and any of its supported files. Will be exported to the + // location specified by the `artifactDestination` field of the + // [ExportModelRequest.output_config][google.cloud.aiplatform.v1beta1.ExportModelRequest.output_config] object. + ARTIFACT = 1; + + // The container image that is to be used when deploying this Model. Will + // be exported to the location specified by the `imageDestination` field + // of the [ExportModelRequest.output_config][google.cloud.aiplatform.v1beta1.ExportModelRequest.output_config] object. + IMAGE = 2; + } + + // Output only. The ID of the export format. + // The possible format IDs are: + // + // * `tflite` + // Used for Android mobile devices. + // + // * `edgetpu-tflite` + // Used for [Edge TPU](https://cloud.google.com/edge-tpu/) devices. + // + // * `tf-saved-model` + // A tensorflow model in SavedModel format. + // + // * `tf-js` + // A [TensorFlow.js](https://www.tensorflow.org/js) model that can be used + // in the browser and in Node.js using JavaScript. + // + // * `core-ml` + // Used for iOS mobile devices. + // + // * `custom-trained` + // A Model that was uploaded or trained by custom code. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The content of this Model that may be exported. + repeated ExportableContent exportable_contents = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Identifies a type of Model's prediction resources. + enum DeploymentResourcesType { + // Should not be used. + DEPLOYMENT_RESOURCES_TYPE_UNSPECIFIED = 0; + + // Resources that are dedicated to the [DeployedModel][google.cloud.aiplatform.v1beta1.DeployedModel], and that need a + // higher degree of manual configuration. + DEDICATED_RESOURCES = 1; + + // Resources that to large degree are decided by Vertex AI, and require + // only a modest additional configuration. + AUTOMATIC_RESOURCES = 2; + } + + // The resource name of the Model. + string name = 1; + + // Output only. Immutable. The version ID of the model. + // A new version is committed when a new model version is uploaded or + // trained under an existing model id. It is an auto-incrementing decimal + // number in string representation. + string version_id = 28 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // User provided version aliases so that a model version can be referenced via + // alias (i.e. + // projects/{project}/locations/{location}/models/{model_id}@{version_alias} + // instead of auto-generated version id (i.e. + // projects/{project}/locations/{location}/models/{model_id}@{version_id}). + // The format is [a-z][a-zA-Z0-9-]{0,126}[a-z0-9] to distinguish from + // version_id. A default version alias will be created for the first version + // of the model, and there must be exactly one default version alias for a + // model. + repeated string version_aliases = 29; + + // Output only. Timestamp when this version was created. + google.protobuf.Timestamp version_create_time = 31 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this version was most recently updated. + google.protobuf.Timestamp version_update_time = 32 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the Model. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the Model. + string description = 3; + + // The description of this version. + string version_description = 30; + + // The schemata that describe formats of the Model's predictions and + // explanations as given and returned via + // [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict] and [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain]. + PredictSchemata predict_schemata = 4; + + // Immutable. Points to a YAML file stored on Google Cloud Storage describing additional + // information about the Model, that is specific to it. Unset if the Model + // does not have any additional information. + // The schema is defined as an OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + // AutoML Models always have this field populated by Vertex AI, if no + // additional metadata is needed, this field is set to an empty string. + // Note: The URI given on output will be immutable and probably different, + // including the URI scheme, than the one given on input. The output URI will + // point to a location where the user only has a read access. + string metadata_schema_uri = 5 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. An additional information about the Model; the schema of the metadata can + // be found in [metadata_schema][google.cloud.aiplatform.v1beta1.Model.metadata_schema_uri]. + // Unset if the Model does not have any additional information. + google.protobuf.Value metadata = 6 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The formats in which this Model may be exported. If empty, this Model is + // not available for export. + repeated ExportFormat supported_export_formats = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The resource name of the TrainingPipeline that uploaded this Model, if + // any. + string training_pipeline = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TrainingPipeline" + } + ]; + + // Input only. The specification of the container that is to be used when deploying + // this Model. The specification is ingested upon + // [ModelService.UploadModel][google.cloud.aiplatform.v1beta1.ModelService.UploadModel], and all binaries it contains are copied + // and stored internally by Vertex AI. + // Not present for AutoML Models. + ModelContainerSpec container_spec = 9 [(google.api.field_behavior) = INPUT_ONLY]; + + // Immutable. The path to the directory containing the Model artifact and any of its + // supporting files. + // Not present for AutoML Models. + string artifact_uri = 26 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. When this Model is deployed, its prediction resources are described by the + // `prediction_resources` field of the [Endpoint.deployed_models][google.cloud.aiplatform.v1beta1.Endpoint.deployed_models] object. + // Because not all Models support all resource configuration types, the + // configuration types this Model supports are listed here. If no + // configuration types are listed, the Model cannot be deployed to an + // [Endpoint][google.cloud.aiplatform.v1beta1.Endpoint] and does not support + // online predictions ([PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict] or + // [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain]). Such a Model can serve predictions by + // using a [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob], if it has at least one entry each in + // [supported_input_storage_formats][google.cloud.aiplatform.v1beta1.Model.supported_input_storage_formats] and + // [supported_output_storage_formats][google.cloud.aiplatform.v1beta1.Model.supported_output_storage_formats]. + repeated DeploymentResourcesType supported_deployment_resources_types = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The formats this Model supports in + // [BatchPredictionJob.input_config][google.cloud.aiplatform.v1beta1.BatchPredictionJob.input_config]. If + // [PredictSchemata.instance_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri] exists, the instances + // should be given as per that schema. + // + // The possible formats are: + // + // * `jsonl` + // The JSON Lines format, where each instance is a single line. Uses + // [GcsSource][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig.gcs_source]. + // + // * `csv` + // The CSV format, where each instance is a single comma-separated line. + // The first line in the file is the header, containing comma-separated field + // names. Uses [GcsSource][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig.gcs_source]. + // + // * `tf-record` + // The TFRecord format, where each instance is a single record in tfrecord + // syntax. Uses [GcsSource][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig.gcs_source]. + // + // * `tf-record-gzip` + // Similar to `tf-record`, but the file is gzipped. Uses + // [GcsSource][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig.gcs_source]. + // + // * `bigquery` + // Each instance is a single row in BigQuery. Uses + // [BigQuerySource][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig.bigquery_source]. + // + // * `file-list` + // Each line of the file is the location of an instance to process, uses + // `gcs_source` field of the + // [InputConfig][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig] object. + // + // + // If this Model doesn't support any of these formats it means it cannot be + // used with a [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob]. However, if it has + // [supported_deployment_resources_types][google.cloud.aiplatform.v1beta1.Model.supported_deployment_resources_types], it could serve online + // predictions by using [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict] or + // [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain]. + repeated string supported_input_storage_formats = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The formats this Model supports in + // [BatchPredictionJob.output_config][google.cloud.aiplatform.v1beta1.BatchPredictionJob.output_config]. If both + // [PredictSchemata.instance_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri] and + // [PredictSchemata.prediction_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.prediction_schema_uri] exist, the predictions + // are returned together with their instances. In other words, the + // prediction has the original instance data first, followed + // by the actual prediction content (as per the schema). + // + // The possible formats are: + // + // * `jsonl` + // The JSON Lines format, where each prediction is a single line. Uses + // [GcsDestination][google.cloud.aiplatform.v1beta1.BatchPredictionJob.OutputConfig.gcs_destination]. + // + // * `csv` + // The CSV format, where each prediction is a single comma-separated line. + // The first line in the file is the header, containing comma-separated field + // names. Uses + // [GcsDestination][google.cloud.aiplatform.v1beta1.BatchPredictionJob.OutputConfig.gcs_destination]. + // + // * `bigquery` + // Each prediction is a single row in a BigQuery table, uses + // [BigQueryDestination][google.cloud.aiplatform.v1beta1.BatchPredictionJob.OutputConfig.bigquery_destination] + // . + // + // + // If this Model doesn't support any of these formats it means it cannot be + // used with a [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob]. However, if it has + // [supported_deployment_resources_types][google.cloud.aiplatform.v1beta1.Model.supported_deployment_resources_types], it could serve online + // predictions by using [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict] or + // [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain]. + repeated string supported_output_storage_formats = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Model was uploaded into Vertex AI. + google.protobuf.Timestamp create_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Model was most recently updated. + google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The pointers to DeployedModels created from this Model. Note that + // Model could have been deployed to Endpoints in different Locations. + repeated DeployedModelRef deployed_models = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The default explanation specification for this Model. + // + // The Model can be used for [requesting + // explanation][PredictionService.Explain] after being + // [deployed][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel] if it is populated. + // The Model can be used for [batch + // explanation][BatchPredictionJob.generate_explanation] if it is populated. + // + // All fields of the explanation_spec can be overridden by + // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] of + // [DeployModelRequest.deployed_model][google.cloud.aiplatform.v1beta1.DeployModelRequest.deployed_model], or + // [explanation_spec][google.cloud.aiplatform.v1beta1.BatchPredictionJob.explanation_spec] of + // [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob]. + // + // If the default explanation specification is not set for this Model, this + // Model can still be used for [requesting + // explanation][PredictionService.Explain] by setting + // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] of + // [DeployModelRequest.deployed_model][google.cloud.aiplatform.v1beta1.DeployModelRequest.deployed_model] and for [batch + // explanation][BatchPredictionJob.generate_explanation] by setting + // [explanation_spec][google.cloud.aiplatform.v1beta1.BatchPredictionJob.explanation_spec] of + // [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob]. + ExplanationSpec explanation_spec = 23; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 16; + + // The labels with user-defined metadata to organize your Models. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 17; + + // Customer-managed encryption key spec for a Model. If set, this + // Model and all sub-resources of this Model will be secured by this key. + EncryptionSpec encryption_spec = 24; +} + +// Contains the schemata used in Model's predictions and explanations via +// [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict], [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain] and +// [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob]. +message PredictSchemata { + // Immutable. Points to a YAML file stored on Google Cloud Storage describing the format + // of a single instance, which are used in [PredictRequest.instances][google.cloud.aiplatform.v1beta1.PredictRequest.instances], + // [ExplainRequest.instances][google.cloud.aiplatform.v1beta1.ExplainRequest.instances] and + // [BatchPredictionJob.input_config][google.cloud.aiplatform.v1beta1.BatchPredictionJob.input_config]. + // The schema is defined as an OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + // AutoML Models always have this field populated by Vertex AI. + // Note: The URI given on output will be immutable and probably different, + // including the URI scheme, than the one given on input. The output URI will + // point to a location where the user only has a read access. + string instance_schema_uri = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Points to a YAML file stored on Google Cloud Storage describing the + // parameters of prediction and explanation via + // [PredictRequest.parameters][google.cloud.aiplatform.v1beta1.PredictRequest.parameters], [ExplainRequest.parameters][google.cloud.aiplatform.v1beta1.ExplainRequest.parameters] and + // [BatchPredictionJob.model_parameters][google.cloud.aiplatform.v1beta1.BatchPredictionJob.model_parameters]. + // The schema is defined as an OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + // AutoML Models always have this field populated by Vertex AI, if no + // parameters are supported, then it is set to an empty string. + // Note: The URI given on output will be immutable and probably different, + // including the URI scheme, than the one given on input. The output URI will + // point to a location where the user only has a read access. + string parameters_schema_uri = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Points to a YAML file stored on Google Cloud Storage describing the format + // of a single prediction produced by this Model, which are returned via + // [PredictResponse.predictions][google.cloud.aiplatform.v1beta1.PredictResponse.predictions], [ExplainResponse.explanations][google.cloud.aiplatform.v1beta1.ExplainResponse.explanations], and + // [BatchPredictionJob.output_config][google.cloud.aiplatform.v1beta1.BatchPredictionJob.output_config]. + // The schema is defined as an OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + // AutoML Models always have this field populated by Vertex AI. + // Note: The URI given on output will be immutable and probably different, + // including the URI scheme, than the one given on input. The output URI will + // point to a location where the user only has a read access. + string prediction_schema_uri = 3 [(google.api.field_behavior) = IMMUTABLE]; +} + +// Specification of a container for serving predictions. Some fields in this +// message correspond to fields in the [Kubernetes Container v1 core +// specification](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). +message ModelContainerSpec { + // Required. Immutable. URI of the Docker image to be used as the custom container for serving + // predictions. This URI must identify an image in Artifact Registry or + // Container Registry. Learn more about the [container publishing + // requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#publishing), + // including permissions requirements for the Vertex AI Service Agent. + // + // The container image is ingested upon [ModelService.UploadModel][google.cloud.aiplatform.v1beta1.ModelService.UploadModel], stored + // internally, and this original path is afterwards not used. + // + // To learn about the requirements for the Docker image itself, see + // [Custom container + // requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#). + // + // You can use the URI to one of Vertex AI's [pre-built container images for + // prediction](https://cloud.google.com/vertex-ai/docs/predictions/pre-built-containers) + // in this field. + string image_uri = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Immutable. Specifies the command that runs when the container starts. This overrides + // the container's + // [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint). + // Specify this field as an array of executable and arguments, similar to a + // Docker `ENTRYPOINT`'s "exec" form, not its "shell" form. + // + // If you do not specify this field, then the container's `ENTRYPOINT` runs, + // in conjunction with the [args][google.cloud.aiplatform.v1beta1.ModelContainerSpec.args] field or the + // container's [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd), + // if either exists. If this field is not specified and the container does not + // have an `ENTRYPOINT`, then refer to the Docker documentation about [how + // `CMD` and `ENTRYPOINT` + // interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). + // + // If you specify this field, then you can also specify the `args` field to + // provide additional arguments for this command. However, if you specify this + // field, then the container's `CMD` is ignored. See the + // [Kubernetes documentation about how the + // `command` and `args` fields interact with a container's `ENTRYPOINT` and + // `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). + // + // In this field, you can reference [environment variables set by Vertex + // AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) + // and environment variables set in the [env][google.cloud.aiplatform.v1beta1.ModelContainerSpec.env] field. + // You cannot reference environment variables set in the Docker image. In + // order for environment variables to be expanded, reference them by using the + // following syntax: + // $(VARIABLE_NAME) + // Note that this differs from Bash variable expansion, which does not use + // parentheses. If a variable cannot be resolved, the reference in the input + // string is used unchanged. To avoid variable expansion, you can escape this + // syntax with `$$`; for example: + // $$(VARIABLE_NAME) + // This field corresponds to the `command` field of the Kubernetes Containers + // [v1 core + // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). + repeated string command = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Specifies arguments for the command that runs when the container starts. + // This overrides the container's + // [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd). Specify + // this field as an array of executable and arguments, similar to a Docker + // `CMD`'s "default parameters" form. + // + // If you don't specify this field but do specify the + // [command][google.cloud.aiplatform.v1beta1.ModelContainerSpec.command] field, then the command from the + // `command` field runs without any additional arguments. See the + // [Kubernetes documentation about how the + // `command` and `args` fields interact with a container's `ENTRYPOINT` and + // `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). + // + // If you don't specify this field and don't specify the `command` field, + // then the container's + // [`ENTRYPOINT`](https://docs.docker.com/engine/reference/builder/#cmd) and + // `CMD` determine what runs based on their default behavior. See the Docker + // documentation about [how `CMD` and `ENTRYPOINT` + // interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). + // + // In this field, you can reference [environment variables + // set by Vertex + // AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) + // and environment variables set in the [env][google.cloud.aiplatform.v1beta1.ModelContainerSpec.env] field. + // You cannot reference environment variables set in the Docker image. In + // order for environment variables to be expanded, reference them by using the + // following syntax: + // $(VARIABLE_NAME) + // Note that this differs from Bash variable expansion, which does not use + // parentheses. If a variable cannot be resolved, the reference in the input + // string is used unchanged. To avoid variable expansion, you can escape this + // syntax with `$$`; for example: + // $$(VARIABLE_NAME) + // This field corresponds to the `args` field of the Kubernetes Containers + // [v1 core + // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). + repeated string args = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. List of environment variables to set in the container. After the container + // starts running, code running in the container can read these environment + // variables. + // + // Additionally, the [command][google.cloud.aiplatform.v1beta1.ModelContainerSpec.command] and + // [args][google.cloud.aiplatform.v1beta1.ModelContainerSpec.args] fields can reference these variables. Later + // entries in this list can also reference earlier entries. For example, the + // following example sets the variable `VAR_2` to have the value `foo bar`: + // + // ```json + // [ + // { + // "name": "VAR_1", + // "value": "foo" + // }, + // { + // "name": "VAR_2", + // "value": "$(VAR_1) bar" + // } + // ] + // ``` + // + // If you switch the order of the variables in the example, then the expansion + // does not occur. + // + // This field corresponds to the `env` field of the Kubernetes Containers + // [v1 core + // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). + repeated EnvVar env = 4 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. List of ports to expose from the container. Vertex AI sends any + // prediction requests that it receives to the first port on this list. Vertex + // AI also sends + // [liveness and health + // checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#liveness) + // to this port. + // + // If you do not specify this field, it defaults to following value: + // + // ```json + // [ + // { + // "containerPort": 8080 + // } + // ] + // ``` + // + // Vertex AI does not use ports other than the first one listed. This field + // corresponds to the `ports` field of the Kubernetes Containers + // [v1 core + // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). + repeated Port ports = 5 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. HTTP path on the container to send prediction requests to. Vertex AI + // forwards requests sent using + // [projects.locations.endpoints.predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict] to this + // path on the container's IP address and port. Vertex AI then returns the + // container's response in the API response. + // + // For example, if you set this field to `/foo`, then when Vertex AI + // receives a prediction request, it forwards the request body in a POST + // request to the `/foo` path on the port of your container specified by the + // first value of this `ModelContainerSpec`'s + // [ports][google.cloud.aiplatform.v1beta1.ModelContainerSpec.ports] field. + // + // If you don't specify this field, it defaults to the following value when + // you [deploy this Model to an Endpoint][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel]: + // /v1/endpoints/ENDPOINT/deployedModels/DEPLOYED_MODEL:predict + // The placeholders in this value are replaced as follows: + // + // * ENDPOINT: The last segment (following `endpoints/`)of the + // Endpoint.name][] field of the Endpoint where this Model has been + // deployed. (Vertex AI makes this value available to your container code + // as the [`AIP_ENDPOINT_ID` environment + // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) + // + // * DEPLOYED_MODEL: [DeployedModel.id][google.cloud.aiplatform.v1beta1.DeployedModel.id] of the `DeployedModel`. + // (Vertex AI makes this value available to your container code + // as the [`AIP_DEPLOYED_MODEL_ID` environment + // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) + string predict_route = 6 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. HTTP path on the container to send health checks to. Vertex AI + // intermittently sends GET requests to this path on the container's IP + // address and port to check that the container is healthy. Read more about + // [health + // checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#health). + // + // For example, if you set this field to `/bar`, then Vertex AI + // intermittently sends a GET request to the `/bar` path on the port of your + // container specified by the first value of this `ModelContainerSpec`'s + // [ports][google.cloud.aiplatform.v1beta1.ModelContainerSpec.ports] field. + // + // If you don't specify this field, it defaults to the following value when + // you [deploy this Model to an Endpoint][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel]: + // /v1/endpoints/ENDPOINT/deployedModels/DEPLOYED_MODEL:predict + // The placeholders in this value are replaced as follows: + // + // * ENDPOINT: The last segment (following `endpoints/`)of the + // Endpoint.name][] field of the Endpoint where this Model has been + // deployed. (Vertex AI makes this value available to your container code + // as the [`AIP_ENDPOINT_ID` environment + // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) + // + // * DEPLOYED_MODEL: [DeployedModel.id][google.cloud.aiplatform.v1beta1.DeployedModel.id] of the `DeployedModel`. + // (Vertex AI makes this value available to your container code as the + // [`AIP_DEPLOYED_MODEL_ID` environment + // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) + string health_route = 7 [(google.api.field_behavior) = IMMUTABLE]; +} + +// Represents a network port in a container. +message Port { + // The number of the port to expose on the pod's IP address. + // Must be a valid port number, between 1 and 65535 inclusive. + int32 container_port = 3; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto new file mode 100644 index 00000000..014f42f5 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto @@ -0,0 +1,300 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto"; +import "google/cloud/aiplatform/v1beta1/io.proto"; +import "google/cloud/aiplatform/v1beta1/job_state.proto"; +import "google/cloud/aiplatform/v1beta1/model_monitoring.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ModelDeploymentMonitoringJobProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// The Model Monitoring Objective types. +enum ModelDeploymentMonitoringObjectiveType { + // Default value, should not be set. + MODEL_DEPLOYMENT_MONITORING_OBJECTIVE_TYPE_UNSPECIFIED = 0; + + // Raw feature values' stats to detect skew between Training-Prediction + // datasets. + RAW_FEATURE_SKEW = 1; + + // Raw feature values' stats to detect drift between Serving-Prediction + // datasets. + RAW_FEATURE_DRIFT = 2; + + // Feature attribution scores to detect skew between Training-Prediction + // datasets. + FEATURE_ATTRIBUTION_SKEW = 3; + + // Feature attribution scores to detect skew between Prediction datasets + // collected within different time windows. + FEATURE_ATTRIBUTION_DRIFT = 4; +} + +// Represents a job that runs periodically to monitor the deployed models in an +// endpoint. It will analyze the logged training & prediction data to detect any +// abnormal behaviors. +message ModelDeploymentMonitoringJob { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" + pattern: "projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}" + }; + + // All metadata of most recent monitoring pipelines. + message LatestMonitoringPipelineMetadata { + // The time that most recent monitoring pipelines that is related to this + // run. + google.protobuf.Timestamp run_time = 1; + + // The status of the most recent monitoring pipeline. + google.rpc.Status status = 2; + } + + // The state to Specify the monitoring pipeline. + enum MonitoringScheduleState { + // Unspecified state. + MONITORING_SCHEDULE_STATE_UNSPECIFIED = 0; + + // The pipeline is picked up and wait to run. + PENDING = 1; + + // The pipeline is offline and will be scheduled for next run. + OFFLINE = 2; + + // The pipeline is running. + RUNNING = 3; + } + + // Output only. Resource name of a ModelDeploymentMonitoringJob. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The user-defined name of the ModelDeploymentMonitoringJob. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + // Display name of a ModelDeploymentMonitoringJob. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Endpoint resource name. + // Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Output only. The detailed state of the monitoring job. + // When the job is still creating, the state will be 'PENDING'. + // Once the job is successfully created, the state will be 'RUNNING'. + // Pause the job, the state will be 'PAUSED'. + // Resume the job, the state will return to 'RUNNING'. + JobState state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Schedule state when the monitoring job is in Running state. + MonitoringScheduleState schedule_state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Latest triggered monitoring pipeline metadata. + LatestMonitoringPipelineMetadata latest_monitoring_pipeline_metadata = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The config for monitoring objectives. This is a per DeployedModel config. + // Each DeployedModel needs to be configured separately. + repeated ModelDeploymentMonitoringObjectiveConfig model_deployment_monitoring_objective_configs = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. Schedule config for running the monitoring job. + ModelDeploymentMonitoringScheduleConfig model_deployment_monitoring_schedule_config = 7 [(google.api.field_behavior) = REQUIRED]; + + // Required. Sample Strategy for logging. + SamplingStrategy logging_sampling_strategy = 8 [(google.api.field_behavior) = REQUIRED]; + + // Alert config for model monitoring. + ModelMonitoringAlertConfig model_monitoring_alert_config = 15; + + // YAML schema file uri describing the format of a single instance, + // which are given to format this Endpoint's prediction (and explanation). + // If not set, we will generate predict schema from collected predict + // requests. + string predict_instance_schema_uri = 9; + + // Sample Predict instance, same format as [PredictRequest.instances][google.cloud.aiplatform.v1beta1.PredictRequest.instances], + // this can be set as a replacement of + // [ModelDeploymentMonitoringJob.predict_instance_schema_uri][google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob.predict_instance_schema_uri]. If not set, + // we will generate predict schema from collected predict requests. + google.protobuf.Value sample_predict_instance = 19; + + // YAML schema file uri describing the format of a single instance that you + // want Tensorflow Data Validation (TFDV) to analyze. + // + // If this field is empty, all the feature data types are inferred from + // [predict_instance_schema_uri][google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob.predict_instance_schema_uri], + // meaning that TFDV will use the data in the exact format(data type) as + // prediction request/response. + // If there are any data type differences between predict instance and TFDV + // instance, this field can be used to override the schema. + // For models trained with Vertex AI, this field must be set as all the + // fields in predict instance formatted as string. + string analysis_instance_schema_uri = 16; + + // Output only. The created bigquery tables for the job under customer project. Customer + // could do their own query & analysis. There could be 4 log tables in + // maximum: + // 1. Training data logging predict request/response + // 2. Serving data logging predict request/response + repeated ModelDeploymentMonitoringBigQueryTable bigquery_tables = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The TTL of BigQuery tables in user projects which stores logs. + // A day is the basic unit of the TTL and we take the ceil of TTL/86400(a + // day). e.g. { second: 3600} indicates ttl = 1 day. + google.protobuf.Duration log_ttl = 17; + + // The labels with user-defined metadata to organize your + // ModelDeploymentMonitoringJob. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 11; + + // Output only. Timestamp when this ModelDeploymentMonitoringJob was created. + google.protobuf.Timestamp create_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this ModelDeploymentMonitoringJob was updated most recently. + google.protobuf.Timestamp update_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this monitoring pipeline will be scheduled to run for the + // next round. + google.protobuf.Timestamp next_schedule_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Stats anomalies base folder path. + GcsDestination stats_anomalies_base_directory = 20; + + // Customer-managed encryption key spec for a ModelDeploymentMonitoringJob. If + // set, this ModelDeploymentMonitoringJob and all sub-resources of this + // ModelDeploymentMonitoringJob will be secured by this key. + EncryptionSpec encryption_spec = 21; + + // If true, the scheduled monitoring pipeline logs are sent to + // Google Cloud Logging, including pipeline status and anomalies detected. + // Please note the logs incur cost, which are subject to [Cloud Logging + // pricing](https://cloud.google.com/logging#pricing). + bool enable_monitoring_pipeline_logs = 22; + + // Output only. Only populated when the job's state is `JOB_STATE_FAILED` or + // `JOB_STATE_CANCELLED`. + google.rpc.Status error = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// ModelDeploymentMonitoringBigQueryTable specifies the BigQuery table name +// as well as some information of the logs stored in this table. +message ModelDeploymentMonitoringBigQueryTable { + // Indicates where does the log come from. + enum LogSource { + // Unspecified source. + LOG_SOURCE_UNSPECIFIED = 0; + + // Logs coming from Training dataset. + TRAINING = 1; + + // Logs coming from Serving traffic. + SERVING = 2; + } + + // Indicates what type of traffic does the log belong to. + enum LogType { + // Unspecified type. + LOG_TYPE_UNSPECIFIED = 0; + + // Predict logs. + PREDICT = 1; + + // Explain logs. + EXPLAIN = 2; + } + + // The source of log. + LogSource log_source = 1; + + // The type of log. + LogType log_type = 2; + + // The created BigQuery table to store logs. Customer could do their own query + // & analysis. Format: + // `bq://.model_deployment_monitoring_._` + string bigquery_table_path = 3; +} + +// ModelDeploymentMonitoringObjectiveConfig contains the pair of +// deployed_model_id to ModelMonitoringObjectiveConfig. +message ModelDeploymentMonitoringObjectiveConfig { + // The DeployedModel ID of the objective config. + string deployed_model_id = 1; + + // The objective config of for the modelmonitoring job of this deployed model. + ModelMonitoringObjectiveConfig objective_config = 2; +} + +// The config for scheduling monitoring job. +message ModelDeploymentMonitoringScheduleConfig { + // Required. The model monitoring job scheduling interval. It will be rounded up to next + // full hour. This defines how often the monitoring jobs are triggered. + google.protobuf.Duration monitor_interval = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Statistics and anomalies generated by Model Monitoring. +message ModelMonitoringStatsAnomalies { + // Historical Stats (and Anomalies) for a specific Feature. + message FeatureHistoricStatsAnomalies { + // Display Name of the Feature. + string feature_display_name = 1; + + // Threshold for anomaly detection. + ThresholdConfig threshold = 3; + + // Stats calculated for the Training Dataset. + FeatureStatsAnomaly training_stats = 4; + + // A list of historical stats generated by different time window's + // Prediction Dataset. + repeated FeatureStatsAnomaly prediction_stats = 5; + } + + // Model Monitoring Objective those stats and anomalies belonging to. + ModelDeploymentMonitoringObjectiveType objective = 1; + + // Deployed Model ID. + string deployed_model_id = 2; + + // Number of anomalies within all stats. + int32 anomaly_count = 3; + + // A list of historical Stats and Anomalies generated for all Features. + repeated FeatureHistoricStatsAnomalies feature_stats = 4; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto new file mode 100644 index 00000000..4e2c903e --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto @@ -0,0 +1,94 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/explanation.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ModelEvaluationProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A collection of metrics calculated by comparing Model's predictions on all of +// the test data against annotations from the test data. +message ModelEvaluation { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/ModelEvaluation" + pattern: "projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}" + }; + + message ModelEvaluationExplanationSpec { + // Explanation type. + // + // For AutoML Image Classification models, possible values are: + // + // * `image-integrated-gradients` + // * `image-xrai` + string explanation_type = 1; + + // Explanation spec details. + ExplanationSpec explanation_spec = 2; + } + + // Output only. The resource name of the ModelEvaluation. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The display name of the ModelEvaluation. + string display_name = 10; + + // Points to a YAML file stored on Google Cloud Storage describing the + // [metrics][google.cloud.aiplatform.v1beta1.ModelEvaluation.metrics] of this ModelEvaluation. The schema is + // defined as an OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + string metrics_schema_uri = 2; + + // Evaluation metrics of the Model. The schema of the metrics is stored in + // [metrics_schema_uri][google.cloud.aiplatform.v1beta1.ModelEvaluation.metrics_schema_uri] + google.protobuf.Value metrics = 3; + + // Output only. Timestamp when this ModelEvaluation was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // All possible [dimensions][ModelEvaluationSlice.slice.dimension] of + // ModelEvaluationSlices. The dimensions can be used as the filter of the + // [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluationSlices] request, in the form of + // `slice.dimension = `. + repeated string slice_dimensions = 5; + + // Aggregated explanation metrics for the Model's prediction output over the + // data this ModelEvaluation uses. This field is populated only if the Model + // is evaluated with explanations, and only for AutoML tabular Models. + // + ModelExplanation model_explanation = 8; + + // Describes the values of [ExplanationSpec][google.cloud.aiplatform.v1beta1.ExplanationSpec] that are used for explaining + // the predicted values on the evaluated data. + repeated ModelEvaluationExplanationSpec explanation_specs = 9; + + // The metadata of the ModelEvaluation. + // For the ModelEvaluation uploaded from Managed Pipeline, metadata contains a + // structured value with keys of "pipeline_job_id", "evaluation_dataset_type", + // "evaluation_dataset_path". + google.protobuf.Value metadata = 11; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto new file mode 100644 index 00000000..aa39f111 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto @@ -0,0 +1,71 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ModelEvaluationSliceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A collection of metrics calculated by comparing Model's predictions on a +// slice of the test data against ground truth annotations. +message ModelEvaluationSlice { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/ModelEvaluationSlice" + pattern: "projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}" + }; + + // Definition of a slice. + message Slice { + // Output only. The dimension of the slice. + // Well-known dimensions are: + // * `annotationSpec`: This slice is on the test data that has either + // ground truth or prediction with [AnnotationSpec.display_name][google.cloud.aiplatform.v1beta1.AnnotationSpec.display_name] + // equals to [value][google.cloud.aiplatform.v1beta1.ModelEvaluationSlice.Slice.value]. + string dimension = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The value of the dimension in this slice. + string value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The resource name of the ModelEvaluationSlice. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The slice of the test data that is used to evaluate the Model. + Slice slice = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Points to a YAML file stored on Google Cloud Storage describing the + // [metrics][google.cloud.aiplatform.v1beta1.ModelEvaluationSlice.metrics] of this ModelEvaluationSlice. The + // schema is defined as an OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + string metrics_schema_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Sliced evaluation metrics of the Model. The schema of the metrics is stored + // in [metrics_schema_uri][google.cloud.aiplatform.v1beta1.ModelEvaluationSlice.metrics_schema_uri] + google.protobuf.Value metrics = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this ModelEvaluationSlice was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto new file mode 100644 index 00000000..49676251 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto @@ -0,0 +1,202 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/io.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ModelMonitoringProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Next ID: 8 +message ModelMonitoringObjectiveConfig { + // Training Dataset information. + message TrainingDataset { + oneof data_source { + // The resource name of the Dataset used to train this Model. + string dataset = 3 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Dataset" + }]; + + // The Google Cloud Storage uri of the unmanaged Dataset used to train + // this Model. + GcsSource gcs_source = 4; + + // The BigQuery table of the unmanaged Dataset used to train this + // Model. + BigQuerySource bigquery_source = 5; + } + + // Data format of the dataset, only applicable if the input is from + // Google Cloud Storage. + // The possible formats are: + // + // "tf-record" + // The source file is a TFRecord file. + // + // "csv" + // The source file is a CSV file. + string data_format = 2; + + // The target field name the model is to predict. + // This field will be excluded when doing Predict and (or) Explain for the + // training data. + string target_field = 6; + + // Strategy to sample data from Training Dataset. + // If not set, we process the whole dataset. + SamplingStrategy logging_sampling_strategy = 7; + } + + // The config for Training & Prediction data skew detection. It specifies the + // training dataset sources and the skew detection parameters. + message TrainingPredictionSkewDetectionConfig { + // Key is the feature name and value is the threshold. If a feature needs to + // be monitored for skew, a value threshold must be configured for that + // feature. The threshold here is against feature distribution distance + // between the training and prediction feature. + map skew_thresholds = 1; + + // Key is the feature name and value is the threshold. The threshold here is + // against attribution score distance between the training and prediction + // feature. + map attribution_score_skew_thresholds = 2; + } + + // The config for Prediction data drift detection. + message PredictionDriftDetectionConfig { + // Key is the feature name and value is the threshold. If a feature needs to + // be monitored for drift, a value threshold must be configured for that + // feature. The threshold here is against feature distribution distance + // between different time windws. + map drift_thresholds = 1; + + // Key is the feature name and value is the threshold. The threshold here is + // against attribution score distance between different time windows. + map attribution_score_drift_thresholds = 2; + } + + // The config for integrating with Vertex Explainable AI. Only applicable if + // the Model has explanation_spec populated. + message ExplanationConfig { + // Output from [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob] for Model Monitoring baseline dataset, + // which can be used to generate baseline attribution scores. + message ExplanationBaseline { + // The storage format of the predictions generated BatchPrediction job. + enum PredictionFormat { + // Should not be set. + PREDICTION_FORMAT_UNSPECIFIED = 0; + + // Predictions are in JSONL files. + JSONL = 2; + + // Predictions are in BigQuery. + BIGQUERY = 3; + } + + // The configuration specifying of BatchExplain job output. This can be + // used to generate the baseline of feature attribution scores. + oneof destination { + // Cloud Storage location for BatchExplain output. + GcsDestination gcs = 2; + + // BigQuery location for BatchExplain output. + BigQueryDestination bigquery = 3; + } + + // The storage format of the predictions generated BatchPrediction job. + PredictionFormat prediction_format = 1; + } + + // If want to analyze the Vertex Explainable AI feature attribute scores or + // not. If set to true, Vertex AI will log the feature attributions from + // explain response and do the skew/drift detection for them. + bool enable_feature_attributes = 1; + + // Predictions generated by the BatchPredictionJob using baseline dataset. + ExplanationBaseline explanation_baseline = 2; + } + + // Training dataset for models. This field has to be set only if + // TrainingPredictionSkewDetectionConfig is specified. + TrainingDataset training_dataset = 1; + + // The config for skew between training data and prediction data. + TrainingPredictionSkewDetectionConfig training_prediction_skew_detection_config = 2; + + // The config for drift of prediction data. + PredictionDriftDetectionConfig prediction_drift_detection_config = 3; + + // The config for integrating with Vertex Explainable AI. + ExplanationConfig explanation_config = 5; +} + +// Next ID: 3 +message ModelMonitoringAlertConfig { + // The config for email alert. + message EmailAlertConfig { + // The email addresses to send the alert. + repeated string user_emails = 1; + } + + oneof alert { + // Email alert config. + EmailAlertConfig email_alert_config = 1; + } + + // Dump the anomalies to Cloud Logging. The anomalies will be put to json + // payload encoded from proto + // [google.cloud.aiplatform.logging.ModelMonitoringAnomaliesLogEntry][]. + // This can be further sinked to Pub/Sub or any other services supported + // by Cloud Logging. + bool enable_logging = 2; +} + +// The config for feature monitoring threshold. +// Next ID: 3 +message ThresholdConfig { + oneof threshold { + // Specify a threshold value that can trigger the alert. + // If this threshold config is for feature distribution distance: + // 1. For categorical feature, the distribution distance is calculated by + // L-inifinity norm. + // 2. For numerical feature, the distribution distance is calculated by + // Jensen–Shannon divergence. + // Each feature must have a non-zero threshold if they need to be monitored. + // Otherwise no alert will be triggered for that feature. + double value = 1; + } +} + +// Sampling Strategy for logging, can be for both training and prediction +// dataset. +// Next ID: 2 +message SamplingStrategy { + // Requests are randomly selected. + message RandomSampleConfig { + // Sample rate (0, 1] + double sample_rate = 1; + } + + // Random sample config. Will support more sampling strategies later. + RandomSampleConfig random_sample_config = 1; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto new file mode 100644 index 00000000..273718e0 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto @@ -0,0 +1,660 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/explanation.proto"; +import "google/cloud/aiplatform/v1beta1/io.proto"; +import "google/cloud/aiplatform/v1beta1/model.proto"; +import "google/cloud/aiplatform/v1beta1/model_evaluation.proto"; +import "google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto"; +import "google/cloud/aiplatform/v1beta1/operation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "ModelServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A service for managing Vertex AI's machine learning Models. +service ModelService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Uploads a Model artifact into Vertex AI. + rpc UploadModel(UploadModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/models:upload" + body: "*" + }; + option (google.api.method_signature) = "parent,model"; + option (google.longrunning.operation_info) = { + response_type: "UploadModelResponse" + metadata_type: "UploadModelOperationMetadata" + }; + } + + // Gets a Model. + rpc GetModel(GetModelRequest) returns (Model) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/models/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Models in a Location. + rpc ListModels(ListModelsRequest) returns (ListModelsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/models" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists versions of the specified model. + rpc ListModelVersions(ListModelVersionsRequest) returns (ListModelVersionsResponse) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/models/*}:listVersions" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a Model. + rpc UpdateModel(UpdateModelRequest) returns (Model) { + option (google.api.http) = { + patch: "/v1beta1/{model.name=projects/*/locations/*/models/*}" + body: "model" + }; + option (google.api.method_signature) = "model,update_mask"; + } + + // Incremental update the dataset used for a examples model. + rpc UpdateExplanationDataset(UpdateExplanationDatasetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{model=projects/*/locations/*/models/*}:updateExplanationDataset" + body: "*" + }; + option (google.api.method_signature) = "model"; + option (google.longrunning.operation_info) = { + response_type: "UpdateExplanationDatasetResponse" + metadata_type: "UpdateExplanationDatasetOperationMetadata" + }; + } + + // Deletes a Model. + // + // A model cannot be deleted if any [Endpoint][google.cloud.aiplatform.v1beta1.Endpoint] resource has a + // [DeployedModel][google.cloud.aiplatform.v1beta1.DeployedModel] based on the model in its + // [deployed_models][google.cloud.aiplatform.v1beta1.Endpoint.deployed_models] field. + rpc DeleteModel(DeleteModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/models/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Deletes a Model version. + // + // Model version can only be deleted if there are no [DeployedModels][] + // created from it. Deleting the only version in the Model is not allowed. Use + // [DeleteModel][google.cloud.aiplatform.v1beta1.ModelService.DeleteModel] for deleting the Model instead. + rpc DeleteModelVersion(DeleteModelVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/models/*}:deleteVersion" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Merges a set of aliases for a Model version. + rpc MergeVersionAliases(MergeVersionAliasesRequest) returns (Model) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/models/*}:mergeVersionAliases" + body: "*" + }; + option (google.api.method_signature) = "name,version_aliases"; + } + + // Exports a trained, exportable Model to a location specified by the + // user. A Model is considered to be exportable if it has at least one + // [supported export format][google.cloud.aiplatform.v1beta1.Model.supported_export_formats]. + rpc ExportModel(ExportModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/models/*}:export" + body: "*" + }; + option (google.api.method_signature) = "name,output_config"; + option (google.longrunning.operation_info) = { + response_type: "ExportModelResponse" + metadata_type: "ExportModelOperationMetadata" + }; + } + + // Imports an externally generated ModelEvaluation. + rpc ImportModelEvaluation(ImportModelEvaluationRequest) returns (ModelEvaluation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/models/*}/evaluations:import" + body: "*" + }; + option (google.api.method_signature) = "parent,model_evaluation"; + } + + // Gets a ModelEvaluation. + rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists ModelEvaluations in a Model. + rpc ListModelEvaluations(ListModelEvaluationsRequest) returns (ListModelEvaluationsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/models/*}/evaluations" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a ModelEvaluationSlice. + rpc GetModelEvaluationSlice(GetModelEvaluationSliceRequest) returns (ModelEvaluationSlice) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/slices/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists ModelEvaluationSlices in a ModelEvaluation. + rpc ListModelEvaluationSlices(ListModelEvaluationSlicesRequest) returns (ListModelEvaluationSlicesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/models/*/evaluations/*}/slices" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for [ModelService.UploadModel][google.cloud.aiplatform.v1beta1.ModelService.UploadModel]. +message UploadModelRequest { + // Required. The resource name of the Location into which to upload the Model. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. The resource name of the model into which to upload the version. Only + // specify this field when uploading a new version. + string parent_model = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The ID to use for the uploaded Model, which will become the final + // component of the model resource name. + // + // This value may be up to 63 characters, and valid characters are + // `[a-z0-9_-]`. The first character cannot be a number or hyphen. + string model_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The Model to create. + Model model = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Details of [ModelService.UploadModel][google.cloud.aiplatform.v1beta1.ModelService.UploadModel] operation. +message UploadModelOperationMetadata { + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; +} + +// Response message of [ModelService.UploadModel][google.cloud.aiplatform.v1beta1.ModelService.UploadModel] operation. +message UploadModelResponse { + // The name of the uploaded Model resource. + // Format: `projects/{project}/locations/{location}/models/{model}` + string model = 1 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + }]; + + // Output only. The version ID of the model that is uploaded. + string model_version_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for [ModelService.GetModel][google.cloud.aiplatform.v1beta1.ModelService.GetModel]. +message GetModelRequest { + // Required. The name of the Model resource. + // Format: `projects/{project}/locations/{location}/models/{model}` + // + // In order to retrieve a specific version of the model, also provide + // the version ID or version alias. + // Example: projects/{project}/locations/{location}/models/{model}@2 + // or + // projects/{project}/locations/{location}/models/{model}@golden + // If no version ID or alias is specified, the "default" version will be + // returned. The "default" version alias is created for the first version of + // the model, and can be moved to other versions later on. There will be + // exactly one default version. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; +} + +// Request message for [ModelService.ListModels][google.cloud.aiplatform.v1beta1.ModelService.ListModels]. +message ListModelsRequest { + // Required. The resource name of the Location to list the Models from. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // An expression for filtering the results of the request. For field names + // both snake_case and camelCase are supported. + // + // * `model` supports = and !=. `model` represents the Model ID, + // i.e. the last segment of the Model's [resource name][google.cloud.aiplatform.v1beta1.Model.name]. + // * `display_name` supports = and != + // * `labels` supports general map functions that is: + // * `labels.key=value` - key:value equality + // * `labels.key:* or labels:key - key existence + // * A key including a space must be quoted. `labels."a key"`. + // + // Some examples: + // * `model=1234` + // * `displayName="myDisplayName"` + // * `labels.myKey="myValue"` + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListModelsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListModelsResponse.next_page_token] of the previous + // [ModelService.ListModels][google.cloud.aiplatform.v1beta1.ModelService.ListModels] call. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for [ModelService.ListModels][google.cloud.aiplatform.v1beta1.ModelService.ListModels] +message ListModelsResponse { + // List of Models in the requested page. + repeated Model models = 1; + + // A token to retrieve next page of results. + // Pass to [ListModelsRequest.page_token][google.cloud.aiplatform.v1beta1.ListModelsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [ModelService.ListModelVersions][google.cloud.aiplatform.v1beta1.ModelService.ListModelVersions]. +message ListModelVersionsRequest { + // Required. The name of the model to list versions for. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // The standard list page size. + int32 page_size = 2; + + // The standard list page token. + // Typically obtained via + // [ListModelVersionsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token] of the previous + // [ModelService.ListModelversions][] call. + string page_token = 3; + + // An expression for filtering the results of the request. For field names + // both snake_case and camelCase are supported. + // + // * `labels` supports general map functions that is: + // * `labels.key=value` - key:value equality + // * `labels.key:* or labels:key - key existence + // * A key including a space must be quoted. `labels."a key"`. + // + // Some examples: + // * `labels.myKey="myValue"` + string filter = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for [ModelService.ListModelVersions][google.cloud.aiplatform.v1beta1.ModelService.ListModelVersions] +message ListModelVersionsResponse { + // List of Model versions in the requested page. + // In the returned Model name field, version ID instead of regvision tag will + // be included. + repeated Model models = 1; + + // A token to retrieve the next page of results. + // Pass to [ListModelVersionsRequest.page_token][google.cloud.aiplatform.v1beta1.ListModelVersionsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [ModelService.UpdateModel][google.cloud.aiplatform.v1beta1.ModelService.UpdateModel]. +message UpdateModelRequest { + // Required. The Model which replaces the resource on the server. + // When Model Versioning is enabled, the model.name will be used to determine + // whether to update the model or model version. + // 1. model.name with the @ value, e.g. models/123@1, refers to a version + // specific update. + // 2. model.name without the @ value, e.g. models/123, refers to a model + // update. + // 3. model.name with @-, e.g. models/123@-, refers to a model update. + // 4. Supported model fields: display_name, description; supported + // version-specific fields: version_description. Labels are supported in both + // scenarios. Both the model labels and the version labels are merged when a + // model is returned. When updating labels, if the request is for + // model-specific update, model label gets updated. Otherwise, version labels + // get updated. + // 5. A model name or model version name fields update mismatch will cause a + // precondition error. + // 6. One request cannot update both the model and the version fields. You + // must update them separately. + Model model = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. + // For the `FieldMask` definition, see [google.protobuf.FieldMask][google.protobuf.FieldMask]. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [ModelService.UpdateExplanationDataset][google.cloud.aiplatform.v1beta1.ModelService.UpdateExplanationDataset]. +message UpdateExplanationDatasetRequest { + // Required. The resource name of the Model to update. + // Format: `projects/{project}/locations/{location}/models/{model}` + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // The example config containing the location of the dataset. + Examples examples = 2; +} + +// Runtime operation information for +// [ModelService.UpdateExplanationDataset][google.cloud.aiplatform.v1beta1.ModelService.UpdateExplanationDataset]. +message UpdateExplanationDatasetOperationMetadata { + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [ModelService.DeleteModel][google.cloud.aiplatform.v1beta1.ModelService.DeleteModel]. +message DeleteModelRequest { + // Required. The name of the Model resource to be deleted. + // Format: `projects/{project}/locations/{location}/models/{model}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; +} + +// Request message for [ModelService.DeleteModelVersion][google.cloud.aiplatform.v1beta1.ModelService.DeleteModelVersion]. +message DeleteModelVersionRequest { + // Required. The name of the model version to be deleted, with a version ID explicitly + // included. + // + // Example: `projects/{project}/locations/{location}/models/{model}@1234` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; +} + +// Request message for [ModelService.MergeVersionAliases][google.cloud.aiplatform.v1beta1.ModelService.MergeVersionAliases]. +message MergeVersionAliasesRequest { + // Required. The name of the model version to merge aliases, with a version ID + // explicitly included. + // + // Example: `projects/{project}/locations/{location}/models/{model}@1234` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // 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. + // + // There is NO ordering in aliases, which means + // 1) The aliases returned from GetModel API might not have the exactly same + // order from this MergeVersionAliases API. 2) Adding and deleting the same + // alias in the request is not recommended, and the 2 operations will be + // cancelled out. + repeated string version_aliases = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [ModelService.ExportModel][google.cloud.aiplatform.v1beta1.ModelService.ExportModel]. +message ExportModelRequest { + // Output configuration for the Model export. + message OutputConfig { + // The ID of the format in which the Model must be exported. Each Model + // lists the [export formats it supports][google.cloud.aiplatform.v1beta1.Model.supported_export_formats]. + // If no value is provided here, then the first from the list of the Model's + // supported formats is used by default. + string export_format_id = 1; + + // The Cloud Storage location where the Model artifact is to be + // written to. Under the directory given as the destination a new one with + // name "`model-export--`", + // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, + // will be created. Inside, the Model and any of its supporting files + // will be written. + // This field should only be set when the `exportableContent` field of the + // [Model.supported_export_formats] object contains `ARTIFACT`. + GcsDestination artifact_destination = 3; + + // The Google Container Registry or Artifact Registry uri where the + // Model container image will be copied to. + // This field should only be set when the `exportableContent` field of the + // [Model.supported_export_formats] object contains `IMAGE`. + ContainerRegistryDestination image_destination = 4; + } + + // Required. The resource name of the Model to export. + // The resource name may contain version id or version alias to specify the + // version, if no version is specified, the default version will be exported. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // Required. The desired output location and configuration. + OutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Details of [ModelService.ExportModel][google.cloud.aiplatform.v1beta1.ModelService.ExportModel] operation. +message ExportModelOperationMetadata { + // Further describes the output of the ExportModel. Supplements + // [ExportModelRequest.OutputConfig][google.cloud.aiplatform.v1beta1.ExportModelRequest.OutputConfig]. + message OutputInfo { + // Output only. If the Model artifact is being exported to Google Cloud Storage this is + // the full path of the directory created, into which the Model files are + // being written to. + string artifact_output_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If the Model image is being exported to Google Container Registry or + // Artifact Registry this is the full path of the image created. + string image_output_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; + + // Output only. Information further describing the output of this Model export. + OutputInfo output_info = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Response message of [ModelService.UpdateExplanationDataset][google.cloud.aiplatform.v1beta1.ModelService.UpdateExplanationDataset] operation. +message UpdateExplanationDatasetResponse { + +} + +// Response message of [ModelService.ExportModel][google.cloud.aiplatform.v1beta1.ModelService.ExportModel] operation. +message ExportModelResponse { + +} + +// Request message for [ModelService.ImportModelEvaluation][google.cloud.aiplatform.v1beta1.ModelService.ImportModelEvaluation] +message ImportModelEvaluationRequest { + // Required. The name of the parent model resource. + // Format: `projects/{project}/locations/{location}/models/{model}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // Required. Model evaluation resource to be imported. + ModelEvaluation model_evaluation = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [ModelService.GetModelEvaluation][google.cloud.aiplatform.v1beta1.ModelService.GetModelEvaluation]. +message GetModelEvaluationRequest { + // Required. The name of the ModelEvaluation resource. + // Format: + // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelEvaluation" + } + ]; +} + +// Request message for [ModelService.ListModelEvaluations][google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluations]. +message ListModelEvaluationsRequest { + // Required. The resource name of the Model to list the ModelEvaluations from. + // Format: `projects/{project}/locations/{location}/models/{model}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // The standard list filter. + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListModelEvaluationsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListModelEvaluationsResponse.next_page_token] of the previous + // [ModelService.ListModelEvaluations][google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluations] call. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for [ModelService.ListModelEvaluations][google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluations]. +message ListModelEvaluationsResponse { + // List of ModelEvaluations in the requested page. + repeated ModelEvaluation model_evaluations = 1; + + // A token to retrieve next page of results. + // Pass to [ListModelEvaluationsRequest.page_token][google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [ModelService.GetModelEvaluationSlice][google.cloud.aiplatform.v1beta1.ModelService.GetModelEvaluationSlice]. +message GetModelEvaluationSliceRequest { + // Required. The name of the ModelEvaluationSlice resource. + // Format: + // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelEvaluationSlice" + } + ]; +} + +// Request message for [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluationSlices]. +message ListModelEvaluationSlicesRequest { + // Required. The resource name of the ModelEvaluation to list the ModelEvaluationSlices + // from. Format: + // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ModelEvaluation" + } + ]; + + // The standard list filter. + // + // * `slice.dimension` - for =. + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListModelEvaluationSlicesResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesResponse.next_page_token] of the previous + // [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluationSlices] call. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluationSlices]. +message ListModelEvaluationSlicesResponse { + // List of ModelEvaluations in the requested page. + repeated ModelEvaluationSlice model_evaluation_slices = 1; + + // A token to retrieve next page of results. + // Pass to [ListModelEvaluationSlicesRequest.page_token][google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest.page_token] to obtain that + // page. + string next_page_token = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/operation.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/operation.proto new file mode 100644 index 00000000..04e04b20 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/operation.proto @@ -0,0 +1,52 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "OperationProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Generic Metadata shared by all operations. +message GenericOperationMetadata { + // Output only. Partial failures encountered. + // E.g. single files that couldn't be read. + // This field should never exceed 20 entries. + // Status details field will contain standard GCP error details. + repeated google.rpc.Status partial_failures = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the operation was created. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the operation was updated for the last time. + // If the operation has finished (successfully or not), this is the finish + // time. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Details of operations that perform deletes of any entities. +message DeleteOperationMetadata { + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto new file mode 100644 index 00000000..3e5b5ea0 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto @@ -0,0 +1,340 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/artifact.proto"; +import "google/cloud/aiplatform/v1beta1/context.proto"; +import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1beta1/execution.proto"; +import "google/cloud/aiplatform/v1beta1/pipeline_state.proto"; +import "google/cloud/aiplatform/v1beta1/value.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "Pipeline"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Network" + pattern: "projects/{project}/global/networks/{network}" +}; + +// An instance of a machine learning PipelineJob. +message PipelineJob { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/PipelineJob" + pattern: "projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}" + }; + + // The runtime config of a PipelineJob. + message RuntimeConfig { + // Deprecated. Use [RuntimeConfig.parameter_values][google.cloud.aiplatform.v1beta1.PipelineJob.RuntimeConfig.parameter_values] instead. The runtime + // parameters of the PipelineJob. The parameters will be passed into + // [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1beta1.PipelineJob.pipeline_spec] to replace the placeholders at runtime. + // This field is used by pipelines built using + // `PipelineJob.pipeline_spec.schema_version` 2.0.0 or lower, such as + // pipelines built using Kubeflow Pipelines SDK 1.8 or lower. + map parameters = 1 [deprecated = true]; + + // Required. A path in a Cloud Storage bucket, which will be treated as the root + // output directory of the pipeline. It is used by the system to + // generate the paths of output artifacts. The artifact paths are generated + // with a sub-path pattern `{job_id}/{task_id}/{output_key}` under the + // specified output directory. The service account specified in this + // pipeline must have the `storage.objects.get` and `storage.objects.create` + // permissions for this bucket. + string gcs_output_directory = 2 [(google.api.field_behavior) = REQUIRED]; + + // The runtime parameters of the PipelineJob. The parameters will be + // passed into [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1beta1.PipelineJob.pipeline_spec] to replace the placeholders + // at runtime. This field is used by pipelines built using + // `PipelineJob.pipeline_spec.schema_version` 2.1.0, such as pipelines built + // using Kubeflow Pipelines SDK 1.9 or higher and the v2 DSL. + map parameter_values = 3; + } + + // Output only. The resource name of the PipelineJob. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The display name of the Pipeline. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + string display_name = 2; + + // Output only. Pipeline creation time. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Pipeline start time. + google.protobuf.Timestamp start_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Pipeline end time. + google.protobuf.Timestamp end_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this PipelineJob was most recently updated. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The spec of the pipeline. + google.protobuf.Struct pipeline_spec = 7; + + // Output only. The detailed state of the job. + PipelineState state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The details of pipeline run. Not available in the list view. + PipelineJobDetail job_detail = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error that occurred during pipeline execution. + // Only populated when the pipeline's state is FAILED or CANCELLED. + google.rpc.Status error = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize PipelineJob. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 11; + + // Runtime config of the pipeline. + RuntimeConfig runtime_config = 12; + + // Customer-managed encryption key spec for a pipelineJob. If set, this + // PipelineJob and all of its sub-resources will be secured by this key. + EncryptionSpec encryption_spec = 16; + + // The service account that the pipeline workload runs as. + // If not specified, the Compute Engine default service account in the project + // will be used. + // See + // https://cloud.google.com/compute/docs/access/service-accounts#default_service_account + // + // Users starting the pipeline must have the `iam.serviceAccounts.actAs` + // permission on this service account. + string service_account = 17; + + // The full name of the Compute Engine + // [network](/compute/docs/networks-and-firewalls#networks) to which the + // Pipeline Job's workload should be peered. For example, + // `projects/12345/global/networks/myVPC`. + // [Format](/compute/docs/reference/rest/v1/networks/insert) + // is of the form `projects/{project}/global/networks/{network}`. + // Where {project} is a project number, as in `12345`, and {network} is a + // network name. + // + // Private services access must already be configured for the network. + // Pipeline job will apply the network configuration to the GCP resources + // being launched, if applied, such as Vertex AI + // Training or Dataflow job. If left unspecified, the workload is not peered + // with any network. + string network = 18 [(google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + }]; + + // A template uri from where the [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1beta1.PipelineJob.pipeline_spec], if empty, will + // be downloaded. + string template_uri = 19; + + // Output only. Pipeline template metadata. Will fill up fields if + // [PipelineJob.template_uri][google.cloud.aiplatform.v1beta1.PipelineJob.template_uri] is from supported template registry. + PipelineTemplateMetadata template_metadata = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Pipeline template metadata if [PipelineJob.template_uri][google.cloud.aiplatform.v1beta1.PipelineJob.template_uri] is from supported +// template registry. Currently, the only supported registry is Artifact +// Registry. +message PipelineTemplateMetadata { + // The version_name in artifact registry. + // + // Will always be presented in output if the [PipelineJob.template_uri][google.cloud.aiplatform.v1beta1.PipelineJob.template_uri] is + // from supported template registry. + // + // Format is "sha256:abcdef123456...". + string version = 3; +} + +// The runtime detail of PipelineJob. +message PipelineJobDetail { + // Output only. The context of the pipeline. + Context pipeline_context = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The context of the current pipeline run. + Context pipeline_run_context = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The runtime details of the tasks under the pipeline. + repeated PipelineTaskDetail task_details = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The runtime detail of a task execution. +message PipelineTaskDetail { + // A single record of the task status. + message PipelineTaskStatus { + // Output only. Update time of this status. + google.protobuf.Timestamp update_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of the task. + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error that occurred during the state. May be set when the state is + // any of the non-final state (PENDING/RUNNING/CANCELLING) or FAILED state. + // If the state is FAILED, the error here is final and not going to be + // retried. + // If the state is a non-final state, the error indicates a system-error + // being retried. + google.rpc.Status error = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // A list of artifact metadata. + message ArtifactList { + // Output only. A list of artifact metadata. + repeated Artifact artifacts = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Specifies state of TaskExecution + enum State { + // Unspecified. + STATE_UNSPECIFIED = 0; + + // Specifies pending state for the task. + PENDING = 1; + + // Specifies task is being executed. + RUNNING = 2; + + // Specifies task completed successfully. + SUCCEEDED = 3; + + // Specifies Task cancel is in pending state. + CANCEL_PENDING = 4; + + // Specifies task is being cancelled. + CANCELLING = 5; + + // Specifies task was cancelled. + CANCELLED = 6; + + // Specifies task failed. + FAILED = 7; + + // Specifies task was skipped due to cache hit. + SKIPPED = 8; + + // Specifies that the task was not triggered because the task's trigger + // policy is not satisfied. The trigger policy is specified in the + // `condition` field of [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1beta1.PipelineJob.pipeline_spec]. + NOT_TRIGGERED = 9; + } + + // Output only. The system generated ID of the task. + int64 task_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The id of the parent task if the task is within a component scope. + // Empty if the task is at the root level. + int64 parent_task_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user specified name of the task that is defined in + // [PipelineJob.spec][]. + string task_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Task create time. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Task start time. + google.protobuf.Timestamp start_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Task end time. + google.protobuf.Timestamp end_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The detailed execution info. + PipelineTaskExecutorDetail executor_detail = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the task. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The execution metadata of the task. + Execution execution = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error that occurred during task execution. + // Only populated when the task's state is FAILED or CANCELLED. + google.rpc.Status error = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A list of task status. This field keeps a record of task status evolving + // over time. + repeated PipelineTaskStatus pipeline_task_status = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The runtime input artifacts of the task. + map inputs = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The runtime output artifacts of the task. + map outputs = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The runtime detail of a pipeline executor. +message PipelineTaskExecutorDetail { + // The detail of a container execution. It contains the job names of the + // lifecycle of a container execution. + message ContainerDetail { + // Output only. The name of the [CustomJob][google.cloud.aiplatform.v1beta1.CustomJob] for the main container execution. + string main_job = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/CustomJob" + } + ]; + + // Output only. The name of the [CustomJob][google.cloud.aiplatform.v1beta1.CustomJob] for the pre-caching-check container + // execution. This job will be available if the + // [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1beta1.PipelineJob.pipeline_spec] specifies the `pre_caching_check` hook in + // the lifecycle events. + string pre_caching_check_job = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/CustomJob" + } + ]; + } + + // The detailed info for a custom job executor. + message CustomJobDetail { + option deprecated = true; + + // Output only. The name of the [CustomJob][google.cloud.aiplatform.v1beta1.CustomJob]. + string job = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/CustomJob" + } + ]; + } + + oneof details { + // Output only. The detailed info for a container executor. + ContainerDetail container_detail = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The detailed info for a custom job executor. + CustomJobDetail custom_job_detail = 2 [ + deprecated = true, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + } +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto new file mode 100644 index 00000000..56123e65 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto @@ -0,0 +1,403 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/pipeline_job.proto"; +import "google/cloud/aiplatform/v1beta1/training_pipeline.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "PipelineServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A service for creating and managing Vertex AI's pipelines. This includes both +// `TrainingPipeline` resources (used for AutoML and custom training) and +// `PipelineJob` resources (used for Vertex AI Pipelines). +service PipelineService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a TrainingPipeline. A created TrainingPipeline right away will be + // attempted to be run. + rpc CreateTrainingPipeline(CreateTrainingPipelineRequest) returns (TrainingPipeline) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/trainingPipelines" + body: "training_pipeline" + }; + option (google.api.method_signature) = "parent,training_pipeline"; + } + + // Gets a TrainingPipeline. + rpc GetTrainingPipeline(GetTrainingPipelineRequest) returns (TrainingPipeline) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists TrainingPipelines in a Location. + rpc ListTrainingPipelines(ListTrainingPipelinesRequest) returns (ListTrainingPipelinesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/trainingPipelines" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a TrainingPipeline. + rpc DeleteTrainingPipeline(DeleteTrainingPipelineRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Cancels a TrainingPipeline. + // Starts asynchronous cancellation on the TrainingPipeline. The server + // makes a best effort to cancel the pipeline, but success is not + // guaranteed. Clients can use [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1beta1.PipelineService.GetTrainingPipeline] or + // other methods to check whether the cancellation succeeded or whether the + // pipeline completed despite cancellation. On successful cancellation, + // the TrainingPipeline is not deleted; instead it becomes a pipeline with + // a [TrainingPipeline.error][google.cloud.aiplatform.v1beta1.TrainingPipeline.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`, and [TrainingPipeline.state][google.cloud.aiplatform.v1beta1.TrainingPipeline.state] is set to + // `CANCELLED`. + rpc CancelTrainingPipeline(CancelTrainingPipelineRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a PipelineJob. A PipelineJob will run immediately when created. + rpc CreatePipelineJob(CreatePipelineJobRequest) returns (PipelineJob) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/pipelineJobs" + body: "pipeline_job" + }; + option (google.api.method_signature) = "parent,pipeline_job,pipeline_job_id"; + } + + // Gets a PipelineJob. + rpc GetPipelineJob(GetPipelineJobRequest) returns (PipelineJob) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists PipelineJobs in a Location. + rpc ListPipelineJobs(ListPipelineJobsRequest) returns (ListPipelineJobsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/pipelineJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a PipelineJob. + rpc DeletePipelineJob(DeletePipelineJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Cancels a PipelineJob. + // Starts asynchronous cancellation on the PipelineJob. The server + // makes a best effort to cancel the pipeline, but success is not + // guaranteed. Clients can use [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1beta1.PipelineService.GetPipelineJob] or + // other methods to check whether the cancellation succeeded or whether the + // pipeline completed despite cancellation. On successful cancellation, + // the PipelineJob is not deleted; instead it becomes a pipeline with + // a [PipelineJob.error][google.cloud.aiplatform.v1beta1.PipelineJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`, and [PipelineJob.state][google.cloud.aiplatform.v1beta1.PipelineJob.state] is set to + // `CANCELLED`. + rpc CancelPipelineJob(CancelPipelineJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for [PipelineService.CreateTrainingPipeline][google.cloud.aiplatform.v1beta1.PipelineService.CreateTrainingPipeline]. +message CreateTrainingPipelineRequest { + // Required. The resource name of the Location to create the TrainingPipeline in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The TrainingPipeline to create. + TrainingPipeline training_pipeline = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1beta1.PipelineService.GetTrainingPipeline]. +message GetTrainingPipelineRequest { + // Required. The name of the TrainingPipeline resource. + // Format: + // `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TrainingPipeline" + } + ]; +} + +// Request message for [PipelineService.ListTrainingPipelines][google.cloud.aiplatform.v1beta1.PipelineService.ListTrainingPipelines]. +message ListTrainingPipelinesRequest { + // Required. The resource name of the Location to list the TrainingPipelines from. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The standard list filter. + // Supported fields: + // + // * `display_name` supports = and !=. + // + // * `state` supports = and !=. + // + // Some examples of using the filter are: + // + // * `state="PIPELINE_STATE_SUCCEEDED" AND display_name="my_pipeline"` + // + // * `state="PIPELINE_STATE_RUNNING" OR display_name="my_pipeline"` + // + // * `NOT display_name="my_pipeline"` + // + // * `state="PIPELINE_STATE_FAILED"` + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListTrainingPipelinesResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListTrainingPipelinesResponse.next_page_token] of the previous + // [PipelineService.ListTrainingPipelines][google.cloud.aiplatform.v1beta1.PipelineService.ListTrainingPipelines] call. + string page_token = 4; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 5; +} + +// Response message for [PipelineService.ListTrainingPipelines][google.cloud.aiplatform.v1beta1.PipelineService.ListTrainingPipelines] +message ListTrainingPipelinesResponse { + // List of TrainingPipelines in the requested page. + repeated TrainingPipeline training_pipelines = 1; + + // A token to retrieve the next page of results. + // Pass to [ListTrainingPipelinesRequest.page_token][google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [PipelineService.DeleteTrainingPipeline][google.cloud.aiplatform.v1beta1.PipelineService.DeleteTrainingPipeline]. +message DeleteTrainingPipelineRequest { + // Required. The name of the TrainingPipeline resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TrainingPipeline" + } + ]; +} + +// Request message for [PipelineService.CancelTrainingPipeline][google.cloud.aiplatform.v1beta1.PipelineService.CancelTrainingPipeline]. +message CancelTrainingPipelineRequest { + // Required. The name of the TrainingPipeline to cancel. + // Format: + // `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TrainingPipeline" + } + ]; +} + +// Request message for [PipelineService.CreatePipelineJob][google.cloud.aiplatform.v1beta1.PipelineService.CreatePipelineJob]. +message CreatePipelineJobRequest { + // Required. The resource name of the Location to create the PipelineJob in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The PipelineJob to create. + PipelineJob pipeline_job = 2 [(google.api.field_behavior) = REQUIRED]; + + // The ID to use for the PipelineJob, which will become the final component of + // the PipelineJob name. If not provided, an ID will be automatically + // generated. + // + // This value should be less than 128 characters, and valid characters + // are /[a-z][0-9]-/. + string pipeline_job_id = 3; +} + +// Request message for [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1beta1.PipelineService.GetPipelineJob]. +message GetPipelineJobRequest { + // Required. The name of the PipelineJob resource. + // Format: + // `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/PipelineJob" + } + ]; +} + +// Request message for [PipelineService.ListPipelineJobs][google.cloud.aiplatform.v1beta1.PipelineService.ListPipelineJobs]. +message ListPipelineJobsRequest { + // Required. The resource name of the Location to list the PipelineJobs from. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Lists the PipelineJobs that match the filter expression. The following + // fields are supported: + // + // * `pipeline_name`: Supports `=` and `!=` comparisons. + // * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. + // * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. + // for example, can check if pipeline's display_name contains *step* by doing + // display_name:\"*step*\" + // * `state`: Supports `=` and `!=` comparisons. + // * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + // Values must be in RFC 3339 format. + // * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + // Values must be in RFC 3339 format. + // * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + // Values must be in RFC 3339 format. + // * `labels`: Supports key-value equality and key presence. + // * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. + // * `template_metadata.version_name`: Supports `=`, `!=` comparisons, and `:` + // wildcard. + // + // Filter expressions can be combined together using logical operators + // (`AND` & `OR`). + // For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. + // + // The syntax to define filter expression is based on + // https://google.aip.dev/160. + // + // Examples: + // + // * `create_time>"2021-05-18T00:00:00Z" OR + // update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated + // after 2020-05-18 00:00:00 UTC. + // * `labels.env = "prod"` + // PipelineJobs with label "env" set to "prod". + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + // Typically obtained via + // [ListPipelineJobsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListPipelineJobsResponse.next_page_token] of the previous + // [PipelineService.ListPipelineJobs][google.cloud.aiplatform.v1beta1.PipelineService.ListPipelineJobs] call. + string page_token = 4; + + // A comma-separated list of fields to order by. The default sort order is in + // ascending order. Use "desc" after a field name for descending. You can have + // multiple order_by fields provided e.g. "create_time desc, end_time", + // "end_time, start_time, update_time" For example, using "create_time desc, + // end_time" will order results by create time in descending order, and if + // there are multiple jobs having the same create time, order them by the end + // time in ascending order. if order_by is not specified, it will order by + // default order is create time in descending order. Supported fields: + // * `create_time` + // * `update_time` + // * `end_time` + // * `start_time` + string order_by = 6; +} + +// Response message for [PipelineService.ListPipelineJobs][google.cloud.aiplatform.v1beta1.PipelineService.ListPipelineJobs] +message ListPipelineJobsResponse { + // List of PipelineJobs in the requested page. + repeated PipelineJob pipeline_jobs = 1; + + // A token to retrieve the next page of results. + // Pass to [ListPipelineJobsRequest.page_token][google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [PipelineService.DeletePipelineJob][google.cloud.aiplatform.v1beta1.PipelineService.DeletePipelineJob]. +message DeletePipelineJobRequest { + // Required. The name of the PipelineJob resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/PipelineJob" + } + ]; +} + +// Request message for [PipelineService.CancelPipelineJob][google.cloud.aiplatform.v1beta1.PipelineService.CancelPipelineJob]. +message CancelPipelineJobRequest { + // Required. The name of the PipelineJob to cancel. + // Format: + // `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/PipelineJob" + } + ]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto new file mode 100644 index 00000000..41f2fb6a --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto @@ -0,0 +1,58 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "PipelineStateProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Describes the state of a pipeline. +enum PipelineState { + // The pipeline state is unspecified. + PIPELINE_STATE_UNSPECIFIED = 0; + + // The pipeline has been created or resumed, and processing has not yet + // begun. + PIPELINE_STATE_QUEUED = 1; + + // The service is preparing to run the pipeline. + PIPELINE_STATE_PENDING = 2; + + // The pipeline is in progress. + PIPELINE_STATE_RUNNING = 3; + + // The pipeline completed successfully. + PIPELINE_STATE_SUCCEEDED = 4; + + // The pipeline failed. + PIPELINE_STATE_FAILED = 5; + + // The pipeline is being cancelled. From this state, the pipeline may only go + // to either PIPELINE_STATE_SUCCEEDED, PIPELINE_STATE_FAILED or + // PIPELINE_STATE_CANCELLED. + PIPELINE_STATE_CANCELLING = 6; + + // The pipeline has been cancelled. + PIPELINE_STATE_CANCELLED = 7; + + // The pipeline has been stopped, and can be resumed. + PIPELINE_STATE_PAUSED = 8; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto new file mode 100644 index 00000000..e2452420 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto @@ -0,0 +1,231 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/httpbody.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/explanation.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "PredictionServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A service for online predictions and explanations. +service PredictionService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Perform an online prediction. + rpc Predict(PredictRequest) returns (PredictResponse) { + option (google.api.http) = { + post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:predict" + body: "*" + }; + option (google.api.method_signature) = "endpoint,instances,parameters"; + } + + // Perform an online prediction with an arbitrary HTTP payload. + // + // The response includes the following HTTP headers: + // + // * `X-Vertex-AI-Endpoint-Id`: ID of the [Endpoint][google.cloud.aiplatform.v1beta1.Endpoint] that served this + // prediction. + // + // * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's [DeployedModel][google.cloud.aiplatform.v1beta1.DeployedModel] + // that served this prediction. + rpc RawPredict(RawPredictRequest) returns (google.api.HttpBody) { + option (google.api.http) = { + post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:rawPredict" + body: "*" + }; + option (google.api.method_signature) = "endpoint,http_body"; + } + + // Perform an online explanation. + // + // If [deployed_model_id][google.cloud.aiplatform.v1beta1.ExplainRequest.deployed_model_id] is specified, + // the corresponding DeployModel must have + // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] + // populated. If [deployed_model_id][google.cloud.aiplatform.v1beta1.ExplainRequest.deployed_model_id] + // is not specified, all DeployedModels must have + // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] + // populated. Only deployed AutoML tabular Models have + // explanation_spec. + rpc Explain(ExplainRequest) returns (ExplainResponse) { + option (google.api.http) = { + post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:explain" + body: "*" + }; + option (google.api.method_signature) = "endpoint,instances,parameters,deployed_model_id"; + } +} + +// Request message for [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict]. +message PredictRequest { + // Required. The name of the Endpoint requested to serve the prediction. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Required. The instances that are the input to the prediction call. + // A DeployedModel may have an upper limit on the number of instances it + // supports per request, and when it is exceeded the prediction call errors + // in case of AutoML Models, or, in case of customer created Models, the + // behaviour is as documented by that Model. + // The schema of any single instance may be specified via Endpoint's + // DeployedModels' [Model's][google.cloud.aiplatform.v1beta1.DeployedModel.model] + // [PredictSchemata's][google.cloud.aiplatform.v1beta1.Model.predict_schemata] + // [instance_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri]. + repeated google.protobuf.Value instances = 2 [(google.api.field_behavior) = REQUIRED]; + + // The parameters that govern the prediction. The schema of the parameters may + // be specified via Endpoint's DeployedModels' [Model's ][google.cloud.aiplatform.v1beta1.DeployedModel.model] + // [PredictSchemata's][google.cloud.aiplatform.v1beta1.Model.predict_schemata] + // [parameters_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.parameters_schema_uri]. + google.protobuf.Value parameters = 3; +} + +// Response message for [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict]. +message PredictResponse { + // The predictions that are the output of the predictions call. + // The schema of any single prediction may be specified via Endpoint's + // DeployedModels' [Model's ][google.cloud.aiplatform.v1beta1.DeployedModel.model] + // [PredictSchemata's][google.cloud.aiplatform.v1beta1.Model.predict_schemata] + // [prediction_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.prediction_schema_uri]. + repeated google.protobuf.Value predictions = 1; + + // ID of the Endpoint's DeployedModel that served this prediction. + string deployed_model_id = 2; + + // Output only. The resource name of the Model which is deployed as the DeployedModel that + // this prediction hits. + string model = 3 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // Output only. The version ID of the Model which is deployed as the DeployedModel that + // this prediction hits. + string model_version_id = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The [display name][google.cloud.aiplatform.v1beta1.Model.display_name] of the Model which is deployed as + // the DeployedModel that this prediction hits. + string model_display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for [PredictionService.RawPredict][google.cloud.aiplatform.v1beta1.PredictionService.RawPredict]. +message RawPredictRequest { + // Required. The name of the Endpoint requested to serve the prediction. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // The prediction input. Supports HTTP headers and arbitrary data payload. + // + // A [DeployedModel][google.cloud.aiplatform.v1beta1.DeployedModel] may have an upper limit on the number of instances it + // supports per request. When this limit it is exceeded for an AutoML model, + // the [RawPredict][google.cloud.aiplatform.v1beta1.PredictionService.RawPredict] method returns an error. + // When this limit is exceeded for a custom-trained model, the behavior varies + // depending on the model. + // + // You can specify the schema for each instance in the + // [predict_schemata.instance_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri] + // field when you create a [Model][google.cloud.aiplatform.v1beta1.Model]. This schema applies when you deploy the + // `Model` as a `DeployedModel` to an [Endpoint][google.cloud.aiplatform.v1beta1.Endpoint] and use the `RawPredict` + // method. + google.api.HttpBody http_body = 2; +} + +// Request message for [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain]. +message ExplainRequest { + // Required. The name of the Endpoint requested to serve the explanation. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Required. The instances that are the input to the explanation call. + // A DeployedModel may have an upper limit on the number of instances it + // supports per request, and when it is exceeded the explanation call errors + // in case of AutoML Models, or, in case of customer created Models, the + // behaviour is as documented by that Model. + // The schema of any single instance may be specified via Endpoint's + // DeployedModels' [Model's][google.cloud.aiplatform.v1beta1.DeployedModel.model] + // [PredictSchemata's][google.cloud.aiplatform.v1beta1.Model.predict_schemata] + // [instance_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri]. + repeated google.protobuf.Value instances = 2 [(google.api.field_behavior) = REQUIRED]; + + // The parameters that govern the prediction. The schema of the parameters may + // be specified via Endpoint's DeployedModels' [Model's ][google.cloud.aiplatform.v1beta1.DeployedModel.model] + // [PredictSchemata's][google.cloud.aiplatform.v1beta1.Model.predict_schemata] + // [parameters_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.parameters_schema_uri]. + google.protobuf.Value parameters = 4; + + // If specified, overrides the + // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] of the DeployedModel. + // Can be used for explaining prediction results with different + // configurations, such as: + // - Explaining top-5 predictions results as opposed to top-1; + // - Increasing path count or step count of the attribution methods to reduce + // approximate errors; + // - Using different baselines for explaining the prediction results. + ExplanationSpecOverride explanation_spec_override = 5; + + // If specified, this ExplainRequest will be served by the chosen + // DeployedModel, overriding [Endpoint.traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split]. + string deployed_model_id = 3; +} + +// Response message for [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain]. +message ExplainResponse { + // The explanations of the Model's [PredictResponse.predictions][google.cloud.aiplatform.v1beta1.PredictResponse.predictions]. + // + // It has the same number of elements as [instances][google.cloud.aiplatform.v1beta1.ExplainRequest.instances] + // to be explained. + repeated Explanation explanations = 1; + + // ID of the Endpoint's DeployedModel that served this explanation. + string deployed_model_id = 2; + + // The predictions that are the output of the predictions call. + // Same as [PredictResponse.predictions][google.cloud.aiplatform.v1beta1.PredictResponse.predictions]. + repeated google.protobuf.Value predictions = 3; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto new file mode 100644 index 00000000..384e92c6 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto @@ -0,0 +1,231 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema; + +import "google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto"; +import "google/cloud/aiplatform/v1beta1/schema/geometry.proto"; +import "google/protobuf/duration.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema;schema"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationPayloadProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema"; + +// Annotation details specific to image classification. +message ImageClassificationAnnotation { + // The resource Id of the AnnotationSpec that this Annotation pertains to. + string annotation_spec_id = 1; + + // The display name of the AnnotationSpec that this Annotation pertains to. + string display_name = 2; +} + +// Annotation details specific to image object detection. +message ImageBoundingBoxAnnotation { + // The resource Id of the AnnotationSpec that this Annotation pertains to. + string annotation_spec_id = 1; + + // The display name of the AnnotationSpec that this Annotation pertains to. + string display_name = 2; + + // The leftmost coordinate of the bounding box. + double x_min = 3; + + // The rightmost coordinate of the bounding box. + double x_max = 4; + + // The topmost coordinate of the bounding box. + double y_min = 5; + + // The bottommost coordinate of the bounding box. + double y_max = 6; +} + +// Annotation details specific to image segmentation. +message ImageSegmentationAnnotation { + // The mask based segmentation annotation. + message MaskAnnotation { + // Google Cloud Storage URI that points to the mask image. The image must be + // in PNG format. It must have the same size as the DataItem's image. Each + // pixel in the image mask represents the AnnotationSpec which the pixel in + // the image DataItem belong to. Each color is mapped to one AnnotationSpec + // based on annotation_spec_colors. + string mask_gcs_uri = 1; + + // The mapping between color and AnnotationSpec for this Annotation. + repeated AnnotationSpecColor annotation_spec_colors = 2; + } + + // Represents a polygon in image. + message PolygonAnnotation { + // The vertexes are connected one by one and the last vertex is connected to + // the first one to represent a polygon. + repeated Vertex vertexes = 1; + + // The resource Id of the AnnotationSpec that this Annotation pertains to. + string annotation_spec_id = 2; + + // The display name of the AnnotationSpec that this Annotation pertains to. + string display_name = 3; + } + + // Represents a polyline in image. + message PolylineAnnotation { + // The vertexes are connected one by one and the last vertex in not + // connected to the first one. + repeated Vertex vertexes = 1; + + // The resource Id of the AnnotationSpec that this Annotation pertains to. + string annotation_spec_id = 2; + + // The display name of the AnnotationSpec that this Annotation pertains to. + string display_name = 3; + } + + oneof annotation { + // Mask based segmentation annotation. Only one mask annotation can exist + // for one image. + MaskAnnotation mask_annotation = 3; + + // Polygon annotation. + PolygonAnnotation polygon_annotation = 4; + + // Polyline annotation. + PolylineAnnotation polyline_annotation = 5; + } +} + +// Annotation details specific to text classification. +message TextClassificationAnnotation { + // The resource Id of the AnnotationSpec that this Annotation pertains to. + string annotation_spec_id = 1; + + // The display name of the AnnotationSpec that this Annotation pertains to. + string display_name = 2; +} + +// Annotation details specific to text extraction. +message TextExtractionAnnotation { + // The segment of the text content. + TextSegment text_segment = 1; + + // The resource Id of the AnnotationSpec that this Annotation pertains to. + string annotation_spec_id = 2; + + // The display name of the AnnotationSpec that this Annotation pertains to. + string display_name = 3; +} + +// The text segment inside of DataItem. +message TextSegment { + // Zero-based character index of the first character of the text + // segment (counting characters from the beginning of the text). + uint64 start_offset = 1; + + // Zero-based character index of the first character past the end of + // the text segment (counting character from the beginning of the text). + // The character at the end_offset is NOT included in the text segment. + uint64 end_offset = 2; + + // The text content in the segment for output only. + string content = 3; +} + +// Annotation details specific to text sentiment. +message TextSentimentAnnotation { + // The sentiment score for text. + int32 sentiment = 1; + + // The sentiment max score for text. + int32 sentiment_max = 2; + + // The resource Id of the AnnotationSpec that this Annotation pertains to. + string annotation_spec_id = 3; + + // The display name of the AnnotationSpec that this Annotation pertains to. + string display_name = 4; +} + +// Annotation details specific to video classification. +message VideoClassificationAnnotation { + // This Annotation applies to the time period represented by the TimeSegment. + // If it's not set, the Annotation applies to the whole video. + TimeSegment time_segment = 1; + + // The resource Id of the AnnotationSpec that this Annotation pertains to. + string annotation_spec_id = 2; + + // The display name of the AnnotationSpec that this Annotation pertains to. + string display_name = 3; +} + +// A time period inside of a DataItem that has a time dimension (e.g. video). +message TimeSegment { + // Start of the time segment (inclusive), represented as the duration since + // the start of the DataItem. + google.protobuf.Duration start_time_offset = 1; + + // End of the time segment (exclusive), represented as the duration since the + // start of the DataItem. + google.protobuf.Duration end_time_offset = 2; +} + +// Annotation details specific to video object tracking. +message VideoObjectTrackingAnnotation { + // A time (frame) of a video to which this annotation pertains. + // Represented as the duration since the video's start. + google.protobuf.Duration time_offset = 1; + + // The leftmost coordinate of the bounding box. + double x_min = 2; + + // The rightmost coordinate of the bounding box. + double x_max = 3; + + // The topmost coordinate of the bounding box. + double y_min = 4; + + // The bottommost coordinate of the bounding box. + double y_max = 5; + + // The instance of the object, expressed as a positive integer. Used to track + // the same object across different frames. + int64 instance_id = 6; + + // The resource Id of the AnnotationSpec that this Annotation pertains to. + string annotation_spec_id = 7; + + // The display name of the AnnotationSpec that this Annotation pertains to. + string display_name = 8; +} + +// Annotation details specific to video action recognition. +message VideoActionRecognitionAnnotation { + // This Annotation applies to the time period represented by the TimeSegment. + // If it's not set, the Annotation applies to the whole video. + TimeSegment time_segment = 1; + + // The resource Id of the AnnotationSpec that this Annotation pertains to. + string annotation_spec_id = 2; + + // The display name of the AnnotationSpec that this Annotation pertains to. + string display_name = 3; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto new file mode 100644 index 00000000..1f53d4de --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto @@ -0,0 +1,43 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema; + +import "google/type/color.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema;schema"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationSpecColorProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema"; + +// An entry of mapping between color and AnnotationSpec. The mapping is used in +// segmentation mask. +message AnnotationSpecColor { + // The color of the AnnotationSpec in a segmentation mask. + google.type.Color color = 1; + + // The display name of the AnnotationSpec represented by the color in the + // segmentation mask. + string display_name = 2; + + // The ID of the AnnotationSpec represented by the color in the segmentation + // mask. + string id = 3; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto new file mode 100644 index 00000000..164aacef --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto @@ -0,0 +1,69 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema; + +import "google/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema;schema"; +option java_multiple_files = true; +option java_outer_classname = "DataItemPayloadProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema"; + +// Payload of Image DataItem. +message ImageDataItem { + // Required. Google Cloud Storage URI points to the original image in user's bucket. + // The image is up to 30MB in size. + string gcs_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The mime type of the content of the image. Only the images in below listed + // mime types are supported. + // - image/jpeg + // - image/gif + // - image/png + // - image/webp + // - image/bmp + // - image/tiff + // - image/vnd.microsoft.icon + string mime_type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Payload of Video DataItem. +message VideoDataItem { + // Required. Google Cloud Storage URI points to the original video in user's bucket. + // The video is up to 50 GB in size and up to 3 hour in duration. + string gcs_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The mime type of the content of the video. Only the videos in below listed + // mime types are supported. + // Supported mime_type: + // - video/mp4 + // - video/avi + // - video/quicktime + string mime_type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Payload of Text DataItem. +message TextDataItem { + // Output only. Google Cloud Storage URI points to the original text in user's bucket. + // The text file is up to 10MB in size. + string gcs_uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto new file mode 100644 index 00000000..2a0ed121 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto @@ -0,0 +1,127 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema;schema"; +option java_multiple_files = true; +option java_outer_classname = "DatasetMetadataProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema"; + +// The metadata of Datasets that contain Image DataItems. +message ImageDatasetMetadata { + // Points to a YAML file stored on Google Cloud Storage describing payload of + // the Image DataItems that belong to this Dataset. + string data_item_schema_uri = 1; + + // Google Cloud Storage Bucket name that contains the blob data of this + // Dataset. + string gcs_bucket = 2; +} + +// The metadata of Datasets that contain Text DataItems. +message TextDatasetMetadata { + // Points to a YAML file stored on Google Cloud Storage describing payload of + // the Text DataItems that belong to this Dataset. + string data_item_schema_uri = 1; + + // Google Cloud Storage Bucket name that contains the blob data of this + // Dataset. + string gcs_bucket = 2; +} + +// The metadata of Datasets that contain Video DataItems. +message VideoDatasetMetadata { + // Points to a YAML file stored on Google Cloud Storage describing payload of + // the Video DataItems that belong to this Dataset. + string data_item_schema_uri = 1; + + // Google Cloud Storage Bucket name that contains the blob data of this + // Dataset. + string gcs_bucket = 2; +} + +// The metadata of Datasets that contain tables data. +message TablesDatasetMetadata { + // The tables Dataset's data source. The Dataset doesn't store the data + // directly, but only pointer(s) to its data. + message InputConfig { + oneof source { + GcsSource gcs_source = 1; + + BigQuerySource bigquery_source = 2; + } + } + + message GcsSource { + // Cloud Storage URI of one or more files. Only CSV files are supported. + // The first line of the CSV file is used as the header. + // If there are multiple files, the header is the first line of + // the lexicographically first file, the other files must either + // contain the exact same header or omit the header. + repeated string uri = 1; + } + + message BigQuerySource { + // The URI of a BigQuery table. + // e.g. bq://projectId.bqDatasetId.bqTableId + string uri = 1; + } + + InputConfig input_config = 1; +} + +// The metadata of Datasets that contain time series data. +message TimeSeriesDatasetMetadata { + // The time series Dataset's data source. The Dataset doesn't store the data + // directly, but only pointer(s) to its data. + message InputConfig { + oneof source { + GcsSource gcs_source = 1; + + BigQuerySource bigquery_source = 2; + } + } + + message GcsSource { + // Cloud Storage URI of one or more files. Only CSV files are supported. + // The first line of the CSV file is used as the header. + // If there are multiple files, the header is the first line of + // the lexicographically first file, the other files must either + // contain the exact same header or omit the header. + repeated string uri = 1; + } + + message BigQuerySource { + // The URI of a BigQuery table. + string uri = 1; + } + + InputConfig input_config = 1; + + // The column name of the time series identifier column that identifies the + // time series. + string time_series_identifier_column = 2; + + // The column name of the time column that identifies time order in the time + // series. + string time_column = 3; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto new file mode 100644 index 00000000..dc53d2d7 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto @@ -0,0 +1,38 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema;schema"; +option java_multiple_files = true; +option java_outer_classname = "GeometryProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema"; + +// A vertex represents a 2D point in the image. +// NOTE: the normalized vertex coordinates are relative to the original image +// and range from 0 to 1. +message Vertex { + // X coordinate. + double x = 1; + + // Y coordinate. + double y = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto new file mode 100644 index 00000000..572886a8 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto @@ -0,0 +1,44 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.instance; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Instance"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/instance;instance"; +option java_multiple_files = true; +option java_outer_classname = "ImageClassificationPredictionInstanceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.instance"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Instance"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Instance"; + +// Prediction input format for Image Classification. +message ImageClassificationPredictionInstance { + // The image bytes or Cloud Storage URI to make the prediction on. + string content = 1; + + // The MIME type of the content of the image. Only the images in below listed + // MIME types are supported. + // - image/jpeg + // - image/gif + // - image/png + // - image/webp + // - image/bmp + // - image/tiff + // - image/vnd.microsoft.icon + string mime_type = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto new file mode 100644 index 00000000..41eb7a6a --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto @@ -0,0 +1,44 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.instance; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Instance"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/instance;instance"; +option java_multiple_files = true; +option java_outer_classname = "ImageObjectDetectionPredictionInstanceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.instance"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Instance"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Instance"; + +// Prediction input format for Image Object Detection. +message ImageObjectDetectionPredictionInstance { + // The image bytes or Cloud Storage URI to make the prediction on. + string content = 1; + + // The MIME type of the content of the image. Only the images in below listed + // MIME types are supported. + // - image/jpeg + // - image/gif + // - image/png + // - image/webp + // - image/bmp + // - image/tiff + // - image/vnd.microsoft.icon + string mime_type = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto new file mode 100644 index 00000000..9da318e5 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto @@ -0,0 +1,39 @@ +// Copyright 2020 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.instance; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Instance"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/instance;instance"; +option java_multiple_files = true; +option java_outer_classname = "ImageSegmentationPredictionInstanceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.instance"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Instance"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Instance"; + +// Prediction input format for Image Segmentation. +message ImageSegmentationPredictionInstance { + // The image bytes to make the predictions on. + string content = 1; + + // The MIME type of the content of the image. Only the images in below listed + // MIME types are supported. + // - image/jpeg + // - image/png + string mime_type = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto new file mode 100644 index 00000000..68bf6c10 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto @@ -0,0 +1,38 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.instance; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Instance"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/instance;instance"; +option java_multiple_files = true; +option java_outer_classname = "TextClassificationPredictionInstanceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.instance"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Instance"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Instance"; + +// Prediction input format for Text Classification. +message TextClassificationPredictionInstance { + // The text snippet to make the predictions on. + string content = 1; + + // The MIME type of the text snippet. The supported MIME types are listed + // below. + // - text/plain + string mime_type = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto new file mode 100644 index 00000000..9b629213 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto @@ -0,0 +1,45 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.instance; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Instance"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/instance;instance"; +option java_multiple_files = true; +option java_outer_classname = "TextExtractionPredictionInstanceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.instance"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Instance"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Instance"; + +// Prediction input format for Text Extraction. +message TextExtractionPredictionInstance { + // The text snippet to make the predictions on. + string content = 1; + + // The MIME type of the text snippet. The supported MIME types are listed + // below. + // - text/plain + string mime_type = 2; + + // This field is only used for batch prediction. If a key is provided, the + // batch prediction result will by mapped to this key. If omitted, then the + // batch prediction result will contain the entire input instance. Vertex AI + // will not check if keys in the request are duplicates, so it is up to the + // caller to ensure the keys are unique. + string key = 3; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto new file mode 100644 index 00000000..e312e865 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto @@ -0,0 +1,38 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.instance; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Instance"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/instance;instance"; +option java_multiple_files = true; +option java_outer_classname = "TextSentimentPredictionInstanceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.instance"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Instance"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Instance"; + +// Prediction input format for Text Sentiment. +message TextSentimentPredictionInstance { + // The text snippet to make the predictions on. + string content = 1; + + // The MIME type of the text snippet. The supported MIME types are listed + // below. + // - text/plain + string mime_type = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto new file mode 100644 index 00000000..810a4112 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto @@ -0,0 +1,51 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.instance; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Instance"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/instance;instance"; +option java_multiple_files = true; +option java_outer_classname = "VideoActionRecognitionPredictionInstanceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.instance"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Instance"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Instance"; + +// Prediction input format for Video Action Recognition. +message VideoActionRecognitionPredictionInstance { + // The Google Cloud Storage location of the video on which to perform the + // prediction. + string content = 1; + + // The MIME type of the content of the video. Only the following are + // supported: video/mp4 video/avi video/quicktime + string mime_type = 2; + + // The beginning, inclusive, of the video's time segment on which to perform + // the prediction. Expressed as a number of seconds as measured from the + // start of the video, with "s" appended at the end. Fractions are allowed, + // up to a microsecond precision. + string time_segment_start = 3; + + // The end, exclusive, of the video's time segment on which to perform + // the prediction. Expressed as a number of seconds as measured from the + // start of the video, with "s" appended at the end. Fractions are allowed, + // up to a microsecond precision, and "inf" or "Infinity" is allowed, which + // means the end of the video. + string time_segment_end = 4; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto new file mode 100644 index 00000000..edc61a69 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto @@ -0,0 +1,51 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.instance; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Instance"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/instance;instance"; +option java_multiple_files = true; +option java_outer_classname = "VideoClassificationPredictionInstanceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.instance"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Instance"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Instance"; + +// Prediction input format for Video Classification. +message VideoClassificationPredictionInstance { + // The Google Cloud Storage location of the video on which to perform the + // prediction. + string content = 1; + + // The MIME type of the content of the video. Only the following are + // supported: video/mp4 video/avi video/quicktime + string mime_type = 2; + + // The beginning, inclusive, of the video's time segment on which to perform + // the prediction. Expressed as a number of seconds as measured from the + // start of the video, with "s" appended at the end. Fractions are allowed, + // up to a microsecond precision. + string time_segment_start = 3; + + // The end, exclusive, of the video's time segment on which to perform + // the prediction. Expressed as a number of seconds as measured from the + // start of the video, with "s" appended at the end. Fractions are allowed, + // up to a microsecond precision, and "inf" or "Infinity" is allowed, which + // means the end of the video. + string time_segment_end = 4; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto new file mode 100644 index 00000000..119e0c9b --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto @@ -0,0 +1,51 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.instance; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Instance"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/instance;instance"; +option java_multiple_files = true; +option java_outer_classname = "VideoObjectTrackingPredictionInstanceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.instance"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Instance"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Instance"; + +// Prediction input format for Video Object Tracking. +message VideoObjectTrackingPredictionInstance { + // The Google Cloud Storage location of the video on which to perform the + // prediction. + string content = 1; + + // The MIME type of the content of the video. Only the following are + // supported: video/mp4 video/avi video/quicktime + string mime_type = 2; + + // The beginning, inclusive, of the video's time segment on which to perform + // the prediction. Expressed as a number of seconds as measured from the + // start of the video, with "s" appended at the end. Fractions are allowed, + // up to a microsecond precision. + string time_segment_start = 3; + + // The end, exclusive, of the video's time segment on which to perform + // the prediction. Expressed as a number of seconds as measured from the + // start of the video, with "s" appended at the end. Fractions are allowed, + // up to a microsecond precision, and "inf" or "Infinity" is allowed, which + // means the end of the video. + string time_segment_end = 4; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto new file mode 100644 index 00000000..a637e4a7 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto @@ -0,0 +1,39 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.params; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Params"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/params;params"; +option java_multiple_files = true; +option java_outer_classname = "ImageClassificationPredictionParamsProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.params"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Params"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Params"; + +// Prediction model parameters for Image Classification. +message ImageClassificationPredictionParams { + // The Model only returns predictions with at least this confidence score. + // Default value is 0.0 + float confidence_threshold = 1; + + // The Model only returns up to that many top, by confidence score, + // predictions per instance. If this number is very high, the Model may return + // fewer predictions. Default value is 10. + int32 max_predictions = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto new file mode 100644 index 00000000..35856e6c --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto @@ -0,0 +1,39 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.params; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Params"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/params;params"; +option java_multiple_files = true; +option java_outer_classname = "ImageObjectDetectionPredictionParamsProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.params"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Params"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Params"; + +// Prediction model parameters for Image Object Detection. +message ImageObjectDetectionPredictionParams { + // The Model only returns predictions with at least this confidence score. + // Default value is 0.0 + float confidence_threshold = 1; + + // The Model only returns up to that many top, by confidence score, + // predictions per instance. Note that number of returned predictions is also + // limited by metadata's predictionsLimit. Default value is 10. + int32 max_predictions = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto new file mode 100644 index 00000000..ee18a880 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto @@ -0,0 +1,36 @@ +// Copyright 2020 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.params; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Params"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/params;params"; +option java_multiple_files = true; +option java_outer_classname = "ImageSegmentationPredictionParamsProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.params"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Params"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Params"; + +// Prediction model parameters for Image Segmentation. +message ImageSegmentationPredictionParams { + // When the model predicts category of pixels of the image, it will only + // provide predictions for pixels that it is at least this much confident + // about. All other pixels will be classified as background. Default value is + // 0.5. + float confidence_threshold = 1; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto new file mode 100644 index 00000000..8cd1d47c --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto @@ -0,0 +1,39 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.params; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Params"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/params;params"; +option java_multiple_files = true; +option java_outer_classname = "VideoActionRecognitionPredictionParamsProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.params"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Params"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Params"; + +// Prediction model parameters for Video Action Recognition. +message VideoActionRecognitionPredictionParams { + // The Model only returns predictions with at least this confidence score. + // Default value is 0.0 + float confidence_threshold = 1; + + // The model only returns up to that many top, by confidence score, + // predictions per frame of the video. If this number is very high, the + // Model may return fewer predictions per frame. Default value is 50. + int32 max_predictions = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto new file mode 100644 index 00000000..856869cd --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto @@ -0,0 +1,64 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.params; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Params"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/params;params"; +option java_multiple_files = true; +option java_outer_classname = "VideoClassificationPredictionParamsProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.params"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Params"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Params"; + +// Prediction model parameters for Video Classification. +message VideoClassificationPredictionParams { + // The Model only returns predictions with at least this confidence score. + // Default value is 0.0 + float confidence_threshold = 1; + + // The Model only returns up to that many top, by confidence score, + // predictions per instance. If this number is very high, the Model may return + // fewer predictions. Default value is 10,000. + int32 max_predictions = 2; + + // Set to true to request segment-level classification. Vertex AI returns + // labels and their confidence scores for the entire time segment of the + // video that user specified in the input instance. + // Default value is true + bool segment_classification = 3; + + // Set to true to request shot-level classification. Vertex AI determines + // the boundaries for each camera shot in the entire time segment of the + // video that user specified in the input instance. Vertex AI then + // returns labels and their confidence scores for each detected shot, along + // with the start and end time of the shot. + // WARNING: Model evaluation is not done for this classification type, + // the quality of it depends on the training data, but there are no metrics + // provided to describe that quality. + // Default value is false + bool shot_classification = 4; + + // Set to true to request classification for a video at one-second intervals. + // Vertex AI returns labels and their confidence scores for each second of + // the entire time segment of the video that user specified in the input + // WARNING: Model evaluation is not done for this classification type, the + // quality of it depends on the training data, but there are no metrics + // provided to describe that quality. Default value is false + bool one_sec_interval_classification = 5; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto new file mode 100644 index 00000000..8fc616cd --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto @@ -0,0 +1,43 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.params; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Params"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/params;params"; +option java_multiple_files = true; +option java_outer_classname = "VideoObjectTrackingPredictionParamsProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.params"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Params"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Params"; + +// Prediction model parameters for Video Object Tracking. +message VideoObjectTrackingPredictionParams { + // The Model only returns predictions with at least this confidence score. + // Default value is 0.0 + float confidence_threshold = 1; + + // The model only returns up to that many top, by confidence score, + // predictions per frame of the video. If this number is very high, the + // Model may return fewer predictions per frame. Default value is 50. + int32 max_predictions = 2; + + // Only bounding boxes with shortest edge at least that long as a relative + // value of video frame size are returned. Default value is 0.0. + float min_bounding_box_size = 3; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto new file mode 100644 index 00000000..0a77a247 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto @@ -0,0 +1,41 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.prediction; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "ClassificationPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; + +// Prediction output format for Image and Text Classification. +message ClassificationPredictionResult { + // The resource IDs of the AnnotationSpecs that had been identified. + repeated int64 ids = 1; + + // The display names of the AnnotationSpecs that had been identified, order + // matches the IDs. + repeated string display_names = 2; + + // The Model's confidences in correctness of the predicted IDs, higher value + // means higher confidence. Order matches the Ids. + repeated float confidences = 3; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto new file mode 100644 index 00000000..3df5d1e4 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto @@ -0,0 +1,51 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.prediction; + +import "google/protobuf/struct.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "ImageObjectDetectionPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; + +// Prediction output format for Image Object Detection. +message ImageObjectDetectionPredictionResult { + // The resource IDs of the AnnotationSpecs that had been identified, ordered + // by the confidence score descendingly. + repeated int64 ids = 1; + + // The display names of the AnnotationSpecs that had been identified, order + // matches the IDs. + repeated string display_names = 2; + + // The Model's confidences in correctness of the predicted IDs, higher value + // means higher confidence. Order matches the Ids. + repeated float confidences = 3; + + // Bounding boxes, i.e. the rectangles over the image, that pinpoint + // the found AnnotationSpecs. Given in order that matches the IDs. Each + // bounding box is an array of 4 numbers `xMin`, `xMax`, `yMin`, and + // `yMax`, which represent the extremal coordinates of the box. They are + // relative to the image size, and the point 0,0 is in the top left + // of the image. + repeated google.protobuf.ListValue bboxes = 4; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto new file mode 100644 index 00000000..db998c63 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto @@ -0,0 +1,45 @@ +// Copyright 2020 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.prediction; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "ImageSegmentationPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; + +// Prediction output format for Image Segmentation. +message ImageSegmentationPredictionResult { + // A PNG image where each pixel in the mask represents the category in which + // the pixel in the original image was predicted to belong to. The size of + // this image will be the same as the original image. The mapping between the + // AnntoationSpec and the color can be found in model's metadata. The model + // will choose the most likely category and if none of the categories reach + // the confidence threshold, the pixel will be marked as background. + string category_mask = 1; + + // A one channel image which is encoded as an 8bit lossless PNG. The size of + // the image will be the same as the original image. For a specific pixel, + // darker color means less confidence in correctness of the cateogry in the + // categoryMask for the corresponding pixel. Black means no confidence and + // white means complete confidence. + string confidence_mask = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto new file mode 100644 index 00000000..fde1fae6 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto @@ -0,0 +1,39 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.prediction; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "TabularClassificationPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; + +// Prediction output format for Tabular Classification. +message TabularClassificationPredictionResult { + // The name of the classes being classified, contains all possible values of + // the target column. + repeated string classes = 1; + + // The model's confidence in each class being correct, higher + // value means higher confidence. The N-th score corresponds to + // the N-th class in classes. + repeated float scores = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto new file mode 100644 index 00000000..7e8de866 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto @@ -0,0 +1,39 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.prediction; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "TabularRegressionPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; + +// Prediction output format for Tabular Regression. +message TabularRegressionPredictionResult { + // The regression value. + float value = 1; + + // The lower bound of the prediction interval. + float lower_bound = 2; + + // The upper bound of the prediction interval. + float upper_bound = 3; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto new file mode 100644 index 00000000..cce7b068 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto @@ -0,0 +1,52 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.prediction; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "TextExtractionPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; + +// Prediction output format for Text Extraction. +message TextExtractionPredictionResult { + // The resource IDs of the AnnotationSpecs that had been identified, + // ordered by the confidence score descendingly. + repeated int64 ids = 1; + + // The display names of the AnnotationSpecs that had been identified, + // order matches the IDs. + repeated string display_names = 2; + + // The start offsets, inclusive, of the text segment in which the + // AnnotationSpec has been identified. Expressed as a zero-based number + // of characters as measured from the start of the text snippet. + repeated int64 text_segment_start_offsets = 3; + + // The end offsets, inclusive, of the text segment in which the + // AnnotationSpec has been identified. Expressed as a zero-based number + // of characters as measured from the start of the text snippet. + repeated int64 text_segment_end_offsets = 4; + + // The Model's confidences in correctness of the predicted IDs, higher + // value means higher confidence. Order matches the Ids. + repeated float confidences = 5; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto new file mode 100644 index 00000000..faefeb19 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto @@ -0,0 +1,37 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.prediction; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "TextSentimentPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; + +// Prediction output format for Text Sentiment +message TextSentimentPredictionResult { + // The integer sentiment labels between 0 (inclusive) and sentimentMax label + // (inclusive), while 0 maps to the least positive sentiment and + // sentimentMax maps to the most positive one. The higher the score is, the + // more positive the sentiment in the text snippet is. Note: sentimentMax is + // an integer value between 1 (inclusive) and 10 (inclusive). + int32 sentiment = 1; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto new file mode 100644 index 00000000..d1517b4a --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto @@ -0,0 +1,33 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.prediction; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "TimeSeriesForecastingPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; + +// Prediction output format for Time Series Forecasting. +message TimeSeriesForecastingPredictionResult { + // The regression value. + float value = 1; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto new file mode 100644 index 00000000..5a03f70d --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto @@ -0,0 +1,54 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.prediction; + +import "google/protobuf/duration.proto"; +import "google/protobuf/wrappers.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "VideoActionRecognitionPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; + +// Prediction output format for Video Action Recognition. +message VideoActionRecognitionPredictionResult { + // The resource ID of the AnnotationSpec that had been identified. + string id = 1; + + // The display name of the AnnotationSpec that had been identified. + string display_name = 2; + + // The beginning, inclusive, of the video's time segment in which the + // AnnotationSpec has been identified. Expressed as a number of seconds as + // measured from the start of the video, with fractions up to a microsecond + // precision, and with "s" appended at the end. + google.protobuf.Duration time_segment_start = 4; + + // The end, exclusive, of the video's time segment in which the + // AnnotationSpec has been identified. Expressed as a number of seconds as + // measured from the start of the video, with fractions up to a microsecond + // precision, and with "s" appended at the end. + google.protobuf.Duration time_segment_end = 5; + + // The Model's confidence in correction of this prediction, higher + // value means higher confidence. + google.protobuf.FloatValue confidence = 6; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto new file mode 100644 index 00000000..bc5c5c37 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto @@ -0,0 +1,67 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.prediction; + +import "google/protobuf/duration.proto"; +import "google/protobuf/wrappers.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "VideoClassificationPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; + +// Prediction output format for Video Classification. +message VideoClassificationPredictionResult { + // The resource ID of the AnnotationSpec that had been identified. + string id = 1; + + // The display name of the AnnotationSpec that had been identified. + string display_name = 2; + + // The type of the prediction. The requested types can be configured + // via parameters. This will be one of + // - segment-classification + // - shot-classification + // - one-sec-interval-classification + string type = 3; + + // The beginning, inclusive, of the video's time segment in which the + // AnnotationSpec has been identified. Expressed as a number of seconds as + // measured from the start of the video, with fractions up to a microsecond + // precision, and with "s" appended at the end. Note that for + // 'segment-classification' prediction type, this equals the original + // 'timeSegmentStart' from the input instance, for other types it is the + // start of a shot or a 1 second interval respectively. + google.protobuf.Duration time_segment_start = 4; + + // The end, exclusive, of the video's time segment in which the + // AnnotationSpec has been identified. Expressed as a number of seconds as + // measured from the start of the video, with fractions up to a microsecond + // precision, and with "s" appended at the end. Note that for + // 'segment-classification' prediction type, this equals the original + // 'timeSegmentEnd' from the input instance, for other types it is the end + // of a shot or a 1 second interval respectively. + google.protobuf.Duration time_segment_end = 5; + + // The Model's confidence in correction of this prediction, higher + // value means higher confidence. + google.protobuf.FloatValue confidence = 6; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto new file mode 100644 index 00000000..fcfbff92 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto @@ -0,0 +1,82 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.predict.prediction; + +import "google/protobuf/duration.proto"; +import "google/protobuf/wrappers.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; +option java_multiple_files = true; +option java_outer_classname = "VideoObjectTrackingPredictionResultProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; + +// Prediction output format for Video Object Tracking. +message VideoObjectTrackingPredictionResult { + // The fields `xMin`, `xMax`, `yMin`, and `yMax` refer to a bounding box, + // i.e. the rectangle over the video frame pinpointing the found + // AnnotationSpec. The coordinates are relative to the frame size, and the + // point 0,0 is in the top left of the frame. + message Frame { + // A time (frame) of a video in which the object has been detected. + // Expressed as a number of seconds as measured from the + // start of the video, with fractions up to a microsecond precision, and + // with "s" appended at the end. + google.protobuf.Duration time_offset = 1; + + // The leftmost coordinate of the bounding box. + google.protobuf.FloatValue x_min = 2; + + // The rightmost coordinate of the bounding box. + google.protobuf.FloatValue x_max = 3; + + // The topmost coordinate of the bounding box. + google.protobuf.FloatValue y_min = 4; + + // The bottommost coordinate of the bounding box. + google.protobuf.FloatValue y_max = 5; + } + + // The resource ID of the AnnotationSpec that had been identified. + string id = 1; + + // The display name of the AnnotationSpec that had been identified. + string display_name = 2; + + // The beginning, inclusive, of the video's time segment in which the + // object instance has been detected. Expressed as a number of seconds as + // measured from the start of the video, with fractions up to a microsecond + // precision, and with "s" appended at the end. + google.protobuf.Duration time_segment_start = 3; + + // The end, inclusive, of the video's time segment in which the + // object instance has been detected. Expressed as a number of seconds as + // measured from the start of the video, with fractions up to a microsecond + // precision, and with "s" appended at the end. + google.protobuf.Duration time_segment_end = 4; + + // The Model's confidence in correction of this prediction, higher + // value means higher confidence. + google.protobuf.FloatValue confidence = 5; + + // All of the frames of the video in which a single object instance has been + // detected. The bounding boxes in the frames identify the same object. + repeated Frame frames = 6; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto new file mode 100644 index 00000000..53ead626 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto @@ -0,0 +1,128 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLImageClassificationProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Image Classification Model. +message AutoMlImageClassification { + // The input parameters of this TrainingJob. + AutoMlImageClassificationInputs inputs = 1; + + // The metadata information. + AutoMlImageClassificationMetadata metadata = 2; +} + +message AutoMlImageClassificationInputs { + enum ModelType { + // Should not be set. + MODEL_TYPE_UNSPECIFIED = 0; + + // A Model best tailored to be used within Google Cloud, and which cannot + // be exported. + // Default. + CLOUD = 1; + + // A model that, in addition to being available within Google + // Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow + // or Core ML model and used on a mobile or edge device afterwards. + // Expected to have low latency, but may have lower prediction + // quality than other mobile models. + MOBILE_TF_LOW_LATENCY_1 = 2; + + // A model that, in addition to being available within Google + // Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow + // or Core ML model and used on a mobile or edge device with afterwards. + MOBILE_TF_VERSATILE_1 = 3; + + // A model that, in addition to being available within Google + // Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow + // or Core ML model and used on a mobile or edge device afterwards. + // Expected to have a higher latency, but should also have a higher + // prediction quality than other mobile models. + MOBILE_TF_HIGH_ACCURACY_1 = 4; + } + + ModelType model_type = 1; + + // The ID of the `base` model. If it is specified, the new model will be + // trained based on the `base` model. Otherwise, the new model will be + // trained from scratch. The `base` model must be in the same + // Project and Location as the new Model to train, and have the same + // modelType. + string base_model_id = 2; + + // The training budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. The actual + // metadata.costMilliNodeHours will be equal or less than this value. + // If further model training ceases to provide any improvements, it will + // stop without using the full budget and the metadata.successfulStopReason + // will be `model-converged`. + // Note, node_hour = actual_hour * number_of_nodes_involved. + // For modelType `cloud`(default), the budget must be between 8,000 + // and 800,000 milli node hours, inclusive. The default value is 192,000 + // which represents one day in wall time, considering 8 nodes are used. + // For model types `mobile-tf-low-latency-1`, `mobile-tf-versatile-1`, + // `mobile-tf-high-accuracy-1`, the training budget must be between + // 1,000 and 100,000 milli node hours, inclusive. + // The default value is 24,000 which represents one day in wall time on a + // single node that is used. + int64 budget_milli_node_hours = 3; + + // Use the entire training budget. This disables the early stopping feature. + // When false the early stopping feature is enabled, which means that + // AutoML Image Classification might stop training before the entire + // training budget has been used. + bool disable_early_stopping = 4; + + // If false, a single-label (multi-class) Model will be trained (i.e. + // assuming that for each image just up to one annotation may be + // applicable). If true, a multi-label Model will be trained (i.e. + // assuming that for each image multiple annotations may be applicable). + bool multi_label = 5; +} + +message AutoMlImageClassificationMetadata { + enum SuccessfulStopReason { + // Should not be set. + SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0; + + // The inputs.budgetMilliNodeHours had been reached. + BUDGET_REACHED = 1; + + // Further training of the Model ceased to increase its quality, since it + // already has converged. + MODEL_CONVERGED = 2; + } + + // The actual training cost of creating this model, expressed in + // milli node hours, i.e. 1,000 value in this field means 1 node hour. + // Guaranteed to not exceed inputs.budgetMilliNodeHours. + int64 cost_milli_node_hours = 1; + + // For successful job completions, this is the reason why the job has + // finished. + SuccessfulStopReason successful_stop_reason = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto new file mode 100644 index 00000000..4c006644 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto @@ -0,0 +1,120 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLImageObjectDetectionProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Image Object Detection Model. +message AutoMlImageObjectDetection { + // The input parameters of this TrainingJob. + AutoMlImageObjectDetectionInputs inputs = 1; + + // The metadata information + AutoMlImageObjectDetectionMetadata metadata = 2; +} + +message AutoMlImageObjectDetectionInputs { + enum ModelType { + // Should not be set. + MODEL_TYPE_UNSPECIFIED = 0; + + // A model best tailored to be used within Google Cloud, and which cannot + // be exported. Expected to have a higher latency, but should also have a + // higher prediction quality than other cloud models. + CLOUD_HIGH_ACCURACY_1 = 1; + + // A model best tailored to be used within Google Cloud, and which cannot + // be exported. Expected to have a low latency, but may have lower + // prediction quality than other cloud models. + CLOUD_LOW_LATENCY_1 = 2; + + // A model that, in addition to being available within Google + // Cloud can also be exported (see ModelService.ExportModel) and + // used on a mobile or edge device with TensorFlow afterwards. + // Expected to have low latency, but may have lower prediction + // quality than other mobile models. + MOBILE_TF_LOW_LATENCY_1 = 3; + + // A model that, in addition to being available within Google + // Cloud can also be exported (see ModelService.ExportModel) and + // used on a mobile or edge device with TensorFlow afterwards. + MOBILE_TF_VERSATILE_1 = 4; + + // A model that, in addition to being available within Google + // Cloud, can also be exported (see ModelService.ExportModel) and + // used on a mobile or edge device with TensorFlow afterwards. + // Expected to have a higher latency, but should also have a higher + // prediction quality than other mobile models. + MOBILE_TF_HIGH_ACCURACY_1 = 5; + } + + ModelType model_type = 1; + + // The training budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. The actual + // metadata.costMilliNodeHours will be equal or less than this value. + // If further model training ceases to provide any improvements, it will + // stop without using the full budget and the metadata.successfulStopReason + // will be `model-converged`. + // Note, node_hour = actual_hour * number_of_nodes_involved. + // For modelType `cloud`(default), the budget must be between 20,000 + // and 900,000 milli node hours, inclusive. The default value is 216,000 + // which represents one day in wall time, considering 9 nodes are used. + // For model types `mobile-tf-low-latency-1`, `mobile-tf-versatile-1`, + // `mobile-tf-high-accuracy-1` + // the training budget must be between 1,000 and 100,000 milli node hours, + // inclusive. The default value is 24,000 which represents one day in + // wall time on a single node that is used. + int64 budget_milli_node_hours = 2; + + // Use the entire training budget. This disables the early stopping feature. + // When false the early stopping feature is enabled, which means that AutoML + // Image Object Detection might stop training before the entire training + // budget has been used. + bool disable_early_stopping = 3; +} + +message AutoMlImageObjectDetectionMetadata { + enum SuccessfulStopReason { + // Should not be set. + SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0; + + // The inputs.budgetMilliNodeHours had been reached. + BUDGET_REACHED = 1; + + // Further training of the Model ceased to increase its quality, since it + // already has converged. + MODEL_CONVERGED = 2; + } + + // The actual training cost of creating this model, expressed in + // milli node hours, i.e. 1,000 value in this field means 1 node hour. + // Guaranteed to not exceed inputs.budgetMilliNodeHours. + int64 cost_milli_node_hours = 1; + + // For successful job completions, this is the reason why the job has + // finished. + SuccessfulStopReason successful_stop_reason = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto new file mode 100644 index 00000000..c16721da --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto @@ -0,0 +1,106 @@ +// Copyright 2020 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLImageSegmentationProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Image Segmentation Model. +message AutoMlImageSegmentation { + // The input parameters of this TrainingJob. + AutoMlImageSegmentationInputs inputs = 1; + + // The metadata information. + AutoMlImageSegmentationMetadata metadata = 2; +} + +message AutoMlImageSegmentationInputs { + enum ModelType { + // Should not be set. + MODEL_TYPE_UNSPECIFIED = 0; + + // A model to be used via prediction calls to uCAIP API. Expected + // to have a higher latency, but should also have a higher prediction + // quality than other models. + CLOUD_HIGH_ACCURACY_1 = 1; + + // A model to be used via prediction calls to uCAIP API. Expected + // to have a lower latency but relatively lower prediction quality. + CLOUD_LOW_ACCURACY_1 = 2; + + // A model that, in addition to being available within Google + // Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow + // model and used on a mobile or edge device afterwards. + // Expected to have low latency, but may have lower prediction + // quality than other mobile models. + MOBILE_TF_LOW_LATENCY_1 = 3; + } + + ModelType model_type = 1; + + // The training budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. The actual + // metadata.costMilliNodeHours will be equal or less than this value. + // If further model training ceases to provide any improvements, it will + // stop without using the full budget and the metadata.successfulStopReason + // will be `model-converged`. + // Note, node_hour = actual_hour * number_of_nodes_involved. Or + // actaul_wall_clock_hours = train_budget_milli_node_hours / + // (number_of_nodes_involved * 1000) + // For modelType `cloud-high-accuracy-1`(default), the budget must be between + // 20,000 and 2,000,000 milli node hours, inclusive. The default value is + // 192,000 which represents one day in wall time + // (1000 milli * 24 hours * 8 nodes). + int64 budget_milli_node_hours = 2; + + // The ID of the `base` model. If it is specified, the new model will be + // trained based on the `base` model. Otherwise, the new model will be + // trained from scratch. The `base` model must be in the same + // Project and Location as the new Model to train, and have the same + // modelType. + string base_model_id = 3; +} + +message AutoMlImageSegmentationMetadata { + enum SuccessfulStopReason { + // Should not be set. + SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0; + + // The inputs.budgetMilliNodeHours had been reached. + BUDGET_REACHED = 1; + + // Further training of the Model ceased to increase its quality, since it + // already has converged. + MODEL_CONVERGED = 2; + } + + // The actual training cost of creating this model, expressed in + // milli node hours, i.e. 1,000 value in this field means 1 node hour. + // Guaranteed to not exceed inputs.budgetMilliNodeHours. + int64 cost_milli_node_hours = 1; + + // For successful job completions, this is the reason why the job has + // finished. + SuccessfulStopReason successful_stop_reason = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto new file mode 100644 index 00000000..29d8d80a --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto @@ -0,0 +1,284 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; + +import "google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLTablesProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Tables Model. +message AutoMlTables { + // The input parameters of this TrainingJob. + AutoMlTablesInputs inputs = 1; + + // The metadata information. + AutoMlTablesMetadata metadata = 2; +} + +message AutoMlTablesInputs { + message Transformation { + // Training pipeline will infer the proper transformation based on the + // statistic of dataset. + message AutoTransformation { + string column_name = 1; + } + + // Training pipeline will perform following transformation functions. + // * The value converted to float32. + // * The z_score of the value. + // * log(value+1) when the value is greater than or equal to 0. Otherwise, + // this transformation is not applied and the value is considered a + // missing value. + // * z_score of log(value+1) when the value is greater than or equal to 0. + // Otherwise, this transformation is not applied and the value is + // considered a missing value. + // * A boolean value that indicates whether the value is valid. + message NumericTransformation { + string column_name = 1; + + // If invalid values is allowed, the training pipeline will create a + // boolean feature that indicated whether the value is valid. + // Otherwise, the training pipeline will discard the input row from + // trainining data. + bool invalid_values_allowed = 2; + } + + // Training pipeline will perform following transformation functions. + // * The categorical string as is--no change to case, punctuation, + // spelling, + // tense, and so on. + // * Convert the category name to a dictionary lookup index and generate an + // embedding for each index. + // * Categories that appear less than 5 times in the training dataset are + // treated as the "unknown" category. The "unknown" category gets its own + // special lookup index and resulting embedding. + message CategoricalTransformation { + string column_name = 1; + } + + // Training pipeline will perform following transformation functions. + // * Apply the transformation functions for Numerical columns. + // * Determine the year, month, day,and weekday. Treat each value from the + // * timestamp as a Categorical column. + // * Invalid numerical values (for example, values that fall outside of a + // typical timestamp range, or are extreme values) receive no special + // treatment and are not removed. + message TimestampTransformation { + string column_name = 1; + + // The format in which that time field is expressed. The time_format must + // either be one of: + // * `unix-seconds` + // * `unix-milliseconds` + // * `unix-microseconds` + // * `unix-nanoseconds` + // (for respectively number of seconds, milliseconds, microseconds and + // nanoseconds since start of the Unix epoch); + // or be written in `strftime` syntax. If time_format is not set, then the + // default format is RFC 3339 `date-time` format, where + // `time-offset` = `"Z"` (e.g. 1985-04-12T23:20:50.52Z) + string time_format = 2; + + // If invalid values is allowed, the training pipeline will create a + // boolean feature that indicated whether the value is valid. + // Otherwise, the training pipeline will discard the input row from + // trainining data. + bool invalid_values_allowed = 3; + } + + // Training pipeline will perform following transformation functions. + // * The text as is--no change to case, punctuation, spelling, tense, and + // so + // on. + // * Tokenize text to words. Convert each words to a dictionary lookup + // index + // and generate an embedding for each index. Combine the embedding of all + // elements into a single embedding using the mean. + // * Tokenization is based on unicode script boundaries. + // * Missing values get their own lookup index and resulting embedding. + // * Stop-words receive no special treatment and are not removed. + message TextTransformation { + string column_name = 1; + } + + // Treats the column as numerical array and performs following + // transformation functions. + // * All transformations for Numerical types applied to the average of the + // all elements. + // * The average of empty arrays is treated as zero. + message NumericArrayTransformation { + string column_name = 1; + + // If invalid values is allowed, the training pipeline will create a + // boolean feature that indicated whether the value is valid. + // Otherwise, the training pipeline will discard the input row from + // trainining data. + bool invalid_values_allowed = 2; + } + + // Treats the column as categorical array and performs following + // transformation functions. + // * For each element in the array, convert the category name to a + // dictionary + // lookup index and generate an embedding for each index. + // Combine the embedding of all elements into a single embedding using + // the mean. + // * Empty arrays treated as an embedding of zeroes. + message CategoricalArrayTransformation { + string column_name = 1; + } + + // Treats the column as text array and performs following transformation + // functions. + // * Concatenate all text values in the array into a single text value + // using + // a space (" ") as a delimiter, and then treat the result as a single + // text value. Apply the transformations for Text columns. + // * Empty arrays treated as an empty text. + message TextArrayTransformation { + string column_name = 1; + } + + // The transformation that the training pipeline will apply to the input + // columns. + oneof transformation_detail { + AutoTransformation auto = 1; + + NumericTransformation numeric = 2; + + CategoricalTransformation categorical = 3; + + TimestampTransformation timestamp = 4; + + TextTransformation text = 5; + + NumericArrayTransformation repeated_numeric = 6; + + CategoricalArrayTransformation repeated_categorical = 7; + + TextArrayTransformation repeated_text = 8; + } + } + + // Additional optimization objective configuration. Required for + // `maximize-precision-at-recall` and `maximize-recall-at-precision`, + // otherwise unused. + oneof additional_optimization_objective_config { + // Required when optimization_objective is "maximize-precision-at-recall". + // Must be between 0 and 1, inclusive. + float optimization_objective_recall_value = 5; + + // Required when optimization_objective is "maximize-recall-at-precision". + // Must be between 0 and 1, inclusive. + float optimization_objective_precision_value = 6; + } + + // The type of prediction the Model is to produce. + // "classification" - Predict one out of multiple target values is + // picked for each row. + // "regression" - Predict a value based on its relation to other values. + // This type is available only to columns that contain + // semantically numeric values, i.e. integers or floating + // point number, even if stored as e.g. strings. + string prediction_type = 1; + + // The column name of the target column that the model is to predict. + string target_column = 2; + + // Each transformation will apply transform function to given input column. + // And the result will be used for training. + // When creating transformation for BigQuery Struct column, the column should + // be flattened using "." as the delimiter. + repeated Transformation transformations = 3; + + // Objective function the model is optimizing towards. The training process + // creates a model that maximizes/minimizes the value of the objective + // function over the validation set. + // + // The supported optimization objectives depend on the prediction type. + // If the field is not set, a default objective function is used. + // + // classification (binary): + // "maximize-au-roc" (default) - Maximize the area under the receiver + // operating characteristic (ROC) curve. + // "minimize-log-loss" - Minimize log loss. + // "maximize-au-prc" - Maximize the area under the precision-recall curve. + // "maximize-precision-at-recall" - Maximize precision for a specified + // recall value. + // "maximize-recall-at-precision" - Maximize recall for a specified + // precision value. + // + // classification (multi-class): + // "minimize-log-loss" (default) - Minimize log loss. + // + // regression: + // "minimize-rmse" (default) - Minimize root-mean-squared error (RMSE). + // "minimize-mae" - Minimize mean-absolute error (MAE). + // "minimize-rmsle" - Minimize root-mean-squared log error (RMSLE). + string optimization_objective = 4; + + // Required. The train budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. + // + // The training cost of the model will not exceed this budget. The final cost + // will be attempted to be close to the budget, though may end up being (even) + // noticeably smaller - at the backend's discretion. This especially may + // happen when further model training ceases to provide any improvements. + // + // If the budget is set to a value known to be insufficient to train a + // model for the given dataset, the training won't be attempted and + // will error. + // + // The train budget must be between 1,000 and 72,000 milli node hours, + // inclusive. + int64 train_budget_milli_node_hours = 7; + + // Use the entire training budget. This disables the early stopping feature. + // By default, the early stopping feature is enabled, which means that AutoML + // Tables might stop training before the entire training budget has been used. + bool disable_early_stopping = 8; + + // Column name that should be used as the weight column. + // Higher values in this column give more importance to the row + // during model training. The column must have numeric values between 0 and + // 10000 inclusively; 0 means the row is ignored for training. If weight + // column field is not set, then all rows are assumed to have equal weight + // of 1. + string weight_column_name = 9; + + // Configuration for exporting test set predictions to a BigQuery table. If + // this configuration is absent, then the export is not performed. + ExportEvaluatedDataItemsConfig export_evaluated_data_items_config = 10; + + // Additional experiment flags for the Tables training pipeline. + repeated string additional_experiments = 11; +} + +// Model metadata specific to AutoML Tables. +message AutoMlTablesMetadata { + // Output only. The actual training cost of the model, expressed in milli + // node hours, i.e. 1,000 value in this field means 1 node hour. Guaranteed + // to not exceed the train budget. + int64 train_cost_milli_node_hours = 1; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto new file mode 100644 index 00000000..6a2c93dd --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto @@ -0,0 +1,37 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLTextClassificationProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Text Classification Model. +message AutoMlTextClassification { + // The input parameters of this TrainingJob. + AutoMlTextClassificationInputs inputs = 1; +} + +message AutoMlTextClassificationInputs { + bool multi_label = 1; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto new file mode 100644 index 00000000..6b172764 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto @@ -0,0 +1,37 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLTextExtractionProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Text Extraction Model. +message AutoMlTextExtraction { + // The input parameters of this TrainingJob. + AutoMlTextExtractionInputs inputs = 1; +} + +message AutoMlTextExtractionInputs { + +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto new file mode 100644 index 00000000..18e42dce --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto @@ -0,0 +1,44 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLTextSentimentProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Text Sentiment Model. +message AutoMlTextSentiment { + // The input parameters of this TrainingJob. + AutoMlTextSentimentInputs inputs = 1; +} + +message AutoMlTextSentimentInputs { + // A sentiment is expressed as an integer ordinal, where higher value + // means a more positive sentiment. The range of sentiments that will be used + // is between 0 and sentimentMax (inclusive on both ends), and all the values + // in the range must be represented in the dataset before a model can be + // created. + // Only the Annotations with this sentimentMax will be used for training. + // sentimentMax value must be between 1 and 10 (inclusive). + int32 sentiment_max = 1; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto new file mode 100644 index 00000000..fdae0f0d --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto @@ -0,0 +1,287 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; + +import "google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLForecastingProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Forecasting Model. +message AutoMlForecasting { + // The input parameters of this TrainingJob. + AutoMlForecastingInputs inputs = 1; + + // The metadata information. + AutoMlForecastingMetadata metadata = 2; +} + +message AutoMlForecastingInputs { + message Transformation { + // Training pipeline will infer the proper transformation based on the + // statistic of dataset. + message AutoTransformation { + string column_name = 1; + } + + // Training pipeline will perform following transformation functions. + // + // * The value converted to float32. + // + // * The z_score of the value. + // + // * log(value+1) when the value is greater than or equal to 0. Otherwise, + // this transformation is not applied and the value is considered a + // missing value. + // + // * z_score of log(value+1) when the value is greater than or equal to 0. + // Otherwise, this transformation is not applied and the value is + // considered a missing value. + // + // * A boolean value that indicates whether the value is valid. + message NumericTransformation { + string column_name = 1; + } + + // Training pipeline will perform following transformation functions. + // + // * The categorical string as is--no change to case, punctuation, + // spelling, tense, and so on. + // + // * Convert the category name to a dictionary lookup index and generate an + // embedding for each index. + // + // * Categories that appear less than 5 times in the training dataset are + // treated as the "unknown" category. The "unknown" category gets its own + // special lookup index and resulting embedding. + message CategoricalTransformation { + string column_name = 1; + } + + // Training pipeline will perform following transformation functions. + // + // * Apply the transformation functions for Numerical columns. + // + // * Determine the year, month, day,and weekday. Treat each value from the + // timestamp as a Categorical column. + // + // * Invalid numerical values (for example, values that fall outside of a + // typical timestamp range, or are extreme values) receive no special + // treatment and are not removed. + message TimestampTransformation { + string column_name = 1; + + // The format in which that time field is expressed. The time_format must + // either be one of: + // + // * `unix-seconds` + // + // * `unix-milliseconds` + // + // * `unix-microseconds` + // + // * `unix-nanoseconds` + // + // (for respectively number of seconds, milliseconds, microseconds and + // nanoseconds since start of the Unix epoch); + // + // or be written in `strftime` syntax. + // + // If time_format is not set, then the + // default format is RFC 3339 `date-time` format, where + // `time-offset` = `"Z"` (e.g. 1985-04-12T23:20:50.52Z) + string time_format = 2; + } + + // Training pipeline will perform following transformation functions. + // + // * The text as is--no change to case, punctuation, spelling, tense, and + // so on. + // + // * Convert the category name to a dictionary lookup index and generate an + // embedding for each index. + message TextTransformation { + string column_name = 1; + } + + // The transformation that the training pipeline will apply to the input + // columns. + oneof transformation_detail { + AutoTransformation auto = 1; + + NumericTransformation numeric = 2; + + CategoricalTransformation categorical = 3; + + TimestampTransformation timestamp = 4; + + TextTransformation text = 5; + } + } + + // A duration of time expressed in time granularity units. + message Granularity { + // The time granularity unit of this time period. + // The supported units are: + // + // * "minute" + // + // * "hour" + // + // * "day" + // + // * "week" + // + // * "month" + // + // * "year" + string unit = 1; + + // The number of granularity_units between data points in the training + // data. If `granularity_unit` is `minute`, + // can be 1, 5, 10, 15, or 30. For all other values of `granularity_unit`, + // must be 1. + int64 quantity = 2; + } + + // The name of the column that the model is to predict. + string target_column = 1; + + // The name of the column that identifies the time series. + string time_series_identifier_column = 2; + + // The name of the column that identifies time order in the time series. + string time_column = 3; + + // Each transformation will apply transform function to given input column. + // And the result will be used for training. + // When creating transformation for BigQuery Struct column, the column should + // be flattened using "." as the delimiter. + repeated Transformation transformations = 4; + + // Objective function the model is optimizing towards. The training process + // creates a model that optimizes the value of the objective + // function over the validation set. + // + // The supported optimization objectives: + // + // * "minimize-rmse" (default) - Minimize root-mean-squared error (RMSE). + // + // * "minimize-mae" - Minimize mean-absolute error (MAE). + // + // * "minimize-rmsle" - Minimize root-mean-squared log error (RMSLE). + // + // * "minimize-rmspe" - Minimize root-mean-squared percentage error (RMSPE). + // + // * "minimize-wape-mae" - Minimize the combination of weighted absolute + // percentage error (WAPE) and mean-absolute-error (MAE). + // + // * "minimize-quantile-loss" - Minimize the quantile loss at the quantiles + // defined in `quantiles`. + string optimization_objective = 5; + + // Required. The train budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. + // + // The training cost of the model will not exceed this budget. The final cost + // will be attempted to be close to the budget, though may end up being (even) + // noticeably smaller - at the backend's discretion. This especially may + // happen when further model training ceases to provide any improvements. + // + // If the budget is set to a value known to be insufficient to train a + // model for the given dataset, the training won't be attempted and + // will error. + // + // The train budget must be between 1,000 and 72,000 milli node hours, + // inclusive. + int64 train_budget_milli_node_hours = 6; + + // Column name that should be used as the weight column. + // Higher values in this column give more importance to the row + // during model training. The column must have numeric values between 0 and + // 10000 inclusively; 0 means the row is ignored for training. If weight + // column field is not set, then all rows are assumed to have equal weight + // of 1. + string weight_column = 7; + + // Column names that should be used as attribute columns. + // The value of these columns does not vary as a function of time. + // For example, store ID or item color. + repeated string time_series_attribute_columns = 19; + + // Names of columns that are unavailable when a forecast is requested. + // This column contains information for the given entity (identified + // by the time_series_identifier_column) that is unknown before the forecast + // For example, actual weather on a given day. + repeated string unavailable_at_forecast_columns = 20; + + // Names of columns that are available and provided when a forecast + // is requested. These columns + // contain information for the given entity (identified by the + // time_series_identifier_column column) that is known at forecast. + // For example, predicted weather for a specific day. + repeated string available_at_forecast_columns = 21; + + // Expected difference in time granularity between rows in the data. + Granularity data_granularity = 22; + + // The amount of time into the future for which forecasted values for the + // target are returned. Expressed in number of units defined by the + // `data_granularity` field. + int64 forecast_horizon = 23; + + // The amount of time into the past training and prediction data is used + // for model training and prediction respectively. Expressed in number of + // units defined by the `data_granularity` field. + int64 context_window = 24; + + // Configuration for exporting test set predictions to a BigQuery table. If + // this configuration is absent, then the export is not performed. + ExportEvaluatedDataItemsConfig export_evaluated_data_items_config = 15; + + // Quantiles to use for minimize-quantile-loss `optimization_objective`. Up to + // 5 quantiles are allowed of values between 0 and 1, exclusive. Required if + // the value of optimization_objective is minimize-quantile-loss. Represents + // the percent quantiles to use for that objective. Quantiles must be unique. + repeated double quantiles = 16; + + // Validation options for the data validation component. The available options + // are: + // + // * "fail-pipeline" - default, will validate against the validation and + // fail the pipeline if it fails. + // + // * "ignore-validation" - ignore the results of the validation and continue + string validation_options = 17; + + // Additional experiment flags for the time series forcasting training. + repeated string additional_experiments = 25; +} + +// Model metadata specific to AutoML Forecasting. +message AutoMlForecastingMetadata { + // Output only. The actual training cost of the model, expressed in milli + // node hours, i.e. 1,000 value in this field means 1 node hour. Guaranteed + // to not exceed the train budget. + int64 train_cost_milli_node_hours = 1; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto new file mode 100644 index 00000000..4a16d658 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto @@ -0,0 +1,62 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLVideoActionRecognitionProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Video Action Recognition +// Model. +message AutoMlVideoActionRecognition { + // The input parameters of this TrainingJob. + AutoMlVideoActionRecognitionInputs inputs = 1; +} + +message AutoMlVideoActionRecognitionInputs { + enum ModelType { + // Should not be set. + MODEL_TYPE_UNSPECIFIED = 0; + + // A model best tailored to be used within Google Cloud, and which c annot + // be exported. Default. + CLOUD = 1; + + // A model that, in addition to being available within Google Cloud, can + // also be exported (see ModelService.ExportModel) as a TensorFlow or + // TensorFlow Lite model and used on a mobile or edge device afterwards. + MOBILE_VERSATILE_1 = 2; + + // A model that, in addition to being available within Google Cloud, can + // also be exported (see ModelService.ExportModel) to a Jetson device + // afterwards. + MOBILE_JETSON_VERSATILE_1 = 3; + + // A model that, in addition to being available within Google Cloud, can + // also be exported (see ModelService.ExportModel) as a TensorFlow or + // TensorFlow Lite model and used on a Coral device afterwards. + MOBILE_CORAL_VERSATILE_1 = 4; + } + + ModelType model_type = 1; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto new file mode 100644 index 00000000..020ef526 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto @@ -0,0 +1,56 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLVideoClassificationProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Video Classification Model. +message AutoMlVideoClassification { + // The input parameters of this TrainingJob. + AutoMlVideoClassificationInputs inputs = 1; +} + +message AutoMlVideoClassificationInputs { + enum ModelType { + // Should not be set. + MODEL_TYPE_UNSPECIFIED = 0; + + // A model best tailored to be used within Google Cloud, and which cannot + // be exported. Default. + CLOUD = 1; + + // A model that, in addition to being available within Google Cloud, can + // also be exported (see ModelService.ExportModel) as a TensorFlow or + // TensorFlow Lite model and used on a mobile or edge device afterwards. + MOBILE_VERSATILE_1 = 2; + + // A model that, in addition to being available within Google Cloud, can + // also be exported (see ModelService.ExportModel) to a Jetson device + // afterwards. + MOBILE_JETSON_VERSATILE_1 = 3; + } + + ModelType model_type = 1; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto new file mode 100644 index 00000000..9858eafc --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto @@ -0,0 +1,67 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "AutoMLVideoObjectTrackingProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; + +// A TrainingJob that trains and uploads an AutoML Video ObjectTracking Model. +message AutoMlVideoObjectTracking { + // The input parameters of this TrainingJob. + AutoMlVideoObjectTrackingInputs inputs = 1; +} + +message AutoMlVideoObjectTrackingInputs { + enum ModelType { + // Should not be set. + MODEL_TYPE_UNSPECIFIED = 0; + + // A model best tailored to be used within Google Cloud, and which c annot + // be exported. Default. + CLOUD = 1; + + // A model that, in addition to being available within Google Cloud, can + // also be exported (see ModelService.ExportModel) as a TensorFlow or + // TensorFlow Lite model and used on a mobile or edge device afterwards. + MOBILE_VERSATILE_1 = 2; + + // A versatile model that is meant to be exported (see + // ModelService.ExportModel) and used on a Google Coral device. + MOBILE_CORAL_VERSATILE_1 = 3; + + // A model that trades off quality for low latency, to be exported (see + // ModelService.ExportModel) and used on a Google Coral device. + MOBILE_CORAL_LOW_LATENCY_1 = 4; + + // A versatile model that is meant to be exported (see + // ModelService.ExportModel) and used on an NVIDIA Jetson device. + MOBILE_JETSON_VERSATILE_1 = 5; + + // A model that trades off quality for low latency, to be exported (see + // ModelService.ExportModel) and used on an NVIDIA Jetson device. + MOBILE_JETSON_LOW_LATENCY_1 = 6; + } + + ModelType model_type = 1; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto new file mode 100644 index 00000000..80385668 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto @@ -0,0 +1,43 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; +option java_multiple_files = true; +option java_outer_classname = "ExportEvaluatedDataItemsConfigProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; + +// Configuration for exporting test set predictions to a BigQuery table. +message ExportEvaluatedDataItemsConfig { + // URI of desired destination BigQuery table. Expected format: + // bq://::
include:samples/generated/v1/dataset_service.get_dataset.jsinclude:samples/generated/v1/dataset_service.update_dataset.jsinclude:samples/generated/v1/dataset_service.get_annotation_spec.jsinclude:samples/generated/v1/dataset_service.create_dataset.jsinclude:samples/generated/v1/dataset_service.create_dataset.jsinclude:samples/generated/v1/dataset_service.delete_dataset.jsinclude:samples/generated/v1/dataset_service.delete_dataset.jsinclude:samples/generated/v1/dataset_service.import_data.jsinclude:samples/generated/v1/dataset_service.import_data.jsinclude:samples/generated/v1/dataset_service.export_data.jsinclude:samples/generated/v1/dataset_service.export_data.jsinclude:samples/generated/v1/dataset_service.list_datasets.jsinclude:samples/generated/v1/dataset_service.list_data_items.jsinclude:samples/generated/v1/dataset_service.list_annotations.jsinclude:samples/generated/v1/endpoint_service.get_endpoint.jsinclude:samples/generated/v1/endpoint_service.update_endpoint.jsinclude:samples/generated/v1/endpoint_service.create_endpoint.jsinclude:samples/generated/v1/endpoint_service.create_endpoint.jsinclude:samples/generated/v1/endpoint_service.delete_endpoint.jsinclude:samples/generated/v1/endpoint_service.delete_endpoint.jsinclude:samples/generated/v1/endpoint_service.deploy_model.jsinclude:samples/generated/v1/endpoint_service.deploy_model.jsinclude:samples/generated/v1/endpoint_service.undeploy_model.jsinclude:samples/generated/v1/endpoint_service.undeploy_model.jsinclude:samples/generated/v1/endpoint_service.list_endpoints.jsinclude:samples/generated/v1/featurestore_online_serving_service.read_feature_values.jsinclude:samples/generated/v1/featurestore_online_serving_service.streaming_read_feature_values.jsinclude:samples/generated/v1/featurestore_service.get_featurestore.jsinclude:samples/generated/v1/featurestore_service.get_entity_type.jsinclude:samples/generated/v1/featurestore_service.update_entity_type.jsinclude:samples/generated/v1/featurestore_service.get_feature.jsinclude:samples/generated/v1/featurestore_service.update_feature.jsinclude:samples/generated/v1/featurestore_service.create_featurestore.jsinclude:samples/generated/v1/featurestore_service.create_featurestore.jsinclude:samples/generated/v1/featurestore_service.update_featurestore.jsinclude:samples/generated/v1/featurestore_service.update_featurestore.jsinclude:samples/generated/v1/featurestore_service.delete_featurestore.jsinclude:samples/generated/v1/featurestore_service.delete_featurestore.jsinclude:samples/generated/v1/featurestore_service.create_entity_type.jsinclude:samples/generated/v1/featurestore_service.create_entity_type.jsinclude:samples/generated/v1/featurestore_service.delete_entity_type.jsinclude:samples/generated/v1/featurestore_service.delete_entity_type.jsinclude:samples/generated/v1/featurestore_service.create_feature.jsinclude:samples/generated/v1/featurestore_service.create_feature.jsinclude:samples/generated/v1/featurestore_service.batch_create_features.jsinclude:samples/generated/v1/featurestore_service.batch_create_features.jsinclude:samples/generated/v1/featurestore_service.delete_feature.jsinclude:samples/generated/v1/featurestore_service.delete_feature.jsinclude:samples/generated/v1/featurestore_service.import_feature_values.jsinclude:samples/generated/v1/featurestore_service.import_feature_values.jsinclude:samples/generated/v1/featurestore_service.batch_read_feature_values.jsinclude:samples/generated/v1/featurestore_service.batch_read_feature_values.jsinclude:samples/generated/v1/featurestore_service.export_feature_values.jsinclude:samples/generated/v1/featurestore_service.export_feature_values.jsinclude:samples/generated/v1/featurestore_service.list_featurestores.jsinclude:samples/generated/v1/featurestore_service.list_entity_types.jsinclude:samples/generated/v1/featurestore_service.list_features.jsinclude:samples/generated/v1/featurestore_service.search_features.jsinclude:samples/generated/v1/index_endpoint_service.get_index_endpoint.jsinclude:samples/generated/v1/index_endpoint_service.update_index_endpoint.jsinclude:samples/generated/v1/index_endpoint_service.create_index_endpoint.jsinclude:samples/generated/v1/index_endpoint_service.create_index_endpoint.jsinclude:samples/generated/v1/index_endpoint_service.delete_index_endpoint.jsinclude:samples/generated/v1/index_endpoint_service.delete_index_endpoint.jsinclude:samples/generated/v1/index_endpoint_service.deploy_index.jsinclude:samples/generated/v1/index_endpoint_service.deploy_index.jsinclude:samples/generated/v1/index_endpoint_service.undeploy_index.jsinclude:samples/generated/v1/index_endpoint_service.undeploy_index.jsinclude:samples/generated/v1/index_endpoint_service.mutate_deployed_index.jsinclude:samples/generated/v1/index_endpoint_service.mutate_deployed_index.jsinclude:samples/generated/v1/index_endpoint_service.list_index_endpoints.jsinclude:samples/generated/v1/index_service.get_index.jsinclude:samples/generated/v1/index_service.create_index.jsinclude:samples/generated/v1/index_service.create_index.jsinclude:samples/generated/v1/index_service.update_index.jsinclude:samples/generated/v1/index_service.update_index.jsinclude:samples/generated/v1/index_service.delete_index.jsinclude:samples/generated/v1/index_service.delete_index.jsinclude:samples/generated/v1/index_service.list_indexes.jsinclude:samples/generated/v1/job_service.create_custom_job.jsinclude:samples/generated/v1/job_service.get_custom_job.jsinclude:samples/generated/v1/job_service.cancel_custom_job.jsinclude:samples/generated/v1/job_service.create_data_labeling_job.jsinclude:samples/generated/v1/job_service.get_data_labeling_job.jsinclude:samples/generated/v1/job_service.cancel_data_labeling_job.jsinclude:samples/generated/v1/job_service.create_hyperparameter_tuning_job.jsinclude:samples/generated/v1/job_service.get_hyperparameter_tuning_job.jsinclude:samples/generated/v1/job_service.cancel_hyperparameter_tuning_job.jsinclude:samples/generated/v1/job_service.create_batch_prediction_job.jsinclude:samples/generated/v1/job_service.get_batch_prediction_job.jsinclude:samples/generated/v1/job_service.cancel_batch_prediction_job.jsinclude:samples/generated/v1/job_service.create_model_deployment_monitoring_job.jsinclude:samples/generated/v1/job_service.get_model_deployment_monitoring_job.jsinclude:samples/generated/v1/job_service.pause_model_deployment_monitoring_job.jsinclude:samples/generated/v1/job_service.resume_model_deployment_monitoring_job.jsinclude:samples/generated/v1/job_service.delete_custom_job.jsinclude:samples/generated/v1/job_service.delete_custom_job.jsinclude:samples/generated/v1/job_service.delete_data_labeling_job.jsinclude:samples/generated/v1/job_service.delete_data_labeling_job.jsinclude:samples/generated/v1/job_service.delete_hyperparameter_tuning_job.jsinclude:samples/generated/v1/job_service.delete_hyperparameter_tuning_job.jsinclude:samples/generated/v1/job_service.delete_batch_prediction_job.jsinclude:samples/generated/v1/job_service.delete_batch_prediction_job.jsinclude:samples/generated/v1/job_service.update_model_deployment_monitoring_job.jsinclude:samples/generated/v1/job_service.update_model_deployment_monitoring_job.jsinclude:samples/generated/v1/job_service.delete_model_deployment_monitoring_job.jsinclude:samples/generated/v1/job_service.delete_model_deployment_monitoring_job.jsinclude:samples/generated/v1/job_service.list_custom_jobs.jsinclude:samples/generated/v1/job_service.list_data_labeling_jobs.jsinclude:samples/generated/v1/job_service.list_hyperparameter_tuning_jobs.jsinclude:samples/generated/v1/job_service.list_batch_prediction_jobs.jsinclude:samples/generated/v1/job_service.search_model_deployment_monitoring_stats_anomalies.jsinclude:samples/generated/v1/job_service.list_model_deployment_monitoring_jobs.jsinclude:samples/generated/v1/metadata_service.get_metadata_store.jsinclude:samples/generated/v1/metadata_service.create_artifact.jsinclude:samples/generated/v1/metadata_service.get_artifact.jsinclude:samples/generated/v1/metadata_service.update_artifact.jsinclude:samples/generated/v1/metadata_service.create_context.jsinclude:samples/generated/v1/metadata_service.get_context.jsinclude:samples/generated/v1/metadata_service.update_context.jsinclude:samples/generated/v1/metadata_service.add_context_artifacts_and_executions.jsinclude:samples/generated/v1/metadata_service.add_context_children.jsinclude:samples/generated/v1/metadata_service.query_context_lineage_subgraph.jsinclude:samples/generated/v1/metadata_service.create_execution.jsinclude:samples/generated/v1/metadata_service.get_execution.jsinclude:samples/generated/v1/metadata_service.update_execution.jsinclude:samples/generated/v1/metadata_service.add_execution_events.jsinclude:samples/generated/v1/metadata_service.query_execution_inputs_and_outputs.jsinclude:samples/generated/v1/metadata_service.create_metadata_schema.jsinclude:samples/generated/v1/metadata_service.get_metadata_schema.jsinclude:samples/generated/v1/metadata_service.query_artifact_lineage_subgraph.jsinclude:samples/generated/v1/metadata_service.create_metadata_store.jsinclude:samples/generated/v1/metadata_service.create_metadata_store.jsinclude:samples/generated/v1/metadata_service.delete_metadata_store.jsinclude:samples/generated/v1/metadata_service.delete_metadata_store.jsinclude:samples/generated/v1/metadata_service.delete_artifact.jsinclude:samples/generated/v1/metadata_service.delete_artifact.jsinclude:samples/generated/v1/metadata_service.purge_artifacts.jsinclude:samples/generated/v1/metadata_service.purge_artifacts.jsinclude:samples/generated/v1/metadata_service.delete_context.jsinclude:samples/generated/v1/metadata_service.delete_context.jsinclude:samples/generated/v1/metadata_service.purge_contexts.jsinclude:samples/generated/v1/metadata_service.purge_contexts.jsinclude:samples/generated/v1/metadata_service.delete_execution.jsinclude:samples/generated/v1/metadata_service.delete_execution.jsinclude:samples/generated/v1/metadata_service.purge_executions.jsinclude:samples/generated/v1/metadata_service.purge_executions.jsinclude:samples/generated/v1/metadata_service.list_metadata_stores.jsinclude:samples/generated/v1/metadata_service.list_artifacts.jsinclude:samples/generated/v1/metadata_service.list_contexts.jsinclude:samples/generated/v1/metadata_service.list_executions.jsinclude:samples/generated/v1/metadata_service.list_metadata_schemas.jsinclude:samples/generated/v1/migration_service.batch_migrate_resources.jsinclude:samples/generated/v1/migration_service.batch_migrate_resources.jsinclude:samples/generated/v1/migration_service.search_migratable_resources.jsinclude:samples/generated/v1/model_service.get_model.jsinclude:samples/generated/v1/model_service.update_model.jsinclude:samples/generated/v1/model_service.import_model_evaluation.jsinclude:samples/generated/v1/model_service.get_model_evaluation.jsinclude:samples/generated/v1/model_service.get_model_evaluation_slice.jsinclude:samples/generated/v1/model_service.upload_model.jsinclude:samples/generated/v1/model_service.upload_model.jsinclude:samples/generated/v1/model_service.delete_model.jsinclude:samples/generated/v1/model_service.delete_model.jsinclude:samples/generated/v1/model_service.export_model.jsinclude:samples/generated/v1/model_service.export_model.jsinclude:samples/generated/v1/model_service.list_models.jsinclude:samples/generated/v1/model_service.list_model_evaluations.jsinclude:samples/generated/v1/model_service.list_model_evaluation_slices.jsinclude:samples/generated/v1/pipeline_service.create_training_pipeline.jsinclude:samples/generated/v1/pipeline_service.get_training_pipeline.jsinclude:samples/generated/v1/pipeline_service.cancel_training_pipeline.jsinclude:samples/generated/v1/pipeline_service.create_pipeline_job.jsinclude:samples/generated/v1/pipeline_service.get_pipeline_job.jsinclude:samples/generated/v1/pipeline_service.cancel_pipeline_job.jsinclude:samples/generated/v1/pipeline_service.delete_training_pipeline.jsinclude:samples/generated/v1/pipeline_service.delete_training_pipeline.jsinclude:samples/generated/v1/pipeline_service.delete_pipeline_job.jsinclude:samples/generated/v1/pipeline_service.delete_pipeline_job.jsinclude:samples/generated/v1/pipeline_service.list_training_pipelines.jsinclude:samples/generated/v1/pipeline_service.list_pipeline_jobs.jsinclude:samples/generated/v1/prediction_service.predict.jsinclude:samples/generated/v1/prediction_service.raw_predict.jsinclude:samples/generated/v1/prediction_service.explain.jsinclude:samples/generated/v1/specialist_pool_service.get_specialist_pool.jsinclude:samples/generated/v1/specialist_pool_service.create_specialist_pool.jsinclude:samples/generated/v1/specialist_pool_service.create_specialist_pool.jsinclude:samples/generated/v1/specialist_pool_service.delete_specialist_pool.jsinclude:samples/generated/v1/specialist_pool_service.delete_specialist_pool.jsinclude:samples/generated/v1/specialist_pool_service.update_specialist_pool.jsinclude:samples/generated/v1/specialist_pool_service.update_specialist_pool.jsinclude:samples/generated/v1/specialist_pool_service.list_specialist_pools.jsinclude:samples/generated/v1/tensorboard_service.get_tensorboard.jsinclude:samples/generated/v1/tensorboard_service.create_tensorboard_experiment.jsinclude:samples/generated/v1/tensorboard_service.get_tensorboard_experiment.jsinclude:samples/generated/v1/tensorboard_service.update_tensorboard_experiment.jsinclude:samples/generated/v1/tensorboard_service.create_tensorboard_run.jsinclude:samples/generated/v1/tensorboard_service.batch_create_tensorboard_runs.jsinclude:samples/generated/v1/tensorboard_service.get_tensorboard_run.jsinclude:samples/generated/v1/tensorboard_service.update_tensorboard_run.jsinclude:samples/generated/v1/tensorboard_service.batch_create_tensorboard_time_series.jsinclude:samples/generated/v1/tensorboard_service.create_tensorboard_time_series.jsinclude:samples/generated/v1/tensorboard_service.get_tensorboard_time_series.jsinclude:samples/generated/v1/tensorboard_service.update_tensorboard_time_series.jsinclude:samples/generated/v1/tensorboard_service.batch_read_tensorboard_time_series_data.jsinclude:samples/generated/v1/tensorboard_service.read_tensorboard_time_series_data.jsinclude:samples/generated/v1/tensorboard_service.write_tensorboard_experiment_data.jsinclude:samples/generated/v1/tensorboard_service.write_tensorboard_run_data.jsinclude:samples/generated/v1/tensorboard_service.read_tensorboard_blob_data.jsinclude:samples/generated/v1/tensorboard_service.create_tensorboard.jsinclude:samples/generated/v1/tensorboard_service.create_tensorboard.jsinclude:samples/generated/v1/tensorboard_service.update_tensorboard.jsinclude:samples/generated/v1/tensorboard_service.update_tensorboard.jsinclude:samples/generated/v1/tensorboard_service.delete_tensorboard.jsinclude:samples/generated/v1/tensorboard_service.delete_tensorboard.jsinclude:samples/generated/v1/tensorboard_service.delete_tensorboard_experiment.jsinclude:samples/generated/v1/tensorboard_service.delete_tensorboard_experiment.jsinclude:samples/generated/v1/tensorboard_service.delete_tensorboard_run.jsinclude:samples/generated/v1/tensorboard_service.delete_tensorboard_run.jsinclude:samples/generated/v1/tensorboard_service.delete_tensorboard_time_series.jsinclude:samples/generated/v1/tensorboard_service.delete_tensorboard_time_series.jsinclude:samples/generated/v1/tensorboard_service.list_tensorboards.jsinclude:samples/generated/v1/tensorboard_service.list_tensorboard_experiments.jsinclude:samples/generated/v1/tensorboard_service.list_tensorboard_runs.jsinclude:samples/generated/v1/tensorboard_service.list_tensorboard_time_series.jsinclude:samples/generated/v1/tensorboard_service.export_tensorboard_time_series_data.jsinclude:samples/generated/v1/vizier_service.create_study.jsinclude:samples/generated/v1/vizier_service.get_study.jsinclude:samples/generated/v1/vizier_service.delete_study.jsinclude:samples/generated/v1/vizier_service.lookup_study.jsinclude:samples/generated/v1/vizier_service.create_trial.jsinclude:samples/generated/v1/vizier_service.get_trial.jsinclude:samples/generated/v1/vizier_service.add_trial_measurement.jsinclude:samples/generated/v1/vizier_service.complete_trial.jsinclude:samples/generated/v1/vizier_service.delete_trial.jsinclude:samples/generated/v1/vizier_service.stop_trial.jsinclude:samples/generated/v1/vizier_service.list_optimal_trials.jsinclude:samples/generated/v1/vizier_service.suggest_trials.jsinclude:samples/generated/v1/vizier_service.suggest_trials.jsinclude:samples/generated/v1/vizier_service.check_trial_early_stopping_state.jsinclude:samples/generated/v1/vizier_service.check_trial_early_stopping_state.jsinclude:samples/generated/v1/vizier_service.list_studies.jsinclude:samples/generated/v1/vizier_service.list_trials.js
+ // + // If not specified, then results are exported to the following auto-created + // BigQuery table: + // :export_evaluated_examples__.evaluated_examples + string destination_bigquery_uri = 1; + + // If true and an export destination is specified, then the contents of the + // destination are overwritten. Otherwise, if the export destination already + // exists, then the export operation fails. + bool override_existing_table = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto new file mode 100644 index 00000000..49be7b79 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto @@ -0,0 +1,62 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "SpecialistPoolProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// SpecialistPool represents customers' own workforce to work on their data +// labeling jobs. It includes a group of specialist managers and workers. +// Managers are responsible for managing the workers in this pool as well as +// customers' data labeling jobs associated with this pool. Customers create +// specialist pool as well as start data labeling jobs on Cloud, managers and +// workers handle the jobs using CrowdCompute console. +message SpecialistPool { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/SpecialistPool" + pattern: "projects/{project}/locations/{location}/specialistPools/{specialist_pool}" + }; + + // Required. The resource name of the SpecialistPool. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The user-defined name of the SpecialistPool. + // The name can be up to 128 characters long and can be consist of any UTF-8 + // characters. + // This field should be unique on project-level. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The number of managers in this SpecialistPool. + int32 specialist_managers_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The email addresses of the managers in the SpecialistPool. + repeated string specialist_manager_emails = 4; + + // Output only. The resource name of the pending data labeling jobs. + repeated string pending_data_labeling_jobs = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The email addresses of workers in the SpecialistPool. + repeated string specialist_worker_emails = 7; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto new file mode 100644 index 00000000..a110b9cb --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto @@ -0,0 +1,210 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/operation.proto"; +import "google/cloud/aiplatform/v1beta1/specialist_pool.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "SpecialistPoolServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A service for creating and managing Customer SpecialistPools. +// When customers start Data Labeling jobs, they can reuse/create Specialist +// Pools to bring their own Specialists to label the data. +// Customers can add/remove Managers for the Specialist Pool on Cloud console, +// then Managers will get email notifications to manage Specialists and tasks on +// CrowdCompute console. +service SpecialistPoolService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a SpecialistPool. + rpc CreateSpecialistPool(CreateSpecialistPoolRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/specialistPools" + body: "specialist_pool" + }; + option (google.api.method_signature) = "parent,specialist_pool"; + option (google.longrunning.operation_info) = { + response_type: "SpecialistPool" + metadata_type: "CreateSpecialistPoolOperationMetadata" + }; + } + + // Gets a SpecialistPool. + rpc GetSpecialistPool(GetSpecialistPoolRequest) returns (SpecialistPool) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/specialistPools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists SpecialistPools in a Location. + rpc ListSpecialistPools(ListSpecialistPoolsRequest) returns (ListSpecialistPoolsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/specialistPools" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a SpecialistPool as well as all Specialists in the pool. + rpc DeleteSpecialistPool(DeleteSpecialistPoolRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/specialistPools/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Updates a SpecialistPool. + rpc UpdateSpecialistPool(UpdateSpecialistPoolRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{specialist_pool.name=projects/*/locations/*/specialistPools/*}" + body: "specialist_pool" + }; + option (google.api.method_signature) = "specialist_pool,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "SpecialistPool" + metadata_type: "UpdateSpecialistPoolOperationMetadata" + }; + } +} + +// Request message for [SpecialistPoolService.CreateSpecialistPool][google.cloud.aiplatform.v1beta1.SpecialistPoolService.CreateSpecialistPool]. +message CreateSpecialistPoolRequest { + // Required. The parent Project name for the new SpecialistPool. + // The form is `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The SpecialistPool to create. + SpecialistPool specialist_pool = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Runtime operation information for +// [SpecialistPoolService.CreateSpecialistPool][google.cloud.aiplatform.v1beta1.SpecialistPoolService.CreateSpecialistPool]. +message CreateSpecialistPoolOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for [SpecialistPoolService.GetSpecialistPool][google.cloud.aiplatform.v1beta1.SpecialistPoolService.GetSpecialistPool]. +message GetSpecialistPoolRequest { + // Required. The name of the SpecialistPool resource. + // The form is + // `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/SpecialistPool" + } + ]; +} + +// Request message for [SpecialistPoolService.ListSpecialistPools][google.cloud.aiplatform.v1beta1.SpecialistPoolService.ListSpecialistPools]. +message ListSpecialistPoolsRequest { + // Required. The name of the SpecialistPool's parent resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The standard list page size. + int32 page_size = 2; + + // The standard list page token. + // Typically obtained by [ListSpecialistPoolsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListSpecialistPoolsResponse.next_page_token] of + // the previous [SpecialistPoolService.ListSpecialistPools][google.cloud.aiplatform.v1beta1.SpecialistPoolService.ListSpecialistPools] call. Return + // first page if empty. + string page_token = 3; + + // Mask specifying which fields to read. FieldMask represents a set of + google.protobuf.FieldMask read_mask = 4; +} + +// Response message for [SpecialistPoolService.ListSpecialistPools][google.cloud.aiplatform.v1beta1.SpecialistPoolService.ListSpecialistPools]. +message ListSpecialistPoolsResponse { + // A list of SpecialistPools that matches the specified filter in the request. + repeated SpecialistPool specialist_pools = 1; + + // The standard List next-page token. + string next_page_token = 2; +} + +// Request message for [SpecialistPoolService.DeleteSpecialistPool][google.cloud.aiplatform.v1beta1.SpecialistPoolService.DeleteSpecialistPool]. +message DeleteSpecialistPoolRequest { + // Required. The resource name of the SpecialistPool to delete. Format: + // `projects/{project}/locations/{location}/specialistPools/{specialist_pool}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/SpecialistPool" + } + ]; + + // If set to true, any specialist managers in this SpecialistPool will also be + // deleted. (Otherwise, the request will only work if the SpecialistPool has + // no specialist managers.) + bool force = 2; +} + +// Request message for [SpecialistPoolService.UpdateSpecialistPool][google.cloud.aiplatform.v1beta1.SpecialistPoolService.UpdateSpecialistPool]. +message UpdateSpecialistPoolRequest { + // Required. The SpecialistPool which replaces the resource on the server. + SpecialistPool specialist_pool = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Runtime operation metadata for +// [SpecialistPoolService.UpdateSpecialistPool][google.cloud.aiplatform.v1beta1.SpecialistPoolService.UpdateSpecialistPool]. +message UpdateSpecialistPoolOperationMetadata { + // Output only. The name of the SpecialistPool to which the specialists are being added. + // Format: + // `projects/{project_id}/locations/{location_id}/specialistPools/{specialist_pool}` + string specialist_pool = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/SpecialistPool" + } + ]; + + // The operation generic information. + GenericOperationMetadata generic_metadata = 2; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/study.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/study.proto new file mode 100644 index 00000000..d0642d18 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/study.proto @@ -0,0 +1,602 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "StudyProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A message representing a Study. +message Study { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Study" + pattern: "projects/{project}/locations/{location}/studies/{study}" + }; + + // Describes the Study state. + enum State { + // The study state is unspecified. + STATE_UNSPECIFIED = 0; + + // The study is active. + ACTIVE = 1; + + // The study is stopped due to an internal error. + INACTIVE = 2; + + // The study is done when the service exhausts the parameter search space + // or max_trial_count is reached. + COMPLETED = 3; + } + + // Output only. The name of a study. The study's globally unique identifier. + // Format: `projects/{project}/locations/{location}/studies/{study}` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Describes the Study, default value is empty string. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Configuration of the Study. + StudySpec study_spec = 3 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The detailed state of a Study. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the study was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A human readable reason why the Study is inactive. + // This should be empty if a study is ACTIVE or COMPLETED. + string inactive_reason = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A message representing a Trial. A Trial contains a unique set of Parameters +// that has been or will be evaluated, along with the objective metrics got by +// running the Trial. +message Trial { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Trial" + pattern: "projects/{project}/locations/{location}/studies/{study}/trials/{trial}" + }; + + // A message representing a parameter to be tuned. + message Parameter { + // Output only. The ID of the parameter. The parameter should be defined in + // [StudySpec's Parameters][google.cloud.aiplatform.v1beta1.StudySpec.parameters]. + string parameter_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The value of the parameter. + // `number_value` will be set if a parameter defined in StudySpec is + // in type 'INTEGER', 'DOUBLE' or 'DISCRETE'. + // `string_value` will be set if a parameter defined in StudySpec is + // in type 'CATEGORICAL'. + google.protobuf.Value value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Describes a Trial state. + enum State { + // The Trial state is unspecified. + STATE_UNSPECIFIED = 0; + + // Indicates that a specific Trial has been requested, but it has not yet + // been suggested by the service. + REQUESTED = 1; + + // Indicates that the Trial has been suggested. + ACTIVE = 2; + + // Indicates that the Trial should stop according to the service. + STOPPING = 3; + + // Indicates that the Trial is completed successfully. + SUCCEEDED = 4; + + // Indicates that the Trial should not be attempted again. + // The service will set a Trial to INFEASIBLE when it's done but missing + // the final_measurement. + INFEASIBLE = 5; + } + + // Output only. Resource name of the Trial assigned by the service. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The identifier of the Trial assigned by the service. + string id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The detailed state of the Trial. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The parameters of the Trial. + repeated Parameter parameters = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The final measurement containing the objective value. + Measurement final_measurement = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A list of measurements that are strictly lexicographically + // ordered by their induced tuples (steps, elapsed_duration). + // These are used for early stopping computations. + repeated Measurement measurements = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the Trial was started. + google.protobuf.Timestamp start_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the Trial's status changed to `SUCCEEDED` or `INFEASIBLE`. + google.protobuf.Timestamp end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The identifier of the client that originally requested this Trial. + // Each client is identified by a unique client_id. When a client + // asks for a suggestion, Vertex AI Vizier will assign it a Trial. The client + // should evaluate the Trial, complete it, and report back to Vertex AI + // Vizier. If suggestion is asked again by same client_id before the Trial is + // completed, the same Trial will be returned. Multiple clients with + // different client_ids can ask for suggestions simultaneously, each of them + // will get their own Trial. + string client_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A human readable string describing why the Trial is + // infeasible. This is set only if Trial state is `INFEASIBLE`. + string infeasible_reason = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The CustomJob name linked to the Trial. + // It's set for a HyperparameterTuningJob's Trial. + string custom_job = 11 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/CustomJob" + } + ]; + + // Output only. URIs for accessing [interactive + // shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) + // (one URI for each training node). Only available if this trial is part of + // a [HyperparameterTuningJob][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob] and the job's + // [trial_job_spec.enable_web_access][google.cloud.aiplatform.v1beta1.CustomJobSpec.enable_web_access] field + // is `true`. + // + // The keys are names of each node used for the trial; for example, + // `workerpool0-0` for the primary node, `workerpool1-0` for the first node in + // the second worker pool, and `workerpool1-1` for the second node in the + // second worker pool. + // + // The values are the URIs for each node's interactive shell. + map web_access_uris = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents specification of a Study. +message StudySpec { + // Represents a metric to optimize. + message MetricSpec { + // The available types of optimization goals. + enum GoalType { + // Goal Type will default to maximize. + GOAL_TYPE_UNSPECIFIED = 0; + + // Maximize the goal metric. + MAXIMIZE = 1; + + // Minimize the goal metric. + MINIMIZE = 2; + } + + // Required. The ID of the metric. Must not contain whitespaces and must be unique + // amongst all MetricSpecs. + string metric_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The optimization goal of the metric. + GoalType goal = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Represents a single parameter to optimize. + message ParameterSpec { + // Value specification for a parameter in `DOUBLE` type. + message DoubleValueSpec { + // Required. Inclusive minimum value of the parameter. + double min_value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Inclusive maximum value of the parameter. + double max_value = 2 [(google.api.field_behavior) = REQUIRED]; + + // A default value for a `DOUBLE` parameter that is assumed to be a + // relatively good starting point. Unset value signals that there is no + // offered starting point. + // + // Currently only supported by the Vertex AI Vizier service. Not supported + // by HyperparamterTuningJob or TrainingPipeline. + optional double default_value = 4; + } + + // Value specification for a parameter in `INTEGER` type. + message IntegerValueSpec { + // Required. Inclusive minimum value of the parameter. + int64 min_value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Inclusive maximum value of the parameter. + int64 max_value = 2 [(google.api.field_behavior) = REQUIRED]; + + // A default value for an `INTEGER` parameter that is assumed to be a + // relatively good starting point. Unset value signals that there is no + // offered starting point. + // + // Currently only supported by the Vertex AI Vizier service. Not supported + // by HyperparamterTuningJob or TrainingPipeline. + optional int64 default_value = 4; + } + + // Value specification for a parameter in `CATEGORICAL` type. + message CategoricalValueSpec { + // Required. The list of possible categories. + repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; + + // A default value for a `CATEGORICAL` parameter that is assumed to be a + // relatively good starting point. Unset value signals that there is no + // offered starting point. + // + // Currently only supported by the Vizier service. Not supported by + // HyperparamterTuningJob or TrainingPipeline. + optional string default_value = 3; + } + + // Value specification for a parameter in `DISCRETE` type. + message DiscreteValueSpec { + // Required. A list of possible values. + // The list should be in increasing order and at least 1e-10 apart. + // For instance, this parameter might have possible settings of 1.5, 2.5, + // and 4.0. This list should not contain more than 1,000 values. + repeated double values = 1 [(google.api.field_behavior) = REQUIRED]; + + // A default value for a `DISCRETE` parameter that is assumed to be a + // relatively good starting point. Unset value signals that there is no + // offered starting point. It automatically rounds to the + // nearest feasible discrete point. + // + // Currently only supported by the Vizier service. Not supported by + // HyperparamterTuningJob or TrainingPipeline. + optional double default_value = 3; + } + + // Represents a parameter spec with condition from its parent parameter. + message ConditionalParameterSpec { + // Represents the spec to match discrete values from parent parameter. + message DiscreteValueCondition { + // Required. Matches values of the parent parameter of 'DISCRETE' type. + // All values must exist in `discrete_value_spec` of parent parameter. + // + // The Epsilon of the value matching is 1e-10. + repeated double values = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Represents the spec to match integer values from parent parameter. + message IntValueCondition { + // Required. Matches values of the parent parameter of 'INTEGER' type. + // All values must lie in `integer_value_spec` of parent parameter. + repeated int64 values = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Represents the spec to match categorical values from parent parameter. + message CategoricalValueCondition { + // Required. Matches values of the parent parameter of 'CATEGORICAL' type. + // All values must exist in `categorical_value_spec` of parent + // parameter. + repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A set of parameter values from the parent ParameterSpec's feasible + // space. + oneof parent_value_condition { + // The spec for matching values from a parent parameter of + // `DISCRETE` type. + DiscreteValueCondition parent_discrete_values = 2; + + // The spec for matching values from a parent parameter of `INTEGER` + // type. + IntValueCondition parent_int_values = 3; + + // The spec for matching values from a parent parameter of + // `CATEGORICAL` type. + CategoricalValueCondition parent_categorical_values = 4; + } + + // Required. The spec for a conditional parameter. + ParameterSpec parameter_spec = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The type of scaling that should be applied to this parameter. + enum ScaleType { + // By default, no scaling is applied. + SCALE_TYPE_UNSPECIFIED = 0; + + // Scales the feasible space to (0, 1) linearly. + UNIT_LINEAR_SCALE = 1; + + // Scales the feasible space logarithmically to (0, 1). The entire + // feasible space must be strictly positive. + UNIT_LOG_SCALE = 2; + + // Scales the feasible space "reverse" logarithmically to (0, 1). The + // result is that values close to the top of the feasible space are spread + // out more than points near the bottom. The entire feasible space must be + // strictly positive. + UNIT_REVERSE_LOG_SCALE = 3; + } + + oneof parameter_value_spec { + // The value spec for a 'DOUBLE' parameter. + DoubleValueSpec double_value_spec = 2; + + // The value spec for an 'INTEGER' parameter. + IntegerValueSpec integer_value_spec = 3; + + // The value spec for a 'CATEGORICAL' parameter. + CategoricalValueSpec categorical_value_spec = 4; + + // The value spec for a 'DISCRETE' parameter. + DiscreteValueSpec discrete_value_spec = 5; + } + + // Required. The ID of the parameter. Must not contain whitespaces and must be unique + // amongst all ParameterSpecs. + string parameter_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // How the parameter should be scaled. + // Leave unset for `CATEGORICAL` parameters. + ScaleType scale_type = 6; + + // A conditional parameter node is active if the parameter's value matches + // the conditional node's parent_value_condition. + // + // If two items in conditional_parameter_specs have the same name, they + // must have disjoint parent_value_condition. + repeated ConditionalParameterSpec conditional_parameter_specs = 10; + } + + // The decay curve automated stopping rule builds a Gaussian Process + // Regressor to predict the final objective value of a Trial based on the + // already completed Trials and the intermediate measurements of the current + // Trial. Early stopping is requested for the current Trial if there is very + // low probability to exceed the optimal value found so far. + message DecayCurveAutomatedStoppingSpec { + // True if [Measurement.elapsed_duration][google.cloud.aiplatform.v1beta1.Measurement.elapsed_duration] is used as the x-axis of each + // Trials Decay Curve. Otherwise, [Measurement.step_count][google.cloud.aiplatform.v1beta1.Measurement.step_count] will be used + // as the x-axis. + bool use_elapsed_duration = 1; + } + + // The median automated stopping rule stops a pending Trial if the Trial's + // best objective_value is strictly below the median 'performance' of all + // completed Trials reported up to the Trial's last measurement. + // Currently, 'performance' refers to the running average of the objective + // values reported by the Trial in each measurement. + message MedianAutomatedStoppingSpec { + // True if median automated stopping rule applies on + // [Measurement.elapsed_duration][google.cloud.aiplatform.v1beta1.Measurement.elapsed_duration]. It means that elapsed_duration + // field of latest measurement of current Trial is used to compute median + // objective value for each completed Trials. + bool use_elapsed_duration = 1; + } + + // Configuration for ConvexAutomatedStoppingSpec. + // When there are enough completed trials (configured by + // min_measurement_count), for pending trials with enough measurements and + // steps, the policy first computes an overestimate of the objective value at + // max_num_steps according to the slope of the incomplete objective value + // curve. No prediction can be made if the curve is completely flat. If the + // overestimation is worse than the best objective value of the completed + // trials, this pending trial will be early-stopped, but a last measurement + // will be added to the pending trial with max_num_steps and predicted + // objective value from the autoregression model. + message ConvexAutomatedStoppingSpec { + // Steps used in predicting the final objective for early stopped trials. In + // general, it's set to be the same as the defined steps in training / + // tuning. If not defined, it will learn it from the completed trials. When + // use_steps is false, this field is set to the maximum elapsed seconds. + int64 max_step_count = 1; + + // Minimum number of steps for a trial to complete. Trials which do not have + // a measurement with step_count > min_step_count won't be considered for + // early stopping. It's ok to set it to 0, and a trial can be early stopped + // at any stage. By default, min_step_count is set to be one-tenth of the + // max_step_count. + // When use_elapsed_duration is true, this field is set to the minimum + // elapsed seconds. + int64 min_step_count = 2; + + // The minimal number of measurements in a Trial. Early-stopping checks + // will not trigger if less than min_measurement_count+1 completed trials or + // pending trials with less than min_measurement_count measurements. If not + // defined, the default value is 5. + int64 min_measurement_count = 3; + + // The hyper-parameter name used in the tuning job that stands for learning + // rate. Leave it blank if learning rate is not in a parameter in tuning. + // The learning_rate is used to estimate the objective value of the ongoing + // trial. + string learning_rate_parameter_name = 4; + + // This bool determines whether or not the rule is applied based on + // elapsed_secs or steps. If use_elapsed_duration==false, the early stopping + // decision is made according to the predicted objective values according to + // the target steps. If use_elapsed_duration==true, elapsed_secs is used + // instead of steps. Also, in this case, the parameters max_num_steps and + // min_num_steps are overloaded to contain max_elapsed_seconds and + // min_elapsed_seconds. + bool use_elapsed_duration = 5; + } + + // Configuration for ConvexStopPolicy. + message ConvexStopConfig { + option deprecated = true; + + // Steps used in predicting the final objective for early stopped trials. In + // general, it's set to be the same as the defined steps in training / + // tuning. When use_steps is false, this field is set to the maximum elapsed + // seconds. + int64 max_num_steps = 1; + + // Minimum number of steps for a trial to complete. Trials which do not have + // a measurement with num_steps > min_num_steps won't be considered for + // early stopping. It's ok to set it to 0, and a trial can be early stopped + // at any stage. By default, min_num_steps is set to be one-tenth of the + // max_num_steps. + // When use_steps is false, this field is set to the minimum elapsed + // seconds. + int64 min_num_steps = 2; + + // The number of Trial measurements used in autoregressive model for + // value prediction. A trial won't be considered early stopping if has fewer + // measurement points. + int64 autoregressive_order = 3; + + // The hyper-parameter name used in the tuning job that stands for learning + // rate. Leave it blank if learning rate is not in a parameter in tuning. + // The learning_rate is used to estimate the objective value of the ongoing + // trial. + string learning_rate_parameter_name = 4; + + // This bool determines whether or not the rule is applied based on + // elapsed_secs or steps. If use_seconds==false, the early stopping decision + // is made according to the predicted objective values according to the + // target steps. If use_seconds==true, elapsed_secs is used instead of + // steps. Also, in this case, the parameters max_num_steps and min_num_steps + // are overloaded to contain max_elapsed_seconds and min_elapsed_seconds. + bool use_seconds = 5; + } + + // The available search algorithms for the Study. + enum Algorithm { + // The default algorithm used by Vertex AI for [hyperparameter + // tuning](https://cloud.google.com/vertex-ai/docs/training/hyperparameter-tuning-overview) + // and [Vertex AI Vizier](https://cloud.google.com/vertex-ai/docs/vizier). + ALGORITHM_UNSPECIFIED = 0; + + // Simple grid search within the feasible space. To use grid search, + // all parameters must be `INTEGER`, `CATEGORICAL`, or `DISCRETE`. + GRID_SEARCH = 2; + + // Simple random search within the feasible space. + RANDOM_SEARCH = 3; + } + + // Describes the noise level of the repeated observations. + // + // "Noisy" means that the repeated observations with the same Trial parameters + // may lead to different metric evaluations. + enum ObservationNoise { + // The default noise level chosen by Vertex AI. + OBSERVATION_NOISE_UNSPECIFIED = 0; + + // Vertex AI assumes that the objective function is (nearly) + // perfectly reproducible, and will never repeat the same Trial + // parameters. + LOW = 1; + + // Vertex AI will estimate the amount of noise in metric + // evaluations, it may repeat the same Trial parameters more than once. + HIGH = 2; + } + + // This indicates which measurement to use if/when the service automatically + // selects the final measurement from previously reported intermediate + // measurements. Choose this based on two considerations: + // A) Do you expect your measurements to monotonically improve? + // If so, choose LAST_MEASUREMENT. On the other hand, if you're in a + // situation where your system can "over-train" and you expect the + // performance to get better for a while but then start declining, + // choose BEST_MEASUREMENT. + // B) Are your measurements significantly noisy and/or irreproducible? + // If so, BEST_MEASUREMENT will tend to be over-optimistic, and it + // may be better to choose LAST_MEASUREMENT. + // If both or neither of (A) and (B) apply, it doesn't matter which + // selection type is chosen. + enum MeasurementSelectionType { + // Will be treated as LAST_MEASUREMENT. + MEASUREMENT_SELECTION_TYPE_UNSPECIFIED = 0; + + // Use the last measurement reported. + LAST_MEASUREMENT = 1; + + // Use the best measurement reported. + BEST_MEASUREMENT = 2; + } + + oneof automated_stopping_spec { + // The automated early stopping spec using decay curve rule. + DecayCurveAutomatedStoppingSpec decay_curve_stopping_spec = 4; + + // The automated early stopping spec using median rule. + MedianAutomatedStoppingSpec median_automated_stopping_spec = 5; + + // Deprecated. + // The automated early stopping using convex stopping rule. + ConvexStopConfig convex_stop_config = 8 [deprecated = true]; + + // The automated early stopping spec using convex stopping rule. + ConvexAutomatedStoppingSpec convex_automated_stopping_spec = 9; + } + + // Required. Metric specs for the Study. + repeated MetricSpec metrics = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The set of parameters to tune. + repeated ParameterSpec parameters = 2 [(google.api.field_behavior) = REQUIRED]; + + // The search algorithm specified for the Study. + Algorithm algorithm = 3; + + // The observation noise level of the study. + // Currently only supported by the Vertex AI Vizier service. Not supported by + // HyperparamterTuningJob or TrainingPipeline. + ObservationNoise observation_noise = 6; + + // Describe which measurement selection type will be used + MeasurementSelectionType measurement_selection_type = 7; +} + +// A message representing a Measurement of a Trial. A Measurement contains +// the Metrics got by executing a Trial using suggested hyperparameter +// values. +message Measurement { + // A message representing a metric in the measurement. + message Metric { + // Output only. The ID of the Metric. The Metric should be defined in + // [StudySpec's Metrics][google.cloud.aiplatform.v1beta1.StudySpec.metrics]. + string metric_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The value for this metric. + double value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Time that the Trial has been running at the point of this Measurement. + google.protobuf.Duration elapsed_duration = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of steps the machine learning model has been trained for. + // Must be non-negative. + int64 step_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A list of metrics got by evaluating the objective functions using suggested + // Parameter values. + repeated Metric metrics = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto new file mode 100644 index 00000000..640e636e --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto @@ -0,0 +1,86 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "TensorboardProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Tensorboard is a physical database that stores users' training metrics. +// A default Tensorboard is provided in each region of a GCP project. +// If needed users can also create extra Tensorboards in their projects. +message Tensorboard { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Tensorboard" + pattern: "projects/{project}/locations/{location}/tensorboards/{tensorboard}" + }; + + // Output only. Name of the Tensorboard. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. User provided name of this Tensorboard. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Description of this Tensorboard. + string description = 3; + + // Customer-managed encryption key spec for a Tensorboard. If set, this + // Tensorboard and all sub-resources of this Tensorboard will be secured by + // this key. + EncryptionSpec encryption_spec = 11; + + // Output only. Consumer project Cloud Storage path prefix used to store blob data, which + // can either be a bucket or directory. Does not end with a '/'. + string blob_storage_path_prefix = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of Runs stored in this Tensorboard. + int32 run_count = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Tensorboard was created. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this Tensorboard was last updated. + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize your Tensorboards. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one Tensorboard + // (System labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. + map labels = 8; + + // Used to perform a consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 9; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto new file mode 100644 index 00000000..cfc36e30 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto @@ -0,0 +1,101 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "TensorboardDataProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// All the data stored in a TensorboardTimeSeries. +message TimeSeriesData { + // Required. The ID of the TensorboardTimeSeries, which will become the final component + // of the TensorboardTimeSeries' resource name + string tensorboard_time_series_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Immutable. The value type of this time series. All the values in this time series data + // must match this value type. + TensorboardTimeSeries.ValueType value_type = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Data points in this time series. + repeated TimeSeriesDataPoint values = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A TensorboardTimeSeries data point. +message TimeSeriesDataPoint { + // Value of this time series data point. + oneof value { + // A scalar value. + Scalar scalar = 3; + + // A tensor value. + TensorboardTensor tensor = 4; + + // A blob sequence value. + TensorboardBlobSequence blobs = 5; + } + + // Wall clock timestamp when this data point is generated by the end user. + google.protobuf.Timestamp wall_time = 1; + + // Step index of this data point within the run. + int64 step = 2; +} + +// One point viewable on a scalar metric plot. +message Scalar { + // Value of the point at this step / timestamp. + double value = 1; +} + +// One point viewable on a tensor metric plot. +message TensorboardTensor { + // Required. Serialized form of + // https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/tensor.proto + bytes value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Version number of TensorProto used to serialize [value][google.cloud.aiplatform.v1beta1.TensorboardTensor.value]. + int32 version_number = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// One point viewable on a blob metric plot, but mostly just a wrapper message +// to work around repeated fields can't be used directly within `oneof` fields. +message TensorboardBlobSequence { + // List of blobs contained within the sequence. + repeated TensorboardBlob values = 1; +} + +// One blob (e.g, image, graph) viewable on a blob metric plot. +message TensorboardBlob { + // Output only. A URI safe key uniquely identifying a blob. Can be used to locate the blob + // stored in the Cloud Storage bucket of the consumer project. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The bytes of the blob is not present unless it's returned by the + // ReadTensorboardBlobData endpoint. + bytes data = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto new file mode 100644 index 00000000..0258ef6d --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto @@ -0,0 +1,78 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "TensorboardExperimentProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A TensorboardExperiment is a group of TensorboardRuns, that are typically the +// results of a training job run, in a Tensorboard. +message TensorboardExperiment { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/TensorboardExperiment" + pattern: "projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}" + }; + + // Output only. Name of the TensorboardExperiment. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User provided name of this TensorboardExperiment. + string display_name = 2; + + // Description of this TensorboardExperiment. + string description = 3; + + // Output only. Timestamp when this TensorboardExperiment was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this TensorboardExperiment was last updated. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize your Datasets. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one Dataset (System + // labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. Following system labels exist for each Dataset: + // * "aiplatform.googleapis.com/dataset_metadata_schema": + // - output only, its value is the + // [metadata_schema's][metadata_schema_uri] title. + map labels = 6; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 7; + + // Immutable. Source of the TensorboardExperiment. Example: a custom training job. + string source = 8 [(google.api.field_behavior) = IMMUTABLE]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto new file mode 100644 index 00000000..b5f570c8 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto @@ -0,0 +1,81 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "TensorboardRunProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// TensorboardRun maps to a specific execution of a training job with a given +// set of hyperparameter values, model definition, dataset, etc +message TensorboardRun { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/TensorboardRun" + pattern: "projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}" + }; + + // Output only. Name of the TensorboardRun. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. User provided name of this TensorboardRun. + // This value must be unique among all TensorboardRuns + // belonging to the same parent TensorboardExperiment. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Description of this TensorboardRun. + string description = 3; + + // Output only. Timestamp when this TensorboardRun was created. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this TensorboardRun was last updated. + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize your TensorboardRuns. + // + // This field will be used to filter and visualize Runs in the Tensorboard UI. + // For example, a Vertex AI training job can set a label + // aiplatform.googleapis.com/training_job_id=xxxxx to all the runs created + // within that job. An end user can set a label experiment_id=xxxxx for all + // the runs produced in a Jupyter notebook. These runs can be grouped by a + // label value and visualized together in the Tensorboard UI. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one TensorboardRun + // (System labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with "aiplatform.googleapis.com/" + // and are immutable. + map labels = 8; + + // Used to perform a consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 9; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto new file mode 100644 index 00000000..629e5d79 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto @@ -0,0 +1,1004 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/operation.proto"; +import "google/cloud/aiplatform/v1beta1/tensorboard.proto"; +import "google/cloud/aiplatform/v1beta1/tensorboard_data.proto"; +import "google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto"; +import "google/cloud/aiplatform/v1beta1/tensorboard_run.proto"; +import "google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "TensorboardServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// TensorboardService +service TensorboardService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a Tensorboard. + rpc CreateTensorboard(CreateTensorboardRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/tensorboards" + body: "tensorboard" + }; + option (google.api.method_signature) = "parent,tensorboard"; + option (google.longrunning.operation_info) = { + response_type: "Tensorboard" + metadata_type: "CreateTensorboardOperationMetadata" + }; + } + + // Gets a Tensorboard. + rpc GetTensorboard(GetTensorboardRequest) returns (Tensorboard) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/tensorboards/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a Tensorboard. + rpc UpdateTensorboard(UpdateTensorboardRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{tensorboard.name=projects/*/locations/*/tensorboards/*}" + body: "tensorboard" + }; + option (google.api.method_signature) = "tensorboard,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Tensorboard" + metadata_type: "UpdateTensorboardOperationMetadata" + }; + } + + // Lists Tensorboards in a Location. + rpc ListTensorboards(ListTensorboardsRequest) returns (ListTensorboardsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/tensorboards" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a Tensorboard. + rpc DeleteTensorboard(DeleteTensorboardRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/tensorboards/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Creates a TensorboardExperiment. + rpc CreateTensorboardExperiment(CreateTensorboardExperimentRequest) returns (TensorboardExperiment) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/tensorboards/*}/experiments" + body: "tensorboard_experiment" + }; + option (google.api.method_signature) = "parent,tensorboard_experiment,tensorboard_experiment_id"; + } + + // Gets a TensorboardExperiment. + rpc GetTensorboardExperiment(GetTensorboardExperimentRequest) returns (TensorboardExperiment) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a TensorboardExperiment. + rpc UpdateTensorboardExperiment(UpdateTensorboardExperimentRequest) returns (TensorboardExperiment) { + option (google.api.http) = { + patch: "/v1beta1/{tensorboard_experiment.name=projects/*/locations/*/tensorboards/*/experiments/*}" + body: "tensorboard_experiment" + }; + option (google.api.method_signature) = "tensorboard_experiment,update_mask"; + } + + // Lists TensorboardExperiments in a Location. + rpc ListTensorboardExperiments(ListTensorboardExperimentsRequest) returns (ListTensorboardExperimentsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/tensorboards/*}/experiments" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a TensorboardExperiment. + rpc DeleteTensorboardExperiment(DeleteTensorboardExperimentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Creates a TensorboardRun. + rpc CreateTensorboardRun(CreateTensorboardRunRequest) returns (TensorboardRun) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs" + body: "tensorboard_run" + }; + option (google.api.method_signature) = "parent,tensorboard_run,tensorboard_run_id"; + } + + // Batch create TensorboardRuns. + rpc BatchCreateTensorboardRuns(BatchCreateTensorboardRunsRequest) returns (BatchCreateTensorboardRunsResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs:batchCreate" + body: "*" + }; + option (google.api.method_signature) = "parent,requests"; + } + + // Gets a TensorboardRun. + rpc GetTensorboardRun(GetTensorboardRunRequest) returns (TensorboardRun) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a TensorboardRun. + rpc UpdateTensorboardRun(UpdateTensorboardRunRequest) returns (TensorboardRun) { + option (google.api.http) = { + patch: "/v1beta1/{tensorboard_run.name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}" + body: "tensorboard_run" + }; + option (google.api.method_signature) = "tensorboard_run,update_mask"; + } + + // Lists TensorboardRuns in a Location. + rpc ListTensorboardRuns(ListTensorboardRunsRequest) returns (ListTensorboardRunsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a TensorboardRun. + rpc DeleteTensorboardRun(DeleteTensorboardRunRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Batch create TensorboardTimeSeries that belong to a TensorboardExperiment. + rpc BatchCreateTensorboardTimeSeries(BatchCreateTensorboardTimeSeriesRequest) returns (BatchCreateTensorboardTimeSeriesResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs/*/timeSeries:batchCreate" + body: "*" + }; + option (google.api.method_signature) = "parent,requests"; + } + + // Creates a TensorboardTimeSeries. + rpc CreateTensorboardTimeSeries(CreateTensorboardTimeSeriesRequest) returns (TensorboardTimeSeries) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/timeSeries" + body: "tensorboard_time_series" + }; + option (google.api.method_signature) = "parent,tensorboard_time_series"; + } + + // Gets a TensorboardTimeSeries. + rpc GetTensorboardTimeSeries(GetTensorboardTimeSeriesRequest) returns (TensorboardTimeSeries) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a TensorboardTimeSeries. + rpc UpdateTensorboardTimeSeries(UpdateTensorboardTimeSeriesRequest) returns (TensorboardTimeSeries) { + option (google.api.http) = { + patch: "/v1beta1/{tensorboard_time_series.name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}" + body: "tensorboard_time_series" + }; + option (google.api.method_signature) = "tensorboard_time_series,update_mask"; + } + + // Lists TensorboardTimeSeries in a Location. + rpc ListTensorboardTimeSeries(ListTensorboardTimeSeriesRequest) returns (ListTensorboardTimeSeriesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/timeSeries" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a TensorboardTimeSeries. + rpc DeleteTensorboardTimeSeries(DeleteTensorboardTimeSeriesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Reads multiple TensorboardTimeSeries' data. The data point number limit is + // 1000 for scalars, 100 for tensors and blob references. If the number of + // data points stored is less than the limit, all data will be returned. + // Otherwise, that limit number of data points will be randomly selected from + // this time series and returned. + rpc BatchReadTensorboardTimeSeriesData(BatchReadTensorboardTimeSeriesDataRequest) returns (BatchReadTensorboardTimeSeriesDataResponse) { + option (google.api.http) = { + get: "/v1beta1/{tensorboard=projects/*/locations/*/tensorboards/*}/experiments/*/runs/*/timeSeries:batchRead" + }; + option (google.api.method_signature) = "tensorboard"; + } + + // Reads a TensorboardTimeSeries' data. By default, if the number of data + // points stored is less than 1000, all data will be returned. Otherwise, 1000 + // data points will be randomly selected from this time series and returned. + // This value can be changed by changing max_data_points, which can't be + // greater than 10k. + rpc ReadTensorboardTimeSeriesData(ReadTensorboardTimeSeriesDataRequest) returns (ReadTensorboardTimeSeriesDataResponse) { + option (google.api.http) = { + get: "/v1beta1/{tensorboard_time_series=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}:read" + }; + option (google.api.method_signature) = "tensorboard_time_series"; + } + + // Gets bytes of TensorboardBlobs. + // This is to allow reading blob data stored in consumer project's Cloud + // Storage bucket without users having to obtain Cloud Storage access + // permission. + rpc ReadTensorboardBlobData(ReadTensorboardBlobDataRequest) returns (stream ReadTensorboardBlobDataResponse) { + option (google.api.http) = { + get: "/v1beta1/{time_series=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}:readBlobData" + }; + option (google.api.method_signature) = "time_series"; + } + + // Write time series data points of multiple TensorboardTimeSeries in multiple + // TensorboardRun's. If any data fail to be ingested, an error will be + // returned. + rpc WriteTensorboardExperimentData(WriteTensorboardExperimentDataRequest) returns (WriteTensorboardExperimentDataResponse) { + option (google.api.http) = { + post: "/v1beta1/{tensorboard_experiment=projects/*/locations/*/tensorboards/*/experiments/*}:write" + body: "*" + }; + option (google.api.method_signature) = "tensorboard_experiment,write_run_data_requests"; + } + + // Write time series data points into multiple TensorboardTimeSeries under + // a TensorboardRun. If any data fail to be ingested, an error will be + // returned. + rpc WriteTensorboardRunData(WriteTensorboardRunDataRequest) returns (WriteTensorboardRunDataResponse) { + option (google.api.http) = { + post: "/v1beta1/{tensorboard_run=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}:write" + body: "*" + }; + option (google.api.method_signature) = "tensorboard_run,time_series_data"; + } + + // Exports a TensorboardTimeSeries' data. Data is returned in paginated + // responses. + rpc ExportTensorboardTimeSeriesData(ExportTensorboardTimeSeriesDataRequest) returns (ExportTensorboardTimeSeriesDataResponse) { + option (google.api.http) = { + post: "/v1beta1/{tensorboard_time_series=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}:exportTensorboardTimeSeries" + body: "*" + }; + option (google.api.method_signature) = "tensorboard_time_series"; + } +} + +// Request message for [TensorboardService.CreateTensorboard][google.cloud.aiplatform.v1beta1.TensorboardService.CreateTensorboard]. +message CreateTensorboardRequest { + // Required. The resource name of the Location to create the Tensorboard in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Tensorboard" + } + ]; + + // Required. The Tensorboard to create. + Tensorboard tensorboard = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [TensorboardService.GetTensorboard][google.cloud.aiplatform.v1beta1.TensorboardService.GetTensorboard]. +message GetTensorboardRequest { + // Required. The name of the Tensorboard resource. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Tensorboard" + } + ]; +} + +// Request message for [TensorboardService.ListTensorboards][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards]. +message ListTensorboardsRequest { + // Required. The resource name of the Location to list Tensorboards. + // Format: + // `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/Tensorboard" + } + ]; + + // Lists the Tensorboards that match the filter expression. + string filter = 2; + + // The maximum number of Tensorboards to return. The service may return + // fewer than this value. If unspecified, at most 100 Tensorboards will be + // returned. The maximum value is 100; values above 100 will be coerced to + // 100. + int32 page_size = 3; + + // A page token, received from a previous + // [TensorboardService.ListTensorboards][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [TensorboardService.ListTensorboards][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards] must + // match the call that provided the page token. + string page_token = 4; + + // Field to use to sort the list. + string order_by = 5; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 6; +} + +// Response message for [TensorboardService.ListTensorboards][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards]. +message ListTensorboardsResponse { + // The Tensorboards mathching the request. + repeated Tensorboard tensorboards = 1; + + // A token, which can be sent as [ListTensorboardsRequest.page_token][google.cloud.aiplatform.v1beta1.ListTensorboardsRequest.page_token] + // to retrieve the next page. If this field is omitted, there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for [TensorboardService.UpdateTensorboard][google.cloud.aiplatform.v1beta1.TensorboardService.UpdateTensorboard]. +message UpdateTensorboardRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // Tensorboard resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten if new + // values are specified. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Tensorboard's `name` field is used to identify the + // Tensorboard to be updated. Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + Tensorboard tensorboard = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [TensorboardService.DeleteTensorboard][google.cloud.aiplatform.v1beta1.TensorboardService.DeleteTensorboard]. +message DeleteTensorboardRequest { + // Required. The name of the Tensorboard to be deleted. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Tensorboard" + } + ]; +} + +// Request message for [TensorboardService.CreateTensorboardExperiment][google.cloud.aiplatform.v1beta1.TensorboardService.CreateTensorboardExperiment]. +message CreateTensorboardExperimentRequest { + // Required. The resource name of the Tensorboard to create the TensorboardExperiment + // in. Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardExperiment" + } + ]; + + // The TensorboardExperiment to create. + TensorboardExperiment tensorboard_experiment = 2; + + // Required. The ID to use for the Tensorboard experiment, which will become the final + // component of the Tensorboard experiment's resource name. + // + // This value should be 1-128 characters, and valid characters + // are /[a-z][0-9]-/. + string tensorboard_experiment_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [TensorboardService.GetTensorboardExperiment][google.cloud.aiplatform.v1beta1.TensorboardService.GetTensorboardExperiment]. +message GetTensorboardExperimentRequest { + // Required. The name of the TensorboardExperiment resource. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardExperiment" + } + ]; +} + +// Request message for [TensorboardService.ListTensorboardExperiments][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments]. +message ListTensorboardExperimentsRequest { + // Required. The resource name of the Tensorboard to list TensorboardExperiments. + // Format: + // 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/TensorboardExperiment" + } + ]; + + // Lists the TensorboardExperiments that match the filter expression. + string filter = 2; + + // The maximum number of TensorboardExperiments to return. The service may + // return fewer than this value. If unspecified, at most 50 + // TensorboardExperiments will be returned. The maximum value is 1000; values + // above 1000 will be coerced to 1000. + int32 page_size = 3; + + // A page token, received from a previous + // [TensorboardService.ListTensorboardExperiments][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [TensorboardService.ListTensorboardExperiments][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments] must + // match the call that provided the page token. + string page_token = 4; + + // Field to use to sort the list. + string order_by = 5; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 6; +} + +// Response message for [TensorboardService.ListTensorboardExperiments][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments]. +message ListTensorboardExperimentsResponse { + // The TensorboardExperiments mathching the request. + repeated TensorboardExperiment tensorboard_experiments = 1; + + // A token, which can be sent as + // [ListTensorboardExperimentsRequest.page_token][google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest.page_token] to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [TensorboardService.UpdateTensorboardExperiment][google.cloud.aiplatform.v1beta1.TensorboardService.UpdateTensorboardExperiment]. +message UpdateTensorboardExperimentRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // TensorboardExperiment resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten if new + // values are specified. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The TensorboardExperiment's `name` field is used to identify the + // TensorboardExperiment to be updated. Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + TensorboardExperiment tensorboard_experiment = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [TensorboardService.DeleteTensorboardExperiment][google.cloud.aiplatform.v1beta1.TensorboardService.DeleteTensorboardExperiment]. +message DeleteTensorboardExperimentRequest { + // Required. The name of the TensorboardExperiment to be deleted. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardExperiment" + } + ]; +} + +// Request message for [TensorboardService.BatchCreateTensorboardRuns][google.cloud.aiplatform.v1beta1.TensorboardService.BatchCreateTensorboardRuns]. +message BatchCreateTensorboardRunsRequest { + // Required. The resource name of the TensorboardExperiment to create the + // TensorboardRuns in. Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + // The parent field in the CreateTensorboardRunRequest messages must match + // this field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardExperiment" + } + ]; + + // Required. The request message specifying the TensorboardRuns to create. + // A maximum of 1000 TensorboardRuns can be created in a batch. + repeated CreateTensorboardRunRequest requests = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [TensorboardService.BatchCreateTensorboardRuns][google.cloud.aiplatform.v1beta1.TensorboardService.BatchCreateTensorboardRuns]. +message BatchCreateTensorboardRunsResponse { + // The created TensorboardRuns. + repeated TensorboardRun tensorboard_runs = 1; +} + +// Request message for [TensorboardService.CreateTensorboardRun][google.cloud.aiplatform.v1beta1.TensorboardService.CreateTensorboardRun]. +message CreateTensorboardRunRequest { + // Required. The resource name of the TensorboardExperiment to create the TensorboardRun + // in. Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardRun" + } + ]; + + // Required. The TensorboardRun to create. + TensorboardRun tensorboard_run = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the Tensorboard run, which will become the final + // component of the Tensorboard run's resource name. + // + // This value should be 1-128 characters, and valid characters + // are /[a-z][0-9]-/. + string tensorboard_run_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [TensorboardService.GetTensorboardRun][google.cloud.aiplatform.v1beta1.TensorboardService.GetTensorboardRun]. +message GetTensorboardRunRequest { + // Required. The name of the TensorboardRun resource. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardRun" + } + ]; +} + +// Request message for [TensorboardService.ReadTensorboardBlobData][google.cloud.aiplatform.v1beta1.TensorboardService.ReadTensorboardBlobData]. +message ReadTensorboardBlobDataRequest { + // Required. The resource name of the TensorboardTimeSeries to list Blobs. + // Format: + // 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + string time_series = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardTimeSeries" + } + ]; + + // IDs of the blobs to read. + repeated string blob_ids = 2; +} + +// Response message for [TensorboardService.ReadTensorboardBlobData][google.cloud.aiplatform.v1beta1.TensorboardService.ReadTensorboardBlobData]. +message ReadTensorboardBlobDataResponse { + // Blob messages containing blob bytes. + repeated TensorboardBlob blobs = 1; +} + +// Request message for [TensorboardService.ListTensorboardRuns][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns]. +message ListTensorboardRunsRequest { + // Required. The resource name of the TensorboardExperiment to list TensorboardRuns. + // Format: + // 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/TensorboardRun" + } + ]; + + // Lists the TensorboardRuns that match the filter expression. + string filter = 2; + + // The maximum number of TensorboardRuns to return. The service may return + // fewer than this value. If unspecified, at most 50 TensorboardRuns will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 3; + + // A page token, received from a previous + // [TensorboardService.ListTensorboardRuns][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [TensorboardService.ListTensorboardRuns][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns] must + // match the call that provided the page token. + string page_token = 4; + + // Field to use to sort the list. + string order_by = 5; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 6; +} + +// Response message for [TensorboardService.ListTensorboardRuns][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns]. +message ListTensorboardRunsResponse { + // The TensorboardRuns mathching the request. + repeated TensorboardRun tensorboard_runs = 1; + + // A token, which can be sent as [ListTensorboardRunsRequest.page_token][google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest.page_token] to + // retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [TensorboardService.UpdateTensorboardRun][google.cloud.aiplatform.v1beta1.TensorboardService.UpdateTensorboardRun]. +message UpdateTensorboardRunRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // TensorboardRun resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten if new + // values are specified. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The TensorboardRun's `name` field is used to identify the TensorboardRun to + // be updated. Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + TensorboardRun tensorboard_run = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [TensorboardService.DeleteTensorboardRun][google.cloud.aiplatform.v1beta1.TensorboardService.DeleteTensorboardRun]. +message DeleteTensorboardRunRequest { + // Required. The name of the TensorboardRun to be deleted. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardRun" + } + ]; +} + +// Request message for [TensorboardService.BatchCreateTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.BatchCreateTensorboardTimeSeries]. +message BatchCreateTensorboardTimeSeriesRequest { + // Required. The resource name of the TensorboardExperiment to create the + // TensorboardTimeSeries in. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + // The TensorboardRuns referenced by the parent fields in the + // CreateTensorboardTimeSeriesRequest messages must be sub resources of this + // TensorboardExperiment. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardExperiment" + } + ]; + + // Required. The request message specifying the TensorboardTimeSeries to create. + // A maximum of 1000 TensorboardTimeSeries can be created in a batch. + repeated CreateTensorboardTimeSeriesRequest requests = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [TensorboardService.BatchCreateTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.BatchCreateTensorboardTimeSeries]. +message BatchCreateTensorboardTimeSeriesResponse { + // The created TensorboardTimeSeries. + repeated TensorboardTimeSeries tensorboard_time_series = 1; +} + +// Request message for [TensorboardService.CreateTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.CreateTensorboardTimeSeries]. +message CreateTensorboardTimeSeriesRequest { + // Required. The resource name of the TensorboardRun to create the + // TensorboardTimeSeries in. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardTimeSeries" + } + ]; + + // Optional. The user specified unique ID to use for the TensorboardTimeSeries, which + // will become the final component of the TensorboardTimeSeries's resource + // name. + // This value should match "[a-z0-9][a-z0-9-]{0, 127}" + string tensorboard_time_series_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The TensorboardTimeSeries to create. + TensorboardTimeSeries tensorboard_time_series = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [TensorboardService.GetTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.GetTensorboardTimeSeries]. +message GetTensorboardTimeSeriesRequest { + // Required. The name of the TensorboardTimeSeries resource. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardTimeSeries" + } + ]; +} + +// Request message for [TensorboardService.ListTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries]. +message ListTensorboardTimeSeriesRequest { + // Required. The resource name of the TensorboardRun to list TensorboardTimeSeries. + // Format: + // 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/TensorboardTimeSeries" + } + ]; + + // Lists the TensorboardTimeSeries that match the filter expression. + string filter = 2; + + // The maximum number of TensorboardTimeSeries to return. The service may + // return fewer than this value. If unspecified, at most 50 + // TensorboardTimeSeries will be returned. The maximum value is 1000; values + // above 1000 will be coerced to 1000. + int32 page_size = 3; + + // A page token, received from a previous + // [TensorboardService.ListTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [TensorboardService.ListTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries] must + // match the call that provided the page token. + string page_token = 4; + + // Field to use to sort the list. + string order_by = 5; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 6; +} + +// Response message for [TensorboardService.ListTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries]. +message ListTensorboardTimeSeriesResponse { + // The TensorboardTimeSeries mathching the request. + repeated TensorboardTimeSeries tensorboard_time_series = 1; + + // A token, which can be sent as + // [ListTensorboardTimeSeriesRequest.page_token][google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest.page_token] to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for [TensorboardService.UpdateTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.UpdateTensorboardTimeSeries]. +message UpdateTensorboardTimeSeriesRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // TensorboardTimeSeries resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten if new + // values are specified. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The TensorboardTimeSeries' `name` field is used to identify the + // TensorboardTimeSeries to be updated. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + TensorboardTimeSeries tensorboard_time_series = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [TensorboardService.DeleteTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.DeleteTensorboardTimeSeries]. +message DeleteTensorboardTimeSeriesRequest { + // Required. The name of the TensorboardTimeSeries to be deleted. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardTimeSeries" + } + ]; +} + +// Request message for +// [TensorboardService.BatchReadTensorboardTimeSeriesData][google.cloud.aiplatform.v1beta1.TensorboardService.BatchReadTensorboardTimeSeriesData]. +message BatchReadTensorboardTimeSeriesDataRequest { + // Required. The resource name of the Tensorboard containing TensorboardTimeSeries to + // read data from. Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}`. + // The TensorboardTimeSeries referenced by [time_series][google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataRequest.time_series] must be sub + // resources of this Tensorboard. + string tensorboard = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Tensorboard" + } + ]; + + // Required. The resource names of the TensorboardTimeSeries to read data from. Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + repeated string time_series = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardTimeSeries" + } + ]; +} + +// Response message for +// [TensorboardService.BatchReadTensorboardTimeSeriesData][google.cloud.aiplatform.v1beta1.TensorboardService.BatchReadTensorboardTimeSeriesData]. +message BatchReadTensorboardTimeSeriesDataResponse { + // The returned time series data. + repeated TimeSeriesData time_series_data = 1; +} + +// Request message for [TensorboardService.ReadTensorboardTimeSeriesData][google.cloud.aiplatform.v1beta1.TensorboardService.ReadTensorboardTimeSeriesData]. +message ReadTensorboardTimeSeriesDataRequest { + // Required. The resource name of the TensorboardTimeSeries to read data from. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + string tensorboard_time_series = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardTimeSeries" + } + ]; + + // The maximum number of TensorboardTimeSeries' data to return. + // + // This value should be a positive integer. + // This value can be set to -1 to return all data. + int32 max_data_points = 2; + + // Reads the TensorboardTimeSeries' data that match the filter expression. + string filter = 3; +} + +// Response message for [TensorboardService.ReadTensorboardTimeSeriesData][google.cloud.aiplatform.v1beta1.TensorboardService.ReadTensorboardTimeSeriesData]. +message ReadTensorboardTimeSeriesDataResponse { + // The returned time series data. + TimeSeriesData time_series_data = 1; +} + +// Request message for [TensorboardService.WriteTensorboardExperimentData][google.cloud.aiplatform.v1beta1.TensorboardService.WriteTensorboardExperimentData]. +message WriteTensorboardExperimentDataRequest { + // Required. The resource name of the TensorboardExperiment to write data to. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + string tensorboard_experiment = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardExperiment" + } + ]; + + // Required. Requests containing per-run TensorboardTimeSeries data to write. + repeated WriteTensorboardRunDataRequest write_run_data_requests = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [TensorboardService.WriteTensorboardExperimentData][google.cloud.aiplatform.v1beta1.TensorboardService.WriteTensorboardExperimentData]. +message WriteTensorboardExperimentDataResponse { + +} + +// Request message for [TensorboardService.WriteTensorboardRunData][google.cloud.aiplatform.v1beta1.TensorboardService.WriteTensorboardRunData]. +message WriteTensorboardRunDataRequest { + // Required. The resource name of the TensorboardRun to write data to. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + string tensorboard_run = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardRun" + } + ]; + + // Required. The TensorboardTimeSeries data to write. + // Values with in a time series are indexed by their step value. + // Repeated writes to the same step will overwrite the existing value for that + // step. + // The upper limit of data points per write request is 5000. + repeated TimeSeriesData time_series_data = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [TensorboardService.WriteTensorboardRunData][google.cloud.aiplatform.v1beta1.TensorboardService.WriteTensorboardRunData]. +message WriteTensorboardRunDataResponse { + +} + +// Request message for [TensorboardService.ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData]. +message ExportTensorboardTimeSeriesDataRequest { + // Required. The resource name of the TensorboardTimeSeries to export data from. + // Format: + // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + string tensorboard_time_series = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/TensorboardTimeSeries" + } + ]; + + // Exports the TensorboardTimeSeries' data that match the filter expression. + string filter = 2; + + // The maximum number of data points to return per page. + // The default page_size will be 1000. Values must be between 1 and 10000. + // Values above 10000 will be coerced to 10000. + int32 page_size = 3; + + // A page token, received from a previous + // [TensorboardService.ExportTensorboardTimeSeries][] call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [TensorboardService.ExportTensorboardTimeSeries][] must + // match the call that provided the page token. + string page_token = 4; + + // Field to use to sort the TensorboardTimeSeries' data. + // By default, TensorboardTimeSeries' data will be returned in a pseudo random + // order. + string order_by = 5; +} + +// Response message for [TensorboardService.ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData]. +message ExportTensorboardTimeSeriesDataResponse { + // The returned time series data points. + repeated TimeSeriesDataPoint time_series_data_points = 1; + + // A token, which can be sent as + // [ExportTensorboardTimeSeriesRequest.page_token][] to retrieve the next + // page. If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Details of operations that perform create Tensorboard. +message CreateTensorboardOperationMetadata { + // Operation metadata for Tensorboard. + GenericOperationMetadata generic_metadata = 1; +} + +// Details of operations that perform update Tensorboard. +message UpdateTensorboardOperationMetadata { + // Operation metadata for Tensorboard. + GenericOperationMetadata generic_metadata = 1; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto new file mode 100644 index 00000000..6e202a6e --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto @@ -0,0 +1,106 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "TensorboardTimeSeriesProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// TensorboardTimeSeries maps to times series produced in training runs +message TensorboardTimeSeries { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/TensorboardTimeSeries" + pattern: "projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}" + }; + + // Describes metadata for a TensorboardTimeSeries. + message Metadata { + // Output only. Max step index of all data points within a TensorboardTimeSeries. + int64 max_step = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Max wall clock timestamp of all data points within a + // TensorboardTimeSeries. + google.protobuf.Timestamp max_wall_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The largest blob sequence length (number of blobs) of all data points in + // this time series, if its ValueType is BLOB_SEQUENCE. + int64 max_blob_sequence_length = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // An enum representing the value type of a TensorboardTimeSeries. + enum ValueType { + // The value type is unspecified. + VALUE_TYPE_UNSPECIFIED = 0; + + // Used for TensorboardTimeSeries that is a list of scalars. + // E.g. accuracy of a model over epochs/time. + SCALAR = 1; + + // Used for TensorboardTimeSeries that is a list of tensors. + // E.g. histograms of weights of layer in a model over epoch/time. + TENSOR = 2; + + // Used for TensorboardTimeSeries that is a list of blob sequences. + // E.g. set of sample images with labels over epochs/time. + BLOB_SEQUENCE = 3; + } + + // Output only. Name of the TensorboardTimeSeries. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. User provided name of this TensorboardTimeSeries. + // This value should be unique among all TensorboardTimeSeries resources + // belonging to the same TensorboardRun resource (parent resource). + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Description of this TensorboardTimeSeries. + string description = 3; + + // Required. Immutable. Type of TensorboardTimeSeries value. + ValueType value_type = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Timestamp when this TensorboardTimeSeries was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this TensorboardTimeSeries was last updated. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Used to perform a consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 7; + + // Immutable. Name of the plugin this time series pertain to. Such as Scalar, Tensor, + // Blob + string plugin_name = 8 [(google.api.field_behavior) = IMMUTABLE]; + + // Data of the current plugin, with the size limited to 65KB. + bytes plugin_data = 9; + + // Output only. Scalar, Tensor, or Blob metadata for this TensorboardTimeSeries. + Metadata metadata = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto new file mode 100644 index 00000000..c4c9225e --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto @@ -0,0 +1,399 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; +import "google/cloud/aiplatform/v1beta1/io.proto"; +import "google/cloud/aiplatform/v1beta1/model.proto"; +import "google/cloud/aiplatform/v1beta1/pipeline_state.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "TrainingPipelineProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// The TrainingPipeline orchestrates tasks associated with training a Model. It +// always executes the training task, and optionally may also +// export data from Vertex AI's Dataset which becomes the training input, +// [upload][google.cloud.aiplatform.v1beta1.ModelService.UploadModel] the Model to Vertex AI, and evaluate the +// Model. +message TrainingPipeline { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/TrainingPipeline" + pattern: "projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}" + }; + + // Output only. Resource name of the TrainingPipeline. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The user-defined name of this TrainingPipeline. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Specifies Vertex AI owned input data that may be used for training the + // Model. The TrainingPipeline's [training_task_definition][google.cloud.aiplatform.v1beta1.TrainingPipeline.training_task_definition] should make + // clear whether this config is used and if there are any special requirements + // on how it should be filled. If nothing about this config is mentioned in + // the [training_task_definition][google.cloud.aiplatform.v1beta1.TrainingPipeline.training_task_definition], then it should be assumed that the + // TrainingPipeline does not depend on this configuration. + InputDataConfig input_data_config = 3; + + // Required. A Google Cloud Storage path to the YAML file that defines the training task + // which is responsible for producing the model artifact, and may also include + // additional auxiliary work. + // The definition files that can be used here are found in + // gs://google-cloud-aiplatform/schema/trainingjob/definition/. + // Note: The URI given on output will be immutable and probably different, + // including the URI scheme, than the one given on input. The output URI will + // point to a location where the user only has a read access. + string training_task_definition = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The training task's parameter(s), as specified in the + // [training_task_definition][google.cloud.aiplatform.v1beta1.TrainingPipeline.training_task_definition]'s `inputs`. + google.protobuf.Value training_task_inputs = 5 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The metadata information as specified in the [training_task_definition][google.cloud.aiplatform.v1beta1.TrainingPipeline.training_task_definition]'s + // `metadata`. This metadata is an auxiliary runtime and final information + // about the training task. While the pipeline is running this information is + // populated only at a best effort basis. Only present if the + // pipeline's [training_task_definition][google.cloud.aiplatform.v1beta1.TrainingPipeline.training_task_definition] contains `metadata` object. + google.protobuf.Value training_task_metadata = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Describes the Model that may be uploaded (via [ModelService.UploadModel][google.cloud.aiplatform.v1beta1.ModelService.UploadModel]) + // by this TrainingPipeline. The TrainingPipeline's + // [training_task_definition][google.cloud.aiplatform.v1beta1.TrainingPipeline.training_task_definition] should make clear whether this Model + // description should be populated, and if there are any special requirements + // regarding how it should be filled. If nothing is mentioned in the + // [training_task_definition][google.cloud.aiplatform.v1beta1.TrainingPipeline.training_task_definition], then it should be assumed that this field + // should not be filled and the training task either uploads the Model without + // a need of this information, or that training task does not support + // uploading a Model as part of the pipeline. + // When the Pipeline's state becomes `PIPELINE_STATE_SUCCEEDED` and + // the trained Model had been uploaded into Vertex AI, then the + // model_to_upload's resource [name][google.cloud.aiplatform.v1beta1.Model.name] is populated. The Model + // is always uploaded into the Project and Location in which this pipeline + // is. + Model model_to_upload = 7; + + // Optional. The ID to use for the uploaded Model, which will become the final + // component of the model resource name. + // + // This value may be up to 63 characters, and valid characters are + // `[a-z0-9_-]`. The first character cannot be a number or hyphen. + string model_id = 22 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When specify this field, the `model_to_upload` will not be uploaded as a + // new model, instead, it will become a new version of this `parent_model`. + string parent_model = 21 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The detailed state of the pipeline. + PipelineState state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Only populated when the pipeline's state is `PIPELINE_STATE_FAILED` or + // `PIPELINE_STATE_CANCELLED`. + google.rpc.Status error = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the TrainingPipeline was created. + google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the TrainingPipeline for the first time entered the + // `PIPELINE_STATE_RUNNING` state. + google.protobuf.Timestamp start_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the TrainingPipeline entered any of the following states: + // `PIPELINE_STATE_SUCCEEDED`, `PIPELINE_STATE_FAILED`, + // `PIPELINE_STATE_CANCELLED`. + google.protobuf.Timestamp end_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the TrainingPipeline was most recently updated. + google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels with user-defined metadata to organize TrainingPipelines. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 15; + + // Customer-managed encryption key spec for a TrainingPipeline. If set, this + // TrainingPipeline will be secured by this key. + // + // Note: Model trained by this TrainingPipeline is also secured by this key if + // [model_to_upload][google.cloud.aiplatform.v1beta1.TrainingPipeline.encryption_spec] is not set separately. + EncryptionSpec encryption_spec = 18; +} + +// Specifies Vertex AI owned input data to be used for training, and +// possibly evaluating, the Model. +message InputDataConfig { + // The instructions how the input data should be split between the + // training, validation and test sets. + // If no split type is provided, the [fraction_split][google.cloud.aiplatform.v1beta1.InputDataConfig.fraction_split] is used by default. + oneof split { + // Split based on fractions defining the size of each set. + FractionSplit fraction_split = 2; + + // Split based on the provided filters for each set. + FilterSplit filter_split = 3; + + // Supported only for tabular Datasets. + // + // Split based on a predefined key. + PredefinedSplit predefined_split = 4; + + // Supported only for tabular Datasets. + // + // Split based on the timestamp of the input data pieces. + TimestampSplit timestamp_split = 5; + + // Supported only for tabular Datasets. + // + // Split based on the distribution of the specified column. + StratifiedSplit stratified_split = 12; + } + + // Only applicable to Custom and Hyperparameter Tuning TrainingPipelines. + // + // The destination of the training data to be written to. + // + // Supported destination file formats: + // * For non-tabular data: "jsonl". + // * For tabular data: "csv" and "bigquery". + // + // The following Vertex AI environment variables are passed to containers + // or python modules of the training task when this field is set: + // + // * AIP_DATA_FORMAT : Exported data format. + // * AIP_TRAINING_DATA_URI : Sharded exported training data uris. + // * AIP_VALIDATION_DATA_URI : Sharded exported validation data uris. + // * AIP_TEST_DATA_URI : Sharded exported test data uris. + oneof destination { + // The Cloud Storage location where the training data is to be + // written to. In the given directory a new directory is created with + // name: + // `dataset---` + // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. + // All training input data is written into that directory. + // + // The Vertex AI environment variables representing Cloud Storage + // data URIs are represented in the Cloud Storage wildcard + // format to support sharded data. e.g.: "gs://.../training-*.jsonl" + // + // * AIP_DATA_FORMAT = "jsonl" for non-tabular data, "csv" for tabular data + // * AIP_TRAINING_DATA_URI = + // "gcs_destination/dataset--- + * region_tag:aiplatform_v1beta1_generated_DatasetService_GetDataset_async + */ + getDataset( + request?: protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDataset, + protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest|undefined, {}|undefined + ]>; + getDataset( + request: protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IDataset, + protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest|null|undefined, + {}|null|undefined>): void; + getDataset( + request: protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IDataset, + protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest|null|undefined, + {}|null|undefined>): void; + getDataset( + request?: protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IDataset, + protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IDataset, + protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDataset, + protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getDataset(request, options, callback); + } +/** + * Updates a Dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.Dataset} request.dataset + * Required. The Dataset which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. + * Updatable fields: + * + * * `display_name` + * * `description` + * * `labels` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Dataset]{@link google.cloud.aiplatform.v1beta1.Dataset}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_DatasetService_UpdateDataset_async + */ + updateDataset( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDataset, + protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest|undefined, {}|undefined + ]>; + updateDataset( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IDataset, + protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest|null|undefined, + {}|null|undefined>): void; + updateDataset( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IDataset, + protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest|null|undefined, + {}|null|undefined>): void; + updateDataset( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IDataset, + protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IDataset, + protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDataset, + protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'dataset.name': request.dataset!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateDataset(request, options, callback); + } +/** + * Gets an AnnotationSpec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the AnnotationSpec resource. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnnotationSpec]{@link google.cloud.aiplatform.v1beta1.AnnotationSpec}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_DatasetService_GetAnnotationSpec_async + */ + getAnnotationSpec( + request?: protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IAnnotationSpec, + protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest|undefined, {}|undefined + ]>; + getAnnotationSpec( + request: protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IAnnotationSpec, + protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest|null|undefined, + {}|null|undefined>): void; + getAnnotationSpec( + request: protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IAnnotationSpec, + protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest|null|undefined, + {}|null|undefined>): void; + getAnnotationSpec( + request?: protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IAnnotationSpec, + protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IAnnotationSpec, + protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IAnnotationSpec, + protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getAnnotationSpec(request, options, callback); + } + +/** + * Creates a Dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the Dataset in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.Dataset} request.dataset + * Required. The Dataset to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_DatasetService_CreateDataset_async + */ + createDataset( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateDatasetRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createDataset( + request: protos.google.cloud.aiplatform.v1beta1.ICreateDatasetRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createDataset( + request: protos.google.cloud.aiplatform.v1beta1.ICreateDatasetRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createDataset( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateDatasetRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createDataset(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createDataset()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_DatasetService_CreateDataset_async + */ + async checkCreateDatasetProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createDataset, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a Dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Dataset to delete. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_DatasetService_DeleteDataset_async + */ + deleteDataset( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteDatasetRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteDataset( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteDatasetRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteDataset( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteDatasetRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteDataset( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteDatasetRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteDataset(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteDataset()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_DatasetService_DeleteDataset_async + */ + async checkDeleteDatasetProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteDataset, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Imports data into a Dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Dataset resource. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}` + * @param {number[]} request.importConfigs + * Required. The desired input locations. The contents of all input locations will be + * imported in one batch. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_DatasetService_ImportData_async + */ + importData( + request?: protos.google.cloud.aiplatform.v1beta1.IImportDataRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + importData( + request: protos.google.cloud.aiplatform.v1beta1.IImportDataRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importData( + request: protos.google.cloud.aiplatform.v1beta1.IImportDataRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importData( + request?: protos.google.cloud.aiplatform.v1beta1.IImportDataRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.importData(request, options, callback); + } +/** + * Check the status of the long running operation returned by `importData()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_DatasetService_ImportData_async + */ + async checkImportDataProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.importData, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Exports data from a Dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Dataset resource. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}` + * @param {google.cloud.aiplatform.v1beta1.ExportDataConfig} request.exportConfig + * Required. The desired output location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_DatasetService_ExportData_async + */ + exportData( + request?: protos.google.cloud.aiplatform.v1beta1.IExportDataRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + exportData( + request: protos.google.cloud.aiplatform.v1beta1.IExportDataRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportData( + request: protos.google.cloud.aiplatform.v1beta1.IExportDataRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportData( + request?: protos.google.cloud.aiplatform.v1beta1.IExportDataRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.exportData(request, options, callback); + } +/** + * Check the status of the long running operation returned by `exportData()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_DatasetService_ExportData_async + */ + async checkExportDataProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.exportData, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Datasets in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the Dataset's parent resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `display_name`: supports = and != + * * `metadata_schema_uri`: supports = and != + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `displayName="myDisplayName"` + * * `labels.myKey="myValue"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * * `display_name` + * * `create_time` + * * `update_time` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Dataset]{@link google.cloud.aiplatform.v1beta1.Dataset}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDatasetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDatasets( + request?: protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDataset[], + protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListDatasetsResponse + ]>; + listDatasets( + request: protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, + protos.google.cloud.aiplatform.v1beta1.IListDatasetsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDataset>): void; + listDatasets( + request: protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, + protos.google.cloud.aiplatform.v1beta1.IListDatasetsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDataset>): void; + listDatasets( + request?: protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, + protos.google.cloud.aiplatform.v1beta1.IListDatasetsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDataset>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, + protos.google.cloud.aiplatform.v1beta1.IListDatasetsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDataset>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDataset[], + protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListDatasetsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listDatasets(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the Dataset's parent resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `display_name`: supports = and != + * * `metadata_schema_uri`: supports = and != + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `displayName="myDisplayName"` + * * `labels.myKey="myValue"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * * `display_name` + * * `create_time` + * * `update_time` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Dataset]{@link google.cloud.aiplatform.v1beta1.Dataset} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDatasetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDatasetsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDatasets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDatasets.createStream( + this.innerApiCalls.listDatasets as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDatasets`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the Dataset's parent resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `display_name`: supports = and != + * * `metadata_schema_uri`: supports = and != + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `displayName="myDisplayName"` + * * `labels.myKey="myValue"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * * `display_name` + * * `create_time` + * * `update_time` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Dataset]{@link google.cloud.aiplatform.v1beta1.Dataset}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_DatasetService_ListDatasets_async + */ + listDatasetsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDatasets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDatasets.asyncIterate( + this.innerApiCalls['listDatasets'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists DataItems in a Dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Dataset to list DataItems from. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [DataItem]{@link google.cloud.aiplatform.v1beta1.DataItem}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDataItemsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDataItems( + request?: protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDataItem[], + protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListDataItemsResponse + ]>; + listDataItems( + request: protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, + protos.google.cloud.aiplatform.v1beta1.IListDataItemsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDataItem>): void; + listDataItems( + request: protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, + protos.google.cloud.aiplatform.v1beta1.IListDataItemsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDataItem>): void; + listDataItems( + request?: protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, + protos.google.cloud.aiplatform.v1beta1.IListDataItemsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDataItem>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, + protos.google.cloud.aiplatform.v1beta1.IListDataItemsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDataItem>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDataItem[], + protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListDataItemsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listDataItems(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Dataset to list DataItems from. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [DataItem]{@link google.cloud.aiplatform.v1beta1.DataItem} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDataItemsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDataItemsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDataItems']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataItems.createStream( + this.innerApiCalls.listDataItems as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDataItems`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Dataset to list DataItems from. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [DataItem]{@link google.cloud.aiplatform.v1beta1.DataItem}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_DatasetService_ListDataItems_async + */ + listDataItemsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDataItems']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataItems.asyncIterate( + this.innerApiCalls['listDataItems'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists Annotations belongs to a dataitem + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the DataItem to list Annotations from. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Annotation]{@link google.cloud.aiplatform.v1beta1.Annotation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAnnotationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAnnotations( + request?: protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IAnnotation[], + protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListAnnotationsResponse + ]>; + listAnnotations( + request: protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, + protos.google.cloud.aiplatform.v1beta1.IListAnnotationsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IAnnotation>): void; + listAnnotations( + request: protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, + protos.google.cloud.aiplatform.v1beta1.IListAnnotationsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IAnnotation>): void; + listAnnotations( + request?: protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, + protos.google.cloud.aiplatform.v1beta1.IListAnnotationsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IAnnotation>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, + protos.google.cloud.aiplatform.v1beta1.IListAnnotationsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IAnnotation>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IAnnotation[], + protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListAnnotationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listAnnotations(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the DataItem to list Annotations from. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Annotation]{@link google.cloud.aiplatform.v1beta1.Annotation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAnnotationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAnnotationsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listAnnotations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAnnotations.createStream( + this.innerApiCalls.listAnnotations as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAnnotations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the DataItem to list Annotations from. + * Format: + * `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Annotation]{@link google.cloud.aiplatform.v1beta1.Annotation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_DatasetService_ListAnnotations_async + */ + listAnnotationsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listAnnotations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAnnotations.asyncIterate( + this.innerApiCalls['listAnnotations'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.datasetServiceStub && !this._terminated) { + return this.datasetServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/dataset_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/dataset_service_client_config.json new file mode 100644 index 00000000..64c47562 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/dataset_service_client_config.json @@ -0,0 +1,76 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.DatasetService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateDataset": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDataset": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateDataset": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDatasets": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDataset": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ImportData": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportData": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDataItems": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAnnotationSpec": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAnnotations": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/dataset_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/dataset_service_proto_list.json new file mode 100644 index 00000000..c916ab12 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/dataset_service_proto_list.json @@ -0,0 +1,117 @@ +[ + "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/context.proto", + "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1beta1/event.proto", + "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/io.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/study.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/types.proto", + "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1beta1/value.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_client.ts new file mode 100644 index 00000000..968a0f49 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_client.ts @@ -0,0 +1,3134 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/endpoint_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './endpoint_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * A service for managing Vertex AI's Endpoints. + * @class + * @memberof v1beta1 + */ +export class EndpointServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + endpointServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of EndpointServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof EndpointServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listEndpoints: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'endpoints') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const createEndpointResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.Endpoint') as gax.protobuf.Type; + const createEndpointMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.CreateEndpointOperationMetadata') as gax.protobuf.Type; + const deleteEndpointResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteEndpointMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const deployModelResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeployModelResponse') as gax.protobuf.Type; + const deployModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeployModelOperationMetadata') as gax.protobuf.Type; + const undeployModelResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.UndeployModelResponse') as gax.protobuf.Type; + const undeployModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.UndeployModelOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createEndpoint: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createEndpointResponse.decode.bind(createEndpointResponse), + createEndpointMetadata.decode.bind(createEndpointMetadata)), + deleteEndpoint: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteEndpointResponse.decode.bind(deleteEndpointResponse), + deleteEndpointMetadata.decode.bind(deleteEndpointMetadata)), + deployModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deployModelResponse.decode.bind(deployModelResponse), + deployModelMetadata.decode.bind(deployModelMetadata)), + undeployModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeployModelResponse.decode.bind(undeployModelResponse), + undeployModelMetadata.decode.bind(undeployModelMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.EndpointService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.endpointServiceStub) { + return this.endpointServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1beta1.EndpointService. + this.endpointServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.EndpointService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1beta1.EndpointService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const endpointServiceStubMethods = + ['createEndpoint', 'getEndpoint', 'listEndpoints', 'updateEndpoint', 'deleteEndpoint', 'deployModel', 'undeployModel']; + for (const methodName of endpointServiceStubMethods) { + const callPromise = this.endpointServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.endpointServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets an Endpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Endpoint resource. + * Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Endpoint]{@link google.cloud.aiplatform.v1beta1.Endpoint}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_EndpointService_GetEndpoint_async + */ + getEndpoint( + request?: protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IEndpoint, + protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest|undefined, {}|undefined + ]>; + getEndpoint( + request: protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IEndpoint, + protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest|null|undefined, + {}|null|undefined>): void; + getEndpoint( + request: protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IEndpoint, + protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest|null|undefined, + {}|null|undefined>): void; + getEndpoint( + request?: protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IEndpoint, + protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IEndpoint, + protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IEndpoint, + protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getEndpoint(request, options, callback); + } +/** + * Updates an Endpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.Endpoint} request.endpoint + * Required. The Endpoint which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. See {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Endpoint]{@link google.cloud.aiplatform.v1beta1.Endpoint}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_EndpointService_UpdateEndpoint_async + */ + updateEndpoint( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IEndpoint, + protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest|undefined, {}|undefined + ]>; + updateEndpoint( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IEndpoint, + protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest|null|undefined, + {}|null|undefined>): void; + updateEndpoint( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IEndpoint, + protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest|null|undefined, + {}|null|undefined>): void; + updateEndpoint( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IEndpoint, + protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IEndpoint, + protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IEndpoint, + protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'endpoint.name': request.endpoint!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateEndpoint(request, options, callback); + } + +/** + * Creates an Endpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the Endpoint in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.Endpoint} request.endpoint + * Required. The Endpoint to create. + * @param {string} request.endpointId + * Immutable. The ID to use for endpoint, which will become the final + * component of the endpoint resource name. + * If not provided, Vertex AI will generate a value for this ID. + * + * This value should be 1-10 characters, and valid characters are /[0-9]/. + * When using HTTP/JSON, this field is populated based on a query string + * argument, such as `?endpoint_id=12345`. This is the fallback for fields + * that are not included in either the URI or the body. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_async + */ + createEndpoint( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateEndpointRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createEndpoint( + request: protos.google.cloud.aiplatform.v1beta1.ICreateEndpointRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createEndpoint( + request: protos.google.cloud.aiplatform.v1beta1.ICreateEndpointRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createEndpoint( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createEndpoint(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createEndpoint()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_async + */ + async checkCreateEndpointProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createEndpoint, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes an Endpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Endpoint resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_async + */ + deleteEndpoint( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteEndpointRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteEndpoint( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteEndpointRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteEndpoint( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteEndpointRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteEndpoint( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteEndpoint(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteEndpoint()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_async + */ + async checkDeleteEndpointProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteEndpoint, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deploys a Model into this Endpoint, creating a DeployedModel within it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.endpoint + * Required. The name of the Endpoint resource into which to deploy a Model. + * Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {google.cloud.aiplatform.v1beta1.DeployedModel} request.deployedModel + * Required. The DeployedModel to be created within the Endpoint. Note that + * {@link google.cloud.aiplatform.v1beta1.Endpoint.traffic_split|Endpoint.traffic_split} must be updated for the DeployedModel to start + * receiving traffic, either as part of this call, or via + * {@link google.cloud.aiplatform.v1beta1.EndpointService.UpdateEndpoint|EndpointService.UpdateEndpoint}. + * @param {number[]} request.trafficSplit + * A map from a DeployedModel's ID to the percentage of this Endpoint's + * traffic that should be forwarded to that DeployedModel. + * + * If this field is non-empty, then the Endpoint's + * {@link google.cloud.aiplatform.v1beta1.Endpoint.traffic_split|traffic_split} will be overwritten with it. + * To refer to the ID of the just being deployed Model, a "0" should be used, + * and the actual ID of the new DeployedModel will be filled in its place by + * this method. The traffic percentage values must add up to 100. + * + * If this field is empty, then the Endpoint's + * {@link google.cloud.aiplatform.v1beta1.Endpoint.traffic_split|traffic_split} is not updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_EndpointService_DeployModel_async + */ + deployModel( + request?: protos.google.cloud.aiplatform.v1beta1.IDeployModelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deployModel( + request: protos.google.cloud.aiplatform.v1beta1.IDeployModelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deployModel( + request: protos.google.cloud.aiplatform.v1beta1.IDeployModelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deployModel( + request?: protos.google.cloud.aiplatform.v1beta1.IDeployModelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'endpoint': request.endpoint || '', + }); + this.initialize(); + return this.innerApiCalls.deployModel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deployModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_EndpointService_DeployModel_async + */ + async checkDeployModelProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deployModel, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Undeploys a Model from an Endpoint, removing a DeployedModel from it, and + * freeing all resources it's using. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.endpoint + * Required. The name of the Endpoint resource from which to undeploy a Model. + * Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {string} request.deployedModelId + * Required. The ID of the DeployedModel to be undeployed from the Endpoint. + * @param {number[]} request.trafficSplit + * If this field is provided, then the Endpoint's + * {@link google.cloud.aiplatform.v1beta1.Endpoint.traffic_split|traffic_split} will be overwritten with it. If + * last DeployedModel is being undeployed from the Endpoint, the + * [Endpoint.traffic_split] will always end up empty when this call returns. + * A DeployedModel will be successfully undeployed only if it doesn't have + * any traffic assigned to it when this method executes, or if this field + * unassigns any traffic to it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_EndpointService_UndeployModel_async + */ + undeployModel( + request?: protos.google.cloud.aiplatform.v1beta1.IUndeployModelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + undeployModel( + request: protos.google.cloud.aiplatform.v1beta1.IUndeployModelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeployModel( + request: protos.google.cloud.aiplatform.v1beta1.IUndeployModelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeployModel( + request?: protos.google.cloud.aiplatform.v1beta1.IUndeployModelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'endpoint': request.endpoint || '', + }); + this.initialize(); + return this.innerApiCalls.undeployModel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `undeployModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_EndpointService_UndeployModel_async + */ + async checkUndeployModelProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.undeployModel, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Endpoints in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the Endpoints. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID, + * i.e. the last segment of the Endpoint's {@link google.cloud.aiplatform.v1beta1.Endpoint.name|resource name}. + * * `display_name` supports = and, != + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `endpoint=1` + * * `displayName="myDisplayName"` + * * `labels.myKey="myValue"` + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListEndpointsResponse.next_page_token|ListEndpointsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints|EndpointService.ListEndpoints} call. + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Endpoint]{@link google.cloud.aiplatform.v1beta1.Endpoint}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listEndpointsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listEndpoints( + request?: protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IEndpoint[], + protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListEndpointsResponse + ]>; + listEndpoints( + request: protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, + protos.google.cloud.aiplatform.v1beta1.IListEndpointsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IEndpoint>): void; + listEndpoints( + request: protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, + protos.google.cloud.aiplatform.v1beta1.IListEndpointsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IEndpoint>): void; + listEndpoints( + request?: protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, + protos.google.cloud.aiplatform.v1beta1.IListEndpointsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IEndpoint>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, + protos.google.cloud.aiplatform.v1beta1.IListEndpointsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IEndpoint>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IEndpoint[], + protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListEndpointsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listEndpoints(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the Endpoints. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID, + * i.e. the last segment of the Endpoint's {@link google.cloud.aiplatform.v1beta1.Endpoint.name|resource name}. + * * `display_name` supports = and, != + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `endpoint=1` + * * `displayName="myDisplayName"` + * * `labels.myKey="myValue"` + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListEndpointsResponse.next_page_token|ListEndpointsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints|EndpointService.ListEndpoints} call. + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Endpoint]{@link google.cloud.aiplatform.v1beta1.Endpoint} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listEndpointsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listEndpointsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listEndpoints']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEndpoints.createStream( + this.innerApiCalls.listEndpoints as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listEndpoints`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the Endpoints. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID, + * i.e. the last segment of the Endpoint's {@link google.cloud.aiplatform.v1beta1.Endpoint.name|resource name}. + * * `display_name` supports = and, != + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `endpoint=1` + * * `displayName="myDisplayName"` + * * `labels.myKey="myValue"` + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListEndpointsResponse.next_page_token|ListEndpointsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints|EndpointService.ListEndpoints} call. + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Endpoint]{@link google.cloud.aiplatform.v1beta1.Endpoint}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_EndpointService_ListEndpoints_async + */ + listEndpointsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listEndpoints']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEndpoints.asyncIterate( + this.innerApiCalls['listEndpoints'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.endpointServiceStub && !this._terminated) { + return this.endpointServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_client_config.json new file mode 100644 index 00000000..4775abb5 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_client_config.json @@ -0,0 +1,61 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.EndpointService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateEndpoint": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetEndpoint": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListEndpoints": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateEndpoint": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteEndpoint": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeployModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeployModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_proto_list.json new file mode 100644 index 00000000..c916ab12 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_proto_list.json @@ -0,0 +1,117 @@ +[ + "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/context.proto", + "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1beta1/event.proto", + "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/io.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/study.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/types.proto", + "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1beta1/value.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts new file mode 100644 index 00000000..ec79ef5c --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts @@ -0,0 +1,2386 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, GoogleError} from 'google-gax'; + +import { PassThrough } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/featurestore_online_serving_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './featurestore_online_serving_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * A service for serving online feature values. + * @class + * @memberof v1beta1 + */ +export class FeaturestoreOnlineServingServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + featurestoreOnlineServingServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of FeaturestoreOnlineServingServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof FeaturestoreOnlineServingServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + streamingReadFeatureValues: new this._gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.featurestoreOnlineServingServiceStub) { + return this.featurestoreOnlineServingServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService. + this.featurestoreOnlineServingServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const featurestoreOnlineServingServiceStubMethods = + ['readFeatureValues', 'streamingReadFeatureValues']; + for (const methodName of featurestoreOnlineServingServiceStubMethods) { + const callPromise = this.featurestoreOnlineServingServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough(); + setImmediate(() => { + stream.emit('error', new GoogleError('The client has already been closed.')); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.stream[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.featurestoreOnlineServingServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Reads Feature values of a specific entity of an EntityType. For reading + * feature values of multiple entities of an EntityType, please use + * StreamingReadFeatureValues. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.entityType + * Required. The resource name of the EntityType for the entity being read. + * 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`. + * @param {string} request.entityId + * Required. ID for a specific entity. For example, + * for a machine learning model predicting user clicks on a website, an entity + * ID could be `user_123`. + * @param {google.cloud.aiplatform.v1beta1.FeatureSelector} request.featureSelector + * Required. Selector choosing Features of the target EntityType. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ReadFeatureValuesResponse]{@link google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreOnlineServingService_ReadFeatureValues_async + */ + readFeatureValues( + request?: protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesResponse, + protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest|undefined, {}|undefined + ]>; + readFeatureValues( + request: protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesResponse, + protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest|null|undefined, + {}|null|undefined>): void; + readFeatureValues( + request: protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesResponse, + protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest|null|undefined, + {}|null|undefined>): void; + readFeatureValues( + request?: protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesResponse, + protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesResponse, + protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesResponse, + protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'entity_type': request.entityType || '', + }); + this.initialize(); + return this.innerApiCalls.readFeatureValues(request, options, callback); + } + +/** + * Reads Feature values for multiple entities. Depending on their size, data + * for different entities may be broken + * up across multiple responses. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.entityType + * Required. The resource name of the entities' type. + * 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`. + * @param {string[]} request.entityIds + * Required. IDs of entities to read Feature values of. The maximum number of IDs is + * 100. For example, for a machine learning model predicting user clicks on a + * website, an entity ID could be `user_123`. + * @param {google.cloud.aiplatform.v1beta1.FeatureSelector} request.featureSelector + * Required. Selector choosing Features of the target EntityType. Feature IDs will be + * deduplicated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits [ReadFeatureValuesResponse]{@link google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse} on 'data' event. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreOnlineServingService_StreamingReadFeatureValues_async + */ + streamingReadFeatureValues( + request?: protos.google.cloud.aiplatform.v1beta1.IStreamingReadFeatureValuesRequest, + options?: CallOptions): + gax.CancellableStream{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'entity_type': request.entityType || '', + }); + this.initialize(); + return this.innerApiCalls.streamingReadFeatureValues(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.featurestoreOnlineServingServiceStub && !this._terminated) { + return this.featurestoreOnlineServingServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client_config.json new file mode 100644 index 00000000..0a2256f4 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client_config.json @@ -0,0 +1,36 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ReadFeatureValues": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StreamingReadFeatureValues": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_proto_list.json new file mode 100644 index 00000000..c916ab12 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_proto_list.json @@ -0,0 +1,117 @@ +[ + "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/context.proto", + "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1beta1/event.proto", + "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/io.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/study.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/types.proto", + "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1beta1/value.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_client.ts new file mode 100644 index 00000000..db5f3106 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_client.ts @@ -0,0 +1,5310 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/featurestore_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './featurestore_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * The service that handles CRUD and List for resources for Featurestore. + * @class + * @memberof v1beta1 + */ +export class FeaturestoreServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + featurestoreServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of FeaturestoreServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof FeaturestoreServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listFeaturestores: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'featurestores'), + listEntityTypes: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'entityTypes'), + listFeatures: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'features'), + searchFeatures: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'features') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const createFeaturestoreResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.Featurestore') as gax.protobuf.Type; + const createFeaturestoreMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.CreateFeaturestoreOperationMetadata') as gax.protobuf.Type; + const updateFeaturestoreResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.Featurestore') as gax.protobuf.Type; + const updateFeaturestoreMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.UpdateFeaturestoreOperationMetadata') as gax.protobuf.Type; + const deleteFeaturestoreResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteFeaturestoreMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const createEntityTypeResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.EntityType') as gax.protobuf.Type; + const createEntityTypeMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.CreateEntityTypeOperationMetadata') as gax.protobuf.Type; + const deleteEntityTypeResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteEntityTypeMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const createFeatureResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.Feature') as gax.protobuf.Type; + const createFeatureMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.CreateFeatureOperationMetadata') as gax.protobuf.Type; + const batchCreateFeaturesResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.BatchCreateFeaturesResponse') as gax.protobuf.Type; + const batchCreateFeaturesMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.BatchCreateFeaturesOperationMetadata') as gax.protobuf.Type; + const deleteFeatureResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteFeatureMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const importFeatureValuesResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.ImportFeatureValuesResponse') as gax.protobuf.Type; + const importFeatureValuesMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata') as gax.protobuf.Type; + const batchReadFeatureValuesResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.BatchReadFeatureValuesResponse') as gax.protobuf.Type; + const batchReadFeatureValuesMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.BatchReadFeatureValuesOperationMetadata') as gax.protobuf.Type; + const exportFeatureValuesResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.ExportFeatureValuesResponse') as gax.protobuf.Type; + const exportFeatureValuesMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.ExportFeatureValuesOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createFeaturestore: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createFeaturestoreResponse.decode.bind(createFeaturestoreResponse), + createFeaturestoreMetadata.decode.bind(createFeaturestoreMetadata)), + updateFeaturestore: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateFeaturestoreResponse.decode.bind(updateFeaturestoreResponse), + updateFeaturestoreMetadata.decode.bind(updateFeaturestoreMetadata)), + deleteFeaturestore: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteFeaturestoreResponse.decode.bind(deleteFeaturestoreResponse), + deleteFeaturestoreMetadata.decode.bind(deleteFeaturestoreMetadata)), + createEntityType: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createEntityTypeResponse.decode.bind(createEntityTypeResponse), + createEntityTypeMetadata.decode.bind(createEntityTypeMetadata)), + deleteEntityType: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteEntityTypeResponse.decode.bind(deleteEntityTypeResponse), + deleteEntityTypeMetadata.decode.bind(deleteEntityTypeMetadata)), + createFeature: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createFeatureResponse.decode.bind(createFeatureResponse), + createFeatureMetadata.decode.bind(createFeatureMetadata)), + batchCreateFeatures: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchCreateFeaturesResponse.decode.bind(batchCreateFeaturesResponse), + batchCreateFeaturesMetadata.decode.bind(batchCreateFeaturesMetadata)), + deleteFeature: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteFeatureResponse.decode.bind(deleteFeatureResponse), + deleteFeatureMetadata.decode.bind(deleteFeatureMetadata)), + importFeatureValues: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importFeatureValuesResponse.decode.bind(importFeatureValuesResponse), + importFeatureValuesMetadata.decode.bind(importFeatureValuesMetadata)), + batchReadFeatureValues: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchReadFeatureValuesResponse.decode.bind(batchReadFeatureValuesResponse), + batchReadFeatureValuesMetadata.decode.bind(batchReadFeatureValuesMetadata)), + exportFeatureValues: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportFeatureValuesResponse.decode.bind(exportFeatureValuesResponse), + exportFeatureValuesMetadata.decode.bind(exportFeatureValuesMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.FeaturestoreService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.featurestoreServiceStub) { + return this.featurestoreServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1beta1.FeaturestoreService. + this.featurestoreServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.FeaturestoreService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1beta1.FeaturestoreService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const featurestoreServiceStubMethods = + ['createFeaturestore', 'getFeaturestore', 'listFeaturestores', 'updateFeaturestore', 'deleteFeaturestore', 'createEntityType', 'getEntityType', 'listEntityTypes', 'updateEntityType', 'deleteEntityType', 'createFeature', 'batchCreateFeatures', 'getFeature', 'listFeatures', 'updateFeature', 'deleteFeature', 'importFeatureValues', 'batchReadFeatureValues', 'exportFeatureValues', 'searchFeatures']; + for (const methodName of featurestoreServiceStubMethods) { + const callPromise = this.featurestoreServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.featurestoreServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets details of a single Featurestore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Featurestore resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Featurestore]{@link google.cloud.aiplatform.v1beta1.Featurestore}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_GetFeaturestore_async + */ + getFeaturestore( + request?: protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IFeaturestore, + protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest|undefined, {}|undefined + ]>; + getFeaturestore( + request: protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IFeaturestore, + protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest|null|undefined, + {}|null|undefined>): void; + getFeaturestore( + request: protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IFeaturestore, + protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest|null|undefined, + {}|null|undefined>): void; + getFeaturestore( + request?: protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IFeaturestore, + protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IFeaturestore, + protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IFeaturestore, + protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getFeaturestore(request, options, callback); + } +/** + * Gets details of a single EntityType. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the EntityType resource. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [EntityType]{@link google.cloud.aiplatform.v1beta1.EntityType}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_GetEntityType_async + */ + getEntityType( + request?: protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IEntityType, + protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest|undefined, {}|undefined + ]>; + getEntityType( + request: protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IEntityType, + protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest|null|undefined, + {}|null|undefined>): void; + getEntityType( + request: protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IEntityType, + protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest|null|undefined, + {}|null|undefined>): void; + getEntityType( + request?: protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IEntityType, + protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IEntityType, + protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IEntityType, + protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getEntityType(request, options, callback); + } +/** + * Updates the parameters of a single EntityType. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.EntityType} request.entityType + * Required. The EntityType's `name` field is used to identify the EntityType to be + * updated. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields to be overwritten in the + * EntityType resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then only the non-empty fields present in the + * request will be overwritten. Set the update_mask to `*` to override all + * fields. + * + * Updatable fields: + * + * * `description` + * * `labels` + * * `monitoring_config.snapshot_analysis.disabled` + * * `monitoring_config.snapshot_analysis.monitoring_interval_days` + * * `monitoring_config.snapshot_analysis.staleness_days` + * * `monitoring_config.import_features_analysis.state` + * * `monitoring_config.import_features_analysis.anomaly_detection_baseline` + * * `monitoring_config.numerical_threshold_config.value` + * * `monitoring_config.categorical_threshold_config.value` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [EntityType]{@link google.cloud.aiplatform.v1beta1.EntityType}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_UpdateEntityType_async + */ + updateEntityType( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IEntityType, + protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest|undefined, {}|undefined + ]>; + updateEntityType( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IEntityType, + protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest|null|undefined, + {}|null|undefined>): void; + updateEntityType( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IEntityType, + protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest|null|undefined, + {}|null|undefined>): void; + updateEntityType( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IEntityType, + protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IEntityType, + protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IEntityType, + protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'entity_type.name': request.entityType!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateEntityType(request, options, callback); + } +/** + * Gets details of a single Feature. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Feature resource. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Feature]{@link google.cloud.aiplatform.v1beta1.Feature}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_GetFeature_async + */ + getFeature( + request?: protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IFeature, + protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest|undefined, {}|undefined + ]>; + getFeature( + request: protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IFeature, + protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest|null|undefined, + {}|null|undefined>): void; + getFeature( + request: protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IFeature, + protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest|null|undefined, + {}|null|undefined>): void; + getFeature( + request?: protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IFeature, + protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IFeature, + protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IFeature, + protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getFeature(request, options, callback); + } +/** + * Updates the parameters of a single Feature. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.Feature} request.feature + * Required. The Feature's `name` field is used to identify the Feature to be + * updated. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields to be overwritten in the + * Features resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then only the non-empty fields present in the + * request will be overwritten. Set the update_mask to `*` to override all + * fields. + * + * Updatable fields: + * + * * `description` + * * `labels` + * * `disable_monitoring` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Feature]{@link google.cloud.aiplatform.v1beta1.Feature}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_UpdateFeature_async + */ + updateFeature( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IFeature, + protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest|undefined, {}|undefined + ]>; + updateFeature( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IFeature, + protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest|null|undefined, + {}|null|undefined>): void; + updateFeature( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IFeature, + protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest|null|undefined, + {}|null|undefined>): void; + updateFeature( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IFeature, + protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IFeature, + protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IFeature, + protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'feature.name': request.feature!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateFeature(request, options, callback); + } + +/** + * Creates a new Featurestore in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create Featurestores. + * Format: + * `projects/{project}/locations/{location}'` + * @param {google.cloud.aiplatform.v1beta1.Featurestore} request.featurestore + * Required. The Featurestore to create. + * @param {string} request.featurestoreId + * Required. The ID to use for this Featurestore, which will become the final component + * of the Featurestore's resource name. + * + * This value may be up to 60 characters, and valid characters are + * `[a-z0-9_]`. The first character cannot be a number. + * + * The value must be unique within the project and location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_CreateFeaturestore_async + */ + createFeaturestore( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateFeaturestoreRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createFeaturestore( + request: protos.google.cloud.aiplatform.v1beta1.ICreateFeaturestoreRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createFeaturestore( + request: protos.google.cloud.aiplatform.v1beta1.ICreateFeaturestoreRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createFeaturestore( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateFeaturestoreRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createFeaturestore(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createFeaturestore()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_CreateFeaturestore_async + */ + async checkCreateFeaturestoreProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createFeaturestore, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single Featurestore. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.Featurestore} request.featurestore + * Required. The Featurestore's `name` field is used to identify the Featurestore to be + * updated. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}` + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields to be overwritten in the + * Featurestore resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then only the non-empty fields present in the + * request will be overwritten. Set the update_mask to `*` to override all + * fields. + * + * Updatable fields: + * + * * `labels` + * * `online_serving_config.fixed_node_count` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_UpdateFeaturestore_async + */ + updateFeaturestore( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateFeaturestoreRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateFeaturestore( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateFeaturestoreRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateFeaturestore( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateFeaturestoreRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateFeaturestore( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateFeaturestoreRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'featurestore.name': request.featurestore!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateFeaturestore(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateFeaturestore()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_UpdateFeaturestore_async + */ + async checkUpdateFeaturestoreProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateFeaturestore, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single Featurestore. The Featurestore must not contain any + * EntityTypes or `force` must be set to true for the request to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Featurestore to be deleted. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}` + * @param {boolean} request.force + * If set to true, any EntityTypes and Features for this Featurestore will + * also be deleted. (Otherwise, the request will only work if the Featurestore + * has no EntityTypes.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_DeleteFeaturestore_async + */ + deleteFeaturestore( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteFeaturestoreRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteFeaturestore( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteFeaturestoreRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteFeaturestore( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteFeaturestoreRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteFeaturestore( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteFeaturestoreRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteFeaturestore(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteFeaturestore()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_DeleteFeaturestore_async + */ + async checkDeleteFeaturestoreProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteFeaturestore, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new EntityType in a given Featurestore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Featurestore to create EntityTypes. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}` + * @param {google.cloud.aiplatform.v1beta1.EntityType} request.entityType + * The EntityType to create. + * @param {string} request.entityTypeId + * Required. The ID to use for the EntityType, which will become the final component of + * the EntityType's resource name. + * + * This value may be up to 60 characters, and valid characters are + * `[a-z0-9_]`. The first character cannot be a number. + * + * The value must be unique within a featurestore. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_CreateEntityType_async + */ + createEntityType( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateEntityTypeRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createEntityType( + request: protos.google.cloud.aiplatform.v1beta1.ICreateEntityTypeRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createEntityType( + request: protos.google.cloud.aiplatform.v1beta1.ICreateEntityTypeRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createEntityType( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateEntityTypeRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createEntityType(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createEntityType()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_CreateEntityType_async + */ + async checkCreateEntityTypeProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createEntityType, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single EntityType. The EntityType must not have any Features + * or `force` must be set to true for the request to succeed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the EntityType to be deleted. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {boolean} request.force + * If set to true, any Features for this EntityType will also be deleted. + * (Otherwise, the request will only work if the EntityType has no Features.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_DeleteEntityType_async + */ + deleteEntityType( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteEntityTypeRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteEntityType( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteEntityTypeRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteEntityType( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteEntityTypeRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteEntityType( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteEntityTypeRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteEntityType(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteEntityType()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_DeleteEntityType_async + */ + async checkDeleteEntityTypeProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteEntityType, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new Feature in a given EntityType. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the EntityType to create a Feature. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {google.cloud.aiplatform.v1beta1.Feature} request.feature + * Required. The Feature to create. + * @param {string} request.featureId + * Required. The ID to use for the Feature, which will become the final component of + * the Feature's resource name. + * + * This value may be up to 60 characters, and valid characters are + * `[a-z0-9_]`. The first character cannot be a number. + * + * The value must be unique within an EntityType. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_CreateFeature_async + */ + createFeature( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateFeatureRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createFeature( + request: protos.google.cloud.aiplatform.v1beta1.ICreateFeatureRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createFeature( + request: protos.google.cloud.aiplatform.v1beta1.ICreateFeatureRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createFeature( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateFeatureRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createFeature(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createFeature()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_CreateFeature_async + */ + async checkCreateFeatureProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createFeature, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a batch of Features in a given EntityType. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the EntityType to create the batch of Features under. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {number[]} request.requests + * Required. The request message specifying the Features to create. All Features must be + * created under the same parent EntityType. The `parent` field in each child + * request message can be omitted. If `parent` is set in a child request, then + * the value must match the `parent` value in this request message. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_BatchCreateFeatures_async + */ + batchCreateFeatures( + request?: protos.google.cloud.aiplatform.v1beta1.IBatchCreateFeaturesRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + batchCreateFeatures( + request: protos.google.cloud.aiplatform.v1beta1.IBatchCreateFeaturesRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchCreateFeatures( + request: protos.google.cloud.aiplatform.v1beta1.IBatchCreateFeaturesRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchCreateFeatures( + request?: protos.google.cloud.aiplatform.v1beta1.IBatchCreateFeaturesRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.batchCreateFeatures(request, options, callback); + } +/** + * Check the status of the long running operation returned by `batchCreateFeatures()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_BatchCreateFeatures_async + */ + async checkBatchCreateFeaturesProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.batchCreateFeatures, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single Feature. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Features to be deleted. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_DeleteFeature_async + */ + deleteFeature( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteFeatureRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteFeature( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteFeatureRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteFeature( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteFeatureRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteFeature( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteFeatureRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteFeature(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteFeature()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_DeleteFeature_async + */ + async checkDeleteFeatureProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteFeature, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Imports Feature values into the Featurestore from a source storage. + * + * The progress of the import is tracked by the returned operation. The + * imported features are guaranteed to be visible to subsequent read + * operations after the operation is marked as successfully done. + * + * If an import operation fails, the Feature values returned from + * reads and exports may be inconsistent. If consistency is + * required, the caller must retry the same import request again and wait till + * the new operation returned is marked as successfully done. + * + * There are also scenarios where the caller can cause inconsistency. + * + * - Source data for import contains multiple distinct Feature values for + * the same entity ID and timestamp. + * - Source is modified during an import. This includes adding, updating, or + * removing source data and/or metadata. Examples of updating metadata + * include but are not limited to changing storage location, storage class, + * or retention policy. + * - Online serving cluster is under-provisioned. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.AvroSource} request.avroSource + * @param {google.cloud.aiplatform.v1beta1.BigQuerySource} request.bigquerySource + * @param {google.cloud.aiplatform.v1beta1.CsvSource} request.csvSource + * @param {string} request.featureTimeField + * Source column that holds the Feature timestamp for all Feature + * values in each entity. + * @param {google.protobuf.Timestamp} request.featureTime + * Single Feature timestamp for all entities being imported. The + * timestamp must not have higher than millisecond precision. + * @param {string} request.entityType + * Required. The resource name of the EntityType grouping the Features for which values + * are being imported. Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}` + * @param {string} request.entityIdField + * Source column that holds entity IDs. If not provided, entity IDs are + * extracted from the column named `entity_id`. + * @param {number[]} request.featureSpecs + * Required. Specifications defining which Feature values to import from the entity. The + * request fails if no feature_specs are provided, and having multiple + * feature_specs for one Feature is not allowed. + * @param {boolean} request.disableOnlineServing + * If set, data will not be imported for online serving. This + * is typically used for backfilling, where Feature generation timestamps are + * not in the timestamp range needed for online serving. + * @param {number} request.workerCount + * Specifies the number of workers that are used to write data to the + * Featurestore. Consider the online serving capacity that you require to + * achieve the desired import throughput without interfering with online + * serving. The value must be positive, and less than or equal to 100. + * If not set, defaults to using 1 worker. The low count ensures minimal + * impact on online serving performance. + * @param {boolean} request.disableIngestionAnalysis + * If true, API doesn't start ingestion analysis pipeline. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_ImportFeatureValues_async + */ + importFeatureValues( + request?: protos.google.cloud.aiplatform.v1beta1.IImportFeatureValuesRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + importFeatureValues( + request: protos.google.cloud.aiplatform.v1beta1.IImportFeatureValuesRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importFeatureValues( + request: protos.google.cloud.aiplatform.v1beta1.IImportFeatureValuesRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importFeatureValues( + request?: protos.google.cloud.aiplatform.v1beta1.IImportFeatureValuesRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'entity_type': request.entityType || '', + }); + this.initialize(); + return this.innerApiCalls.importFeatureValues(request, options, callback); + } +/** + * Check the status of the long running operation returned by `importFeatureValues()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_ImportFeatureValues_async + */ + async checkImportFeatureValuesProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.importFeatureValues, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Batch reads Feature values from a Featurestore. + * + * This API enables batch reading Feature values, where each read + * instance in the batch may read Feature values of entities from one or + * more EntityTypes. Point-in-time correctness is guaranteed for Feature + * values of each read instance as of each instance's read timestamp. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.CsvSource} request.csvReadInstances + * Each read instance consists of exactly one read timestamp and one or more + * entity IDs identifying entities of the corresponding EntityTypes whose + * Features are requested. + * + * Each output instance contains Feature values of requested entities + * concatenated together as of the read time. + * + * An example read instance may be `foo_entity_id, bar_entity_id, + * 2020-01-01T10:00:00.123Z`. + * + * An example output instance may be `foo_entity_id, bar_entity_id, + * 2020-01-01T10:00:00.123Z, foo_entity_feature1_value, + * bar_entity_feature2_value`. + * + * Timestamp in each read instance must be millisecond-aligned. + * + * `csv_read_instances` are read instances stored in a plain-text CSV file. + * The header should be: + * [ENTITY_TYPE_ID1], [ENTITY_TYPE_ID2], ..., timestamp + * + * The columns can be in any order. + * + * Values in the timestamp column must use the RFC 3339 format, e.g. + * `2012-07-30T10:43:17.123Z`. + * @param {google.cloud.aiplatform.v1beta1.BigQuerySource} request.bigqueryReadInstances + * Similar to csv_read_instances, but from BigQuery source. + * @param {string} request.featurestore + * Required. The resource name of the Featurestore from which to query Feature values. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}` + * @param {google.cloud.aiplatform.v1beta1.FeatureValueDestination} request.destination + * Required. Specifies output location and format. + * @param {number[]} request.passThroughFields + * When not empty, the specified fields in the *_read_instances source will be + * joined as-is in the output, in addition to those fields from the + * Featurestore Entity. + * + * For BigQuery source, the type of the pass-through values will be + * automatically inferred. For CSV source, the pass-through values will be + * passed as opaque bytes. + * @param {number[]} request.entityTypeSpecs + * Required. Specifies EntityType grouping Features to read values of and settings. + * Each EntityType referenced in + * [BatchReadFeatureValuesRequest.entity_type_specs] must have a column + * specifying entity IDs in the EntityType in + * {@link |BatchReadFeatureValuesRequest.request} . + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_BatchReadFeatureValues_async + */ + batchReadFeatureValues( + request?: protos.google.cloud.aiplatform.v1beta1.IBatchReadFeatureValuesRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + batchReadFeatureValues( + request: protos.google.cloud.aiplatform.v1beta1.IBatchReadFeatureValuesRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchReadFeatureValues( + request: protos.google.cloud.aiplatform.v1beta1.IBatchReadFeatureValuesRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchReadFeatureValues( + request?: protos.google.cloud.aiplatform.v1beta1.IBatchReadFeatureValuesRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'featurestore': request.featurestore || '', + }); + this.initialize(); + return this.innerApiCalls.batchReadFeatureValues(request, options, callback); + } +/** + * Check the status of the long running operation returned by `batchReadFeatureValues()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_BatchReadFeatureValues_async + */ + async checkBatchReadFeatureValuesProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.batchReadFeatureValues, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Exports Feature values from all the entities of a target EntityType. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.ExportFeatureValuesRequest.SnapshotExport} request.snapshotExport + * Exports the latest Feature values of all entities of the EntityType + * within a time range. + * @param {google.cloud.aiplatform.v1beta1.ExportFeatureValuesRequest.FullExport} request.fullExport + * Exports all historical values of all entities of the EntityType within a + * time range + * @param {string} request.entityType + * Required. The resource name of the EntityType from which to export Feature values. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {google.cloud.aiplatform.v1beta1.FeatureValueDestination} request.destination + * Required. Specifies destination location and format. + * @param {google.cloud.aiplatform.v1beta1.FeatureSelector} request.featureSelector + * Required. Selects Features to export values of. + * @param {number[]} request.settings + * Per-Feature export settings. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_ExportFeatureValues_async + */ + exportFeatureValues( + request?: protos.google.cloud.aiplatform.v1beta1.IExportFeatureValuesRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + exportFeatureValues( + request: protos.google.cloud.aiplatform.v1beta1.IExportFeatureValuesRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportFeatureValues( + request: protos.google.cloud.aiplatform.v1beta1.IExportFeatureValuesRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportFeatureValues( + request?: protos.google.cloud.aiplatform.v1beta1.IExportFeatureValuesRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'entity_type': request.entityType || '', + }); + this.initialize(); + return this.innerApiCalls.exportFeatureValues(request, options, callback); + } +/** + * Check the status of the long running operation returned by `exportFeatureValues()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_ExportFeatureValues_async + */ + async checkExportFeatureValuesProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.exportFeatureValues, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Featurestores in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list Featurestores. + * Format: + * `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the featurestores that match the filter expression. The following + * fields are supported: + * + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be + * in RFC 3339 format. + * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be + * in RFC 3339 format. + * * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, + * `<=`, and `>=` comparisons. + * * `labels`: Supports key-value equality and key presence. + * + * Examples: + * + * * `create_time > "2020-01-01" OR update_time > "2020-01-01"` + * Featurestores created or updated after 2020-01-01. + * * `labels.env = "prod"` + * Featurestores with label "env" set to "prod". + * @param {number} request.pageSize + * The maximum number of Featurestores to return. The service may return fewer + * than this value. If unspecified, at most 100 Featurestores will be + * returned. The maximum value is 100; any value greater than 100 will be + * coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} must + * match the call that provided the page token. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported Fields: + * + * * `create_time` + * * `update_time` + * * `online_serving_config.fixed_node_count` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Featurestore]{@link google.cloud.aiplatform.v1beta1.Featurestore}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listFeaturestoresAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listFeaturestores( + request?: protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IFeaturestore[], + protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresResponse + ]>; + listFeaturestores( + request: protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, + protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IFeaturestore>): void; + listFeaturestores( + request: protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, + protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IFeaturestore>): void; + listFeaturestores( + request?: protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, + protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IFeaturestore>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, + protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IFeaturestore>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IFeaturestore[], + protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listFeaturestores(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list Featurestores. + * Format: + * `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the featurestores that match the filter expression. The following + * fields are supported: + * + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be + * in RFC 3339 format. + * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be + * in RFC 3339 format. + * * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, + * `<=`, and `>=` comparisons. + * * `labels`: Supports key-value equality and key presence. + * + * Examples: + * + * * `create_time > "2020-01-01" OR update_time > "2020-01-01"` + * Featurestores created or updated after 2020-01-01. + * * `labels.env = "prod"` + * Featurestores with label "env" set to "prod". + * @param {number} request.pageSize + * The maximum number of Featurestores to return. The service may return fewer + * than this value. If unspecified, at most 100 Featurestores will be + * returned. The maximum value is 100; any value greater than 100 will be + * coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} must + * match the call that provided the page token. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported Fields: + * + * * `create_time` + * * `update_time` + * * `online_serving_config.fixed_node_count` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Featurestore]{@link google.cloud.aiplatform.v1beta1.Featurestore} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listFeaturestoresAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listFeaturestoresStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listFeaturestores']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listFeaturestores.createStream( + this.innerApiCalls.listFeaturestores as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listFeaturestores`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list Featurestores. + * Format: + * `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the featurestores that match the filter expression. The following + * fields are supported: + * + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be + * in RFC 3339 format. + * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be + * in RFC 3339 format. + * * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, + * `<=`, and `>=` comparisons. + * * `labels`: Supports key-value equality and key presence. + * + * Examples: + * + * * `create_time > "2020-01-01" OR update_time > "2020-01-01"` + * Featurestores created or updated after 2020-01-01. + * * `labels.env = "prod"` + * Featurestores with label "env" set to "prod". + * @param {number} request.pageSize + * The maximum number of Featurestores to return. The service may return fewer + * than this value. If unspecified, at most 100 Featurestores will be + * returned. The maximum value is 100; any value greater than 100 will be + * coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} must + * match the call that provided the page token. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported Fields: + * + * * `create_time` + * * `update_time` + * * `online_serving_config.fixed_node_count` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Featurestore]{@link google.cloud.aiplatform.v1beta1.Featurestore}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_ListFeaturestores_async + */ + listFeaturestoresAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listFeaturestores']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listFeaturestores.asyncIterate( + this.innerApiCalls['listFeaturestores'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists EntityTypes in a given Featurestore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Featurestore to list EntityTypes. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}` + * @param {string} request.filter + * Lists the EntityTypes that match the filter expression. The following + * filters are supported: + * + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + * Values must be in RFC 3339 format. + * * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + * Values must be in RFC 3339 format. + * * `labels`: Supports key-value equality as well as key presence. + * + * Examples: + * + * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + * or updated after 2020-01-31T15:30:00.000000Z. + * * `labels.active = yes AND labels.env = prod` --> EntityTypes having both + * (active: yes) and (env: prod) labels. + * * `labels.env: *` --> Any EntityType which has a label with 'env' as the + * key. + * @param {number} request.pageSize + * The maximum number of EntityTypes to return. The service may return fewer + * than this value. If unspecified, at most 1000 EntityTypes will be returned. + * The maximum value is 1000; any value greater than 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} must + * match the call that provided the page token. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * + * Supported fields: + * + * * `entity_type_id` + * * `create_time` + * * `update_time` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [EntityType]{@link google.cloud.aiplatform.v1beta1.EntityType}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listEntityTypesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listEntityTypes( + request?: protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IEntityType[], + protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListEntityTypesResponse + ]>; + listEntityTypes( + request: protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, + protos.google.cloud.aiplatform.v1beta1.IListEntityTypesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IEntityType>): void; + listEntityTypes( + request: protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, + protos.google.cloud.aiplatform.v1beta1.IListEntityTypesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IEntityType>): void; + listEntityTypes( + request?: protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, + protos.google.cloud.aiplatform.v1beta1.IListEntityTypesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IEntityType>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, + protos.google.cloud.aiplatform.v1beta1.IListEntityTypesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IEntityType>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IEntityType[], + protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListEntityTypesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listEntityTypes(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Featurestore to list EntityTypes. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}` + * @param {string} request.filter + * Lists the EntityTypes that match the filter expression. The following + * filters are supported: + * + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + * Values must be in RFC 3339 format. + * * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + * Values must be in RFC 3339 format. + * * `labels`: Supports key-value equality as well as key presence. + * + * Examples: + * + * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + * or updated after 2020-01-31T15:30:00.000000Z. + * * `labels.active = yes AND labels.env = prod` --> EntityTypes having both + * (active: yes) and (env: prod) labels. + * * `labels.env: *` --> Any EntityType which has a label with 'env' as the + * key. + * @param {number} request.pageSize + * The maximum number of EntityTypes to return. The service may return fewer + * than this value. If unspecified, at most 1000 EntityTypes will be returned. + * The maximum value is 1000; any value greater than 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} must + * match the call that provided the page token. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * + * Supported fields: + * + * * `entity_type_id` + * * `create_time` + * * `update_time` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [EntityType]{@link google.cloud.aiplatform.v1beta1.EntityType} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listEntityTypesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listEntityTypesStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listEntityTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEntityTypes.createStream( + this.innerApiCalls.listEntityTypes as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listEntityTypes`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Featurestore to list EntityTypes. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}` + * @param {string} request.filter + * Lists the EntityTypes that match the filter expression. The following + * filters are supported: + * + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + * Values must be in RFC 3339 format. + * * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. + * Values must be in RFC 3339 format. + * * `labels`: Supports key-value equality as well as key presence. + * + * Examples: + * + * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + * or updated after 2020-01-31T15:30:00.000000Z. + * * `labels.active = yes AND labels.env = prod` --> EntityTypes having both + * (active: yes) and (env: prod) labels. + * * `labels.env: *` --> Any EntityType which has a label with 'env' as the + * key. + * @param {number} request.pageSize + * The maximum number of EntityTypes to return. The service may return fewer + * than this value. If unspecified, at most 1000 EntityTypes will be returned. + * The maximum value is 1000; any value greater than 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} must + * match the call that provided the page token. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * + * Supported fields: + * + * * `entity_type_id` + * * `create_time` + * * `update_time` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [EntityType]{@link google.cloud.aiplatform.v1beta1.EntityType}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_ListEntityTypes_async + */ + listEntityTypesAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listEntityTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEntityTypes.asyncIterate( + this.innerApiCalls['listEntityTypes'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists Features in a given EntityType. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list Features. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {string} request.filter + * Lists the Features that match the filter expression. The following + * filters are supported: + * + * * `value_type`: Supports = and != comparisons. + * * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + * be in RFC 3339 format. + * * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + * be in RFC 3339 format. + * * `labels`: Supports key-value equality as well as key presence. + * + * Examples: + * + * * `value_type = DOUBLE` --> Features whose type is DOUBLE. + * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + * or updated after 2020-01-31T15:30:00.000000Z. + * * `labels.active = yes AND labels.env = prod` --> Features having both + * (active: yes) and (env: prod) labels. + * * `labels.env: *` --> Any Feature which has a label with 'env' as the + * key. + * @param {number} request.pageSize + * The maximum number of Features to return. The service may return fewer + * than this value. If unspecified, at most 1000 Features will be returned. + * The maximum value is 1000; any value greater than 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} must + * match the call that provided the page token. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * + * * `feature_id` + * * `value_type` + * * `create_time` + * * `update_time` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {number} request.latestStatsCount + * If set, return the most recent {@link google.cloud.aiplatform.v1beta1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count} + * of stats for each Feature in response. Valid value is [0, 10]. If number of + * stats exists < {@link google.cloud.aiplatform.v1beta1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count}, return all + * existing stats. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Feature]{@link google.cloud.aiplatform.v1beta1.Feature}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listFeaturesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listFeatures( + request?: protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IFeature[], + protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListFeaturesResponse + ]>; + listFeatures( + request: protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, + protos.google.cloud.aiplatform.v1beta1.IListFeaturesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IFeature>): void; + listFeatures( + request: protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, + protos.google.cloud.aiplatform.v1beta1.IListFeaturesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IFeature>): void; + listFeatures( + request?: protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, + protos.google.cloud.aiplatform.v1beta1.IListFeaturesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IFeature>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, + protos.google.cloud.aiplatform.v1beta1.IListFeaturesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IFeature>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IFeature[], + protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListFeaturesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listFeatures(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list Features. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {string} request.filter + * Lists the Features that match the filter expression. The following + * filters are supported: + * + * * `value_type`: Supports = and != comparisons. + * * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + * be in RFC 3339 format. + * * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + * be in RFC 3339 format. + * * `labels`: Supports key-value equality as well as key presence. + * + * Examples: + * + * * `value_type = DOUBLE` --> Features whose type is DOUBLE. + * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + * or updated after 2020-01-31T15:30:00.000000Z. + * * `labels.active = yes AND labels.env = prod` --> Features having both + * (active: yes) and (env: prod) labels. + * * `labels.env: *` --> Any Feature which has a label with 'env' as the + * key. + * @param {number} request.pageSize + * The maximum number of Features to return. The service may return fewer + * than this value. If unspecified, at most 1000 Features will be returned. + * The maximum value is 1000; any value greater than 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} must + * match the call that provided the page token. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * + * * `feature_id` + * * `value_type` + * * `create_time` + * * `update_time` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {number} request.latestStatsCount + * If set, return the most recent {@link google.cloud.aiplatform.v1beta1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count} + * of stats for each Feature in response. Valid value is [0, 10]. If number of + * stats exists < {@link google.cloud.aiplatform.v1beta1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count}, return all + * existing stats. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Feature]{@link google.cloud.aiplatform.v1beta1.Feature} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listFeaturesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listFeaturesStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listFeatures']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listFeatures.createStream( + this.innerApiCalls.listFeatures as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listFeatures`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list Features. + * Format: + * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` + * @param {string} request.filter + * Lists the Features that match the filter expression. The following + * filters are supported: + * + * * `value_type`: Supports = and != comparisons. + * * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + * be in RFC 3339 format. + * * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must + * be in RFC 3339 format. + * * `labels`: Supports key-value equality as well as key presence. + * + * Examples: + * + * * `value_type = DOUBLE` --> Features whose type is DOUBLE. + * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR + * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created + * or updated after 2020-01-31T15:30:00.000000Z. + * * `labels.active = yes AND labels.env = prod` --> Features having both + * (active: yes) and (env: prod) labels. + * * `labels.env: *` --> Any Feature which has a label with 'env' as the + * key. + * @param {number} request.pageSize + * The maximum number of Features to return. The service may return fewer + * than this value. If unspecified, at most 1000 Features will be returned. + * The maximum value is 1000; any value greater than 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} must + * match the call that provided the page token. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order. + * Use "desc" after a field name for descending. + * Supported fields: + * + * * `feature_id` + * * `value_type` + * * `create_time` + * * `update_time` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {number} request.latestStatsCount + * If set, return the most recent {@link google.cloud.aiplatform.v1beta1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count} + * of stats for each Feature in response. Valid value is [0, 10]. If number of + * stats exists < {@link google.cloud.aiplatform.v1beta1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count}, return all + * existing stats. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Feature]{@link google.cloud.aiplatform.v1beta1.Feature}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_ListFeatures_async + */ + listFeaturesAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listFeatures']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listFeatures.asyncIterate( + this.innerApiCalls['listFeatures'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Searches Features matching a query in a given project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.location + * Required. The resource name of the Location to search Features. + * Format: + * `projects/{project}/locations/{location}` + * @param {string} request.query + * Query string that is a conjunction of field-restricted queries and/or + * field-restricted filters. Field-restricted queries and filters can be + * combined using `AND` to form a conjunction. + * + * A field query is in the form FIELD:QUERY. This implicitly checks if QUERY + * exists as a substring within Feature's FIELD. The QUERY + * and the FIELD are converted to a sequence of words (i.e. tokens) for + * comparison. This is done by: + * + * * Removing leading/trailing whitespace and tokenizing the search value. + * Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore + * `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated + * as a wildcard that matches characters within a token. + * * Ignoring case. + * * Prepending an asterisk to the first and appending an asterisk to the + * last token in QUERY. + * + * A QUERY must be either a singular token or a phrase. A phrase is one or + * multiple words enclosed in double quotation marks ("). With phrases, the + * order of the words is important. Words in the phrase must be matching in + * order and consecutively. + * + * Supported FIELDs for field-restricted queries: + * + * * `feature_id` + * * `description` + * * `entity_type_id` + * + * Examples: + * + * * `feature_id: foo` --> Matches a Feature with ID containing the substring + * `foo` (eg. `foo`, `foofeature`, `barfoo`). + * * `feature_id: foo*feature` --> Matches a Feature with ID containing the + * substring `foo*feature` (eg. `foobarfeature`). + * * `feature_id: foo AND description: bar` --> Matches a Feature with ID + * containing the substring `foo` and description containing the substring + * `bar`. + * + * + * Besides field queries, the following exact-match filters are + * supported. The exact-match filters do not support wildcards. Unlike + * field-restricted queries, exact-match filters are case-sensitive. + * + * * `feature_id`: Supports = comparisons. + * * `description`: Supports = comparisons. Multi-token filters should be + * enclosed in quotes. + * * `entity_type_id`: Supports = comparisons. + * * `value_type`: Supports = and != comparisons. + * * `labels`: Supports key-value equality as well as key presence. + * * `featurestore_id`: Supports = comparisons. + * + * Examples: + * * `description = "foo bar"` --> Any Feature with description exactly equal + * to `foo bar` + * * `value_type = DOUBLE` --> Features whose type is DOUBLE. + * * `labels.active = yes AND labels.env = prod` --> Features having both + * (active: yes) and (env: prod) labels. + * * `labels.env: *` --> Any Feature which has a label with `env` as the + * key. + * @param {number} request.pageSize + * The maximum number of Features to return. The service may return fewer + * than this value. If unspecified, at most 100 Features will be returned. + * The maximum value is 100; any value greater than 100 will be coerced to + * 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures}, except `page_size`, must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Feature]{@link google.cloud.aiplatform.v1beta1.Feature}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `searchFeaturesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchFeatures( + request?: protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IFeature[], + protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest|null, + protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesResponse + ]>; + searchFeatures( + request: protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, + protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IFeature>): void; + searchFeatures( + request: protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, + protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IFeature>): void; + searchFeatures( + request?: protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, + protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IFeature>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, + protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IFeature>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IFeature[], + protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest|null, + protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'location': request.location || '', + }); + this.initialize(); + return this.innerApiCalls.searchFeatures(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.location + * Required. The resource name of the Location to search Features. + * Format: + * `projects/{project}/locations/{location}` + * @param {string} request.query + * Query string that is a conjunction of field-restricted queries and/or + * field-restricted filters. Field-restricted queries and filters can be + * combined using `AND` to form a conjunction. + * + * A field query is in the form FIELD:QUERY. This implicitly checks if QUERY + * exists as a substring within Feature's FIELD. The QUERY + * and the FIELD are converted to a sequence of words (i.e. tokens) for + * comparison. This is done by: + * + * * Removing leading/trailing whitespace and tokenizing the search value. + * Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore + * `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated + * as a wildcard that matches characters within a token. + * * Ignoring case. + * * Prepending an asterisk to the first and appending an asterisk to the + * last token in QUERY. + * + * A QUERY must be either a singular token or a phrase. A phrase is one or + * multiple words enclosed in double quotation marks ("). With phrases, the + * order of the words is important. Words in the phrase must be matching in + * order and consecutively. + * + * Supported FIELDs for field-restricted queries: + * + * * `feature_id` + * * `description` + * * `entity_type_id` + * + * Examples: + * + * * `feature_id: foo` --> Matches a Feature with ID containing the substring + * `foo` (eg. `foo`, `foofeature`, `barfoo`). + * * `feature_id: foo*feature` --> Matches a Feature with ID containing the + * substring `foo*feature` (eg. `foobarfeature`). + * * `feature_id: foo AND description: bar` --> Matches a Feature with ID + * containing the substring `foo` and description containing the substring + * `bar`. + * + * + * Besides field queries, the following exact-match filters are + * supported. The exact-match filters do not support wildcards. Unlike + * field-restricted queries, exact-match filters are case-sensitive. + * + * * `feature_id`: Supports = comparisons. + * * `description`: Supports = comparisons. Multi-token filters should be + * enclosed in quotes. + * * `entity_type_id`: Supports = comparisons. + * * `value_type`: Supports = and != comparisons. + * * `labels`: Supports key-value equality as well as key presence. + * * `featurestore_id`: Supports = comparisons. + * + * Examples: + * * `description = "foo bar"` --> Any Feature with description exactly equal + * to `foo bar` + * * `value_type = DOUBLE` --> Features whose type is DOUBLE. + * * `labels.active = yes AND labels.env = prod` --> Features having both + * (active: yes) and (env: prod) labels. + * * `labels.env: *` --> Any Feature which has a label with `env` as the + * key. + * @param {number} request.pageSize + * The maximum number of Features to return. The service may return fewer + * than this value. If unspecified, at most 100 Features will be returned. + * The maximum value is 100; any value greater than 100 will be coerced to + * 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures}, except `page_size`, must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Feature]{@link google.cloud.aiplatform.v1beta1.Feature} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `searchFeaturesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchFeaturesStream( + request?: protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'location': request.location || '', + }); + const defaultCallSettings = this._defaults['searchFeatures']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchFeatures.createStream( + this.innerApiCalls.searchFeatures as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchFeatures`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.location + * Required. The resource name of the Location to search Features. + * Format: + * `projects/{project}/locations/{location}` + * @param {string} request.query + * Query string that is a conjunction of field-restricted queries and/or + * field-restricted filters. Field-restricted queries and filters can be + * combined using `AND` to form a conjunction. + * + * A field query is in the form FIELD:QUERY. This implicitly checks if QUERY + * exists as a substring within Feature's FIELD. The QUERY + * and the FIELD are converted to a sequence of words (i.e. tokens) for + * comparison. This is done by: + * + * * Removing leading/trailing whitespace and tokenizing the search value. + * Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore + * `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated + * as a wildcard that matches characters within a token. + * * Ignoring case. + * * Prepending an asterisk to the first and appending an asterisk to the + * last token in QUERY. + * + * A QUERY must be either a singular token or a phrase. A phrase is one or + * multiple words enclosed in double quotation marks ("). With phrases, the + * order of the words is important. Words in the phrase must be matching in + * order and consecutively. + * + * Supported FIELDs for field-restricted queries: + * + * * `feature_id` + * * `description` + * * `entity_type_id` + * + * Examples: + * + * * `feature_id: foo` --> Matches a Feature with ID containing the substring + * `foo` (eg. `foo`, `foofeature`, `barfoo`). + * * `feature_id: foo*feature` --> Matches a Feature with ID containing the + * substring `foo*feature` (eg. `foobarfeature`). + * * `feature_id: foo AND description: bar` --> Matches a Feature with ID + * containing the substring `foo` and description containing the substring + * `bar`. + * + * + * Besides field queries, the following exact-match filters are + * supported. The exact-match filters do not support wildcards. Unlike + * field-restricted queries, exact-match filters are case-sensitive. + * + * * `feature_id`: Supports = comparisons. + * * `description`: Supports = comparisons. Multi-token filters should be + * enclosed in quotes. + * * `entity_type_id`: Supports = comparisons. + * * `value_type`: Supports = and != comparisons. + * * `labels`: Supports key-value equality as well as key presence. + * * `featurestore_id`: Supports = comparisons. + * + * Examples: + * * `description = "foo bar"` --> Any Feature with description exactly equal + * to `foo bar` + * * `value_type = DOUBLE` --> Features whose type is DOUBLE. + * * `labels.active = yes AND labels.env = prod` --> Features having both + * (active: yes) and (env: prod) labels. + * * `labels.env: *` --> Any Feature which has a label with `env` as the + * key. + * @param {number} request.pageSize + * The maximum number of Features to return. The service may return fewer + * than this value. If unspecified, at most 100 Features will be returned. + * The maximum value is 100; any value greater than 100 will be coerced to + * 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures}, except `page_size`, must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Feature]{@link google.cloud.aiplatform.v1beta1.Feature}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_SearchFeatures_async + */ + searchFeaturesAsync( + request?: protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'location': request.location || '', + }); + const defaultCallSettings = this._defaults['searchFeatures']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchFeatures.asyncIterate( + this.innerApiCalls['searchFeatures'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.featurestoreServiceStub && !this._terminated) { + return this.featurestoreServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_client_config.json new file mode 100644 index 00000000..094a033d --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_client_config.json @@ -0,0 +1,125 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.FeaturestoreService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateFeaturestore": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetFeaturestore": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListFeaturestores": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateFeaturestore": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteFeaturestore": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateEntityType": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetEntityType": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListEntityTypes": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateEntityType": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteEntityType": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateFeature": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchCreateFeatures": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetFeature": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListFeatures": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateFeature": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteFeature": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ImportFeatureValues": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchReadFeatureValues": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportFeatureValues": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SearchFeatures": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_proto_list.json new file mode 100644 index 00000000..c916ab12 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_proto_list.json @@ -0,0 +1,117 @@ +[ + "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/context.proto", + "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1beta1/event.proto", + "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/io.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/study.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/types.proto", + "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1beta1/value.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json b/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000..a8aca391 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json @@ -0,0 +1,2243 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.aiplatform.v1beta1", + "libraryPackage": "@google-cloud/aiplatform", + "services": { + "DatasetService": { + "clients": { + "grpc": { + "libraryClient": "DatasetServiceClient", + "rpcs": { + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + }, + "GetAnnotationSpec": { + "methods": [ + "getAnnotationSpec" + ] + }, + "CreateDataset": { + "methods": [ + "createDataset" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets", + "listDatasetsStream", + "listDatasetsAsync" + ] + }, + "ListDataItems": { + "methods": [ + "listDataItems", + "listDataItemsStream", + "listDataItemsAsync" + ] + }, + "ListAnnotations": { + "methods": [ + "listAnnotations", + "listAnnotationsStream", + "listAnnotationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DatasetServiceClient", + "rpcs": { + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + }, + "GetAnnotationSpec": { + "methods": [ + "getAnnotationSpec" + ] + }, + "CreateDataset": { + "methods": [ + "createDataset" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets", + "listDatasetsStream", + "listDatasetsAsync" + ] + }, + "ListDataItems": { + "methods": [ + "listDataItems", + "listDataItemsStream", + "listDataItemsAsync" + ] + }, + "ListAnnotations": { + "methods": [ + "listAnnotations", + "listAnnotationsStream", + "listAnnotationsAsync" + ] + } + } + } + } + }, + "EndpointService": { + "clients": { + "grpc": { + "libraryClient": "EndpointServiceClient", + "rpcs": { + "GetEndpoint": { + "methods": [ + "getEndpoint" + ] + }, + "UpdateEndpoint": { + "methods": [ + "updateEndpoint" + ] + }, + "CreateEndpoint": { + "methods": [ + "createEndpoint" + ] + }, + "DeleteEndpoint": { + "methods": [ + "deleteEndpoint" + ] + }, + "DeployModel": { + "methods": [ + "deployModel" + ] + }, + "UndeployModel": { + "methods": [ + "undeployModel" + ] + }, + "ListEndpoints": { + "methods": [ + "listEndpoints", + "listEndpointsStream", + "listEndpointsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "EndpointServiceClient", + "rpcs": { + "GetEndpoint": { + "methods": [ + "getEndpoint" + ] + }, + "UpdateEndpoint": { + "methods": [ + "updateEndpoint" + ] + }, + "CreateEndpoint": { + "methods": [ + "createEndpoint" + ] + }, + "DeleteEndpoint": { + "methods": [ + "deleteEndpoint" + ] + }, + "DeployModel": { + "methods": [ + "deployModel" + ] + }, + "UndeployModel": { + "methods": [ + "undeployModel" + ] + }, + "ListEndpoints": { + "methods": [ + "listEndpoints", + "listEndpointsStream", + "listEndpointsAsync" + ] + } + } + } + } + }, + "FeaturestoreOnlineServingService": { + "clients": { + "grpc": { + "libraryClient": "FeaturestoreOnlineServingServiceClient", + "rpcs": { + "ReadFeatureValues": { + "methods": [ + "readFeatureValues" + ] + }, + "StreamingReadFeatureValues": { + "methods": [ + "streamingReadFeatureValues" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "FeaturestoreOnlineServingServiceClient", + "rpcs": { + "ReadFeatureValues": { + "methods": [ + "readFeatureValues" + ] + } + } + } + } + }, + "FeaturestoreService": { + "clients": { + "grpc": { + "libraryClient": "FeaturestoreServiceClient", + "rpcs": { + "GetFeaturestore": { + "methods": [ + "getFeaturestore" + ] + }, + "GetEntityType": { + "methods": [ + "getEntityType" + ] + }, + "UpdateEntityType": { + "methods": [ + "updateEntityType" + ] + }, + "GetFeature": { + "methods": [ + "getFeature" + ] + }, + "UpdateFeature": { + "methods": [ + "updateFeature" + ] + }, + "CreateFeaturestore": { + "methods": [ + "createFeaturestore" + ] + }, + "UpdateFeaturestore": { + "methods": [ + "updateFeaturestore" + ] + }, + "DeleteFeaturestore": { + "methods": [ + "deleteFeaturestore" + ] + }, + "CreateEntityType": { + "methods": [ + "createEntityType" + ] + }, + "DeleteEntityType": { + "methods": [ + "deleteEntityType" + ] + }, + "CreateFeature": { + "methods": [ + "createFeature" + ] + }, + "BatchCreateFeatures": { + "methods": [ + "batchCreateFeatures" + ] + }, + "DeleteFeature": { + "methods": [ + "deleteFeature" + ] + }, + "ImportFeatureValues": { + "methods": [ + "importFeatureValues" + ] + }, + "BatchReadFeatureValues": { + "methods": [ + "batchReadFeatureValues" + ] + }, + "ExportFeatureValues": { + "methods": [ + "exportFeatureValues" + ] + }, + "ListFeaturestores": { + "methods": [ + "listFeaturestores", + "listFeaturestoresStream", + "listFeaturestoresAsync" + ] + }, + "ListEntityTypes": { + "methods": [ + "listEntityTypes", + "listEntityTypesStream", + "listEntityTypesAsync" + ] + }, + "ListFeatures": { + "methods": [ + "listFeatures", + "listFeaturesStream", + "listFeaturesAsync" + ] + }, + "SearchFeatures": { + "methods": [ + "searchFeatures", + "searchFeaturesStream", + "searchFeaturesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "FeaturestoreServiceClient", + "rpcs": { + "GetFeaturestore": { + "methods": [ + "getFeaturestore" + ] + }, + "GetEntityType": { + "methods": [ + "getEntityType" + ] + }, + "UpdateEntityType": { + "methods": [ + "updateEntityType" + ] + }, + "GetFeature": { + "methods": [ + "getFeature" + ] + }, + "UpdateFeature": { + "methods": [ + "updateFeature" + ] + }, + "CreateFeaturestore": { + "methods": [ + "createFeaturestore" + ] + }, + "UpdateFeaturestore": { + "methods": [ + "updateFeaturestore" + ] + }, + "DeleteFeaturestore": { + "methods": [ + "deleteFeaturestore" + ] + }, + "CreateEntityType": { + "methods": [ + "createEntityType" + ] + }, + "DeleteEntityType": { + "methods": [ + "deleteEntityType" + ] + }, + "CreateFeature": { + "methods": [ + "createFeature" + ] + }, + "BatchCreateFeatures": { + "methods": [ + "batchCreateFeatures" + ] + }, + "DeleteFeature": { + "methods": [ + "deleteFeature" + ] + }, + "ImportFeatureValues": { + "methods": [ + "importFeatureValues" + ] + }, + "BatchReadFeatureValues": { + "methods": [ + "batchReadFeatureValues" + ] + }, + "ExportFeatureValues": { + "methods": [ + "exportFeatureValues" + ] + }, + "ListFeaturestores": { + "methods": [ + "listFeaturestores", + "listFeaturestoresStream", + "listFeaturestoresAsync" + ] + }, + "ListEntityTypes": { + "methods": [ + "listEntityTypes", + "listEntityTypesStream", + "listEntityTypesAsync" + ] + }, + "ListFeatures": { + "methods": [ + "listFeatures", + "listFeaturesStream", + "listFeaturesAsync" + ] + }, + "SearchFeatures": { + "methods": [ + "searchFeatures", + "searchFeaturesStream", + "searchFeaturesAsync" + ] + } + } + } + } + }, + "IndexEndpointService": { + "clients": { + "grpc": { + "libraryClient": "IndexEndpointServiceClient", + "rpcs": { + "GetIndexEndpoint": { + "methods": [ + "getIndexEndpoint" + ] + }, + "UpdateIndexEndpoint": { + "methods": [ + "updateIndexEndpoint" + ] + }, + "CreateIndexEndpoint": { + "methods": [ + "createIndexEndpoint" + ] + }, + "DeleteIndexEndpoint": { + "methods": [ + "deleteIndexEndpoint" + ] + }, + "DeployIndex": { + "methods": [ + "deployIndex" + ] + }, + "UndeployIndex": { + "methods": [ + "undeployIndex" + ] + }, + "MutateDeployedIndex": { + "methods": [ + "mutateDeployedIndex" + ] + }, + "ListIndexEndpoints": { + "methods": [ + "listIndexEndpoints", + "listIndexEndpointsStream", + "listIndexEndpointsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "IndexEndpointServiceClient", + "rpcs": { + "GetIndexEndpoint": { + "methods": [ + "getIndexEndpoint" + ] + }, + "UpdateIndexEndpoint": { + "methods": [ + "updateIndexEndpoint" + ] + }, + "CreateIndexEndpoint": { + "methods": [ + "createIndexEndpoint" + ] + }, + "DeleteIndexEndpoint": { + "methods": [ + "deleteIndexEndpoint" + ] + }, + "DeployIndex": { + "methods": [ + "deployIndex" + ] + }, + "UndeployIndex": { + "methods": [ + "undeployIndex" + ] + }, + "MutateDeployedIndex": { + "methods": [ + "mutateDeployedIndex" + ] + }, + "ListIndexEndpoints": { + "methods": [ + "listIndexEndpoints", + "listIndexEndpointsStream", + "listIndexEndpointsAsync" + ] + } + } + } + } + }, + "IndexService": { + "clients": { + "grpc": { + "libraryClient": "IndexServiceClient", + "rpcs": { + "GetIndex": { + "methods": [ + "getIndex" + ] + }, + "CreateIndex": { + "methods": [ + "createIndex" + ] + }, + "UpdateIndex": { + "methods": [ + "updateIndex" + ] + }, + "DeleteIndex": { + "methods": [ + "deleteIndex" + ] + }, + "ListIndexes": { + "methods": [ + "listIndexes", + "listIndexesStream", + "listIndexesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "IndexServiceClient", + "rpcs": { + "GetIndex": { + "methods": [ + "getIndex" + ] + }, + "CreateIndex": { + "methods": [ + "createIndex" + ] + }, + "UpdateIndex": { + "methods": [ + "updateIndex" + ] + }, + "DeleteIndex": { + "methods": [ + "deleteIndex" + ] + }, + "ListIndexes": { + "methods": [ + "listIndexes", + "listIndexesStream", + "listIndexesAsync" + ] + } + } + } + } + }, + "JobService": { + "clients": { + "grpc": { + "libraryClient": "JobServiceClient", + "rpcs": { + "CreateCustomJob": { + "methods": [ + "createCustomJob" + ] + }, + "GetCustomJob": { + "methods": [ + "getCustomJob" + ] + }, + "CancelCustomJob": { + "methods": [ + "cancelCustomJob" + ] + }, + "CreateDataLabelingJob": { + "methods": [ + "createDataLabelingJob" + ] + }, + "GetDataLabelingJob": { + "methods": [ + "getDataLabelingJob" + ] + }, + "CancelDataLabelingJob": { + "methods": [ + "cancelDataLabelingJob" + ] + }, + "CreateHyperparameterTuningJob": { + "methods": [ + "createHyperparameterTuningJob" + ] + }, + "GetHyperparameterTuningJob": { + "methods": [ + "getHyperparameterTuningJob" + ] + }, + "CancelHyperparameterTuningJob": { + "methods": [ + "cancelHyperparameterTuningJob" + ] + }, + "CreateBatchPredictionJob": { + "methods": [ + "createBatchPredictionJob" + ] + }, + "GetBatchPredictionJob": { + "methods": [ + "getBatchPredictionJob" + ] + }, + "CancelBatchPredictionJob": { + "methods": [ + "cancelBatchPredictionJob" + ] + }, + "CreateModelDeploymentMonitoringJob": { + "methods": [ + "createModelDeploymentMonitoringJob" + ] + }, + "GetModelDeploymentMonitoringJob": { + "methods": [ + "getModelDeploymentMonitoringJob" + ] + }, + "PauseModelDeploymentMonitoringJob": { + "methods": [ + "pauseModelDeploymentMonitoringJob" + ] + }, + "ResumeModelDeploymentMonitoringJob": { + "methods": [ + "resumeModelDeploymentMonitoringJob" + ] + }, + "DeleteCustomJob": { + "methods": [ + "deleteCustomJob" + ] + }, + "DeleteDataLabelingJob": { + "methods": [ + "deleteDataLabelingJob" + ] + }, + "DeleteHyperparameterTuningJob": { + "methods": [ + "deleteHyperparameterTuningJob" + ] + }, + "DeleteBatchPredictionJob": { + "methods": [ + "deleteBatchPredictionJob" + ] + }, + "UpdateModelDeploymentMonitoringJob": { + "methods": [ + "updateModelDeploymentMonitoringJob" + ] + }, + "DeleteModelDeploymentMonitoringJob": { + "methods": [ + "deleteModelDeploymentMonitoringJob" + ] + }, + "ListCustomJobs": { + "methods": [ + "listCustomJobs", + "listCustomJobsStream", + "listCustomJobsAsync" + ] + }, + "ListDataLabelingJobs": { + "methods": [ + "listDataLabelingJobs", + "listDataLabelingJobsStream", + "listDataLabelingJobsAsync" + ] + }, + "ListHyperparameterTuningJobs": { + "methods": [ + "listHyperparameterTuningJobs", + "listHyperparameterTuningJobsStream", + "listHyperparameterTuningJobsAsync" + ] + }, + "ListBatchPredictionJobs": { + "methods": [ + "listBatchPredictionJobs", + "listBatchPredictionJobsStream", + "listBatchPredictionJobsAsync" + ] + }, + "SearchModelDeploymentMonitoringStatsAnomalies": { + "methods": [ + "searchModelDeploymentMonitoringStatsAnomalies", + "searchModelDeploymentMonitoringStatsAnomaliesStream", + "searchModelDeploymentMonitoringStatsAnomaliesAsync" + ] + }, + "ListModelDeploymentMonitoringJobs": { + "methods": [ + "listModelDeploymentMonitoringJobs", + "listModelDeploymentMonitoringJobsStream", + "listModelDeploymentMonitoringJobsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "JobServiceClient", + "rpcs": { + "CreateCustomJob": { + "methods": [ + "createCustomJob" + ] + }, + "GetCustomJob": { + "methods": [ + "getCustomJob" + ] + }, + "CancelCustomJob": { + "methods": [ + "cancelCustomJob" + ] + }, + "CreateDataLabelingJob": { + "methods": [ + "createDataLabelingJob" + ] + }, + "GetDataLabelingJob": { + "methods": [ + "getDataLabelingJob" + ] + }, + "CancelDataLabelingJob": { + "methods": [ + "cancelDataLabelingJob" + ] + }, + "CreateHyperparameterTuningJob": { + "methods": [ + "createHyperparameterTuningJob" + ] + }, + "GetHyperparameterTuningJob": { + "methods": [ + "getHyperparameterTuningJob" + ] + }, + "CancelHyperparameterTuningJob": { + "methods": [ + "cancelHyperparameterTuningJob" + ] + }, + "CreateBatchPredictionJob": { + "methods": [ + "createBatchPredictionJob" + ] + }, + "GetBatchPredictionJob": { + "methods": [ + "getBatchPredictionJob" + ] + }, + "CancelBatchPredictionJob": { + "methods": [ + "cancelBatchPredictionJob" + ] + }, + "CreateModelDeploymentMonitoringJob": { + "methods": [ + "createModelDeploymentMonitoringJob" + ] + }, + "GetModelDeploymentMonitoringJob": { + "methods": [ + "getModelDeploymentMonitoringJob" + ] + }, + "PauseModelDeploymentMonitoringJob": { + "methods": [ + "pauseModelDeploymentMonitoringJob" + ] + }, + "ResumeModelDeploymentMonitoringJob": { + "methods": [ + "resumeModelDeploymentMonitoringJob" + ] + }, + "DeleteCustomJob": { + "methods": [ + "deleteCustomJob" + ] + }, + "DeleteDataLabelingJob": { + "methods": [ + "deleteDataLabelingJob" + ] + }, + "DeleteHyperparameterTuningJob": { + "methods": [ + "deleteHyperparameterTuningJob" + ] + }, + "DeleteBatchPredictionJob": { + "methods": [ + "deleteBatchPredictionJob" + ] + }, + "UpdateModelDeploymentMonitoringJob": { + "methods": [ + "updateModelDeploymentMonitoringJob" + ] + }, + "DeleteModelDeploymentMonitoringJob": { + "methods": [ + "deleteModelDeploymentMonitoringJob" + ] + }, + "ListCustomJobs": { + "methods": [ + "listCustomJobs", + "listCustomJobsStream", + "listCustomJobsAsync" + ] + }, + "ListDataLabelingJobs": { + "methods": [ + "listDataLabelingJobs", + "listDataLabelingJobsStream", + "listDataLabelingJobsAsync" + ] + }, + "ListHyperparameterTuningJobs": { + "methods": [ + "listHyperparameterTuningJobs", + "listHyperparameterTuningJobsStream", + "listHyperparameterTuningJobsAsync" + ] + }, + "ListBatchPredictionJobs": { + "methods": [ + "listBatchPredictionJobs", + "listBatchPredictionJobsStream", + "listBatchPredictionJobsAsync" + ] + }, + "SearchModelDeploymentMonitoringStatsAnomalies": { + "methods": [ + "searchModelDeploymentMonitoringStatsAnomalies", + "searchModelDeploymentMonitoringStatsAnomaliesStream", + "searchModelDeploymentMonitoringStatsAnomaliesAsync" + ] + }, + "ListModelDeploymentMonitoringJobs": { + "methods": [ + "listModelDeploymentMonitoringJobs", + "listModelDeploymentMonitoringJobsStream", + "listModelDeploymentMonitoringJobsAsync" + ] + } + } + } + } + }, + "MetadataService": { + "clients": { + "grpc": { + "libraryClient": "MetadataServiceClient", + "rpcs": { + "GetMetadataStore": { + "methods": [ + "getMetadataStore" + ] + }, + "CreateArtifact": { + "methods": [ + "createArtifact" + ] + }, + "GetArtifact": { + "methods": [ + "getArtifact" + ] + }, + "UpdateArtifact": { + "methods": [ + "updateArtifact" + ] + }, + "CreateContext": { + "methods": [ + "createContext" + ] + }, + "GetContext": { + "methods": [ + "getContext" + ] + }, + "UpdateContext": { + "methods": [ + "updateContext" + ] + }, + "AddContextArtifactsAndExecutions": { + "methods": [ + "addContextArtifactsAndExecutions" + ] + }, + "AddContextChildren": { + "methods": [ + "addContextChildren" + ] + }, + "QueryContextLineageSubgraph": { + "methods": [ + "queryContextLineageSubgraph" + ] + }, + "CreateExecution": { + "methods": [ + "createExecution" + ] + }, + "GetExecution": { + "methods": [ + "getExecution" + ] + }, + "UpdateExecution": { + "methods": [ + "updateExecution" + ] + }, + "AddExecutionEvents": { + "methods": [ + "addExecutionEvents" + ] + }, + "QueryExecutionInputsAndOutputs": { + "methods": [ + "queryExecutionInputsAndOutputs" + ] + }, + "CreateMetadataSchema": { + "methods": [ + "createMetadataSchema" + ] + }, + "GetMetadataSchema": { + "methods": [ + "getMetadataSchema" + ] + }, + "QueryArtifactLineageSubgraph": { + "methods": [ + "queryArtifactLineageSubgraph" + ] + }, + "CreateMetadataStore": { + "methods": [ + "createMetadataStore" + ] + }, + "DeleteMetadataStore": { + "methods": [ + "deleteMetadataStore" + ] + }, + "DeleteArtifact": { + "methods": [ + "deleteArtifact" + ] + }, + "PurgeArtifacts": { + "methods": [ + "purgeArtifacts" + ] + }, + "DeleteContext": { + "methods": [ + "deleteContext" + ] + }, + "PurgeContexts": { + "methods": [ + "purgeContexts" + ] + }, + "DeleteExecution": { + "methods": [ + "deleteExecution" + ] + }, + "PurgeExecutions": { + "methods": [ + "purgeExecutions" + ] + }, + "ListMetadataStores": { + "methods": [ + "listMetadataStores", + "listMetadataStoresStream", + "listMetadataStoresAsync" + ] + }, + "ListArtifacts": { + "methods": [ + "listArtifacts", + "listArtifactsStream", + "listArtifactsAsync" + ] + }, + "ListContexts": { + "methods": [ + "listContexts", + "listContextsStream", + "listContextsAsync" + ] + }, + "ListExecutions": { + "methods": [ + "listExecutions", + "listExecutionsStream", + "listExecutionsAsync" + ] + }, + "ListMetadataSchemas": { + "methods": [ + "listMetadataSchemas", + "listMetadataSchemasStream", + "listMetadataSchemasAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "MetadataServiceClient", + "rpcs": { + "GetMetadataStore": { + "methods": [ + "getMetadataStore" + ] + }, + "CreateArtifact": { + "methods": [ + "createArtifact" + ] + }, + "GetArtifact": { + "methods": [ + "getArtifact" + ] + }, + "UpdateArtifact": { + "methods": [ + "updateArtifact" + ] + }, + "CreateContext": { + "methods": [ + "createContext" + ] + }, + "GetContext": { + "methods": [ + "getContext" + ] + }, + "UpdateContext": { + "methods": [ + "updateContext" + ] + }, + "AddContextArtifactsAndExecutions": { + "methods": [ + "addContextArtifactsAndExecutions" + ] + }, + "AddContextChildren": { + "methods": [ + "addContextChildren" + ] + }, + "QueryContextLineageSubgraph": { + "methods": [ + "queryContextLineageSubgraph" + ] + }, + "CreateExecution": { + "methods": [ + "createExecution" + ] + }, + "GetExecution": { + "methods": [ + "getExecution" + ] + }, + "UpdateExecution": { + "methods": [ + "updateExecution" + ] + }, + "AddExecutionEvents": { + "methods": [ + "addExecutionEvents" + ] + }, + "QueryExecutionInputsAndOutputs": { + "methods": [ + "queryExecutionInputsAndOutputs" + ] + }, + "CreateMetadataSchema": { + "methods": [ + "createMetadataSchema" + ] + }, + "GetMetadataSchema": { + "methods": [ + "getMetadataSchema" + ] + }, + "QueryArtifactLineageSubgraph": { + "methods": [ + "queryArtifactLineageSubgraph" + ] + }, + "CreateMetadataStore": { + "methods": [ + "createMetadataStore" + ] + }, + "DeleteMetadataStore": { + "methods": [ + "deleteMetadataStore" + ] + }, + "DeleteArtifact": { + "methods": [ + "deleteArtifact" + ] + }, + "PurgeArtifacts": { + "methods": [ + "purgeArtifacts" + ] + }, + "DeleteContext": { + "methods": [ + "deleteContext" + ] + }, + "PurgeContexts": { + "methods": [ + "purgeContexts" + ] + }, + "DeleteExecution": { + "methods": [ + "deleteExecution" + ] + }, + "PurgeExecutions": { + "methods": [ + "purgeExecutions" + ] + }, + "ListMetadataStores": { + "methods": [ + "listMetadataStores", + "listMetadataStoresStream", + "listMetadataStoresAsync" + ] + }, + "ListArtifacts": { + "methods": [ + "listArtifacts", + "listArtifactsStream", + "listArtifactsAsync" + ] + }, + "ListContexts": { + "methods": [ + "listContexts", + "listContextsStream", + "listContextsAsync" + ] + }, + "ListExecutions": { + "methods": [ + "listExecutions", + "listExecutionsStream", + "listExecutionsAsync" + ] + }, + "ListMetadataSchemas": { + "methods": [ + "listMetadataSchemas", + "listMetadataSchemasStream", + "listMetadataSchemasAsync" + ] + } + } + } + } + }, + "MigrationService": { + "clients": { + "grpc": { + "libraryClient": "MigrationServiceClient", + "rpcs": { + "BatchMigrateResources": { + "methods": [ + "batchMigrateResources" + ] + }, + "SearchMigratableResources": { + "methods": [ + "searchMigratableResources", + "searchMigratableResourcesStream", + "searchMigratableResourcesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "MigrationServiceClient", + "rpcs": { + "BatchMigrateResources": { + "methods": [ + "batchMigrateResources" + ] + }, + "SearchMigratableResources": { + "methods": [ + "searchMigratableResources", + "searchMigratableResourcesStream", + "searchMigratableResourcesAsync" + ] + } + } + } + } + }, + "ModelService": { + "clients": { + "grpc": { + "libraryClient": "ModelServiceClient", + "rpcs": { + "GetModel": { + "methods": [ + "getModel" + ] + }, + "UpdateModel": { + "methods": [ + "updateModel" + ] + }, + "MergeVersionAliases": { + "methods": [ + "mergeVersionAliases" + ] + }, + "ImportModelEvaluation": { + "methods": [ + "importModelEvaluation" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "GetModelEvaluationSlice": { + "methods": [ + "getModelEvaluationSlice" + ] + }, + "UploadModel": { + "methods": [ + "uploadModel" + ] + }, + "UpdateExplanationDataset": { + "methods": [ + "updateExplanationDataset" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "DeleteModelVersion": { + "methods": [ + "deleteModelVersion" + ] + }, + "ExportModel": { + "methods": [ + "exportModel" + ] + }, + "ListModels": { + "methods": [ + "listModels", + "listModelsStream", + "listModelsAsync" + ] + }, + "ListModelVersions": { + "methods": [ + "listModelVersions", + "listModelVersionsStream", + "listModelVersionsAsync" + ] + }, + "ListModelEvaluations": { + "methods": [ + "listModelEvaluations", + "listModelEvaluationsStream", + "listModelEvaluationsAsync" + ] + }, + "ListModelEvaluationSlices": { + "methods": [ + "listModelEvaluationSlices", + "listModelEvaluationSlicesStream", + "listModelEvaluationSlicesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ModelServiceClient", + "rpcs": { + "GetModel": { + "methods": [ + "getModel" + ] + }, + "UpdateModel": { + "methods": [ + "updateModel" + ] + }, + "MergeVersionAliases": { + "methods": [ + "mergeVersionAliases" + ] + }, + "ImportModelEvaluation": { + "methods": [ + "importModelEvaluation" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "GetModelEvaluationSlice": { + "methods": [ + "getModelEvaluationSlice" + ] + }, + "UploadModel": { + "methods": [ + "uploadModel" + ] + }, + "UpdateExplanationDataset": { + "methods": [ + "updateExplanationDataset" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "DeleteModelVersion": { + "methods": [ + "deleteModelVersion" + ] + }, + "ExportModel": { + "methods": [ + "exportModel" + ] + }, + "ListModels": { + "methods": [ + "listModels", + "listModelsStream", + "listModelsAsync" + ] + }, + "ListModelVersions": { + "methods": [ + "listModelVersions", + "listModelVersionsStream", + "listModelVersionsAsync" + ] + }, + "ListModelEvaluations": { + "methods": [ + "listModelEvaluations", + "listModelEvaluationsStream", + "listModelEvaluationsAsync" + ] + }, + "ListModelEvaluationSlices": { + "methods": [ + "listModelEvaluationSlices", + "listModelEvaluationSlicesStream", + "listModelEvaluationSlicesAsync" + ] + } + } + } + } + }, + "PipelineService": { + "clients": { + "grpc": { + "libraryClient": "PipelineServiceClient", + "rpcs": { + "CreateTrainingPipeline": { + "methods": [ + "createTrainingPipeline" + ] + }, + "GetTrainingPipeline": { + "methods": [ + "getTrainingPipeline" + ] + }, + "CancelTrainingPipeline": { + "methods": [ + "cancelTrainingPipeline" + ] + }, + "CreatePipelineJob": { + "methods": [ + "createPipelineJob" + ] + }, + "GetPipelineJob": { + "methods": [ + "getPipelineJob" + ] + }, + "CancelPipelineJob": { + "methods": [ + "cancelPipelineJob" + ] + }, + "DeleteTrainingPipeline": { + "methods": [ + "deleteTrainingPipeline" + ] + }, + "DeletePipelineJob": { + "methods": [ + "deletePipelineJob" + ] + }, + "ListTrainingPipelines": { + "methods": [ + "listTrainingPipelines", + "listTrainingPipelinesStream", + "listTrainingPipelinesAsync" + ] + }, + "ListPipelineJobs": { + "methods": [ + "listPipelineJobs", + "listPipelineJobsStream", + "listPipelineJobsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PipelineServiceClient", + "rpcs": { + "CreateTrainingPipeline": { + "methods": [ + "createTrainingPipeline" + ] + }, + "GetTrainingPipeline": { + "methods": [ + "getTrainingPipeline" + ] + }, + "CancelTrainingPipeline": { + "methods": [ + "cancelTrainingPipeline" + ] + }, + "CreatePipelineJob": { + "methods": [ + "createPipelineJob" + ] + }, + "GetPipelineJob": { + "methods": [ + "getPipelineJob" + ] + }, + "CancelPipelineJob": { + "methods": [ + "cancelPipelineJob" + ] + }, + "DeleteTrainingPipeline": { + "methods": [ + "deleteTrainingPipeline" + ] + }, + "DeletePipelineJob": { + "methods": [ + "deletePipelineJob" + ] + }, + "ListTrainingPipelines": { + "methods": [ + "listTrainingPipelines", + "listTrainingPipelinesStream", + "listTrainingPipelinesAsync" + ] + }, + "ListPipelineJobs": { + "methods": [ + "listPipelineJobs", + "listPipelineJobsStream", + "listPipelineJobsAsync" + ] + } + } + } + } + }, + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionServiceClient", + "rpcs": { + "Predict": { + "methods": [ + "predict" + ] + }, + "RawPredict": { + "methods": [ + "rawPredict" + ] + }, + "Explain": { + "methods": [ + "explain" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PredictionServiceClient", + "rpcs": { + "Predict": { + "methods": [ + "predict" + ] + }, + "RawPredict": { + "methods": [ + "rawPredict" + ] + }, + "Explain": { + "methods": [ + "explain" + ] + } + } + } + } + }, + "SpecialistPoolService": { + "clients": { + "grpc": { + "libraryClient": "SpecialistPoolServiceClient", + "rpcs": { + "GetSpecialistPool": { + "methods": [ + "getSpecialistPool" + ] + }, + "CreateSpecialistPool": { + "methods": [ + "createSpecialistPool" + ] + }, + "DeleteSpecialistPool": { + "methods": [ + "deleteSpecialistPool" + ] + }, + "UpdateSpecialistPool": { + "methods": [ + "updateSpecialistPool" + ] + }, + "ListSpecialistPools": { + "methods": [ + "listSpecialistPools", + "listSpecialistPoolsStream", + "listSpecialistPoolsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SpecialistPoolServiceClient", + "rpcs": { + "GetSpecialistPool": { + "methods": [ + "getSpecialistPool" + ] + }, + "CreateSpecialistPool": { + "methods": [ + "createSpecialistPool" + ] + }, + "DeleteSpecialistPool": { + "methods": [ + "deleteSpecialistPool" + ] + }, + "UpdateSpecialistPool": { + "methods": [ + "updateSpecialistPool" + ] + }, + "ListSpecialistPools": { + "methods": [ + "listSpecialistPools", + "listSpecialistPoolsStream", + "listSpecialistPoolsAsync" + ] + } + } + } + } + }, + "TensorboardService": { + "clients": { + "grpc": { + "libraryClient": "TensorboardServiceClient", + "rpcs": { + "GetTensorboard": { + "methods": [ + "getTensorboard" + ] + }, + "CreateTensorboardExperiment": { + "methods": [ + "createTensorboardExperiment" + ] + }, + "GetTensorboardExperiment": { + "methods": [ + "getTensorboardExperiment" + ] + }, + "UpdateTensorboardExperiment": { + "methods": [ + "updateTensorboardExperiment" + ] + }, + "CreateTensorboardRun": { + "methods": [ + "createTensorboardRun" + ] + }, + "BatchCreateTensorboardRuns": { + "methods": [ + "batchCreateTensorboardRuns" + ] + }, + "GetTensorboardRun": { + "methods": [ + "getTensorboardRun" + ] + }, + "UpdateTensorboardRun": { + "methods": [ + "updateTensorboardRun" + ] + }, + "BatchCreateTensorboardTimeSeries": { + "methods": [ + "batchCreateTensorboardTimeSeries" + ] + }, + "CreateTensorboardTimeSeries": { + "methods": [ + "createTensorboardTimeSeries" + ] + }, + "GetTensorboardTimeSeries": { + "methods": [ + "getTensorboardTimeSeries" + ] + }, + "UpdateTensorboardTimeSeries": { + "methods": [ + "updateTensorboardTimeSeries" + ] + }, + "BatchReadTensorboardTimeSeriesData": { + "methods": [ + "batchReadTensorboardTimeSeriesData" + ] + }, + "ReadTensorboardTimeSeriesData": { + "methods": [ + "readTensorboardTimeSeriesData" + ] + }, + "WriteTensorboardExperimentData": { + "methods": [ + "writeTensorboardExperimentData" + ] + }, + "WriteTensorboardRunData": { + "methods": [ + "writeTensorboardRunData" + ] + }, + "ReadTensorboardBlobData": { + "methods": [ + "readTensorboardBlobData" + ] + }, + "CreateTensorboard": { + "methods": [ + "createTensorboard" + ] + }, + "UpdateTensorboard": { + "methods": [ + "updateTensorboard" + ] + }, + "DeleteTensorboard": { + "methods": [ + "deleteTensorboard" + ] + }, + "DeleteTensorboardExperiment": { + "methods": [ + "deleteTensorboardExperiment" + ] + }, + "DeleteTensorboardRun": { + "methods": [ + "deleteTensorboardRun" + ] + }, + "DeleteTensorboardTimeSeries": { + "methods": [ + "deleteTensorboardTimeSeries" + ] + }, + "ListTensorboards": { + "methods": [ + "listTensorboards", + "listTensorboardsStream", + "listTensorboardsAsync" + ] + }, + "ListTensorboardExperiments": { + "methods": [ + "listTensorboardExperiments", + "listTensorboardExperimentsStream", + "listTensorboardExperimentsAsync" + ] + }, + "ListTensorboardRuns": { + "methods": [ + "listTensorboardRuns", + "listTensorboardRunsStream", + "listTensorboardRunsAsync" + ] + }, + "ListTensorboardTimeSeries": { + "methods": [ + "listTensorboardTimeSeries", + "listTensorboardTimeSeriesStream", + "listTensorboardTimeSeriesAsync" + ] + }, + "ExportTensorboardTimeSeriesData": { + "methods": [ + "exportTensorboardTimeSeriesData", + "exportTensorboardTimeSeriesDataStream", + "exportTensorboardTimeSeriesDataAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TensorboardServiceClient", + "rpcs": { + "GetTensorboard": { + "methods": [ + "getTensorboard" + ] + }, + "CreateTensorboardExperiment": { + "methods": [ + "createTensorboardExperiment" + ] + }, + "GetTensorboardExperiment": { + "methods": [ + "getTensorboardExperiment" + ] + }, + "UpdateTensorboardExperiment": { + "methods": [ + "updateTensorboardExperiment" + ] + }, + "CreateTensorboardRun": { + "methods": [ + "createTensorboardRun" + ] + }, + "BatchCreateTensorboardRuns": { + "methods": [ + "batchCreateTensorboardRuns" + ] + }, + "GetTensorboardRun": { + "methods": [ + "getTensorboardRun" + ] + }, + "UpdateTensorboardRun": { + "methods": [ + "updateTensorboardRun" + ] + }, + "BatchCreateTensorboardTimeSeries": { + "methods": [ + "batchCreateTensorboardTimeSeries" + ] + }, + "CreateTensorboardTimeSeries": { + "methods": [ + "createTensorboardTimeSeries" + ] + }, + "GetTensorboardTimeSeries": { + "methods": [ + "getTensorboardTimeSeries" + ] + }, + "UpdateTensorboardTimeSeries": { + "methods": [ + "updateTensorboardTimeSeries" + ] + }, + "BatchReadTensorboardTimeSeriesData": { + "methods": [ + "batchReadTensorboardTimeSeriesData" + ] + }, + "ReadTensorboardTimeSeriesData": { + "methods": [ + "readTensorboardTimeSeriesData" + ] + }, + "WriteTensorboardExperimentData": { + "methods": [ + "writeTensorboardExperimentData" + ] + }, + "WriteTensorboardRunData": { + "methods": [ + "writeTensorboardRunData" + ] + }, + "CreateTensorboard": { + "methods": [ + "createTensorboard" + ] + }, + "UpdateTensorboard": { + "methods": [ + "updateTensorboard" + ] + }, + "DeleteTensorboard": { + "methods": [ + "deleteTensorboard" + ] + }, + "DeleteTensorboardExperiment": { + "methods": [ + "deleteTensorboardExperiment" + ] + }, + "DeleteTensorboardRun": { + "methods": [ + "deleteTensorboardRun" + ] + }, + "DeleteTensorboardTimeSeries": { + "methods": [ + "deleteTensorboardTimeSeries" + ] + }, + "ListTensorboards": { + "methods": [ + "listTensorboards", + "listTensorboardsStream", + "listTensorboardsAsync" + ] + }, + "ListTensorboardExperiments": { + "methods": [ + "listTensorboardExperiments", + "listTensorboardExperimentsStream", + "listTensorboardExperimentsAsync" + ] + }, + "ListTensorboardRuns": { + "methods": [ + "listTensorboardRuns", + "listTensorboardRunsStream", + "listTensorboardRunsAsync" + ] + }, + "ListTensorboardTimeSeries": { + "methods": [ + "listTensorboardTimeSeries", + "listTensorboardTimeSeriesStream", + "listTensorboardTimeSeriesAsync" + ] + }, + "ExportTensorboardTimeSeriesData": { + "methods": [ + "exportTensorboardTimeSeriesData", + "exportTensorboardTimeSeriesDataStream", + "exportTensorboardTimeSeriesDataAsync" + ] + } + } + } + } + }, + "VizierService": { + "clients": { + "grpc": { + "libraryClient": "VizierServiceClient", + "rpcs": { + "CreateStudy": { + "methods": [ + "createStudy" + ] + }, + "GetStudy": { + "methods": [ + "getStudy" + ] + }, + "DeleteStudy": { + "methods": [ + "deleteStudy" + ] + }, + "LookupStudy": { + "methods": [ + "lookupStudy" + ] + }, + "CreateTrial": { + "methods": [ + "createTrial" + ] + }, + "GetTrial": { + "methods": [ + "getTrial" + ] + }, + "AddTrialMeasurement": { + "methods": [ + "addTrialMeasurement" + ] + }, + "CompleteTrial": { + "methods": [ + "completeTrial" + ] + }, + "DeleteTrial": { + "methods": [ + "deleteTrial" + ] + }, + "StopTrial": { + "methods": [ + "stopTrial" + ] + }, + "ListOptimalTrials": { + "methods": [ + "listOptimalTrials" + ] + }, + "SuggestTrials": { + "methods": [ + "suggestTrials" + ] + }, + "CheckTrialEarlyStoppingState": { + "methods": [ + "checkTrialEarlyStoppingState" + ] + }, + "ListStudies": { + "methods": [ + "listStudies", + "listStudiesStream", + "listStudiesAsync" + ] + }, + "ListTrials": { + "methods": [ + "listTrials", + "listTrialsStream", + "listTrialsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "VizierServiceClient", + "rpcs": { + "CreateStudy": { + "methods": [ + "createStudy" + ] + }, + "GetStudy": { + "methods": [ + "getStudy" + ] + }, + "DeleteStudy": { + "methods": [ + "deleteStudy" + ] + }, + "LookupStudy": { + "methods": [ + "lookupStudy" + ] + }, + "CreateTrial": { + "methods": [ + "createTrial" + ] + }, + "GetTrial": { + "methods": [ + "getTrial" + ] + }, + "AddTrialMeasurement": { + "methods": [ + "addTrialMeasurement" + ] + }, + "CompleteTrial": { + "methods": [ + "completeTrial" + ] + }, + "DeleteTrial": { + "methods": [ + "deleteTrial" + ] + }, + "StopTrial": { + "methods": [ + "stopTrial" + ] + }, + "ListOptimalTrials": { + "methods": [ + "listOptimalTrials" + ] + }, + "SuggestTrials": { + "methods": [ + "suggestTrials" + ] + }, + "CheckTrialEarlyStoppingState": { + "methods": [ + "checkTrialEarlyStoppingState" + ] + }, + "ListStudies": { + "methods": [ + "listStudies", + "listStudiesStream", + "listStudiesAsync" + ] + }, + "ListTrials": { + "methods": [ + "listTrials", + "listTrialsStream", + "listTrialsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/index.ts b/owl-bot-staging/v1beta1/src/v1beta1/index.ts new file mode 100644 index 00000000..e88d60a9 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/index.ts @@ -0,0 +1,33 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {DatasetServiceClient} from './dataset_service_client'; +export {EndpointServiceClient} from './endpoint_service_client'; +export {FeaturestoreOnlineServingServiceClient} from './featurestore_online_serving_service_client'; +export {FeaturestoreServiceClient} from './featurestore_service_client'; +export {IndexEndpointServiceClient} from './index_endpoint_service_client'; +export {IndexServiceClient} from './index_service_client'; +export {JobServiceClient} from './job_service_client'; +export {MetadataServiceClient} from './metadata_service_client'; +export {MigrationServiceClient} from './migration_service_client'; +export {ModelServiceClient} from './model_service_client'; +export {PipelineServiceClient} from './pipeline_service_client'; +export {PredictionServiceClient} from './prediction_service_client'; +export {SpecialistPoolServiceClient} from './specialist_pool_service_client'; +export {TensorboardServiceClient} from './tensorboard_service_client'; +export {VizierServiceClient} from './vizier_service_client'; diff --git a/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_client.ts new file mode 100644 index 00000000..f1dfd8db --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_client.ts @@ -0,0 +1,3218 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/index_endpoint_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './index_endpoint_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * A service for managing Vertex AI's IndexEndpoints. + * @class + * @memberof v1beta1 + */ +export class IndexEndpointServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + indexEndpointServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of IndexEndpointServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof IndexEndpointServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listIndexEndpoints: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'indexEndpoints') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const createIndexEndpointResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.IndexEndpoint') as gax.protobuf.Type; + const createIndexEndpointMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.CreateIndexEndpointOperationMetadata') as gax.protobuf.Type; + const deleteIndexEndpointResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteIndexEndpointMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const deployIndexResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeployIndexResponse') as gax.protobuf.Type; + const deployIndexMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeployIndexOperationMetadata') as gax.protobuf.Type; + const undeployIndexResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.UndeployIndexResponse') as gax.protobuf.Type; + const undeployIndexMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.UndeployIndexOperationMetadata') as gax.protobuf.Type; + const mutateDeployedIndexResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.MutateDeployedIndexResponse') as gax.protobuf.Type; + const mutateDeployedIndexMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.MutateDeployedIndexOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createIndexEndpoint: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createIndexEndpointResponse.decode.bind(createIndexEndpointResponse), + createIndexEndpointMetadata.decode.bind(createIndexEndpointMetadata)), + deleteIndexEndpoint: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteIndexEndpointResponse.decode.bind(deleteIndexEndpointResponse), + deleteIndexEndpointMetadata.decode.bind(deleteIndexEndpointMetadata)), + deployIndex: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deployIndexResponse.decode.bind(deployIndexResponse), + deployIndexMetadata.decode.bind(deployIndexMetadata)), + undeployIndex: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeployIndexResponse.decode.bind(undeployIndexResponse), + undeployIndexMetadata.decode.bind(undeployIndexMetadata)), + mutateDeployedIndex: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + mutateDeployedIndexResponse.decode.bind(mutateDeployedIndexResponse), + mutateDeployedIndexMetadata.decode.bind(mutateDeployedIndexMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.IndexEndpointService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.indexEndpointServiceStub) { + return this.indexEndpointServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1beta1.IndexEndpointService. + this.indexEndpointServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.IndexEndpointService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1beta1.IndexEndpointService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const indexEndpointServiceStubMethods = + ['createIndexEndpoint', 'getIndexEndpoint', 'listIndexEndpoints', 'updateIndexEndpoint', 'deleteIndexEndpoint', 'deployIndex', 'undeployIndex', 'mutateDeployedIndex']; + for (const methodName of indexEndpointServiceStubMethods) { + const callPromise = this.indexEndpointServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.indexEndpointServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets an IndexEndpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the IndexEndpoint resource. + * Format: + * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [IndexEndpoint]{@link google.cloud.aiplatform.v1beta1.IndexEndpoint}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_GetIndexEndpoint_async + */ + getIndexEndpoint( + request?: protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest|undefined, {}|undefined + ]>; + getIndexEndpoint( + request: protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest|null|undefined, + {}|null|undefined>): void; + getIndexEndpoint( + request: protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest|null|undefined, + {}|null|undefined>): void; + getIndexEndpoint( + request?: protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getIndexEndpoint(request, options, callback); + } +/** + * Updates an IndexEndpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.IndexEndpoint} request.indexEndpoint + * Required. The IndexEndpoint which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. See {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [IndexEndpoint]{@link google.cloud.aiplatform.v1beta1.IndexEndpoint}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_UpdateIndexEndpoint_async + */ + updateIndexEndpoint( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest|undefined, {}|undefined + ]>; + updateIndexEndpoint( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest|null|undefined, + {}|null|undefined>): void; + updateIndexEndpoint( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest|null|undefined, + {}|null|undefined>): void; + updateIndexEndpoint( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, + protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'index_endpoint.name': request.indexEndpoint!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateIndexEndpoint(request, options, callback); + } + +/** + * Creates an IndexEndpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the IndexEndpoint in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.IndexEndpoint} request.indexEndpoint + * Required. The IndexEndpoint to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_CreateIndexEndpoint_async + */ + createIndexEndpoint( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateIndexEndpointRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createIndexEndpoint( + request: protos.google.cloud.aiplatform.v1beta1.ICreateIndexEndpointRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createIndexEndpoint( + request: protos.google.cloud.aiplatform.v1beta1.ICreateIndexEndpointRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createIndexEndpoint( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateIndexEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createIndexEndpoint(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createIndexEndpoint()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_CreateIndexEndpoint_async + */ + async checkCreateIndexEndpointProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createIndexEndpoint, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes an IndexEndpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the IndexEndpoint resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_DeleteIndexEndpoint_async + */ + deleteIndexEndpoint( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteIndexEndpointRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteIndexEndpoint( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteIndexEndpointRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteIndexEndpoint( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteIndexEndpointRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteIndexEndpoint( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteIndexEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteIndexEndpoint(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteIndexEndpoint()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_DeleteIndexEndpoint_async + */ + async checkDeleteIndexEndpointProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteIndexEndpoint, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deploys an Index into this IndexEndpoint, creating a DeployedIndex within + * it. + * Only non-empty Indexes can be deployed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.indexEndpoint + * Required. The name of the IndexEndpoint resource into which to deploy an Index. + * Format: + * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + * @param {google.cloud.aiplatform.v1beta1.DeployedIndex} request.deployedIndex + * Required. The DeployedIndex to be created within the IndexEndpoint. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_DeployIndex_async + */ + deployIndex( + request?: protos.google.cloud.aiplatform.v1beta1.IDeployIndexRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deployIndex( + request: protos.google.cloud.aiplatform.v1beta1.IDeployIndexRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deployIndex( + request: protos.google.cloud.aiplatform.v1beta1.IDeployIndexRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deployIndex( + request?: protos.google.cloud.aiplatform.v1beta1.IDeployIndexRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'index_endpoint': request.indexEndpoint || '', + }); + this.initialize(); + return this.innerApiCalls.deployIndex(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deployIndex()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_DeployIndex_async + */ + async checkDeployIndexProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deployIndex, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Undeploys an Index from an IndexEndpoint, removing a DeployedIndex from it, + * and freeing all resources it's using. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.indexEndpoint + * Required. The name of the IndexEndpoint resource from which to undeploy an Index. + * Format: + * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + * @param {string} request.deployedIndexId + * Required. The ID of the DeployedIndex to be undeployed from the IndexEndpoint. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_UndeployIndex_async + */ + undeployIndex( + request?: protos.google.cloud.aiplatform.v1beta1.IUndeployIndexRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + undeployIndex( + request: protos.google.cloud.aiplatform.v1beta1.IUndeployIndexRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeployIndex( + request: protos.google.cloud.aiplatform.v1beta1.IUndeployIndexRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeployIndex( + request?: protos.google.cloud.aiplatform.v1beta1.IUndeployIndexRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'index_endpoint': request.indexEndpoint || '', + }); + this.initialize(); + return this.innerApiCalls.undeployIndex(request, options, callback); + } +/** + * Check the status of the long running operation returned by `undeployIndex()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_UndeployIndex_async + */ + async checkUndeployIndexProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.undeployIndex, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Update an existing DeployedIndex under an IndexEndpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.indexEndpoint + * Required. The name of the IndexEndpoint resource into which to deploy an Index. + * Format: + * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + * @param {google.cloud.aiplatform.v1beta1.DeployedIndex} request.deployedIndex + * Required. The DeployedIndex to be updated within the IndexEndpoint. + * Currently, the updatable fields are {@link automatic_resources|DeployedIndex} + * and {@link dedicated_resources|DeployedIndex} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_MutateDeployedIndex_async + */ + mutateDeployedIndex( + request?: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedIndexRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + mutateDeployedIndex( + request: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedIndexRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + mutateDeployedIndex( + request: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedIndexRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + mutateDeployedIndex( + request?: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedIndexRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'index_endpoint': request.indexEndpoint || '', + }); + this.initialize(); + return this.innerApiCalls.mutateDeployedIndex(request, options, callback); + } +/** + * Check the status of the long running operation returned by `mutateDeployedIndex()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_MutateDeployedIndex_async + */ + async checkMutateDeployedIndexProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.mutateDeployedIndex, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists IndexEndpoints in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the IndexEndpoints. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `index_endpoint` supports = and !=. `index_endpoint` represents the + * IndexEndpoint ID, ie. the last segment of the IndexEndpoint's + * {@link google.cloud.aiplatform.v1beta1.IndexEndpoint.name|resourcename}. + * * `display_name` supports =, != and regex() + * (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* or labels:key - key existence + * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `index_endpoint="1"` + * * `display_name="myDisplayName"` + * * `regex(display_name, "^A") -> The display name starts with an A. + * * `labels.myKey="myValue"` + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListIndexEndpointsResponse.next_page_token|ListIndexEndpointsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.IndexEndpointService.ListIndexEndpoints|IndexEndpointService.ListIndexEndpoints} call. + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [IndexEndpoint]{@link google.cloud.aiplatform.v1beta1.IndexEndpoint}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listIndexEndpointsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listIndexEndpoints( + request?: protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint[], + protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsResponse + ]>; + listIndexEndpoints( + request: protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, + protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint>): void; + listIndexEndpoints( + request: protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, + protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint>): void; + listIndexEndpoints( + request?: protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, + protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, + protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint[], + protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listIndexEndpoints(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the IndexEndpoints. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `index_endpoint` supports = and !=. `index_endpoint` represents the + * IndexEndpoint ID, ie. the last segment of the IndexEndpoint's + * {@link google.cloud.aiplatform.v1beta1.IndexEndpoint.name|resourcename}. + * * `display_name` supports =, != and regex() + * (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* or labels:key - key existence + * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `index_endpoint="1"` + * * `display_name="myDisplayName"` + * * `regex(display_name, "^A") -> The display name starts with an A. + * * `labels.myKey="myValue"` + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListIndexEndpointsResponse.next_page_token|ListIndexEndpointsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.IndexEndpointService.ListIndexEndpoints|IndexEndpointService.ListIndexEndpoints} call. + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [IndexEndpoint]{@link google.cloud.aiplatform.v1beta1.IndexEndpoint} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listIndexEndpointsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listIndexEndpointsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listIndexEndpoints']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listIndexEndpoints.createStream( + this.innerApiCalls.listIndexEndpoints as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listIndexEndpoints`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the IndexEndpoints. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `index_endpoint` supports = and !=. `index_endpoint` represents the + * IndexEndpoint ID, ie. the last segment of the IndexEndpoint's + * {@link google.cloud.aiplatform.v1beta1.IndexEndpoint.name|resourcename}. + * * `display_name` supports =, != and regex() + * (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) + * * `labels` supports general map functions that is: + * `labels.key=value` - key:value equality + * `labels.key:* or labels:key - key existence + * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `index_endpoint="1"` + * * `display_name="myDisplayName"` + * * `regex(display_name, "^A") -> The display name starts with an A. + * * `labels.myKey="myValue"` + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListIndexEndpointsResponse.next_page_token|ListIndexEndpointsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.IndexEndpointService.ListIndexEndpoints|IndexEndpointService.ListIndexEndpoints} call. + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [IndexEndpoint]{@link google.cloud.aiplatform.v1beta1.IndexEndpoint}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_ListIndexEndpoints_async + */ + listIndexEndpointsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listIndexEndpoints']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listIndexEndpoints.asyncIterate( + this.innerApiCalls['listIndexEndpoints'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.indexEndpointServiceStub && !this._terminated) { + return this.indexEndpointServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_client_config.json new file mode 100644 index 00000000..a2abf1a1 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_client_config.json @@ -0,0 +1,65 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.IndexEndpointService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateIndexEndpoint": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIndexEndpoint": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListIndexEndpoints": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateIndexEndpoint": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteIndexEndpoint": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeployIndex": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeployIndex": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MutateDeployedIndex": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_proto_list.json new file mode 100644 index 00000000..c916ab12 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_proto_list.json @@ -0,0 +1,117 @@ +[ + "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/context.proto", + "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1beta1/event.proto", + "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/io.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/study.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/types.proto", + "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1beta1/value.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/index_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/index_service_client.ts new file mode 100644 index 00000000..ad3d722d --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/index_service_client.ts @@ -0,0 +1,2884 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/index_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './index_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * A service for creating and managing Vertex AI's Index resources. + * @class + * @memberof v1beta1 + */ +export class IndexServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + indexServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of IndexServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof IndexServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listIndexes: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'indexes') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const createIndexResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.Index') as gax.protobuf.Type; + const createIndexMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.CreateIndexOperationMetadata') as gax.protobuf.Type; + const updateIndexResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.Index') as gax.protobuf.Type; + const updateIndexMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.UpdateIndexOperationMetadata') as gax.protobuf.Type; + const deleteIndexResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteIndexMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createIndex: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createIndexResponse.decode.bind(createIndexResponse), + createIndexMetadata.decode.bind(createIndexMetadata)), + updateIndex: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateIndexResponse.decode.bind(updateIndexResponse), + updateIndexMetadata.decode.bind(updateIndexMetadata)), + deleteIndex: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteIndexResponse.decode.bind(deleteIndexResponse), + deleteIndexMetadata.decode.bind(deleteIndexMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.IndexService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.indexServiceStub) { + return this.indexServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1beta1.IndexService. + this.indexServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.IndexService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1beta1.IndexService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const indexServiceStubMethods = + ['createIndex', 'getIndex', 'listIndexes', 'updateIndex', 'deleteIndex']; + for (const methodName of indexServiceStubMethods) { + const callPromise = this.indexServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.indexServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets an Index. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Index resource. + * Format: + * `projects/{project}/locations/{location}/indexes/{index}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Index]{@link google.cloud.aiplatform.v1beta1.Index}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexService_GetIndex_async + */ + getIndex( + request?: protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IIndex, + protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest|undefined, {}|undefined + ]>; + getIndex( + request: protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IIndex, + protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest|null|undefined, + {}|null|undefined>): void; + getIndex( + request: protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IIndex, + protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest|null|undefined, + {}|null|undefined>): void; + getIndex( + request?: protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IIndex, + protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IIndex, + protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IIndex, + protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getIndex(request, options, callback); + } + +/** + * Creates an Index. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the Index in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.Index} request.index + * Required. The Index to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexService_CreateIndex_async + */ + createIndex( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateIndexRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createIndex( + request: protos.google.cloud.aiplatform.v1beta1.ICreateIndexRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createIndex( + request: protos.google.cloud.aiplatform.v1beta1.ICreateIndexRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createIndex( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateIndexRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createIndex(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createIndex()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexService_CreateIndex_async + */ + async checkCreateIndexProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createIndex, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates an Index. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.Index} request.index + * Required. The Index which updates the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * The update mask applies to the resource. + * For the `FieldMask` definition, see {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexService_UpdateIndex_async + */ + updateIndex( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateIndexRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateIndex( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateIndexRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateIndex( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateIndexRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateIndex( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateIndexRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'index.name': request.index!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateIndex(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateIndex()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexService_UpdateIndex_async + */ + async checkUpdateIndexProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateIndex, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes an Index. + * An Index can only be deleted when all its + * {@link google.cloud.aiplatform.v1beta1.Index.deployed_indexes|DeployedIndexes} had been undeployed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Index resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/indexes/{index}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexService_DeleteIndex_async + */ + deleteIndex( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteIndexRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteIndex( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteIndexRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteIndex( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteIndexRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteIndex( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteIndexRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteIndex(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteIndex()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexService_DeleteIndex_async + */ + async checkDeleteIndexProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteIndex, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Indexes in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the Indexes. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListIndexesResponse.next_page_token|ListIndexesResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.IndexService.ListIndexes|IndexService.ListIndexes} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Index]{@link google.cloud.aiplatform.v1beta1.Index}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listIndexesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listIndexes( + request?: protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IIndex[], + protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListIndexesResponse + ]>; + listIndexes( + request: protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, + protos.google.cloud.aiplatform.v1beta1.IListIndexesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IIndex>): void; + listIndexes( + request: protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, + protos.google.cloud.aiplatform.v1beta1.IListIndexesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IIndex>): void; + listIndexes( + request?: protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, + protos.google.cloud.aiplatform.v1beta1.IListIndexesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IIndex>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, + protos.google.cloud.aiplatform.v1beta1.IListIndexesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IIndex>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IIndex[], + protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListIndexesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listIndexes(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the Indexes. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListIndexesResponse.next_page_token|ListIndexesResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.IndexService.ListIndexes|IndexService.ListIndexes} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Index]{@link google.cloud.aiplatform.v1beta1.Index} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listIndexesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listIndexesStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listIndexes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listIndexes.createStream( + this.innerApiCalls.listIndexes as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listIndexes`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the Indexes. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListIndexesResponse.next_page_token|ListIndexesResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.IndexService.ListIndexes|IndexService.ListIndexes} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Index]{@link google.cloud.aiplatform.v1beta1.Index}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_IndexService_ListIndexes_async + */ + listIndexesAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listIndexes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listIndexes.asyncIterate( + this.innerApiCalls['listIndexes'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.indexServiceStub && !this._terminated) { + return this.indexServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/index_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/index_service_client_config.json new file mode 100644 index 00000000..8151fa3e --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/index_service_client_config.json @@ -0,0 +1,51 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.IndexService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateIndex": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIndex": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListIndexes": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateIndex": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteIndex": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/index_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/index_service_proto_list.json new file mode 100644 index 00000000..c916ab12 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/index_service_proto_list.json @@ -0,0 +1,117 @@ +[ + "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/context.proto", + "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1beta1/event.proto", + "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/io.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/study.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/types.proto", + "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1beta1/value.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/job_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/job_service_client.ts new file mode 100644 index 00000000..914cc185 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/job_service_client.ts @@ -0,0 +1,5577 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/job_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './job_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * A service for creating and managing Vertex AI's jobs. + * @class + * @memberof v1beta1 + */ +export class JobServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + jobServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of JobServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof JobServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listCustomJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customJobs'), + listDataLabelingJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dataLabelingJobs'), + listHyperparameterTuningJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'hyperparameterTuningJobs'), + listBatchPredictionJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'batchPredictionJobs'), + searchModelDeploymentMonitoringStatsAnomalies: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'monitoringStats'), + listModelDeploymentMonitoringJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'modelDeploymentMonitoringJobs') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const deleteCustomJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteCustomJobMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const deleteDataLabelingJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteDataLabelingJobMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const deleteHyperparameterTuningJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteHyperparameterTuningJobMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const deleteBatchPredictionJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteBatchPredictionJobMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const updateModelDeploymentMonitoringJobResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob') as gax.protobuf.Type; + const updateModelDeploymentMonitoringJobMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.UpdateModelDeploymentMonitoringJobOperationMetadata') as gax.protobuf.Type; + const deleteModelDeploymentMonitoringJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteModelDeploymentMonitoringJobMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + deleteCustomJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteCustomJobResponse.decode.bind(deleteCustomJobResponse), + deleteCustomJobMetadata.decode.bind(deleteCustomJobMetadata)), + deleteDataLabelingJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteDataLabelingJobResponse.decode.bind(deleteDataLabelingJobResponse), + deleteDataLabelingJobMetadata.decode.bind(deleteDataLabelingJobMetadata)), + deleteHyperparameterTuningJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteHyperparameterTuningJobResponse.decode.bind(deleteHyperparameterTuningJobResponse), + deleteHyperparameterTuningJobMetadata.decode.bind(deleteHyperparameterTuningJobMetadata)), + deleteBatchPredictionJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBatchPredictionJobResponse.decode.bind(deleteBatchPredictionJobResponse), + deleteBatchPredictionJobMetadata.decode.bind(deleteBatchPredictionJobMetadata)), + updateModelDeploymentMonitoringJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateModelDeploymentMonitoringJobResponse.decode.bind(updateModelDeploymentMonitoringJobResponse), + updateModelDeploymentMonitoringJobMetadata.decode.bind(updateModelDeploymentMonitoringJobMetadata)), + deleteModelDeploymentMonitoringJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteModelDeploymentMonitoringJobResponse.decode.bind(deleteModelDeploymentMonitoringJobResponse), + deleteModelDeploymentMonitoringJobMetadata.decode.bind(deleteModelDeploymentMonitoringJobMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.JobService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.jobServiceStub) { + return this.jobServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1beta1.JobService. + this.jobServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.JobService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1beta1.JobService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const jobServiceStubMethods = + ['createCustomJob', 'getCustomJob', 'listCustomJobs', 'deleteCustomJob', 'cancelCustomJob', 'createDataLabelingJob', 'getDataLabelingJob', 'listDataLabelingJobs', 'deleteDataLabelingJob', 'cancelDataLabelingJob', 'createHyperparameterTuningJob', 'getHyperparameterTuningJob', 'listHyperparameterTuningJobs', 'deleteHyperparameterTuningJob', 'cancelHyperparameterTuningJob', 'createBatchPredictionJob', 'getBatchPredictionJob', 'listBatchPredictionJobs', 'deleteBatchPredictionJob', 'cancelBatchPredictionJob', 'createModelDeploymentMonitoringJob', 'searchModelDeploymentMonitoringStatsAnomalies', 'getModelDeploymentMonitoringJob', 'listModelDeploymentMonitoringJobs', 'updateModelDeploymentMonitoringJob', 'deleteModelDeploymentMonitoringJob', 'pauseModelDeploymentMonitoringJob', 'resumeModelDeploymentMonitoringJob']; + for (const methodName of jobServiceStubMethods) { + const callPromise = this.jobServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.jobServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Creates a CustomJob. A created CustomJob right away + * will be attempted to be run. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the CustomJob in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.CustomJob} request.customJob + * Required. The CustomJob to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CustomJob]{@link google.cloud.aiplatform.v1beta1.CustomJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_CreateCustomJob_async + */ + createCustomJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ICustomJob, + protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest|undefined, {}|undefined + ]>; + createCustomJob( + request: protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ICustomJob, + protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest|null|undefined, + {}|null|undefined>): void; + createCustomJob( + request: protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ICustomJob, + protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest|null|undefined, + {}|null|undefined>): void; + createCustomJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ICustomJob, + protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ICustomJob, + protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ICustomJob, + protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createCustomJob(request, options, callback); + } +/** + * Gets a CustomJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CustomJob resource. + * Format: + * `projects/{project}/locations/{location}/customJobs/{custom_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CustomJob]{@link google.cloud.aiplatform.v1beta1.CustomJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_GetCustomJob_async + */ + getCustomJob( + request?: protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ICustomJob, + protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest|undefined, {}|undefined + ]>; + getCustomJob( + request: protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ICustomJob, + protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest|null|undefined, + {}|null|undefined>): void; + getCustomJob( + request: protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ICustomJob, + protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest|null|undefined, + {}|null|undefined>): void; + getCustomJob( + request?: protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ICustomJob, + protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ICustomJob, + protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ICustomJob, + protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getCustomJob(request, options, callback); + } +/** + * Cancels a CustomJob. + * Starts asynchronous cancellation on the CustomJob. The server + * makes a best effort to cancel the job, but success is not + * guaranteed. Clients can use {@link google.cloud.aiplatform.v1beta1.JobService.GetCustomJob|JobService.GetCustomJob} or + * other methods to check whether the cancellation succeeded or whether the + * job completed despite cancellation. On successful cancellation, + * the CustomJob is not deleted; instead it becomes a job with + * a {@link google.cloud.aiplatform.v1beta1.CustomJob.error|CustomJob.error} value with a {@link google.rpc.Status.code|google.rpc.Status.code} of 1, + * corresponding to `Code.CANCELLED`, and {@link google.cloud.aiplatform.v1beta1.CustomJob.state|CustomJob.state} is set to + * `CANCELLED`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CustomJob to cancel. + * Format: + * `projects/{project}/locations/{location}/customJobs/{custom_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_CancelCustomJob_async + */ + cancelCustomJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest|undefined, {}|undefined + ]>; + cancelCustomJob( + request: protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest|null|undefined, + {}|null|undefined>): void; + cancelCustomJob( + request: protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest|null|undefined, + {}|null|undefined>): void; + cancelCustomJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.cancelCustomJob(request, options, callback); + } +/** + * Creates a DataLabelingJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the DataLabelingJob. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.DataLabelingJob} request.dataLabelingJob + * Required. The DataLabelingJob to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DataLabelingJob]{@link google.cloud.aiplatform.v1beta1.DataLabelingJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_CreateDataLabelingJob_async + */ + createDataLabelingJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest|undefined, {}|undefined + ]>; + createDataLabelingJob( + request: protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest|null|undefined, + {}|null|undefined>): void; + createDataLabelingJob( + request: protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest|null|undefined, + {}|null|undefined>): void; + createDataLabelingJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createDataLabelingJob(request, options, callback); + } +/** + * Gets a DataLabelingJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DataLabelingJob. + * Format: + * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DataLabelingJob]{@link google.cloud.aiplatform.v1beta1.DataLabelingJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_GetDataLabelingJob_async + */ + getDataLabelingJob( + request?: protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest|undefined, {}|undefined + ]>; + getDataLabelingJob( + request: protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest|null|undefined, + {}|null|undefined>): void; + getDataLabelingJob( + request: protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest|null|undefined, + {}|null|undefined>): void; + getDataLabelingJob( + request?: protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, + protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getDataLabelingJob(request, options, callback); + } +/** + * Cancels a DataLabelingJob. Success of cancellation is not guaranteed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DataLabelingJob. + * Format: + * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_CancelDataLabelingJob_async + */ + cancelDataLabelingJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest|undefined, {}|undefined + ]>; + cancelDataLabelingJob( + request: protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest|null|undefined, + {}|null|undefined>): void; + cancelDataLabelingJob( + request: protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest|null|undefined, + {}|null|undefined>): void; + cancelDataLabelingJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.cancelDataLabelingJob(request, options, callback); + } +/** + * Creates a HyperparameterTuningJob + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the HyperparameterTuningJob in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.HyperparameterTuningJob} request.hyperparameterTuningJob + * Required. The HyperparameterTuningJob to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_CreateHyperparameterTuningJob_async + */ + createHyperparameterTuningJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest|undefined, {}|undefined + ]>; + createHyperparameterTuningJob( + request: protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>): void; + createHyperparameterTuningJob( + request: protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>): void; + createHyperparameterTuningJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createHyperparameterTuningJob(request, options, callback); + } +/** + * Gets a HyperparameterTuningJob + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the HyperparameterTuningJob resource. + * Format: + * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_GetHyperparameterTuningJob_async + */ + getHyperparameterTuningJob( + request?: protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest|undefined, {}|undefined + ]>; + getHyperparameterTuningJob( + request: protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>): void; + getHyperparameterTuningJob( + request: protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>): void; + getHyperparameterTuningJob( + request?: protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, + protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getHyperparameterTuningJob(request, options, callback); + } +/** + * Cancels a HyperparameterTuningJob. + * Starts asynchronous cancellation on the HyperparameterTuningJob. The server + * makes a best effort to cancel the job, but success is not + * guaranteed. Clients can use {@link google.cloud.aiplatform.v1beta1.JobService.GetHyperparameterTuningJob|JobService.GetHyperparameterTuningJob} or + * other methods to check whether the cancellation succeeded or whether the + * job completed despite cancellation. On successful cancellation, + * the HyperparameterTuningJob is not deleted; instead it becomes a job with + * a {@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.error|HyperparameterTuningJob.error} value with a {@link google.rpc.Status.code|google.rpc.Status.code} + * of 1, corresponding to `Code.CANCELLED`, and + * {@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.state|HyperparameterTuningJob.state} is set to `CANCELLED`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the HyperparameterTuningJob to cancel. + * Format: + * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_CancelHyperparameterTuningJob_async + */ + cancelHyperparameterTuningJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest|undefined, {}|undefined + ]>; + cancelHyperparameterTuningJob( + request: protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>): void; + cancelHyperparameterTuningJob( + request: protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>): void; + cancelHyperparameterTuningJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.cancelHyperparameterTuningJob(request, options, callback); + } +/** + * Creates a BatchPredictionJob. A BatchPredictionJob once created will + * right away be attempted to start. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the BatchPredictionJob in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.BatchPredictionJob} request.batchPredictionJob + * Required. The BatchPredictionJob to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchPredictionJob]{@link google.cloud.aiplatform.v1beta1.BatchPredictionJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_CreateBatchPredictionJob_async + */ + createBatchPredictionJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest|undefined, {}|undefined + ]>; + createBatchPredictionJob( + request: protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest|null|undefined, + {}|null|undefined>): void; + createBatchPredictionJob( + request: protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest|null|undefined, + {}|null|undefined>): void; + createBatchPredictionJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createBatchPredictionJob(request, options, callback); + } +/** + * Gets a BatchPredictionJob + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the BatchPredictionJob resource. + * Format: + * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchPredictionJob]{@link google.cloud.aiplatform.v1beta1.BatchPredictionJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_GetBatchPredictionJob_async + */ + getBatchPredictionJob( + request?: protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest|undefined, {}|undefined + ]>; + getBatchPredictionJob( + request: protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest|null|undefined, + {}|null|undefined>): void; + getBatchPredictionJob( + request: protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest|null|undefined, + {}|null|undefined>): void; + getBatchPredictionJob( + request?: protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, + protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getBatchPredictionJob(request, options, callback); + } +/** + * Cancels a BatchPredictionJob. + * + * Starts asynchronous cancellation on the BatchPredictionJob. The server + * makes the best effort to cancel the job, but success is not + * guaranteed. Clients can use {@link google.cloud.aiplatform.v1beta1.JobService.GetBatchPredictionJob|JobService.GetBatchPredictionJob} or + * other methods to check whether the cancellation succeeded or whether the + * job completed despite cancellation. On a successful cancellation, + * the BatchPredictionJob is not deleted;instead its + * {@link google.cloud.aiplatform.v1beta1.BatchPredictionJob.state|BatchPredictionJob.state} is set to `CANCELLED`. Any files already + * outputted by the job are not deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the BatchPredictionJob to cancel. + * Format: + * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_CancelBatchPredictionJob_async + */ + cancelBatchPredictionJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest|undefined, {}|undefined + ]>; + cancelBatchPredictionJob( + request: protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest|null|undefined, + {}|null|undefined>): void; + cancelBatchPredictionJob( + request: protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest|null|undefined, + {}|null|undefined>): void; + cancelBatchPredictionJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.cancelBatchPredictionJob(request, options, callback); + } +/** + * Creates a ModelDeploymentMonitoringJob. It will run periodically on a + * configured interval. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the ModelDeploymentMonitoringJob. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob} request.modelDeploymentMonitoringJob + * Required. The ModelDeploymentMonitoringJob to create + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_CreateModelDeploymentMonitoringJob_async + */ + createModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest|undefined, {}|undefined + ]>; + createModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): void; + createModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): void; + createModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createModelDeploymentMonitoringJob(request, options, callback); + } +/** + * Gets a ModelDeploymentMonitoringJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ModelDeploymentMonitoringJob. + * Format: + * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_GetModelDeploymentMonitoringJob_async + */ + getModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest|undefined, {}|undefined + ]>; + getModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): void; + getModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): void; + getModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, + protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getModelDeploymentMonitoringJob(request, options, callback); + } +/** + * Pauses a ModelDeploymentMonitoringJob. If the job is running, the server + * makes a best effort to cancel the job. Will mark + * {@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob.state|ModelDeploymentMonitoringJob.state} to 'PAUSED'. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ModelDeploymentMonitoringJob to pause. + * Format: + * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_PauseModelDeploymentMonitoringJob_async + */ + pauseModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest|undefined, {}|undefined + ]>; + pauseModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): void; + pauseModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): void; + pauseModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.pauseModelDeploymentMonitoringJob(request, options, callback); + } +/** + * Resumes a paused ModelDeploymentMonitoringJob. It will start to run from + * next scheduled time. A deleted ModelDeploymentMonitoringJob can't be + * resumed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ModelDeploymentMonitoringJob to resume. + * Format: + * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_ResumeModelDeploymentMonitoringJob_async + */ + resumeModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest|undefined, {}|undefined + ]>; + resumeModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): void; + resumeModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): void; + resumeModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.resumeModelDeploymentMonitoringJob(request, options, callback); + } + +/** + * Deletes a CustomJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CustomJob resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/customJobs/{custom_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_DeleteCustomJob_async + */ + deleteCustomJob( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteCustomJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteCustomJob( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteCustomJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteCustomJob( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteCustomJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteCustomJob( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteCustomJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteCustomJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteCustomJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_DeleteCustomJob_async + */ + async checkDeleteCustomJobProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteCustomJob, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a DataLabelingJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DataLabelingJob to be deleted. + * Format: + * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_DeleteDataLabelingJob_async + */ + deleteDataLabelingJob( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteDataLabelingJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteDataLabelingJob( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteDataLabelingJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteDataLabelingJob( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteDataLabelingJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteDataLabelingJob( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteDataLabelingJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteDataLabelingJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteDataLabelingJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_DeleteDataLabelingJob_async + */ + async checkDeleteDataLabelingJobProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteDataLabelingJob, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a HyperparameterTuningJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the HyperparameterTuningJob resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_DeleteHyperparameterTuningJob_async + */ + deleteHyperparameterTuningJob( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteHyperparameterTuningJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteHyperparameterTuningJob( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteHyperparameterTuningJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteHyperparameterTuningJob( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteHyperparameterTuningJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteHyperparameterTuningJob( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteHyperparameterTuningJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteHyperparameterTuningJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteHyperparameterTuningJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_DeleteHyperparameterTuningJob_async + */ + async checkDeleteHyperparameterTuningJobProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteHyperparameterTuningJob, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a BatchPredictionJob. Can only be called on jobs that already + * finished. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the BatchPredictionJob resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_DeleteBatchPredictionJob_async + */ + deleteBatchPredictionJob( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteBatchPredictionJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteBatchPredictionJob( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteBatchPredictionJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBatchPredictionJob( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteBatchPredictionJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBatchPredictionJob( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteBatchPredictionJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteBatchPredictionJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteBatchPredictionJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_DeleteBatchPredictionJob_async + */ + async checkDeleteBatchPredictionJobProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteBatchPredictionJob, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates a ModelDeploymentMonitoringJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob} request.modelDeploymentMonitoringJob + * Required. The model monitoring configuration which replaces the resource on the + * server. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask is used to specify the fields to be overwritten in the + * ModelDeploymentMonitoringJob resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then only the non-empty fields present in the + * request will be overwritten. Set the update_mask to `*` to override all + * fields. + * For the objective config, the user can either provide the update mask for + * model_deployment_monitoring_objective_configs or any combination of its + * nested fields, such as: + * model_deployment_monitoring_objective_configs.objective_config.training_dataset. + * + * Updatable fields: + * + * * `display_name` + * * `model_deployment_monitoring_schedule_config` + * * `model_monitoring_alert_config` + * * `logging_sampling_strategy` + * * `labels` + * * `log_ttl` + * * `enable_monitoring_pipeline_logs` + * . and + * * `model_deployment_monitoring_objective_configs` + * . or + * * `model_deployment_monitoring_objective_configs.objective_config.training_dataset` + * * `model_deployment_monitoring_objective_configs.objective_config.training_prediction_skew_detection_config` + * * `model_deployment_monitoring_objective_configs.objective_config.prediction_drift_detection_config` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_UpdateModelDeploymentMonitoringJob_async + */ + updateModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateModelDeploymentMonitoringJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateModelDeploymentMonitoringJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateModelDeploymentMonitoringJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateModelDeploymentMonitoringJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'model_deployment_monitoring_job.name': request.modelDeploymentMonitoringJob!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateModelDeploymentMonitoringJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateModelDeploymentMonitoringJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_UpdateModelDeploymentMonitoringJob_async + */ + async checkUpdateModelDeploymentMonitoringJobProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateModelDeploymentMonitoringJob, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a ModelDeploymentMonitoringJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the model monitoring job to delete. + * Format: + * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_DeleteModelDeploymentMonitoringJob_async + */ + deleteModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteModelDeploymentMonitoringJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteModelDeploymentMonitoringJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteModelDeploymentMonitoringJob( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteModelDeploymentMonitoringJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteModelDeploymentMonitoringJob( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteModelDeploymentMonitoringJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteModelDeploymentMonitoringJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteModelDeploymentMonitoringJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_DeleteModelDeploymentMonitoringJob_async + */ + async checkDeleteModelDeploymentMonitoringJobProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteModelDeploymentMonitoringJob, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists CustomJobs in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the CustomJobs from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListCustomJobsResponse.next_page_token|ListCustomJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.JobService.ListCustomJobs|JobService.ListCustomJobs} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [CustomJob]{@link google.cloud.aiplatform.v1beta1.CustomJob}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCustomJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCustomJobs( + request?: protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ICustomJob[], + protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListCustomJobsResponse + ]>; + listCustomJobs( + request: protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListCustomJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ICustomJob>): void; + listCustomJobs( + request: protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListCustomJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ICustomJob>): void; + listCustomJobs( + request?: protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListCustomJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ICustomJob>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListCustomJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ICustomJob>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ICustomJob[], + protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListCustomJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listCustomJobs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the CustomJobs from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListCustomJobsResponse.next_page_token|ListCustomJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.JobService.ListCustomJobs|JobService.ListCustomJobs} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [CustomJob]{@link google.cloud.aiplatform.v1beta1.CustomJob} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCustomJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCustomJobsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listCustomJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCustomJobs.createStream( + this.innerApiCalls.listCustomJobs as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listCustomJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the CustomJobs from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListCustomJobsResponse.next_page_token|ListCustomJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.JobService.ListCustomJobs|JobService.ListCustomJobs} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [CustomJob]{@link google.cloud.aiplatform.v1beta1.CustomJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_ListCustomJobs_async + */ + listCustomJobsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listCustomJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCustomJobs.asyncIterate( + this.innerApiCalls['listCustomJobs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists DataLabelingJobs in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the DataLabelingJob. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. FieldMask represents a set of + * symbolic field paths. For example, the mask can be `paths: "name"`. The + * "name" here is a field in DataLabelingJob. + * If this field is not set, all fields of the DataLabelingJob are returned. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order by + * default. + * Use `desc` after a field name for descending. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [DataLabelingJob]{@link google.cloud.aiplatform.v1beta1.DataLabelingJob}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDataLabelingJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDataLabelingJobs( + request?: protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob[], + protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsResponse + ]>; + listDataLabelingJobs( + request: protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob>): void; + listDataLabelingJobs( + request: protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob>): void; + listDataLabelingJobs( + request?: protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob[], + protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listDataLabelingJobs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the DataLabelingJob. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. FieldMask represents a set of + * symbolic field paths. For example, the mask can be `paths: "name"`. The + * "name" here is a field in DataLabelingJob. + * If this field is not set, all fields of the DataLabelingJob are returned. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order by + * default. + * Use `desc` after a field name for descending. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [DataLabelingJob]{@link google.cloud.aiplatform.v1beta1.DataLabelingJob} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDataLabelingJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDataLabelingJobsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDataLabelingJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataLabelingJobs.createStream( + this.innerApiCalls.listDataLabelingJobs as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDataLabelingJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the DataLabelingJob. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. FieldMask represents a set of + * symbolic field paths. For example, the mask can be `paths: "name"`. The + * "name" here is a field in DataLabelingJob. + * If this field is not set, all fields of the DataLabelingJob are returned. + * @param {string} request.orderBy + * A comma-separated list of fields to order by, sorted in ascending order by + * default. + * Use `desc` after a field name for descending. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [DataLabelingJob]{@link google.cloud.aiplatform.v1beta1.DataLabelingJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_ListDataLabelingJobs_async + */ + listDataLabelingJobsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDataLabelingJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataLabelingJobs.asyncIterate( + this.innerApiCalls['listDataLabelingJobs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists HyperparameterTuningJobs in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the HyperparameterTuningJobs + * from. Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsResponse.next_page_token|ListHyperparameterTuningJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.JobService.ListHyperparameterTuningJobs|JobService.ListHyperparameterTuningJobs} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listHyperparameterTuningJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listHyperparameterTuningJobs( + request?: protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob[], + protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsResponse + ]>; + listHyperparameterTuningJobs( + request: protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob>): void; + listHyperparameterTuningJobs( + request: protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob>): void; + listHyperparameterTuningJobs( + request?: protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob[], + protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listHyperparameterTuningJobs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the HyperparameterTuningJobs + * from. Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsResponse.next_page_token|ListHyperparameterTuningJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.JobService.ListHyperparameterTuningJobs|JobService.ListHyperparameterTuningJobs} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listHyperparameterTuningJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listHyperparameterTuningJobsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listHyperparameterTuningJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listHyperparameterTuningJobs.createStream( + this.innerApiCalls.listHyperparameterTuningJobs as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listHyperparameterTuningJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the HyperparameterTuningJobs + * from. Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsResponse.next_page_token|ListHyperparameterTuningJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.JobService.ListHyperparameterTuningJobs|JobService.ListHyperparameterTuningJobs} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_ListHyperparameterTuningJobs_async + */ + listHyperparameterTuningJobsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listHyperparameterTuningJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listHyperparameterTuningJobs.asyncIterate( + this.innerApiCalls['listHyperparameterTuningJobs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists BatchPredictionJobs in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the BatchPredictionJobs + * from. Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * * `model_display_name` supports = and != + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsResponse.next_page_token|ListBatchPredictionJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.JobService.ListBatchPredictionJobs|JobService.ListBatchPredictionJobs} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [BatchPredictionJob]{@link google.cloud.aiplatform.v1beta1.BatchPredictionJob}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listBatchPredictionJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listBatchPredictionJobs( + request?: protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob[], + protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsResponse + ]>; + listBatchPredictionJobs( + request: protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob>): void; + listBatchPredictionJobs( + request: protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob>): void; + listBatchPredictionJobs( + request?: protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob[], + protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listBatchPredictionJobs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the BatchPredictionJobs + * from. Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * * `model_display_name` supports = and != + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsResponse.next_page_token|ListBatchPredictionJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.JobService.ListBatchPredictionJobs|JobService.ListBatchPredictionJobs} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [BatchPredictionJob]{@link google.cloud.aiplatform.v1beta1.BatchPredictionJob} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listBatchPredictionJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listBatchPredictionJobsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listBatchPredictionJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBatchPredictionJobs.createStream( + this.innerApiCalls.listBatchPredictionJobs as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listBatchPredictionJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the BatchPredictionJobs + * from. Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * * `model_display_name` supports = and != + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` + * + * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` + * + * * `NOT display_name="my_job"` + * + * * `state="JOB_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsResponse.next_page_token|ListBatchPredictionJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.JobService.ListBatchPredictionJobs|JobService.ListBatchPredictionJobs} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [BatchPredictionJob]{@link google.cloud.aiplatform.v1beta1.BatchPredictionJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_ListBatchPredictionJobs_async + */ + listBatchPredictionJobsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listBatchPredictionJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBatchPredictionJobs.asyncIterate( + this.innerApiCalls['listBatchPredictionJobs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Searches Model Monitoring Statistics generated within a given time window. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.modelDeploymentMonitoringJob + * Required. ModelDeploymentMonitoring Job resource name. + * Format: + * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + * @param {string} request.deployedModelId + * Required. The DeployedModel ID of the + * [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. + * @param {string} request.featureDisplayName + * The feature display name. If specified, only return the stats belonging to + * this feature. Format: + * {@link google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name|ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name}, + * example: "user_destination". + * @param {number[]} request.objectives + * Required. Objectives of the stats to retrieve. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * A page token received from a previous + * {@link google.cloud.aiplatform.v1beta1.JobService.SearchModelDeploymentMonitoringStatsAnomalies|JobService.SearchModelDeploymentMonitoringStatsAnomalies} + * call. + * @param {google.protobuf.Timestamp} request.startTime + * The earliest timestamp of stats being generated. + * If not set, indicates fetching stats till the earliest possible one. + * @param {google.protobuf.Timestamp} request.endTime + * The latest timestamp of stats being generated. + * If not set, indicates feching stats till the latest possible one. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ModelMonitoringStatsAnomalies]{@link google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `searchModelDeploymentMonitoringStatsAnomaliesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchModelDeploymentMonitoringStatsAnomalies( + request?: protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModelMonitoringStatsAnomalies[], + protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest|null, + protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse + ]>; + searchModelDeploymentMonitoringStatsAnomalies( + request: protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModelMonitoringStatsAnomalies>): void; + searchModelDeploymentMonitoringStatsAnomalies( + request: protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModelMonitoringStatsAnomalies>): void; + searchModelDeploymentMonitoringStatsAnomalies( + request?: protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModelMonitoringStatsAnomalies>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModelMonitoringStatsAnomalies>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModelMonitoringStatsAnomalies[], + protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest|null, + protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'model_deployment_monitoring_job': request.modelDeploymentMonitoringJob || '', + }); + this.initialize(); + return this.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.modelDeploymentMonitoringJob + * Required. ModelDeploymentMonitoring Job resource name. + * Format: + * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + * @param {string} request.deployedModelId + * Required. The DeployedModel ID of the + * [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. + * @param {string} request.featureDisplayName + * The feature display name. If specified, only return the stats belonging to + * this feature. Format: + * {@link google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name|ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name}, + * example: "user_destination". + * @param {number[]} request.objectives + * Required. Objectives of the stats to retrieve. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * A page token received from a previous + * {@link google.cloud.aiplatform.v1beta1.JobService.SearchModelDeploymentMonitoringStatsAnomalies|JobService.SearchModelDeploymentMonitoringStatsAnomalies} + * call. + * @param {google.protobuf.Timestamp} request.startTime + * The earliest timestamp of stats being generated. + * If not set, indicates fetching stats till the earliest possible one. + * @param {google.protobuf.Timestamp} request.endTime + * The latest timestamp of stats being generated. + * If not set, indicates feching stats till the latest possible one. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ModelMonitoringStatsAnomalies]{@link google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `searchModelDeploymentMonitoringStatsAnomaliesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchModelDeploymentMonitoringStatsAnomaliesStream( + request?: protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'model_deployment_monitoring_job': request.modelDeploymentMonitoringJob || '', + }); + const defaultCallSettings = this._defaults['searchModelDeploymentMonitoringStatsAnomalies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream( + this.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchModelDeploymentMonitoringStatsAnomalies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.modelDeploymentMonitoringJob + * Required. ModelDeploymentMonitoring Job resource name. + * Format: + * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` + * @param {string} request.deployedModelId + * Required. The DeployedModel ID of the + * [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. + * @param {string} request.featureDisplayName + * The feature display name. If specified, only return the stats belonging to + * this feature. Format: + * {@link google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name|ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name}, + * example: "user_destination". + * @param {number[]} request.objectives + * Required. Objectives of the stats to retrieve. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * A page token received from a previous + * {@link google.cloud.aiplatform.v1beta1.JobService.SearchModelDeploymentMonitoringStatsAnomalies|JobService.SearchModelDeploymentMonitoringStatsAnomalies} + * call. + * @param {google.protobuf.Timestamp} request.startTime + * The earliest timestamp of stats being generated. + * If not set, indicates fetching stats till the earliest possible one. + * @param {google.protobuf.Timestamp} request.endTime + * The latest timestamp of stats being generated. + * If not set, indicates feching stats till the latest possible one. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ModelMonitoringStatsAnomalies]{@link google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_SearchModelDeploymentMonitoringStatsAnomalies_async + */ + searchModelDeploymentMonitoringStatsAnomaliesAsync( + request?: protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'model_deployment_monitoring_job': request.modelDeploymentMonitoringJob || '', + }); + const defaultCallSettings = this._defaults['searchModelDeploymentMonitoringStatsAnomalies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate( + this.innerApiCalls['searchModelDeploymentMonitoringStatsAnomalies'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists ModelDeploymentMonitoringJobs in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the ModelDeploymentMonitoringJob. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listModelDeploymentMonitoringJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listModelDeploymentMonitoringJobs( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob[], + protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsResponse + ]>; + listModelDeploymentMonitoringJobs( + request: protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob>): void; + listModelDeploymentMonitoringJobs( + request: protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob>): void; + listModelDeploymentMonitoringJobs( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob[], + protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listModelDeploymentMonitoringJobs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the ModelDeploymentMonitoringJob. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listModelDeploymentMonitoringJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listModelDeploymentMonitoringJobsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listModelDeploymentMonitoringJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelDeploymentMonitoringJobs.createStream( + this.innerApiCalls.listModelDeploymentMonitoringJobs as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listModelDeploymentMonitoringJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the ModelDeploymentMonitoringJob. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_JobService_ListModelDeploymentMonitoringJobs_async + */ + listModelDeploymentMonitoringJobsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listModelDeploymentMonitoringJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate( + this.innerApiCalls['listModelDeploymentMonitoringJobs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.jobServiceStub && !this._terminated) { + return this.jobServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/job_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/job_service_client_config.json new file mode 100644 index 00000000..8c3c6dd4 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/job_service_client_config.json @@ -0,0 +1,166 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.JobService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateCustomJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetCustomJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListCustomJobs": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCustomJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelCustomJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateDataLabelingJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDataLabelingJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDataLabelingJobs": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDataLabelingJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelDataLabelingJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateHyperparameterTuningJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetHyperparameterTuningJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListHyperparameterTuningJobs": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteHyperparameterTuningJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelHyperparameterTuningJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBatchPredictionJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBatchPredictionJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBatchPredictionJobs": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBatchPredictionJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelBatchPredictionJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateModelDeploymentMonitoringJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SearchModelDeploymentMonitoringStatsAnomalies": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetModelDeploymentMonitoringJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListModelDeploymentMonitoringJobs": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateModelDeploymentMonitoringJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteModelDeploymentMonitoringJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PauseModelDeploymentMonitoringJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ResumeModelDeploymentMonitoringJob": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/job_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/job_service_proto_list.json new file mode 100644 index 00000000..c916ab12 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/job_service_proto_list.json @@ -0,0 +1,117 @@ +[ + "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/context.proto", + "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1beta1/event.proto", + "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/io.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/study.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/types.proto", + "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1beta1/value.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_client.ts new file mode 100644 index 00000000..8e52506f --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_client.ts @@ -0,0 +1,5917 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/metadata_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './metadata_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * Service for reading and writing metadata entries. + * @class + * @memberof v1beta1 + */ +export class MetadataServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + metadataServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of MetadataServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof MetadataServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listMetadataStores: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'metadataStores'), + listArtifacts: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'artifacts'), + listContexts: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'contexts'), + listExecutions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'executions'), + listMetadataSchemas: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'metadataSchemas') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const createMetadataStoreResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.MetadataStore') as gax.protobuf.Type; + const createMetadataStoreMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.CreateMetadataStoreOperationMetadata') as gax.protobuf.Type; + const deleteMetadataStoreResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteMetadataStoreMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteMetadataStoreOperationMetadata') as gax.protobuf.Type; + const deleteArtifactResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteArtifactMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const purgeArtifactsResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.PurgeArtifactsResponse') as gax.protobuf.Type; + const purgeArtifactsMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.PurgeArtifactsMetadata') as gax.protobuf.Type; + const deleteContextResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteContextMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const purgeContextsResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.PurgeContextsResponse') as gax.protobuf.Type; + const purgeContextsMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.PurgeContextsMetadata') as gax.protobuf.Type; + const deleteExecutionResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteExecutionMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const purgeExecutionsResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.PurgeExecutionsResponse') as gax.protobuf.Type; + const purgeExecutionsMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.PurgeExecutionsMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createMetadataStore: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createMetadataStoreResponse.decode.bind(createMetadataStoreResponse), + createMetadataStoreMetadata.decode.bind(createMetadataStoreMetadata)), + deleteMetadataStore: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteMetadataStoreResponse.decode.bind(deleteMetadataStoreResponse), + deleteMetadataStoreMetadata.decode.bind(deleteMetadataStoreMetadata)), + deleteArtifact: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteArtifactResponse.decode.bind(deleteArtifactResponse), + deleteArtifactMetadata.decode.bind(deleteArtifactMetadata)), + purgeArtifacts: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + purgeArtifactsResponse.decode.bind(purgeArtifactsResponse), + purgeArtifactsMetadata.decode.bind(purgeArtifactsMetadata)), + deleteContext: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteContextResponse.decode.bind(deleteContextResponse), + deleteContextMetadata.decode.bind(deleteContextMetadata)), + purgeContexts: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + purgeContextsResponse.decode.bind(purgeContextsResponse), + purgeContextsMetadata.decode.bind(purgeContextsMetadata)), + deleteExecution: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteExecutionResponse.decode.bind(deleteExecutionResponse), + deleteExecutionMetadata.decode.bind(deleteExecutionMetadata)), + purgeExecutions: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + purgeExecutionsResponse.decode.bind(purgeExecutionsResponse), + purgeExecutionsMetadata.decode.bind(purgeExecutionsMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.MetadataService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.metadataServiceStub) { + return this.metadataServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1beta1.MetadataService. + this.metadataServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.MetadataService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1beta1.MetadataService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const metadataServiceStubMethods = + ['createMetadataStore', 'getMetadataStore', 'listMetadataStores', 'deleteMetadataStore', 'createArtifact', 'getArtifact', 'listArtifacts', 'updateArtifact', 'deleteArtifact', 'purgeArtifacts', 'createContext', 'getContext', 'listContexts', 'updateContext', 'deleteContext', 'purgeContexts', 'addContextArtifactsAndExecutions', 'addContextChildren', 'queryContextLineageSubgraph', 'createExecution', 'getExecution', 'listExecutions', 'updateExecution', 'deleteExecution', 'purgeExecutions', 'addExecutionEvents', 'queryExecutionInputsAndOutputs', 'createMetadataSchema', 'getMetadataSchema', 'listMetadataSchemas', 'queryArtifactLineageSubgraph']; + for (const methodName of metadataServiceStubMethods) { + const callPromise = this.metadataServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.metadataServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Retrieves a specific MetadataStore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the MetadataStore to retrieve. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MetadataStore]{@link google.cloud.aiplatform.v1beta1.MetadataStore}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_GetMetadataStore_async + */ + getMetadataStore( + request?: protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IMetadataStore, + protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest|undefined, {}|undefined + ]>; + getMetadataStore( + request: protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IMetadataStore, + protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest|null|undefined, + {}|null|undefined>): void; + getMetadataStore( + request: protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IMetadataStore, + protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest|null|undefined, + {}|null|undefined>): void; + getMetadataStore( + request?: protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IMetadataStore, + protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IMetadataStore, + protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IMetadataStore, + protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getMetadataStore(request, options, callback); + } +/** + * Creates an Artifact associated with a MetadataStore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the MetadataStore where the Artifact should + * be created. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {google.cloud.aiplatform.v1beta1.Artifact} request.artifact + * Required. The Artifact to create. + * @param {string} request.artifactId + * The {artifact} portion of the resource name with the format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + * If not provided, the Artifact's ID will be a UUID generated by the service. + * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. + * Must be unique across all Artifacts in the parent MetadataStore. (Otherwise + * the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the + * caller can't view the preexisting Artifact.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Artifact]{@link google.cloud.aiplatform.v1beta1.Artifact}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_CreateArtifact_async + */ + createArtifact( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IArtifact, + protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest|undefined, {}|undefined + ]>; + createArtifact( + request: protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IArtifact, + protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest|null|undefined, + {}|null|undefined>): void; + createArtifact( + request: protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IArtifact, + protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest|null|undefined, + {}|null|undefined>): void; + createArtifact( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IArtifact, + protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IArtifact, + protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IArtifact, + protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createArtifact(request, options, callback); + } +/** + * Retrieves a specific Artifact. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Artifact to retrieve. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Artifact]{@link google.cloud.aiplatform.v1beta1.Artifact}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_GetArtifact_async + */ + getArtifact( + request?: protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IArtifact, + protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest|undefined, {}|undefined + ]>; + getArtifact( + request: protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IArtifact, + protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest|null|undefined, + {}|null|undefined>): void; + getArtifact( + request: protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IArtifact, + protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest|null|undefined, + {}|null|undefined>): void; + getArtifact( + request?: protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IArtifact, + protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IArtifact, + protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IArtifact, + protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getArtifact(request, options, callback); + } +/** + * Updates a stored Artifact. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.Artifact} request.artifact + * Required. The Artifact containing updates. + * The Artifact's {@link google.cloud.aiplatform.v1beta1.Artifact.name|Artifact.name} field is used to identify the Artifact to + * be updated. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. A FieldMask indicating which fields should be updated. + * Functionality of this field is not yet supported. + * @param {boolean} request.allowMissing + * If set to true, and the {@link google.cloud.aiplatform.v1beta1.Artifact|Artifact} is not found, a new {@link google.cloud.aiplatform.v1beta1.Artifact|Artifact} is + * created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Artifact]{@link google.cloud.aiplatform.v1beta1.Artifact}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_UpdateArtifact_async + */ + updateArtifact( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IArtifact, + protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest|undefined, {}|undefined + ]>; + updateArtifact( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IArtifact, + protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest|null|undefined, + {}|null|undefined>): void; + updateArtifact( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IArtifact, + protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest|null|undefined, + {}|null|undefined>): void; + updateArtifact( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IArtifact, + protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IArtifact, + protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IArtifact, + protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'artifact.name': request.artifact!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateArtifact(request, options, callback); + } +/** + * Creates a Context associated with a MetadataStore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the MetadataStore where the Context should be + * created. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {google.cloud.aiplatform.v1beta1.Context} request.context + * Required. The Context to create. + * @param {string} request.contextId + * The {context} portion of the resource name with the format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`. + * If not provided, the Context's ID will be a UUID generated by the service. + * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. + * Must be unique across all Contexts in the parent MetadataStore. (Otherwise + * the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the + * caller can't view the preexisting Context.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Context]{@link google.cloud.aiplatform.v1beta1.Context}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_CreateContext_async + */ + createContext( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IContext, + protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest|undefined, {}|undefined + ]>; + createContext( + request: protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IContext, + protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest|null|undefined, + {}|null|undefined>): void; + createContext( + request: protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IContext, + protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest|null|undefined, + {}|null|undefined>): void; + createContext( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IContext, + protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IContext, + protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IContext, + protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createContext(request, options, callback); + } +/** + * Retrieves a specific Context. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Context to retrieve. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Context]{@link google.cloud.aiplatform.v1beta1.Context}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_GetContext_async + */ + getContext( + request?: protos.google.cloud.aiplatform.v1beta1.IGetContextRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IContext, + protos.google.cloud.aiplatform.v1beta1.IGetContextRequest|undefined, {}|undefined + ]>; + getContext( + request: protos.google.cloud.aiplatform.v1beta1.IGetContextRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IContext, + protos.google.cloud.aiplatform.v1beta1.IGetContextRequest|null|undefined, + {}|null|undefined>): void; + getContext( + request: protos.google.cloud.aiplatform.v1beta1.IGetContextRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IContext, + protos.google.cloud.aiplatform.v1beta1.IGetContextRequest|null|undefined, + {}|null|undefined>): void; + getContext( + request?: protos.google.cloud.aiplatform.v1beta1.IGetContextRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IContext, + protos.google.cloud.aiplatform.v1beta1.IGetContextRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IContext, + protos.google.cloud.aiplatform.v1beta1.IGetContextRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IContext, + protos.google.cloud.aiplatform.v1beta1.IGetContextRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getContext(request, options, callback); + } +/** + * Updates a stored Context. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.Context} request.context + * Required. The Context containing updates. + * The Context's {@link google.cloud.aiplatform.v1beta1.Context.name|Context.name} field is used to identify the Context to be + * updated. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. A FieldMask indicating which fields should be updated. + * Functionality of this field is not yet supported. + * @param {boolean} request.allowMissing + * If set to true, and the {@link google.cloud.aiplatform.v1beta1.Context|Context} is not found, a new {@link google.cloud.aiplatform.v1beta1.Context|Context} is + * created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Context]{@link google.cloud.aiplatform.v1beta1.Context}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_UpdateContext_async + */ + updateContext( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IContext, + protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest|undefined, {}|undefined + ]>; + updateContext( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IContext, + protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest|null|undefined, + {}|null|undefined>): void; + updateContext( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IContext, + protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest|null|undefined, + {}|null|undefined>): void; + updateContext( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IContext, + protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IContext, + protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IContext, + protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'context.name': request.context!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateContext(request, options, callback); + } +/** + * Adds a set of Artifacts and Executions to a Context. If any of the + * Artifacts or Executions have already been added to a Context, they are + * simply skipped. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.context + * Required. The resource name of the Context that the Artifacts and Executions + * belong to. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + * @param {string[]} request.artifacts + * The resource names of the Artifacts to attribute to the Context. + * + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + * @param {string[]} request.executions + * The resource names of the Executions to associate with the + * Context. + * + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AddContextArtifactsAndExecutionsResponse]{@link google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_AddContextArtifactsAndExecutions_async + */ + addContextArtifactsAndExecutions( + request?: protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsResponse, + protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest|undefined, {}|undefined + ]>; + addContextArtifactsAndExecutions( + request: protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsResponse, + protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest|null|undefined, + {}|null|undefined>): void; + addContextArtifactsAndExecutions( + request: protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsResponse, + protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest|null|undefined, + {}|null|undefined>): void; + addContextArtifactsAndExecutions( + request?: protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsResponse, + protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsResponse, + protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsResponse, + protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'context': request.context || '', + }); + this.initialize(); + return this.innerApiCalls.addContextArtifactsAndExecutions(request, options, callback); + } +/** + * Adds a set of Contexts as children to a parent Context. If any of the + * child Contexts have already been added to the parent Context, they are + * simply skipped. If this call would create a cycle or cause any Context to + * have more than 10 parents, the request will fail with an INVALID_ARGUMENT + * error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.context + * Required. The resource name of the parent Context. + * + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + * @param {string[]} request.childContexts + * The resource names of the child Contexts. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AddContextChildrenResponse]{@link google.cloud.aiplatform.v1beta1.AddContextChildrenResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_AddContextChildren_async + */ + addContextChildren( + request?: protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenResponse, + protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest|undefined, {}|undefined + ]>; + addContextChildren( + request: protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenResponse, + protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest|null|undefined, + {}|null|undefined>): void; + addContextChildren( + request: protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenResponse, + protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest|null|undefined, + {}|null|undefined>): void; + addContextChildren( + request?: protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenResponse, + protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenResponse, + protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenResponse, + protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'context': request.context || '', + }); + this.initialize(); + return this.innerApiCalls.addContextChildren(request, options, callback); + } +/** + * Retrieves Artifacts and Executions within the specified Context, connected + * by Event edges and returned as a LineageSubgraph. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.context + * Required. The resource name of the Context whose Artifacts and Executions + * should be retrieved as a LineageSubgraph. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + * + * The request may error with FAILED_PRECONDITION if the number of Artifacts, + * the number of Executions, or the number of Events that would be returned + * for the Context exceeds 1000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [LineageSubgraph]{@link google.cloud.aiplatform.v1beta1.LineageSubgraph}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_QueryContextLineageSubgraph_async + */ + queryContextLineageSubgraph( + request?: protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest|undefined, {}|undefined + ]>; + queryContextLineageSubgraph( + request: protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest|null|undefined, + {}|null|undefined>): void; + queryContextLineageSubgraph( + request: protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest|null|undefined, + {}|null|undefined>): void; + queryContextLineageSubgraph( + request?: protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'context': request.context || '', + }); + this.initialize(); + return this.innerApiCalls.queryContextLineageSubgraph(request, options, callback); + } +/** + * Creates an Execution associated with a MetadataStore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the MetadataStore where the Execution should + * be created. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {google.cloud.aiplatform.v1beta1.Execution} request.execution + * Required. The Execution to create. + * @param {string} request.executionId + * The {execution} portion of the resource name with the format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + * If not provided, the Execution's ID will be a UUID generated by the + * service. + * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. + * Must be unique across all Executions in the parent MetadataStore. + * (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + * if the caller can't view the preexisting Execution.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Execution]{@link google.cloud.aiplatform.v1beta1.Execution}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_CreateExecution_async + */ + createExecution( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IExecution, + protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest|undefined, {}|undefined + ]>; + createExecution( + request: protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IExecution, + protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest|null|undefined, + {}|null|undefined>): void; + createExecution( + request: protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IExecution, + protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest|null|undefined, + {}|null|undefined>): void; + createExecution( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IExecution, + protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IExecution, + protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IExecution, + protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createExecution(request, options, callback); + } +/** + * Retrieves a specific Execution. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Execution to retrieve. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Execution]{@link google.cloud.aiplatform.v1beta1.Execution}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_GetExecution_async + */ + getExecution( + request?: protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IExecution, + protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest|undefined, {}|undefined + ]>; + getExecution( + request: protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IExecution, + protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest|null|undefined, + {}|null|undefined>): void; + getExecution( + request: protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IExecution, + protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest|null|undefined, + {}|null|undefined>): void; + getExecution( + request?: protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IExecution, + protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IExecution, + protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IExecution, + protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getExecution(request, options, callback); + } +/** + * Updates a stored Execution. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.Execution} request.execution + * Required. The Execution containing updates. + * The Execution's {@link google.cloud.aiplatform.v1beta1.Execution.name|Execution.name} field is used to identify the Execution + * to be updated. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. A FieldMask indicating which fields should be updated. + * Functionality of this field is not yet supported. + * @param {boolean} request.allowMissing + * If set to true, and the {@link google.cloud.aiplatform.v1beta1.Execution|Execution} is not found, a new {@link google.cloud.aiplatform.v1beta1.Execution|Execution} + * is created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Execution]{@link google.cloud.aiplatform.v1beta1.Execution}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_UpdateExecution_async + */ + updateExecution( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IExecution, + protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest|undefined, {}|undefined + ]>; + updateExecution( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IExecution, + protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest|null|undefined, + {}|null|undefined>): void; + updateExecution( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IExecution, + protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest|null|undefined, + {}|null|undefined>): void; + updateExecution( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IExecution, + protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IExecution, + protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IExecution, + protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'execution.name': request.execution!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateExecution(request, options, callback); + } +/** + * Adds Events to the specified Execution. An Event indicates whether an + * Artifact was used as an input or output for an Execution. If an Event + * already exists between the Execution and the Artifact, the Event is + * skipped. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.execution + * Required. The resource name of the Execution that the Events connect + * Artifacts with. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + * @param {number[]} request.events + * The Events to create and add. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AddExecutionEventsResponse]{@link google.cloud.aiplatform.v1beta1.AddExecutionEventsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_AddExecutionEvents_async + */ + addExecutionEvents( + request?: protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsResponse, + protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest|undefined, {}|undefined + ]>; + addExecutionEvents( + request: protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsResponse, + protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest|null|undefined, + {}|null|undefined>): void; + addExecutionEvents( + request: protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsResponse, + protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest|null|undefined, + {}|null|undefined>): void; + addExecutionEvents( + request?: protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsResponse, + protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsResponse, + protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsResponse, + protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'execution': request.execution || '', + }); + this.initialize(); + return this.innerApiCalls.addExecutionEvents(request, options, callback); + } +/** + * Obtains the set of input and output Artifacts for this Execution, in the + * form of LineageSubgraph that also contains the Execution and connecting + * Events. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.execution + * Required. The resource name of the Execution whose input and output Artifacts should + * be retrieved as a LineageSubgraph. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [LineageSubgraph]{@link google.cloud.aiplatform.v1beta1.LineageSubgraph}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_QueryExecutionInputsAndOutputs_async + */ + queryExecutionInputsAndOutputs( + request?: protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest|undefined, {}|undefined + ]>; + queryExecutionInputsAndOutputs( + request: protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest|null|undefined, + {}|null|undefined>): void; + queryExecutionInputsAndOutputs( + request: protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest|null|undefined, + {}|null|undefined>): void; + queryExecutionInputsAndOutputs( + request?: protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'execution': request.execution || '', + }); + this.initialize(); + return this.innerApiCalls.queryExecutionInputsAndOutputs(request, options, callback); + } +/** + * Creates a MetadataSchema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the MetadataStore where the MetadataSchema should + * be created. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {google.cloud.aiplatform.v1beta1.MetadataSchema} request.metadataSchema + * Required. The MetadataSchema to create. + * @param {string} request.metadataSchemaId + * The {metadata_schema} portion of the resource name with the format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` + * If not provided, the MetadataStore's ID will be a UUID generated by the + * service. + * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. + * Must be unique across all MetadataSchemas in the parent Location. + * (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + * if the caller can't view the preexisting MetadataSchema.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MetadataSchema]{@link google.cloud.aiplatform.v1beta1.MetadataSchema}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_CreateMetadataSchema_async + */ + createMetadataSchema( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, + protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest|undefined, {}|undefined + ]>; + createMetadataSchema( + request: protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, + protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest|null|undefined, + {}|null|undefined>): void; + createMetadataSchema( + request: protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, + protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest|null|undefined, + {}|null|undefined>): void; + createMetadataSchema( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, + protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, + protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, + protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createMetadataSchema(request, options, callback); + } +/** + * Retrieves a specific MetadataSchema. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the MetadataSchema to retrieve. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MetadataSchema]{@link google.cloud.aiplatform.v1beta1.MetadataSchema}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_GetMetadataSchema_async + */ + getMetadataSchema( + request?: protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, + protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest|undefined, {}|undefined + ]>; + getMetadataSchema( + request: protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, + protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest|null|undefined, + {}|null|undefined>): void; + getMetadataSchema( + request: protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, + protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest|null|undefined, + {}|null|undefined>): void; + getMetadataSchema( + request?: protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, + protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, + protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, + protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getMetadataSchema(request, options, callback); + } +/** + * Retrieves lineage of an Artifact represented through Artifacts and + * Executions connected by Event edges and returned as a LineageSubgraph. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.artifact + * Required. The resource name of the Artifact whose Lineage needs to be retrieved as a + * LineageSubgraph. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + * + * The request may error with FAILED_PRECONDITION if the number of Artifacts, + * the number of Executions, or the number of Events that would be returned + * for the Context exceeds 1000. + * @param {number} request.maxHops + * Specifies the size of the lineage graph in terms of number of hops from the + * specified artifact. + * Negative Value: INVALID_ARGUMENT error is returned + * 0: Only input artifact is returned. + * No value: Transitive closure is performed to return the complete graph. + * @param {string} request.filter + * Filter specifying the boolean condition for the Artifacts to satisfy in + * order to be part of the Lineage Subgraph. + * The syntax to define filter query is based on https://google.aip.dev/160. + * The supported set of filters include the following: + * + * * **Attribute filtering**: + * For example: `display_name = "test"` + * Supported fields include: `name`, `display_name`, `uri`, `state`, + * `schema_title`, `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"` + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..`. + * For example: `metadata.field_1.number_value = 10.0` + * + * Each of the above supported filter types can be combined together using + * logical operators (`AND` & `OR`). + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [LineageSubgraph]{@link google.cloud.aiplatform.v1beta1.LineageSubgraph}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_QueryArtifactLineageSubgraph_async + */ + queryArtifactLineageSubgraph( + request?: protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest|undefined, {}|undefined + ]>; + queryArtifactLineageSubgraph( + request: protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest|null|undefined, + {}|null|undefined>): void; + queryArtifactLineageSubgraph( + request: protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest|null|undefined, + {}|null|undefined>): void; + queryArtifactLineageSubgraph( + request?: protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, + protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'artifact': request.artifact || '', + }); + this.initialize(); + return this.innerApiCalls.queryArtifactLineageSubgraph(request, options, callback); + } + +/** + * Initializes a MetadataStore, including allocation of resources. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location where the MetadataStore should + * be created. + * Format: `projects/{project}/locations/{location}/` + * @param {google.cloud.aiplatform.v1beta1.MetadataStore} request.metadataStore + * Required. The MetadataStore to create. + * @param {string} request.metadataStoreId + * The {metadatastore} portion of the resource name with the format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * If not provided, the MetadataStore's ID will be a UUID generated by the + * service. + * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. + * Must be unique across all MetadataStores in the parent Location. + * (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED + * if the caller can't view the preexisting MetadataStore.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_CreateMetadataStore_async + */ + createMetadataStore( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateMetadataStoreRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createMetadataStore( + request: protos.google.cloud.aiplatform.v1beta1.ICreateMetadataStoreRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createMetadataStore( + request: protos.google.cloud.aiplatform.v1beta1.ICreateMetadataStoreRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createMetadataStore( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateMetadataStoreRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createMetadataStore(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createMetadataStore()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_CreateMetadataStore_async + */ + async checkCreateMetadataStoreProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createMetadataStore, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single MetadataStore and all its child resources (Artifacts, + * Executions, and Contexts). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the MetadataStore to delete. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {boolean} request.force + * Deprecated: Field is no longer supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_DeleteMetadataStore_async + */ + deleteMetadataStore( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteMetadataStoreRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteMetadataStore( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteMetadataStoreRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteMetadataStore( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteMetadataStoreRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteMetadataStore( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteMetadataStoreRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteMetadataStore(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteMetadataStore()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_DeleteMetadataStore_async + */ + async checkDeleteMetadataStoreProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteMetadataStore, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes an Artifact. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Artifact to delete. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` + * @param {string} [request.etag] + * Optional. The etag of the Artifact to delete. + * If this is provided, it must match the server's etag. Otherwise, the + * request will fail with a FAILED_PRECONDITION. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_DeleteArtifact_async + */ + deleteArtifact( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteArtifactRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteArtifact( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteArtifactRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteArtifact( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteArtifactRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteArtifact( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteArtifactRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteArtifact(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteArtifact()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_DeleteArtifact_async + */ + async checkDeleteArtifactProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteArtifact, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Purges Artifacts. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The metadata store to purge Artifacts from. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {string} request.filter + * Required. A required filter matching the Artifacts to be purged. + * E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + * @param {boolean} [request.force] + * Optional. Flag to indicate to actually perform the purge. + * If `force` is set to false, the method will return a sample of + * Artifact names that would be deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_PurgeArtifacts_async + */ + purgeArtifacts( + request?: protos.google.cloud.aiplatform.v1beta1.IPurgeArtifactsRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + purgeArtifacts( + request: protos.google.cloud.aiplatform.v1beta1.IPurgeArtifactsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + purgeArtifacts( + request: protos.google.cloud.aiplatform.v1beta1.IPurgeArtifactsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + purgeArtifacts( + request?: protos.google.cloud.aiplatform.v1beta1.IPurgeArtifactsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.purgeArtifacts(request, options, callback); + } +/** + * Check the status of the long running operation returned by `purgeArtifacts()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_PurgeArtifacts_async + */ + async checkPurgeArtifactsProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.purgeArtifacts, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a stored Context. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Context to delete. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` + * @param {boolean} request.force + * The force deletion semantics is still undefined. + * Users should not use this field. + * @param {string} [request.etag] + * Optional. The etag of the Context to delete. + * If this is provided, it must match the server's etag. Otherwise, the + * request will fail with a FAILED_PRECONDITION. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_DeleteContext_async + */ + deleteContext( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteContextRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteContext( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteContextRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteContext( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteContextRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteContext( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteContextRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteContext(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteContext()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_DeleteContext_async + */ + async checkDeleteContextProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteContext, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Purges Contexts. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The metadata store to purge Contexts from. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {string} request.filter + * Required. A required filter matching the Contexts to be purged. + * E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + * @param {boolean} [request.force] + * Optional. Flag to indicate to actually perform the purge. + * If `force` is set to false, the method will return a sample of + * Context names that would be deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_PurgeContexts_async + */ + purgeContexts( + request?: protos.google.cloud.aiplatform.v1beta1.IPurgeContextsRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + purgeContexts( + request: protos.google.cloud.aiplatform.v1beta1.IPurgeContextsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + purgeContexts( + request: protos.google.cloud.aiplatform.v1beta1.IPurgeContextsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + purgeContexts( + request?: protos.google.cloud.aiplatform.v1beta1.IPurgeContextsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.purgeContexts(request, options, callback); + } +/** + * Check the status of the long running operation returned by `purgeContexts()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_PurgeContexts_async + */ + async checkPurgeContextsProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.purgeContexts, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes an Execution. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Execution to delete. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` + * @param {string} [request.etag] + * Optional. The etag of the Execution to delete. + * If this is provided, it must match the server's etag. Otherwise, the + * request will fail with a FAILED_PRECONDITION. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_DeleteExecution_async + */ + deleteExecution( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteExecutionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteExecution( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteExecutionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteExecution( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteExecutionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteExecution( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteExecutionRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteExecution(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteExecution()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_DeleteExecution_async + */ + async checkDeleteExecutionProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteExecution, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Purges Executions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The metadata store to purge Executions from. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {string} request.filter + * Required. A required filter matching the Executions to be purged. + * E.g., `update_time <= 2020-11-19T11:30:00-04:00`. + * @param {boolean} [request.force] + * Optional. Flag to indicate to actually perform the purge. + * If `force` is set to false, the method will return a sample of + * Execution names that would be deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_PurgeExecutions_async + */ + purgeExecutions( + request?: protos.google.cloud.aiplatform.v1beta1.IPurgeExecutionsRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + purgeExecutions( + request: protos.google.cloud.aiplatform.v1beta1.IPurgeExecutionsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + purgeExecutions( + request: protos.google.cloud.aiplatform.v1beta1.IPurgeExecutionsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + purgeExecutions( + request?: protos.google.cloud.aiplatform.v1beta1.IPurgeExecutionsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.purgeExecutions(request, options, callback); + } +/** + * Check the status of the long running operation returned by `purgeExecutions()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_PurgeExecutions_async + */ + async checkPurgeExecutionsProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.purgeExecutions, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists MetadataStores for a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Location whose MetadataStores should be listed. + * Format: + * `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The maximum number of Metadata Stores to return. The service may return + * fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataStores|MetadataService.ListMetadataStores} call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [MetadataStore]{@link google.cloud.aiplatform.v1beta1.MetadataStore}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listMetadataStoresAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listMetadataStores( + request?: protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IMetadataStore[], + protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresResponse + ]>; + listMetadataStores( + request: protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, + protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IMetadataStore>): void; + listMetadataStores( + request: protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, + protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IMetadataStore>): void; + listMetadataStores( + request?: protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, + protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IMetadataStore>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, + protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IMetadataStore>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IMetadataStore[], + protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listMetadataStores(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Location whose MetadataStores should be listed. + * Format: + * `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The maximum number of Metadata Stores to return. The service may return + * fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataStores|MetadataService.ListMetadataStores} call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [MetadataStore]{@link google.cloud.aiplatform.v1beta1.MetadataStore} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listMetadataStoresAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listMetadataStoresStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listMetadataStores']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMetadataStores.createStream( + this.innerApiCalls.listMetadataStores as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listMetadataStores`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Location whose MetadataStores should be listed. + * Format: + * `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The maximum number of Metadata Stores to return. The service may return + * fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataStores|MetadataService.ListMetadataStores} call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [MetadataStore]{@link google.cloud.aiplatform.v1beta1.MetadataStore}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_ListMetadataStores_async + */ + listMetadataStoresAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listMetadataStores']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMetadataStores.asyncIterate( + this.innerApiCalls['listMetadataStores'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists Artifacts in the MetadataStore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose Artifacts should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of Artifacts to return. The service may return fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous {@link google.cloud.aiplatform.v1beta1.MetadataService.ListArtifacts|MetadataService.ListArtifacts} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * Filter specifying the boolean condition for the Artifacts to satisfy in + * order to be part of the result set. + * The syntax to define filter query is based on https://google.aip.dev/160. + * The supported set of filters include the following: + * + * * **Attribute filtering**: + * For example: `display_name = "test"`. + * Supported fields include: `name`, `display_name`, `uri`, `state`, + * `schema_title`, `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"` + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..`. + * For example: `metadata.field_1.number_value = 10.0` + * * **Context based filtering**: + * To filter Artifacts based on the contexts to which they belong, use the + * function operator with the full resource name + * `in_context()`. + * For example: + * `in_context("projects//locations//metadataStores//contexts/")` + * + * Each of the above supported filter types can be combined together using + * logical operators (`AND` & `OR`). + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Artifact]{@link google.cloud.aiplatform.v1beta1.Artifact}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listArtifactsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listArtifacts( + request?: protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IArtifact[], + protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListArtifactsResponse + ]>; + listArtifacts( + request: protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, + protos.google.cloud.aiplatform.v1beta1.IListArtifactsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IArtifact>): void; + listArtifacts( + request: protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, + protos.google.cloud.aiplatform.v1beta1.IListArtifactsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IArtifact>): void; + listArtifacts( + request?: protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, + protos.google.cloud.aiplatform.v1beta1.IListArtifactsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IArtifact>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, + protos.google.cloud.aiplatform.v1beta1.IListArtifactsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IArtifact>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IArtifact[], + protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListArtifactsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listArtifacts(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose Artifacts should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of Artifacts to return. The service may return fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous {@link google.cloud.aiplatform.v1beta1.MetadataService.ListArtifacts|MetadataService.ListArtifacts} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * Filter specifying the boolean condition for the Artifacts to satisfy in + * order to be part of the result set. + * The syntax to define filter query is based on https://google.aip.dev/160. + * The supported set of filters include the following: + * + * * **Attribute filtering**: + * For example: `display_name = "test"`. + * Supported fields include: `name`, `display_name`, `uri`, `state`, + * `schema_title`, `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"` + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..`. + * For example: `metadata.field_1.number_value = 10.0` + * * **Context based filtering**: + * To filter Artifacts based on the contexts to which they belong, use the + * function operator with the full resource name + * `in_context()`. + * For example: + * `in_context("projects//locations//metadataStores//contexts/")` + * + * Each of the above supported filter types can be combined together using + * logical operators (`AND` & `OR`). + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Artifact]{@link google.cloud.aiplatform.v1beta1.Artifact} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listArtifactsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listArtifactsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listArtifacts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listArtifacts.createStream( + this.innerApiCalls.listArtifacts as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listArtifacts`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose Artifacts should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of Artifacts to return. The service may return fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous {@link google.cloud.aiplatform.v1beta1.MetadataService.ListArtifacts|MetadataService.ListArtifacts} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * Filter specifying the boolean condition for the Artifacts to satisfy in + * order to be part of the result set. + * The syntax to define filter query is based on https://google.aip.dev/160. + * The supported set of filters include the following: + * + * * **Attribute filtering**: + * For example: `display_name = "test"`. + * Supported fields include: `name`, `display_name`, `uri`, `state`, + * `schema_title`, `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"` + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..`. + * For example: `metadata.field_1.number_value = 10.0` + * * **Context based filtering**: + * To filter Artifacts based on the contexts to which they belong, use the + * function operator with the full resource name + * `in_context()`. + * For example: + * `in_context("projects//locations//metadataStores//contexts/")` + * + * Each of the above supported filter types can be combined together using + * logical operators (`AND` & `OR`). + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Artifact]{@link google.cloud.aiplatform.v1beta1.Artifact}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_ListArtifacts_async + */ + listArtifactsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listArtifacts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listArtifacts.asyncIterate( + this.innerApiCalls['listArtifacts'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists Contexts on the MetadataStore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose Contexts should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of Contexts to return. The service may return fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous {@link google.cloud.aiplatform.v1beta1.MetadataService.ListContexts|MetadataService.ListContexts} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * Filter specifying the boolean condition for the Contexts to satisfy in + * order to be part of the result set. + * The syntax to define filter query is based on https://google.aip.dev/160. + * Following are the supported set of filters: + * + * * **Attribute filtering**: + * For example: `display_name = "test"`. + * Supported fields include: `name`, `display_name`, `schema_title`, + * `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"`. + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..`. + * For example: `metadata.field_1.number_value = 10.0`. + * * **Parent Child filtering**: + * To filter Contexts based on parent-child relationship use the HAS + * operator as follows: + * + * ``` + * parent_contexts: + * "projects//locations//metadataStores//contexts/" + * child_contexts: + * "projects//locations//metadataStores//contexts/" + * ``` + * + * Each of the above supported filters can be combined together using + * logical operators (`AND` & `OR`). + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Context]{@link google.cloud.aiplatform.v1beta1.Context}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listContextsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listContexts( + request?: protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IContext[], + protos.google.cloud.aiplatform.v1beta1.IListContextsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListContextsResponse + ]>; + listContexts( + request: protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, + protos.google.cloud.aiplatform.v1beta1.IListContextsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IContext>): void; + listContexts( + request: protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, + protos.google.cloud.aiplatform.v1beta1.IListContextsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IContext>): void; + listContexts( + request?: protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, + protos.google.cloud.aiplatform.v1beta1.IListContextsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IContext>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, + protos.google.cloud.aiplatform.v1beta1.IListContextsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IContext>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IContext[], + protos.google.cloud.aiplatform.v1beta1.IListContextsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListContextsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listContexts(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose Contexts should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of Contexts to return. The service may return fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous {@link google.cloud.aiplatform.v1beta1.MetadataService.ListContexts|MetadataService.ListContexts} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * Filter specifying the boolean condition for the Contexts to satisfy in + * order to be part of the result set. + * The syntax to define filter query is based on https://google.aip.dev/160. + * Following are the supported set of filters: + * + * * **Attribute filtering**: + * For example: `display_name = "test"`. + * Supported fields include: `name`, `display_name`, `schema_title`, + * `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"`. + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..`. + * For example: `metadata.field_1.number_value = 10.0`. + * * **Parent Child filtering**: + * To filter Contexts based on parent-child relationship use the HAS + * operator as follows: + * + * ``` + * parent_contexts: + * "projects//locations//metadataStores//contexts/" + * child_contexts: + * "projects//locations//metadataStores//contexts/" + * ``` + * + * Each of the above supported filters can be combined together using + * logical operators (`AND` & `OR`). + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Context]{@link google.cloud.aiplatform.v1beta1.Context} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listContextsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listContextsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listContexts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listContexts.createStream( + this.innerApiCalls.listContexts as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listContexts`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose Contexts should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of Contexts to return. The service may return fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous {@link google.cloud.aiplatform.v1beta1.MetadataService.ListContexts|MetadataService.ListContexts} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * Filter specifying the boolean condition for the Contexts to satisfy in + * order to be part of the result set. + * The syntax to define filter query is based on https://google.aip.dev/160. + * Following are the supported set of filters: + * + * * **Attribute filtering**: + * For example: `display_name = "test"`. + * Supported fields include: `name`, `display_name`, `schema_title`, + * `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"`. + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..`. + * For example: `metadata.field_1.number_value = 10.0`. + * * **Parent Child filtering**: + * To filter Contexts based on parent-child relationship use the HAS + * operator as follows: + * + * ``` + * parent_contexts: + * "projects//locations//metadataStores//contexts/" + * child_contexts: + * "projects//locations//metadataStores//contexts/" + * ``` + * + * Each of the above supported filters can be combined together using + * logical operators (`AND` & `OR`). + * + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Context]{@link google.cloud.aiplatform.v1beta1.Context}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_ListContexts_async + */ + listContextsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listContexts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listContexts.asyncIterate( + this.innerApiCalls['listContexts'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists Executions in the MetadataStore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose Executions should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of Executions to return. The service may return fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous {@link google.cloud.aiplatform.v1beta1.MetadataService.ListExecutions|MetadataService.ListExecutions} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with an + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * Filter specifying the boolean condition for the Executions to satisfy in + * order to be part of the result set. + * The syntax to define filter query is based on https://google.aip.dev/160. + * Following are the supported set of filters: + * + * * **Attribute filtering**: + * For example: `display_name = "test"`. + * Supported fields include: `name`, `display_name`, `state`, + * `schema_title`, `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"`. + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..` + * For example: `metadata.field_1.number_value = 10.0` + * * **Context based filtering**: + * To filter Executions based on the contexts to which they belong use + * the function operator with the full resource name: + * `in_context()`. + * For example: + * `in_context("projects//locations//metadataStores//contexts/")` + * + * Each of the above supported filters can be combined together using + * logical operators (`AND` & `OR`). + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Execution]{@link google.cloud.aiplatform.v1beta1.Execution}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listExecutionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listExecutions( + request?: protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IExecution[], + protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListExecutionsResponse + ]>; + listExecutions( + request: protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, + protos.google.cloud.aiplatform.v1beta1.IListExecutionsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IExecution>): void; + listExecutions( + request: protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, + protos.google.cloud.aiplatform.v1beta1.IListExecutionsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IExecution>): void; + listExecutions( + request?: protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, + protos.google.cloud.aiplatform.v1beta1.IListExecutionsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IExecution>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, + protos.google.cloud.aiplatform.v1beta1.IListExecutionsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IExecution>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IExecution[], + protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListExecutionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listExecutions(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose Executions should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of Executions to return. The service may return fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous {@link google.cloud.aiplatform.v1beta1.MetadataService.ListExecutions|MetadataService.ListExecutions} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with an + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * Filter specifying the boolean condition for the Executions to satisfy in + * order to be part of the result set. + * The syntax to define filter query is based on https://google.aip.dev/160. + * Following are the supported set of filters: + * + * * **Attribute filtering**: + * For example: `display_name = "test"`. + * Supported fields include: `name`, `display_name`, `state`, + * `schema_title`, `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"`. + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..` + * For example: `metadata.field_1.number_value = 10.0` + * * **Context based filtering**: + * To filter Executions based on the contexts to which they belong use + * the function operator with the full resource name: + * `in_context()`. + * For example: + * `in_context("projects//locations//metadataStores//contexts/")` + * + * Each of the above supported filters can be combined together using + * logical operators (`AND` & `OR`). + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Execution]{@link google.cloud.aiplatform.v1beta1.Execution} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listExecutionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listExecutionsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listExecutions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listExecutions.createStream( + this.innerApiCalls.listExecutions as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listExecutions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose Executions should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of Executions to return. The service may return fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous {@link google.cloud.aiplatform.v1beta1.MetadataService.ListExecutions|MetadataService.ListExecutions} + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with an + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * Filter specifying the boolean condition for the Executions to satisfy in + * order to be part of the result set. + * The syntax to define filter query is based on https://google.aip.dev/160. + * Following are the supported set of filters: + * + * * **Attribute filtering**: + * For example: `display_name = "test"`. + * Supported fields include: `name`, `display_name`, `state`, + * `schema_title`, `create_time`, and `update_time`. + * Time fields, such as `create_time` and `update_time`, require values + * specified in RFC-3339 format. + * For example: `create_time = "2020-11-19T11:30:00-04:00"`. + * * **Metadata field**: + * To filter on metadata fields use traversal operation as follows: + * `metadata..` + * For example: `metadata.field_1.number_value = 10.0` + * * **Context based filtering**: + * To filter Executions based on the contexts to which they belong use + * the function operator with the full resource name: + * `in_context()`. + * For example: + * `in_context("projects//locations//metadataStores//contexts/")` + * + * Each of the above supported filters can be combined together using + * logical operators (`AND` & `OR`). + * For example: `display_name = "test" AND metadata.field1.bool_value = true`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Execution]{@link google.cloud.aiplatform.v1beta1.Execution}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_ListExecutions_async + */ + listExecutionsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listExecutions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listExecutions.asyncIterate( + this.innerApiCalls['listExecutions'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists MetadataSchemas. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose MetadataSchemas should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of MetadataSchemas to return. The service may return + * fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataSchemas|MetadataService.ListMetadataSchemas} call. Provide this to retrieve the + * next page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * A query to filter available MetadataSchemas for matching results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [MetadataSchema]{@link google.cloud.aiplatform.v1beta1.MetadataSchema}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listMetadataSchemasAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listMetadataSchemas( + request?: protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IMetadataSchema[], + protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasResponse + ]>; + listMetadataSchemas( + request: protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, + protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IMetadataSchema>): void; + listMetadataSchemas( + request: protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, + protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IMetadataSchema>): void; + listMetadataSchemas( + request?: protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, + protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IMetadataSchema>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, + protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IMetadataSchema>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IMetadataSchema[], + protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listMetadataSchemas(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose MetadataSchemas should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of MetadataSchemas to return. The service may return + * fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataSchemas|MetadataService.ListMetadataSchemas} call. Provide this to retrieve the + * next page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * A query to filter available MetadataSchemas for matching results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [MetadataSchema]{@link google.cloud.aiplatform.v1beta1.MetadataSchema} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listMetadataSchemasAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listMetadataSchemasStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listMetadataSchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMetadataSchemas.createStream( + this.innerApiCalls.listMetadataSchemas as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listMetadataSchemas`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MetadataStore whose MetadataSchemas should be listed. + * Format: + * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` + * @param {number} request.pageSize + * The maximum number of MetadataSchemas to return. The service may return + * fewer. + * Must be in range 1-1000, inclusive. Defaults to 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataSchemas|MetadataService.ListMetadataSchemas} call. Provide this to retrieve the + * next page. + * + * When paginating, all other provided parameters must match the call that + * provided the page token. (Otherwise the request will fail with + * INVALID_ARGUMENT error.) + * @param {string} request.filter + * A query to filter available MetadataSchemas for matching results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [MetadataSchema]{@link google.cloud.aiplatform.v1beta1.MetadataSchema}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MetadataService_ListMetadataSchemas_async + */ + listMetadataSchemasAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listMetadataSchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMetadataSchemas.asyncIterate( + this.innerApiCalls['listMetadataSchemas'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.metadataServiceStub && !this._terminated) { + return this.metadataServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_client_config.json new file mode 100644 index 00000000..39313fa9 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_client_config.json @@ -0,0 +1,175 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.MetadataService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateMetadataStore": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetMetadataStore": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListMetadataStores": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteMetadataStore": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateArtifact": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetArtifact": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListArtifacts": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateArtifact": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteArtifact": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PurgeArtifacts": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateContext": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetContext": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListContexts": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateContext": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteContext": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PurgeContexts": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AddContextArtifactsAndExecutions": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AddContextChildren": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "QueryContextLineageSubgraph": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateExecution": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetExecution": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListExecutions": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateExecution": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteExecution": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PurgeExecutions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AddExecutionEvents": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "QueryExecutionInputsAndOutputs": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateMetadataSchema": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetMetadataSchema": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListMetadataSchemas": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "QueryArtifactLineageSubgraph": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_proto_list.json new file mode 100644 index 00000000..c916ab12 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_proto_list.json @@ -0,0 +1,117 @@ +[ + "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/context.proto", + "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1beta1/event.proto", + "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/io.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/study.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/types.proto", + "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1beta1/value.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/migration_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/migration_service_client.ts new file mode 100644 index 00000000..3c7f0246 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/migration_service_client.ts @@ -0,0 +1,2642 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/migration_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './migration_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * A service that migrates resources from automl.googleapis.com, + * datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. + * @class + * @memberof v1beta1 + */ +export class MigrationServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + migrationServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of MigrationServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof MigrationServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + searchMigratableResources: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'migratableResources') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const batchMigrateResourcesResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.BatchMigrateResourcesResponse') as gax.protobuf.Type; + const batchMigrateResourcesMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.BatchMigrateResourcesOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + batchMigrateResources: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchMigrateResourcesResponse.decode.bind(batchMigrateResourcesResponse), + batchMigrateResourcesMetadata.decode.bind(batchMigrateResourcesMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.MigrationService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.migrationServiceStub) { + return this.migrationServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1beta1.MigrationService. + this.migrationServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.MigrationService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1beta1.MigrationService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const migrationServiceStubMethods = + ['searchMigratableResources', 'batchMigrateResources']; + for (const methodName of migrationServiceStubMethods) { + const callPromise = this.migrationServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.migrationServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + +/** + * Batch migrates resources from ml.googleapis.com, automl.googleapis.com, + * and datalabeling.googleapis.com to Vertex AI. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location of the migrated resource will live in. + * Format: `projects/{project}/locations/{location}` + * @param {number[]} request.migrateResourceRequests + * Required. The request messages specifying the resources to migrate. + * They must be in the same location as the destination. + * Up to 50 resources can be migrated in one batch. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MigrationService_BatchMigrateResources_async + */ + batchMigrateResources( + request?: protos.google.cloud.aiplatform.v1beta1.IBatchMigrateResourcesRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + batchMigrateResources( + request: protos.google.cloud.aiplatform.v1beta1.IBatchMigrateResourcesRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchMigrateResources( + request: protos.google.cloud.aiplatform.v1beta1.IBatchMigrateResourcesRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchMigrateResources( + request?: protos.google.cloud.aiplatform.v1beta1.IBatchMigrateResourcesRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.batchMigrateResources(request, options, callback); + } +/** + * Check the status of the long running operation returned by `batchMigrateResources()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MigrationService_BatchMigrateResources_async + */ + async checkBatchMigrateResourcesProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.batchMigrateResources, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Searches all of the resources in automl.googleapis.com, + * datalabeling.googleapis.com and ml.googleapis.com that can be migrated to + * Vertex AI's given location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location that the migratable resources should be searched from. + * It's the Vertex AI location that the resources can be migrated to, not + * the resources' original location. + * Format: + * `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The standard page size. + * The default and maximum value is 100. + * @param {string} request.pageToken + * The standard page token. + * @param {string} request.filter + * A filter for your search. You can use the following types of filters: + * + * * Resource type filters. The following strings filter for a specific type + * of {@link google.cloud.aiplatform.v1beta1.MigratableResource|MigratableResource}: + * * `ml_engine_model_version:*` + * * `automl_model:*` + * * `automl_dataset:*` + * * `data_labeling_dataset:*` + * * "Migrated or not" filters. The following strings filter for resources + * that either have or have not already been migrated: + * * `last_migrate_time:*` filters for migrated resources. + * * `NOT last_migrate_time:*` filters for not yet migrated resources. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [MigratableResource]{@link google.cloud.aiplatform.v1beta1.MigratableResource}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `searchMigratableResourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchMigratableResources( + request?: protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IMigratableResource[], + protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest|null, + protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesResponse + ]>; + searchMigratableResources( + request: protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, + protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IMigratableResource>): void; + searchMigratableResources( + request: protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, + protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IMigratableResource>): void; + searchMigratableResources( + request?: protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, + protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IMigratableResource>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, + protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IMigratableResource>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IMigratableResource[], + protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest|null, + protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.searchMigratableResources(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location that the migratable resources should be searched from. + * It's the Vertex AI location that the resources can be migrated to, not + * the resources' original location. + * Format: + * `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The standard page size. + * The default and maximum value is 100. + * @param {string} request.pageToken + * The standard page token. + * @param {string} request.filter + * A filter for your search. You can use the following types of filters: + * + * * Resource type filters. The following strings filter for a specific type + * of {@link google.cloud.aiplatform.v1beta1.MigratableResource|MigratableResource}: + * * `ml_engine_model_version:*` + * * `automl_model:*` + * * `automl_dataset:*` + * * `data_labeling_dataset:*` + * * "Migrated or not" filters. The following strings filter for resources + * that either have or have not already been migrated: + * * `last_migrate_time:*` filters for migrated resources. + * * `NOT last_migrate_time:*` filters for not yet migrated resources. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [MigratableResource]{@link google.cloud.aiplatform.v1beta1.MigratableResource} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `searchMigratableResourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchMigratableResourcesStream( + request?: protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['searchMigratableResources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchMigratableResources.createStream( + this.innerApiCalls.searchMigratableResources as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchMigratableResources`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location that the migratable resources should be searched from. + * It's the Vertex AI location that the resources can be migrated to, not + * the resources' original location. + * Format: + * `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The standard page size. + * The default and maximum value is 100. + * @param {string} request.pageToken + * The standard page token. + * @param {string} request.filter + * A filter for your search. You can use the following types of filters: + * + * * Resource type filters. The following strings filter for a specific type + * of {@link google.cloud.aiplatform.v1beta1.MigratableResource|MigratableResource}: + * * `ml_engine_model_version:*` + * * `automl_model:*` + * * `automl_dataset:*` + * * `data_labeling_dataset:*` + * * "Migrated or not" filters. The following strings filter for resources + * that either have or have not already been migrated: + * * `last_migrate_time:*` filters for migrated resources. + * * `NOT last_migrate_time:*` filters for not yet migrated resources. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [MigratableResource]{@link google.cloud.aiplatform.v1beta1.MigratableResource}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_MigrationService_SearchMigratableResources_async + */ + searchMigratableResourcesAsync( + request?: protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['searchMigratableResources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchMigratableResources.asyncIterate( + this.innerApiCalls['searchMigratableResources'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.migrationServiceStub && !this._terminated) { + return this.migrationServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/migration_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/migration_service_client_config.json new file mode 100644 index 00000000..10583430 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/migration_service_client_config.json @@ -0,0 +1,34 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.MigrationService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "SearchMigratableResources": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchMigrateResources": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/migration_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/migration_service_proto_list.json new file mode 100644 index 00000000..c916ab12 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/migration_service_proto_list.json @@ -0,0 +1,117 @@ +[ + "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/context.proto", + "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1beta1/event.proto", + "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/io.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/study.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/types.proto", + "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1beta1/value.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/model_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/model_service_client.ts new file mode 100644 index 00000000..f991040b --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/model_service_client.ts @@ -0,0 +1,4184 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/model_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './model_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * A service for managing Vertex AI's machine learning Models. + * @class + * @memberof v1beta1 + */ +export class ModelServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + modelServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ModelServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ModelServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listModels: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'models'), + listModelVersions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'models'), + listModelEvaluations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'modelEvaluations'), + listModelEvaluationSlices: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'modelEvaluationSlices') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const uploadModelResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.UploadModelResponse') as gax.protobuf.Type; + const uploadModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.UploadModelOperationMetadata') as gax.protobuf.Type; + const updateExplanationDatasetResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse') as gax.protobuf.Type; + const updateExplanationDatasetMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata') as gax.protobuf.Type; + const deleteModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const deleteModelVersionResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteModelVersionMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const exportModelResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.ExportModelResponse') as gax.protobuf.Type; + const exportModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.ExportModelOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + uploadModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + uploadModelResponse.decode.bind(uploadModelResponse), + uploadModelMetadata.decode.bind(uploadModelMetadata)), + updateExplanationDataset: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateExplanationDatasetResponse.decode.bind(updateExplanationDatasetResponse), + updateExplanationDatasetMetadata.decode.bind(updateExplanationDatasetMetadata)), + deleteModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteModelResponse.decode.bind(deleteModelResponse), + deleteModelMetadata.decode.bind(deleteModelMetadata)), + deleteModelVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteModelVersionResponse.decode.bind(deleteModelVersionResponse), + deleteModelVersionMetadata.decode.bind(deleteModelVersionMetadata)), + exportModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportModelResponse.decode.bind(exportModelResponse), + exportModelMetadata.decode.bind(exportModelMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.ModelService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.modelServiceStub) { + return this.modelServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1beta1.ModelService. + this.modelServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.ModelService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1beta1.ModelService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const modelServiceStubMethods = + ['uploadModel', 'getModel', 'listModels', 'listModelVersions', 'updateModel', 'updateExplanationDataset', 'deleteModel', 'deleteModelVersion', 'mergeVersionAliases', 'exportModel', 'importModelEvaluation', 'getModelEvaluation', 'listModelEvaluations', 'getModelEvaluationSlice', 'listModelEvaluationSlices']; + for (const methodName of modelServiceStubMethods) { + const callPromise = this.modelServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.modelServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets a Model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Model resource. + * Format: `projects/{project}/locations/{location}/models/{model}` + * + * In order to retrieve a specific version of the model, also provide + * the version ID or version alias. + * Example: projects/{project}/locations/{location}/models/{model}@2 + * or + * projects/{project}/locations/{location}/models/{model}@golden + * If no version ID or alias is specified, the "default" version will be + * returned. The "default" version alias is created for the first version of + * the model, and can be moved to other versions later on. There will be + * exactly one default version. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Model]{@link google.cloud.aiplatform.v1beta1.Model}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_GetModel_async + */ + getModel( + request?: protos.google.cloud.aiplatform.v1beta1.IGetModelRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModel, + protos.google.cloud.aiplatform.v1beta1.IGetModelRequest|undefined, {}|undefined + ]>; + getModel( + request: protos.google.cloud.aiplatform.v1beta1.IGetModelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IModel, + protos.google.cloud.aiplatform.v1beta1.IGetModelRequest|null|undefined, + {}|null|undefined>): void; + getModel( + request: protos.google.cloud.aiplatform.v1beta1.IGetModelRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IModel, + protos.google.cloud.aiplatform.v1beta1.IGetModelRequest|null|undefined, + {}|null|undefined>): void; + getModel( + request?: protos.google.cloud.aiplatform.v1beta1.IGetModelRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IModel, + protos.google.cloud.aiplatform.v1beta1.IGetModelRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IModel, + protos.google.cloud.aiplatform.v1beta1.IGetModelRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModel, + protos.google.cloud.aiplatform.v1beta1.IGetModelRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getModel(request, options, callback); + } +/** + * Updates a Model. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.Model} request.model + * Required. The Model which replaces the resource on the server. + * When Model Versioning is enabled, the model.name will be used to determine + * whether to update the model or model version. + * 1. model.name with the @ value, e.g. models/123@1, refers to a version + * specific update. + * 2. model.name without the @ value, e.g. models/123, refers to a model + * update. + * 3. model.name with @-, e.g. models/123@-, refers to a model update. + * 4. Supported model fields: display_name, description; supported + * version-specific fields: version_description. Labels are supported in both + * scenarios. Both the model labels and the version labels are merged when a + * model is returned. When updating labels, if the request is for + * model-specific update, model label gets updated. Otherwise, version labels + * get updated. + * 5. A model name or model version name fields update mismatch will cause a + * precondition error. + * 6. One request cannot update both the model and the version fields. You + * must update them separately. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. + * For the `FieldMask` definition, see {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Model]{@link google.cloud.aiplatform.v1beta1.Model}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_UpdateModel_async + */ + updateModel( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModel, + protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest|undefined, {}|undefined + ]>; + updateModel( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IModel, + protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest|null|undefined, + {}|null|undefined>): void; + updateModel( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IModel, + protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest|null|undefined, + {}|null|undefined>): void; + updateModel( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IModel, + protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IModel, + protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModel, + protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'model.name': request.model!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateModel(request, options, callback); + } +/** + * Merges a set of aliases for a Model version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the model version to merge aliases, with a version ID + * explicitly included. + * + * Example: `projects/{project}/locations/{location}/models/{model}@1234` + * @param {string[]} request.versionAliases + * Required. The set of version aliases to merge. + * The alias should be at most 128 characters, and match + * `{@link a-z0-9-|a-z}{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 + * 1) The aliases returned from GetModel API might not have the exactly same + * order from this MergeVersionAliases API. 2) Adding and deleting the same + * alias in the request is not recommended, and the 2 operations will be + * cancelled out. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Model]{@link google.cloud.aiplatform.v1beta1.Model}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_MergeVersionAliases_async + */ + mergeVersionAliases( + request?: protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModel, + protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest|undefined, {}|undefined + ]>; + mergeVersionAliases( + request: protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IModel, + protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest|null|undefined, + {}|null|undefined>): void; + mergeVersionAliases( + request: protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IModel, + protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest|null|undefined, + {}|null|undefined>): void; + mergeVersionAliases( + request?: protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IModel, + protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IModel, + protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModel, + protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.mergeVersionAliases(request, options, callback); + } +/** + * Imports an externally generated ModelEvaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent model resource. + * Format: `projects/{project}/locations/{location}/models/{model}` + * @param {google.cloud.aiplatform.v1beta1.ModelEvaluation} request.modelEvaluation + * Required. Model evaluation resource to be imported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ModelEvaluation]{@link google.cloud.aiplatform.v1beta1.ModelEvaluation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_ImportModelEvaluation_async + */ + importModelEvaluation( + request?: protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, + protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest|undefined, {}|undefined + ]>; + importModelEvaluation( + request: protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, + protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest|null|undefined, + {}|null|undefined>): void; + importModelEvaluation( + request: protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, + protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest|null|undefined, + {}|null|undefined>): void; + importModelEvaluation( + request?: protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, + protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, + protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, + protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.importModelEvaluation(request, options, callback); + } +/** + * Gets a ModelEvaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the ModelEvaluation resource. + * Format: + * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ModelEvaluation]{@link google.cloud.aiplatform.v1beta1.ModelEvaluation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_GetModelEvaluation_async + */ + getModelEvaluation( + request?: protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, + protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest|undefined, {}|undefined + ]>; + getModelEvaluation( + request: protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, + protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest|null|undefined, + {}|null|undefined>): void; + getModelEvaluation( + request: protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, + protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest|null|undefined, + {}|null|undefined>): void; + getModelEvaluation( + request?: protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, + protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, + protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, + protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getModelEvaluation(request, options, callback); + } +/** + * Gets a ModelEvaluationSlice. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the ModelEvaluationSlice resource. + * Format: + * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ModelEvaluationSlice]{@link google.cloud.aiplatform.v1beta1.ModelEvaluationSlice}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_GetModelEvaluationSlice_async + */ + getModelEvaluationSlice( + request?: protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice, + protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest|undefined, {}|undefined + ]>; + getModelEvaluationSlice( + request: protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice, + protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest|null|undefined, + {}|null|undefined>): void; + getModelEvaluationSlice( + request: protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice, + protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest|null|undefined, + {}|null|undefined>): void; + getModelEvaluationSlice( + request?: protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice, + protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice, + protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice, + protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getModelEvaluationSlice(request, options, callback); + } + +/** + * Uploads a Model artifact into Vertex AI. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location into which to upload the Model. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.parentModel] + * Optional. The resource name of the model into which to upload the version. Only + * specify this field when uploading a new version. + * @param {string} [request.modelId] + * Optional. The ID to use for the uploaded Model, which will become the final + * component of the model resource name. + * + * This value may be up to 63 characters, and valid characters are + * `[a-z0-9_-]`. The first character cannot be a number or hyphen. + * @param {google.cloud.aiplatform.v1beta1.Model} request.model + * Required. The Model to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_UploadModel_async + */ + uploadModel( + request?: protos.google.cloud.aiplatform.v1beta1.IUploadModelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + uploadModel( + request: protos.google.cloud.aiplatform.v1beta1.IUploadModelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + uploadModel( + request: protos.google.cloud.aiplatform.v1beta1.IUploadModelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + uploadModel( + request?: protos.google.cloud.aiplatform.v1beta1.IUploadModelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.uploadModel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `uploadModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_UploadModel_async + */ + async checkUploadModelProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.uploadModel, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Incremental update the dataset used for a examples model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The resource name of the Model to update. + * Format: `projects/{project}/locations/{location}/models/{model}` + * @param {google.cloud.aiplatform.v1beta1.Examples} request.examples + * The example config containing the location of the dataset. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_UpdateExplanationDataset_async + */ + updateExplanationDataset( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateExplanationDataset( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateExplanationDataset( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateExplanationDataset( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'model': request.model || '', + }); + this.initialize(); + return this.innerApiCalls.updateExplanationDataset(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateExplanationDataset()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_UpdateExplanationDataset_async + */ + async checkUpdateExplanationDatasetProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateExplanationDataset, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a Model. + * + * A model cannot be deleted if any {@link google.cloud.aiplatform.v1beta1.Endpoint|Endpoint} resource has a + * {@link google.cloud.aiplatform.v1beta1.DeployedModel|DeployedModel} based on the model in its + * {@link google.cloud.aiplatform.v1beta1.Endpoint.deployed_models|deployed_models} field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Model resource to be deleted. + * Format: `projects/{project}/locations/{location}/models/{model}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_DeleteModel_async + */ + deleteModel( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteModelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteModel( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteModelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteModel( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteModelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteModel( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteModelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteModel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_DeleteModel_async + */ + async checkDeleteModelProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteModel, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a Model version. + * + * Model version can only be deleted if there are no {@link |DeployedModels} + * created from it. Deleting the only version in the Model is not allowed. Use + * {@link google.cloud.aiplatform.v1beta1.ModelService.DeleteModel|DeleteModel} for deleting the Model instead. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the model version to be deleted, with a version ID explicitly + * included. + * + * Example: `projects/{project}/locations/{location}/models/{model}@1234` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_DeleteModelVersion_async + */ + deleteModelVersion( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteModelVersionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteModelVersion( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteModelVersionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteModelVersion( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteModelVersionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteModelVersion( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteModelVersionRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteModelVersion(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteModelVersion()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_DeleteModelVersion_async + */ + async checkDeleteModelVersionProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteModelVersion, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Exports a trained, exportable Model to a location specified by the + * user. A Model is considered to be exportable if it has at least one + * {@link google.cloud.aiplatform.v1beta1.Model.supported_export_formats|supported export format}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Model to export. + * The resource name may contain version id or version alias to specify the + * version, if no version is specified, the default version will be exported. + * @param {google.cloud.aiplatform.v1beta1.ExportModelRequest.OutputConfig} request.outputConfig + * Required. The desired output location and configuration. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_ExportModel_async + */ + exportModel( + request?: protos.google.cloud.aiplatform.v1beta1.IExportModelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + exportModel( + request: protos.google.cloud.aiplatform.v1beta1.IExportModelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportModel( + request: protos.google.cloud.aiplatform.v1beta1.IExportModelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportModel( + request?: protos.google.cloud.aiplatform.v1beta1.IExportModelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.exportModel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `exportModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_ExportModel_async + */ + async checkExportModelProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.exportModel, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Models in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the Models from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `model` supports = and !=. `model` represents the Model ID, + * i.e. the last segment of the Model's {@link google.cloud.aiplatform.v1beta1.Model.name|resource name}. + * * `display_name` supports = and != + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `model=1234` + * * `displayName="myDisplayName"` + * * `labels.myKey="myValue"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModels|ModelService.ListModels} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Model]{@link google.cloud.aiplatform.v1beta1.Model}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listModelsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listModels( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModel[], + protos.google.cloud.aiplatform.v1beta1.IListModelsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListModelsResponse + ]>; + listModels( + request: protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModel>): void; + listModels( + request: protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModel>): void; + listModels( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModel>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModel>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModel[], + protos.google.cloud.aiplatform.v1beta1.IListModelsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListModelsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listModels(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the Models from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `model` supports = and !=. `model` represents the Model ID, + * i.e. the last segment of the Model's {@link google.cloud.aiplatform.v1beta1.Model.name|resource name}. + * * `display_name` supports = and != + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `model=1234` + * * `displayName="myDisplayName"` + * * `labels.myKey="myValue"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModels|ModelService.ListModels} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Model]{@link google.cloud.aiplatform.v1beta1.Model} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listModelsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listModelsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModels.createStream( + this.innerApiCalls.listModels as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listModels`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the Models from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `model` supports = and !=. `model` represents the Model ID, + * i.e. the last segment of the Model's {@link google.cloud.aiplatform.v1beta1.Model.name|resource name}. + * * `display_name` supports = and != + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `model=1234` + * * `displayName="myDisplayName"` + * * `labels.myKey="myValue"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModels|ModelService.ListModels} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Model]{@link google.cloud.aiplatform.v1beta1.Model}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_ListModels_async + */ + listModelsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModels.asyncIterate( + this.innerApiCalls['listModels'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists versions of the specified model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the model to list versions for. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token|ListModelVersionsResponse.next_page_token} of the previous + * {@link |ModelService.ListModelversions} call. + * @param {string} request.filter + * An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `labels.myKey="myValue"` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Model]{@link google.cloud.aiplatform.v1beta1.Model}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listModelVersionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listModelVersions( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModel[], + protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListModelVersionsResponse + ]>; + listModelVersions( + request: protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelVersionsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModel>): void; + listModelVersions( + request: protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelVersionsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModel>): void; + listModelVersions( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelVersionsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModel>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelVersionsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModel>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModel[], + protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListModelVersionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.listModelVersions(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the model to list versions for. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token|ListModelVersionsResponse.next_page_token} of the previous + * {@link |ModelService.ListModelversions} call. + * @param {string} request.filter + * An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `labels.myKey="myValue"` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Model]{@link google.cloud.aiplatform.v1beta1.Model} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listModelVersionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listModelVersionsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + const defaultCallSettings = this._defaults['listModelVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelVersions.createStream( + this.innerApiCalls.listModelVersions as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listModelVersions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the model to list versions for. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token|ListModelVersionsResponse.next_page_token} of the previous + * {@link |ModelService.ListModelversions} call. + * @param {string} request.filter + * An expression for filtering the results of the request. For field names + * both snake_case and camelCase are supported. + * + * * `labels` supports general map functions that is: + * * `labels.key=value` - key:value equality + * * `labels.key:* or labels:key - key existence + * * A key including a space must be quoted. `labels."a key"`. + * + * Some examples: + * * `labels.myKey="myValue"` + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Model]{@link google.cloud.aiplatform.v1beta1.Model}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_ListModelVersions_async + */ + listModelVersionsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + const defaultCallSettings = this._defaults['listModelVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelVersions.asyncIterate( + this.innerApiCalls['listModelVersions'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists ModelEvaluations in a Model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Model to list the ModelEvaluations from. + * Format: `projects/{project}/locations/{location}/models/{model}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluations|ModelService.ListModelEvaluations} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ModelEvaluation]{@link google.cloud.aiplatform.v1beta1.ModelEvaluation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listModelEvaluationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listModelEvaluations( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModelEvaluation[], + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsResponse + ]>; + listModelEvaluations( + request: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModelEvaluation>): void; + listModelEvaluations( + request: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModelEvaluation>): void; + listModelEvaluations( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModelEvaluation>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModelEvaluation>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModelEvaluation[], + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listModelEvaluations(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Model to list the ModelEvaluations from. + * Format: `projects/{project}/locations/{location}/models/{model}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluations|ModelService.ListModelEvaluations} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ModelEvaluation]{@link google.cloud.aiplatform.v1beta1.ModelEvaluation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listModelEvaluationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listModelEvaluationsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listModelEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelEvaluations.createStream( + this.innerApiCalls.listModelEvaluations as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listModelEvaluations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Model to list the ModelEvaluations from. + * Format: `projects/{project}/locations/{location}/models/{model}` + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluations|ModelService.ListModelEvaluations} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ModelEvaluation]{@link google.cloud.aiplatform.v1beta1.ModelEvaluation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_ListModelEvaluations_async + */ + listModelEvaluationsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listModelEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelEvaluations.asyncIterate( + this.innerApiCalls['listModelEvaluations'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists ModelEvaluationSlices in a ModelEvaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the ModelEvaluation to list the ModelEvaluationSlices + * from. Format: + * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + * @param {string} request.filter + * The standard list filter. + * + * * `slice.dimension` - for =. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesResponse.next_page_token|ListModelEvaluationSlicesResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluationSlices|ModelService.ListModelEvaluationSlices} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ModelEvaluationSlice]{@link google.cloud.aiplatform.v1beta1.ModelEvaluationSlice}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listModelEvaluationSlicesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listModelEvaluationSlices( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice[], + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesResponse + ]>; + listModelEvaluationSlices( + request: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice>): void; + listModelEvaluationSlices( + request: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice>): void; + listModelEvaluationSlices( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice[], + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listModelEvaluationSlices(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the ModelEvaluation to list the ModelEvaluationSlices + * from. Format: + * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + * @param {string} request.filter + * The standard list filter. + * + * * `slice.dimension` - for =. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesResponse.next_page_token|ListModelEvaluationSlicesResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluationSlices|ModelService.ListModelEvaluationSlices} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ModelEvaluationSlice]{@link google.cloud.aiplatform.v1beta1.ModelEvaluationSlice} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listModelEvaluationSlicesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listModelEvaluationSlicesStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listModelEvaluationSlices']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelEvaluationSlices.createStream( + this.innerApiCalls.listModelEvaluationSlices as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listModelEvaluationSlices`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the ModelEvaluation to list the ModelEvaluationSlices + * from. Format: + * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + * @param {string} request.filter + * The standard list filter. + * + * * `slice.dimension` - for =. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesResponse.next_page_token|ListModelEvaluationSlicesResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluationSlices|ModelService.ListModelEvaluationSlices} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ModelEvaluationSlice]{@link google.cloud.aiplatform.v1beta1.ModelEvaluationSlice}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_ListModelEvaluationSlices_async + */ + listModelEvaluationSlicesAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listModelEvaluationSlices']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelEvaluationSlices.asyncIterate( + this.innerApiCalls['listModelEvaluationSlices'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.modelServiceStub && !this._terminated) { + return this.modelServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/model_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/model_service_client_config.json new file mode 100644 index 00000000..5d0c4612 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/model_service_client_config.json @@ -0,0 +1,96 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.ModelService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "UploadModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListModels": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListModelVersions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateExplanationDataset": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteModelVersion": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MergeVersionAliases": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ImportModelEvaluation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetModelEvaluation": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListModelEvaluations": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetModelEvaluationSlice": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListModelEvaluationSlices": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/model_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/model_service_proto_list.json new file mode 100644 index 00000000..c916ab12 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/model_service_proto_list.json @@ -0,0 +1,117 @@ +[ + "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/context.proto", + "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1beta1/event.proto", + "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/io.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/study.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/types.proto", + "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1beta1/value.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_client.ts new file mode 100644 index 00000000..3c4f891c --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_client.ts @@ -0,0 +1,3550 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/pipeline_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './pipeline_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * A service for creating and managing Vertex AI's pipelines. This includes both + * `TrainingPipeline` resources (used for AutoML and custom training) and + * `PipelineJob` resources (used for Vertex AI Pipelines). + * @class + * @memberof v1beta1 + */ +export class PipelineServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + pipelineServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PipelineServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof PipelineServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listTrainingPipelines: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'trainingPipelines'), + listPipelineJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'pipelineJobs') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const deleteTrainingPipelineResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteTrainingPipelineMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const deletePipelineJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deletePipelineJobMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + deleteTrainingPipeline: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTrainingPipelineResponse.decode.bind(deleteTrainingPipelineResponse), + deleteTrainingPipelineMetadata.decode.bind(deleteTrainingPipelineMetadata)), + deletePipelineJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deletePipelineJobResponse.decode.bind(deletePipelineJobResponse), + deletePipelineJobMetadata.decode.bind(deletePipelineJobMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.PipelineService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.pipelineServiceStub) { + return this.pipelineServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1beta1.PipelineService. + this.pipelineServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.PipelineService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1beta1.PipelineService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const pipelineServiceStubMethods = + ['createTrainingPipeline', 'getTrainingPipeline', 'listTrainingPipelines', 'deleteTrainingPipeline', 'cancelTrainingPipeline', 'createPipelineJob', 'getPipelineJob', 'listPipelineJobs', 'deletePipelineJob', 'cancelPipelineJob']; + for (const methodName of pipelineServiceStubMethods) { + const callPromise = this.pipelineServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.pipelineServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Creates a TrainingPipeline. A created TrainingPipeline right away will be + * attempted to be run. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the TrainingPipeline in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.TrainingPipeline} request.trainingPipeline + * Required. The TrainingPipeline to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TrainingPipeline]{@link google.cloud.aiplatform.v1beta1.TrainingPipeline}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_PipelineService_CreateTrainingPipeline_async + */ + createTrainingPipeline( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest|undefined, {}|undefined + ]>; + createTrainingPipeline( + request: protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest|null|undefined, + {}|null|undefined>): void; + createTrainingPipeline( + request: protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest|null|undefined, + {}|null|undefined>): void; + createTrainingPipeline( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createTrainingPipeline(request, options, callback); + } +/** + * Gets a TrainingPipeline. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TrainingPipeline resource. + * Format: + * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TrainingPipeline]{@link google.cloud.aiplatform.v1beta1.TrainingPipeline}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_PipelineService_GetTrainingPipeline_async + */ + getTrainingPipeline( + request?: protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest|undefined, {}|undefined + ]>; + getTrainingPipeline( + request: protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest|null|undefined, + {}|null|undefined>): void; + getTrainingPipeline( + request: protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest|null|undefined, + {}|null|undefined>): void; + getTrainingPipeline( + request?: protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, + protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getTrainingPipeline(request, options, callback); + } +/** + * Cancels a TrainingPipeline. + * Starts asynchronous cancellation on the TrainingPipeline. The server + * makes a best effort to cancel the pipeline, but success is not + * guaranteed. Clients can use {@link google.cloud.aiplatform.v1beta1.PipelineService.GetTrainingPipeline|PipelineService.GetTrainingPipeline} or + * other methods to check whether the cancellation succeeded or whether the + * pipeline completed despite cancellation. On successful cancellation, + * the TrainingPipeline is not deleted; instead it becomes a pipeline with + * a {@link google.cloud.aiplatform.v1beta1.TrainingPipeline.error|TrainingPipeline.error} value with a {@link google.rpc.Status.code|google.rpc.Status.code} of 1, + * corresponding to `Code.CANCELLED`, and {@link google.cloud.aiplatform.v1beta1.TrainingPipeline.state|TrainingPipeline.state} is set to + * `CANCELLED`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TrainingPipeline to cancel. + * Format: + * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_PipelineService_CancelTrainingPipeline_async + */ + cancelTrainingPipeline( + request?: protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest|undefined, {}|undefined + ]>; + cancelTrainingPipeline( + request: protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest|null|undefined, + {}|null|undefined>): void; + cancelTrainingPipeline( + request: protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest|null|undefined, + {}|null|undefined>): void; + cancelTrainingPipeline( + request?: protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.cancelTrainingPipeline(request, options, callback); + } +/** + * Creates a PipelineJob. A PipelineJob will run immediately when created. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the PipelineJob in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.PipelineJob} request.pipelineJob + * Required. The PipelineJob to create. + * @param {string} request.pipelineJobId + * The ID to use for the PipelineJob, which will become the final component of + * the PipelineJob name. If not provided, an ID will be automatically + * generated. + * + * This value should be less than 128 characters, and valid characters + * are /{@link 0-9|a-z}-/. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PipelineJob]{@link google.cloud.aiplatform.v1beta1.PipelineJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_PipelineService_CreatePipelineJob_async + */ + createPipelineJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IPipelineJob, + protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest|undefined, {}|undefined + ]>; + createPipelineJob( + request: protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IPipelineJob, + protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest|null|undefined, + {}|null|undefined>): void; + createPipelineJob( + request: protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IPipelineJob, + protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest|null|undefined, + {}|null|undefined>): void; + createPipelineJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IPipelineJob, + protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IPipelineJob, + protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IPipelineJob, + protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createPipelineJob(request, options, callback); + } +/** + * Gets a PipelineJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the PipelineJob resource. + * Format: + * `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PipelineJob]{@link google.cloud.aiplatform.v1beta1.PipelineJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_PipelineService_GetPipelineJob_async + */ + getPipelineJob( + request?: protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IPipelineJob, + protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest|undefined, {}|undefined + ]>; + getPipelineJob( + request: protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IPipelineJob, + protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest|null|undefined, + {}|null|undefined>): void; + getPipelineJob( + request: protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IPipelineJob, + protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest|null|undefined, + {}|null|undefined>): void; + getPipelineJob( + request?: protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IPipelineJob, + protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IPipelineJob, + protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IPipelineJob, + protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getPipelineJob(request, options, callback); + } +/** + * Cancels a PipelineJob. + * Starts asynchronous cancellation on the PipelineJob. The server + * makes a best effort to cancel the pipeline, but success is not + * guaranteed. Clients can use {@link google.cloud.aiplatform.v1beta1.PipelineService.GetPipelineJob|PipelineService.GetPipelineJob} or + * other methods to check whether the cancellation succeeded or whether the + * pipeline completed despite cancellation. On successful cancellation, + * the PipelineJob is not deleted; instead it becomes a pipeline with + * a {@link google.cloud.aiplatform.v1beta1.PipelineJob.error|PipelineJob.error} value with a {@link google.rpc.Status.code|google.rpc.Status.code} of 1, + * corresponding to `Code.CANCELLED`, and {@link google.cloud.aiplatform.v1beta1.PipelineJob.state|PipelineJob.state} is set to + * `CANCELLED`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the PipelineJob to cancel. + * Format: + * `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_PipelineService_CancelPipelineJob_async + */ + cancelPipelineJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest|undefined, {}|undefined + ]>; + cancelPipelineJob( + request: protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest|null|undefined, + {}|null|undefined>): void; + cancelPipelineJob( + request: protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest|null|undefined, + {}|null|undefined>): void; + cancelPipelineJob( + request?: protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.cancelPipelineJob(request, options, callback); + } + +/** + * Deletes a TrainingPipeline. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TrainingPipeline resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_PipelineService_DeleteTrainingPipeline_async + */ + deleteTrainingPipeline( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTrainingPipelineRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteTrainingPipeline( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteTrainingPipelineRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTrainingPipeline( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteTrainingPipelineRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTrainingPipeline( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTrainingPipelineRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteTrainingPipeline(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteTrainingPipeline()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_PipelineService_DeleteTrainingPipeline_async + */ + async checkDeleteTrainingPipelineProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTrainingPipeline, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a PipelineJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the PipelineJob resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_PipelineService_DeletePipelineJob_async + */ + deletePipelineJob( + request?: protos.google.cloud.aiplatform.v1beta1.IDeletePipelineJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deletePipelineJob( + request: protos.google.cloud.aiplatform.v1beta1.IDeletePipelineJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deletePipelineJob( + request: protos.google.cloud.aiplatform.v1beta1.IDeletePipelineJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deletePipelineJob( + request?: protos.google.cloud.aiplatform.v1beta1.IDeletePipelineJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deletePipelineJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deletePipelineJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_PipelineService_DeletePipelineJob_async + */ + async checkDeletePipelineJobProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deletePipelineJob, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists TrainingPipelines in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the TrainingPipelines from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name="my_pipeline"` + * + * * `state="PIPELINE_STATE_RUNNING" OR display_name="my_pipeline"` + * + * * `NOT display_name="my_pipeline"` + * + * * `state="PIPELINE_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListTrainingPipelinesResponse.next_page_token|ListTrainingPipelinesResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.PipelineService.ListTrainingPipelines|PipelineService.ListTrainingPipelines} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [TrainingPipeline]{@link google.cloud.aiplatform.v1beta1.TrainingPipeline}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTrainingPipelinesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTrainingPipelines( + request?: protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline[], + protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesResponse + ]>; + listTrainingPipelines( + request: protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, + protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline>): void; + listTrainingPipelines( + request: protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, + protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline>): void; + listTrainingPipelines( + request?: protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, + protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, + protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline[], + protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listTrainingPipelines(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the TrainingPipelines from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name="my_pipeline"` + * + * * `state="PIPELINE_STATE_RUNNING" OR display_name="my_pipeline"` + * + * * `NOT display_name="my_pipeline"` + * + * * `state="PIPELINE_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListTrainingPipelinesResponse.next_page_token|ListTrainingPipelinesResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.PipelineService.ListTrainingPipelines|PipelineService.ListTrainingPipelines} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [TrainingPipeline]{@link google.cloud.aiplatform.v1beta1.TrainingPipeline} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTrainingPipelinesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTrainingPipelinesStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTrainingPipelines']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTrainingPipelines.createStream( + this.innerApiCalls.listTrainingPipelines as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTrainingPipelines`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the TrainingPipelines from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * The standard list filter. + * Supported fields: + * + * * `display_name` supports = and !=. + * + * * `state` supports = and !=. + * + * Some examples of using the filter are: + * + * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name="my_pipeline"` + * + * * `state="PIPELINE_STATE_RUNNING" OR display_name="my_pipeline"` + * + * * `NOT display_name="my_pipeline"` + * + * * `state="PIPELINE_STATE_FAILED"` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListTrainingPipelinesResponse.next_page_token|ListTrainingPipelinesResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.PipelineService.ListTrainingPipelines|PipelineService.ListTrainingPipelines} call. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TrainingPipeline]{@link google.cloud.aiplatform.v1beta1.TrainingPipeline}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_PipelineService_ListTrainingPipelines_async + */ + listTrainingPipelinesAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTrainingPipelines']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTrainingPipelines.asyncIterate( + this.innerApiCalls['listTrainingPipelines'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists PipelineJobs in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the PipelineJobs from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the PipelineJobs that match the filter expression. The following + * fields are supported: + * + * * `pipeline_name`: Supports `=` and `!=` comparisons. + * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. + * * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. + * for example, can check if pipeline's display_name contains *step* by doing + * display_name:\"*step*\" + * * `state`: Supports `=` and `!=` comparisons. + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `labels`: Supports key-value equality and key presence. + * * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. + * * `template_metadata.version_name`: Supports `=`, `!=` comparisons, and `:` + * wildcard. + * + * Filter expressions can be combined together using logical operators + * (`AND` & `OR`). + * For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. + * + * The syntax to define filter expression is based on + * https://google.aip.dev/160. + * + * Examples: + * + * * `create_time>"2021-05-18T00:00:00Z" OR + * update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated + * after 2020-05-18 00:00:00 UTC. + * * `labels.env = "prod"` + * PipelineJobs with label "env" set to "prod". + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListPipelineJobsResponse.next_page_token|ListPipelineJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.PipelineService.ListPipelineJobs|PipelineService.ListPipelineJobs} call. + * @param {string} request.orderBy + * A comma-separated list of fields to order by. The default sort order is in + * ascending order. Use "desc" after a field name for descending. You can have + * multiple order_by fields provided e.g. "create_time desc, end_time", + * "end_time, start_time, update_time" For example, using "create_time desc, + * end_time" will order results by create time in descending order, and if + * there are multiple jobs having the same create time, order them by the end + * time in ascending order. if order_by is not specified, it will order by + * default order is create time in descending order. Supported fields: + * * `create_time` + * * `update_time` + * * `end_time` + * * `start_time` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [PipelineJob]{@link google.cloud.aiplatform.v1beta1.PipelineJob}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listPipelineJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listPipelineJobs( + request?: protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IPipelineJob[], + protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsResponse + ]>; + listPipelineJobs( + request: protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IPipelineJob>): void; + listPipelineJobs( + request: protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IPipelineJob>): void; + listPipelineJobs( + request?: protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IPipelineJob>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, + protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IPipelineJob>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IPipelineJob[], + protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listPipelineJobs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the PipelineJobs from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the PipelineJobs that match the filter expression. The following + * fields are supported: + * + * * `pipeline_name`: Supports `=` and `!=` comparisons. + * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. + * * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. + * for example, can check if pipeline's display_name contains *step* by doing + * display_name:\"*step*\" + * * `state`: Supports `=` and `!=` comparisons. + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `labels`: Supports key-value equality and key presence. + * * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. + * * `template_metadata.version_name`: Supports `=`, `!=` comparisons, and `:` + * wildcard. + * + * Filter expressions can be combined together using logical operators + * (`AND` & `OR`). + * For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. + * + * The syntax to define filter expression is based on + * https://google.aip.dev/160. + * + * Examples: + * + * * `create_time>"2021-05-18T00:00:00Z" OR + * update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated + * after 2020-05-18 00:00:00 UTC. + * * `labels.env = "prod"` + * PipelineJobs with label "env" set to "prod". + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListPipelineJobsResponse.next_page_token|ListPipelineJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.PipelineService.ListPipelineJobs|PipelineService.ListPipelineJobs} call. + * @param {string} request.orderBy + * A comma-separated list of fields to order by. The default sort order is in + * ascending order. Use "desc" after a field name for descending. You can have + * multiple order_by fields provided e.g. "create_time desc, end_time", + * "end_time, start_time, update_time" For example, using "create_time desc, + * end_time" will order results by create time in descending order, and if + * there are multiple jobs having the same create time, order them by the end + * time in ascending order. if order_by is not specified, it will order by + * default order is create time in descending order. Supported fields: + * * `create_time` + * * `update_time` + * * `end_time` + * * `start_time` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [PipelineJob]{@link google.cloud.aiplatform.v1beta1.PipelineJob} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listPipelineJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listPipelineJobsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listPipelineJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPipelineJobs.createStream( + this.innerApiCalls.listPipelineJobs as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listPipelineJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the PipelineJobs from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the PipelineJobs that match the filter expression. The following + * fields are supported: + * + * * `pipeline_name`: Supports `=` and `!=` comparisons. + * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. + * * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. + * for example, can check if pipeline's display_name contains *step* by doing + * display_name:\"*step*\" + * * `state`: Supports `=` and `!=` comparisons. + * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. + * Values must be in RFC 3339 format. + * * `labels`: Supports key-value equality and key presence. + * * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. + * * `template_metadata.version_name`: Supports `=`, `!=` comparisons, and `:` + * wildcard. + * + * Filter expressions can be combined together using logical operators + * (`AND` & `OR`). + * For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. + * + * The syntax to define filter expression is based on + * https://google.aip.dev/160. + * + * Examples: + * + * * `create_time>"2021-05-18T00:00:00Z" OR + * update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated + * after 2020-05-18 00:00:00 UTC. + * * `labels.env = "prod"` + * PipelineJobs with label "env" set to "prod". + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained via + * {@link google.cloud.aiplatform.v1beta1.ListPipelineJobsResponse.next_page_token|ListPipelineJobsResponse.next_page_token} of the previous + * {@link google.cloud.aiplatform.v1beta1.PipelineService.ListPipelineJobs|PipelineService.ListPipelineJobs} call. + * @param {string} request.orderBy + * A comma-separated list of fields to order by. The default sort order is in + * ascending order. Use "desc" after a field name for descending. You can have + * multiple order_by fields provided e.g. "create_time desc, end_time", + * "end_time, start_time, update_time" For example, using "create_time desc, + * end_time" will order results by create time in descending order, and if + * there are multiple jobs having the same create time, order them by the end + * time in ascending order. if order_by is not specified, it will order by + * default order is create time in descending order. Supported fields: + * * `create_time` + * * `update_time` + * * `end_time` + * * `start_time` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [PipelineJob]{@link google.cloud.aiplatform.v1beta1.PipelineJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_PipelineService_ListPipelineJobs_async + */ + listPipelineJobsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listPipelineJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPipelineJobs.asyncIterate( + this.innerApiCalls['listPipelineJobs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.pipelineServiceStub && !this._terminated) { + return this.pipelineServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_client_config.json new file mode 100644 index 00000000..dfa51e95 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_client_config.json @@ -0,0 +1,71 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.PipelineService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateTrainingPipeline": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTrainingPipeline": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTrainingPipelines": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTrainingPipeline": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelTrainingPipeline": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreatePipelineJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetPipelineJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListPipelineJobs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeletePipelineJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelPipelineJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_proto_list.json new file mode 100644 index 00000000..c916ab12 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_proto_list.json @@ -0,0 +1,117 @@ +[ + "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/context.proto", + "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1beta1/event.proto", + "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/io.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/study.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/types.proto", + "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1beta1/value.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_client.ts new file mode 100644 index 00000000..4c3c5c74 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_client.ts @@ -0,0 +1,2532 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/prediction_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './prediction_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * A service for online predictions and explanations. + * @class + * @memberof v1beta1 + */ +export class PredictionServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + predictionServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PredictionServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof PredictionServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.PredictionService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.predictionServiceStub) { + return this.predictionServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1beta1.PredictionService. + this.predictionServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.PredictionService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1beta1.PredictionService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const predictionServiceStubMethods = + ['predict', 'rawPredict', 'explain']; + for (const methodName of predictionServiceStubMethods) { + const callPromise = this.predictionServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.predictionServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Perform an online prediction. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.endpoint + * Required. The name of the Endpoint requested to serve the prediction. + * Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {number[]} request.instances + * Required. The instances that are the input to the prediction call. + * A DeployedModel may have an upper limit on the number of instances it + * supports per request, and when it is exceeded the prediction call errors + * in case of AutoML Models, or, in case of customer created Models, the + * behaviour is as documented by that Model. + * The schema of any single instance may be specified via Endpoint's + * DeployedModels' {@link google.cloud.aiplatform.v1beta1.DeployedModel.model|Model's} + * {@link google.cloud.aiplatform.v1beta1.Model.predict_schemata|PredictSchemata's} + * {@link google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri|instance_schema_uri}. + * @param {google.protobuf.Value} request.parameters + * The parameters that govern the prediction. The schema of the parameters may + * be specified via Endpoint's DeployedModels' {@link google.cloud.aiplatform.v1beta1.DeployedModel.model|Model's } + * {@link google.cloud.aiplatform.v1beta1.Model.predict_schemata|PredictSchemata's} + * {@link google.cloud.aiplatform.v1beta1.PredictSchemata.parameters_schema_uri|parameters_schema_uri}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PredictResponse]{@link google.cloud.aiplatform.v1beta1.PredictResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_PredictionService_Predict_async + */ + predict( + request?: protos.google.cloud.aiplatform.v1beta1.IPredictRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IPredictResponse, + protos.google.cloud.aiplatform.v1beta1.IPredictRequest|undefined, {}|undefined + ]>; + predict( + request: protos.google.cloud.aiplatform.v1beta1.IPredictRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IPredictResponse, + protos.google.cloud.aiplatform.v1beta1.IPredictRequest|null|undefined, + {}|null|undefined>): void; + predict( + request: protos.google.cloud.aiplatform.v1beta1.IPredictRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IPredictResponse, + protos.google.cloud.aiplatform.v1beta1.IPredictRequest|null|undefined, + {}|null|undefined>): void; + predict( + request?: protos.google.cloud.aiplatform.v1beta1.IPredictRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IPredictResponse, + protos.google.cloud.aiplatform.v1beta1.IPredictRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IPredictResponse, + protos.google.cloud.aiplatform.v1beta1.IPredictRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IPredictResponse, + protos.google.cloud.aiplatform.v1beta1.IPredictRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'endpoint': request.endpoint || '', + }); + this.initialize(); + return this.innerApiCalls.predict(request, options, callback); + } +/** + * Perform an online prediction with an arbitrary HTTP payload. + * + * The response includes the following HTTP headers: + * + * * `X-Vertex-AI-Endpoint-Id`: ID of the {@link google.cloud.aiplatform.v1beta1.Endpoint|Endpoint} that served this + * prediction. + * + * * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's {@link google.cloud.aiplatform.v1beta1.DeployedModel|DeployedModel} + * that served this prediction. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.endpoint + * Required. The name of the Endpoint requested to serve the prediction. + * Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {google.api.HttpBody} request.httpBody + * The prediction input. Supports HTTP headers and arbitrary data payload. + * + * A {@link google.cloud.aiplatform.v1beta1.DeployedModel|DeployedModel} may have an upper limit on the number of instances it + * supports per request. When this limit it is exceeded for an AutoML model, + * the {@link google.cloud.aiplatform.v1beta1.PredictionService.RawPredict|RawPredict} method returns an error. + * When this limit is exceeded for a custom-trained model, the behavior varies + * depending on the model. + * + * You can specify the schema for each instance in the + * {@link google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri|predict_schemata.instance_schema_uri} + * field when you create a {@link google.cloud.aiplatform.v1beta1.Model|Model}. This schema applies when you deploy the + * `Model` as a `DeployedModel` to an {@link google.cloud.aiplatform.v1beta1.Endpoint|Endpoint} and use the `RawPredict` + * method. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [HttpBody]{@link google.api.HttpBody}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_PredictionService_RawPredict_async + */ + rawPredict( + request?: protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest, + options?: CallOptions): + Promise<[ + protos.google.api.IHttpBody, + protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest|undefined, {}|undefined + ]>; + rawPredict( + request: protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest, + options: CallOptions, + callback: Callback< + protos.google.api.IHttpBody, + protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest|null|undefined, + {}|null|undefined>): void; + rawPredict( + request: protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest, + callback: Callback< + protos.google.api.IHttpBody, + protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest|null|undefined, + {}|null|undefined>): void; + rawPredict( + request?: protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.api.IHttpBody, + protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.api.IHttpBody, + protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.api.IHttpBody, + protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'endpoint': request.endpoint || '', + }); + this.initialize(); + return this.innerApiCalls.rawPredict(request, options, callback); + } +/** + * Perform an online explanation. + * + * If {@link google.cloud.aiplatform.v1beta1.ExplainRequest.deployed_model_id|deployed_model_id} is specified, + * the corresponding DeployModel must have + * {@link google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec|explanation_spec} + * populated. If {@link google.cloud.aiplatform.v1beta1.ExplainRequest.deployed_model_id|deployed_model_id} + * is not specified, all DeployedModels must have + * {@link google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec|explanation_spec} + * populated. Only deployed AutoML tabular Models have + * explanation_spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.endpoint + * Required. The name of the Endpoint requested to serve the explanation. + * Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {number[]} request.instances + * Required. The instances that are the input to the explanation call. + * A DeployedModel may have an upper limit on the number of instances it + * supports per request, and when it is exceeded the explanation call errors + * in case of AutoML Models, or, in case of customer created Models, the + * behaviour is as documented by that Model. + * The schema of any single instance may be specified via Endpoint's + * DeployedModels' {@link google.cloud.aiplatform.v1beta1.DeployedModel.model|Model's} + * {@link google.cloud.aiplatform.v1beta1.Model.predict_schemata|PredictSchemata's} + * {@link google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri|instance_schema_uri}. + * @param {google.protobuf.Value} request.parameters + * The parameters that govern the prediction. The schema of the parameters may + * be specified via Endpoint's DeployedModels' {@link google.cloud.aiplatform.v1beta1.DeployedModel.model|Model's } + * {@link google.cloud.aiplatform.v1beta1.Model.predict_schemata|PredictSchemata's} + * {@link google.cloud.aiplatform.v1beta1.PredictSchemata.parameters_schema_uri|parameters_schema_uri}. + * @param {google.cloud.aiplatform.v1beta1.ExplanationSpecOverride} request.explanationSpecOverride + * If specified, overrides the + * {@link google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec|explanation_spec} of the DeployedModel. + * Can be used for explaining prediction results with different + * configurations, such as: + * - Explaining top-5 predictions results as opposed to top-1; + * - Increasing path count or step count of the attribution methods to reduce + * approximate errors; + * - Using different baselines for explaining the prediction results. + * @param {string} request.deployedModelId + * If specified, this ExplainRequest will be served by the chosen + * DeployedModel, overriding {@link google.cloud.aiplatform.v1beta1.Endpoint.traffic_split|Endpoint.traffic_split}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ExplainResponse]{@link google.cloud.aiplatform.v1beta1.ExplainResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_PredictionService_Explain_async + */ + explain( + request?: protos.google.cloud.aiplatform.v1beta1.IExplainRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IExplainResponse, + protos.google.cloud.aiplatform.v1beta1.IExplainRequest|undefined, {}|undefined + ]>; + explain( + request: protos.google.cloud.aiplatform.v1beta1.IExplainRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IExplainResponse, + protos.google.cloud.aiplatform.v1beta1.IExplainRequest|null|undefined, + {}|null|undefined>): void; + explain( + request: protos.google.cloud.aiplatform.v1beta1.IExplainRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IExplainResponse, + protos.google.cloud.aiplatform.v1beta1.IExplainRequest|null|undefined, + {}|null|undefined>): void; + explain( + request?: protos.google.cloud.aiplatform.v1beta1.IExplainRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IExplainResponse, + protos.google.cloud.aiplatform.v1beta1.IExplainRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IExplainResponse, + protos.google.cloud.aiplatform.v1beta1.IExplainRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IExplainResponse, + protos.google.cloud.aiplatform.v1beta1.IExplainRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'endpoint': request.endpoint || '', + }); + this.initialize(); + return this.innerApiCalls.explain(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.predictionServiceStub && !this._terminated) { + return this.predictionServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_client_config.json new file mode 100644 index 00000000..475b31fc --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_client_config.json @@ -0,0 +1,40 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.PredictionService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "Predict": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RawPredict": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Explain": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_proto_list.json new file mode 100644 index 00000000..c916ab12 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_proto_list.json @@ -0,0 +1,117 @@ +[ + "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/context.proto", + "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1beta1/event.proto", + "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/io.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/study.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/types.proto", + "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1beta1/value.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_client.ts new file mode 100644 index 00000000..acff0a70 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_client.ts @@ -0,0 +1,2883 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/specialist_pool_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './specialist_pool_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * A service for creating and managing Customer SpecialistPools. + * When customers start Data Labeling jobs, they can reuse/create Specialist + * Pools to bring their own Specialists to label the data. + * Customers can add/remove Managers for the Specialist Pool on Cloud console, + * then Managers will get email notifications to manage Specialists and tasks on + * CrowdCompute console. + * @class + * @memberof v1beta1 + */ +export class SpecialistPoolServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + specialistPoolServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SpecialistPoolServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof SpecialistPoolServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listSpecialistPools: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'specialistPools') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const createSpecialistPoolResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.SpecialistPool') as gax.protobuf.Type; + const createSpecialistPoolMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.CreateSpecialistPoolOperationMetadata') as gax.protobuf.Type; + const deleteSpecialistPoolResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteSpecialistPoolMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const updateSpecialistPoolResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.SpecialistPool') as gax.protobuf.Type; + const updateSpecialistPoolMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.UpdateSpecialistPoolOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createSpecialistPool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSpecialistPoolResponse.decode.bind(createSpecialistPoolResponse), + createSpecialistPoolMetadata.decode.bind(createSpecialistPoolMetadata)), + deleteSpecialistPool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteSpecialistPoolResponse.decode.bind(deleteSpecialistPoolResponse), + deleteSpecialistPoolMetadata.decode.bind(deleteSpecialistPoolMetadata)), + updateSpecialistPool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateSpecialistPoolResponse.decode.bind(updateSpecialistPoolResponse), + updateSpecialistPoolMetadata.decode.bind(updateSpecialistPoolMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.SpecialistPoolService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.specialistPoolServiceStub) { + return this.specialistPoolServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1beta1.SpecialistPoolService. + this.specialistPoolServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.SpecialistPoolService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1beta1.SpecialistPoolService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const specialistPoolServiceStubMethods = + ['createSpecialistPool', 'getSpecialistPool', 'listSpecialistPools', 'deleteSpecialistPool', 'updateSpecialistPool']; + for (const methodName of specialistPoolServiceStubMethods) { + const callPromise = this.specialistPoolServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.specialistPoolServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets a SpecialistPool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the SpecialistPool resource. + * The form is + * `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SpecialistPool]{@link google.cloud.aiplatform.v1beta1.SpecialistPool}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_SpecialistPoolService_GetSpecialistPool_async + */ + getSpecialistPool( + request?: protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ISpecialistPool, + protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest|undefined, {}|undefined + ]>; + getSpecialistPool( + request: protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ISpecialistPool, + protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest|null|undefined, + {}|null|undefined>): void; + getSpecialistPool( + request: protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ISpecialistPool, + protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest|null|undefined, + {}|null|undefined>): void; + getSpecialistPool( + request?: protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ISpecialistPool, + protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ISpecialistPool, + protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ISpecialistPool, + protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getSpecialistPool(request, options, callback); + } + +/** + * Creates a SpecialistPool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent Project name for the new SpecialistPool. + * The form is `projects/{project}/locations/{location}`. + * @param {google.cloud.aiplatform.v1beta1.SpecialistPool} request.specialistPool + * Required. The SpecialistPool to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_SpecialistPoolService_CreateSpecialistPool_async + */ + createSpecialistPool( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateSpecialistPoolRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createSpecialistPool( + request: protos.google.cloud.aiplatform.v1beta1.ICreateSpecialistPoolRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSpecialistPool( + request: protos.google.cloud.aiplatform.v1beta1.ICreateSpecialistPoolRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSpecialistPool( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateSpecialistPoolRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createSpecialistPool(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createSpecialistPool()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_SpecialistPoolService_CreateSpecialistPool_async + */ + async checkCreateSpecialistPoolProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createSpecialistPool, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a SpecialistPool as well as all Specialists in the pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the SpecialistPool to delete. Format: + * `projects/{project}/locations/{location}/specialistPools/{specialist_pool}` + * @param {boolean} request.force + * If set to true, any specialist managers in this SpecialistPool will also be + * deleted. (Otherwise, the request will only work if the SpecialistPool has + * no specialist managers.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_SpecialistPoolService_DeleteSpecialistPool_async + */ + deleteSpecialistPool( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteSpecialistPoolRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteSpecialistPool( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteSpecialistPoolRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteSpecialistPool( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteSpecialistPoolRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteSpecialistPool( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteSpecialistPoolRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteSpecialistPool(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteSpecialistPool()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_SpecialistPoolService_DeleteSpecialistPool_async + */ + async checkDeleteSpecialistPoolProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteSpecialistPool, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates a SpecialistPool. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.SpecialistPool} request.specialistPool + * Required. The SpecialistPool which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_SpecialistPoolService_UpdateSpecialistPool_async + */ + updateSpecialistPool( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateSpecialistPoolRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateSpecialistPool( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateSpecialistPoolRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateSpecialistPool( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateSpecialistPoolRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateSpecialistPool( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateSpecialistPoolRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'specialist_pool.name': request.specialistPool!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateSpecialistPool(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateSpecialistPool()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_SpecialistPoolService_UpdateSpecialistPool_async + */ + async checkUpdateSpecialistPoolProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateSpecialistPool, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists SpecialistPools in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the SpecialistPool's parent resource. + * Format: `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained by {@link google.cloud.aiplatform.v1beta1.ListSpecialistPoolsResponse.next_page_token|ListSpecialistPoolsResponse.next_page_token} of + * the previous {@link google.cloud.aiplatform.v1beta1.SpecialistPoolService.ListSpecialistPools|SpecialistPoolService.ListSpecialistPools} call. Return + * first page if empty. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. FieldMask represents a set of + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [SpecialistPool]{@link google.cloud.aiplatform.v1beta1.SpecialistPool}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSpecialistPoolsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSpecialistPools( + request?: protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ISpecialistPool[], + protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsResponse + ]>; + listSpecialistPools( + request: protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, + protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ISpecialistPool>): void; + listSpecialistPools( + request: protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, + protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ISpecialistPool>): void; + listSpecialistPools( + request?: protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, + protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ISpecialistPool>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, + protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ISpecialistPool>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ISpecialistPool[], + protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listSpecialistPools(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the SpecialistPool's parent resource. + * Format: `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained by {@link google.cloud.aiplatform.v1beta1.ListSpecialistPoolsResponse.next_page_token|ListSpecialistPoolsResponse.next_page_token} of + * the previous {@link google.cloud.aiplatform.v1beta1.SpecialistPoolService.ListSpecialistPools|SpecialistPoolService.ListSpecialistPools} call. Return + * first page if empty. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. FieldMask represents a set of + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [SpecialistPool]{@link google.cloud.aiplatform.v1beta1.SpecialistPool} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSpecialistPoolsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSpecialistPoolsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listSpecialistPools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSpecialistPools.createStream( + this.innerApiCalls.listSpecialistPools as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSpecialistPools`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the SpecialistPool's parent resource. + * Format: `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * Typically obtained by {@link google.cloud.aiplatform.v1beta1.ListSpecialistPoolsResponse.next_page_token|ListSpecialistPoolsResponse.next_page_token} of + * the previous {@link google.cloud.aiplatform.v1beta1.SpecialistPoolService.ListSpecialistPools|SpecialistPoolService.ListSpecialistPools} call. Return + * first page if empty. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. FieldMask represents a set of + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [SpecialistPool]{@link google.cloud.aiplatform.v1beta1.SpecialistPool}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_SpecialistPoolService_ListSpecialistPools_async + */ + listSpecialistPoolsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listSpecialistPools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSpecialistPools.asyncIterate( + this.innerApiCalls['listSpecialistPools'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.specialistPoolServiceStub && !this._terminated) { + return this.specialistPoolServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_client_config.json new file mode 100644 index 00000000..c39dc80f --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_client_config.json @@ -0,0 +1,51 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.SpecialistPoolService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateSpecialistPool": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSpecialistPool": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSpecialistPools": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSpecialistPool": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSpecialistPool": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_proto_list.json new file mode 100644 index 00000000..c916ab12 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_proto_list.json @@ -0,0 +1,117 @@ +[ + "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/context.proto", + "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1beta1/event.proto", + "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/io.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/study.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/types.proto", + "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1beta1/value.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_client.ts new file mode 100644 index 00000000..987b8f21 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_client.ts @@ -0,0 +1,5387 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall, GoogleError} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import { PassThrough } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/tensorboard_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './tensorboard_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * TensorboardService + * @class + * @memberof v1beta1 + */ +export class TensorboardServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + tensorboardServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TensorboardServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof TensorboardServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listTensorboards: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tensorboards'), + listTensorboardExperiments: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tensorboardExperiments'), + listTensorboardRuns: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tensorboardRuns'), + listTensorboardTimeSeries: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tensorboardTimeSeries'), + exportTensorboardTimeSeriesData: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'timeSeriesDataPoints') + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + readTensorboardBlobData: new this._gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING) + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const createTensorboardResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.Tensorboard') as gax.protobuf.Type; + const createTensorboardMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.CreateTensorboardOperationMetadata') as gax.protobuf.Type; + const updateTensorboardResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.Tensorboard') as gax.protobuf.Type; + const updateTensorboardMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.UpdateTensorboardOperationMetadata') as gax.protobuf.Type; + const deleteTensorboardResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteTensorboardMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const deleteTensorboardExperimentResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteTensorboardExperimentMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const deleteTensorboardRunResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteTensorboardRunMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + const deleteTensorboardTimeSeriesResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteTensorboardTimeSeriesMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createTensorboard: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createTensorboardResponse.decode.bind(createTensorboardResponse), + createTensorboardMetadata.decode.bind(createTensorboardMetadata)), + updateTensorboard: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateTensorboardResponse.decode.bind(updateTensorboardResponse), + updateTensorboardMetadata.decode.bind(updateTensorboardMetadata)), + deleteTensorboard: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTensorboardResponse.decode.bind(deleteTensorboardResponse), + deleteTensorboardMetadata.decode.bind(deleteTensorboardMetadata)), + deleteTensorboardExperiment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTensorboardExperimentResponse.decode.bind(deleteTensorboardExperimentResponse), + deleteTensorboardExperimentMetadata.decode.bind(deleteTensorboardExperimentMetadata)), + deleteTensorboardRun: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTensorboardRunResponse.decode.bind(deleteTensorboardRunResponse), + deleteTensorboardRunMetadata.decode.bind(deleteTensorboardRunMetadata)), + deleteTensorboardTimeSeries: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTensorboardTimeSeriesResponse.decode.bind(deleteTensorboardTimeSeriesResponse), + deleteTensorboardTimeSeriesMetadata.decode.bind(deleteTensorboardTimeSeriesMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.TensorboardService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.tensorboardServiceStub) { + return this.tensorboardServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1beta1.TensorboardService. + this.tensorboardServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.TensorboardService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1beta1.TensorboardService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const tensorboardServiceStubMethods = + ['createTensorboard', 'getTensorboard', 'updateTensorboard', 'listTensorboards', 'deleteTensorboard', 'createTensorboardExperiment', 'getTensorboardExperiment', 'updateTensorboardExperiment', 'listTensorboardExperiments', 'deleteTensorboardExperiment', 'createTensorboardRun', 'batchCreateTensorboardRuns', 'getTensorboardRun', 'updateTensorboardRun', 'listTensorboardRuns', 'deleteTensorboardRun', 'batchCreateTensorboardTimeSeries', 'createTensorboardTimeSeries', 'getTensorboardTimeSeries', 'updateTensorboardTimeSeries', 'listTensorboardTimeSeries', 'deleteTensorboardTimeSeries', 'batchReadTensorboardTimeSeriesData', 'readTensorboardTimeSeriesData', 'readTensorboardBlobData', 'writeTensorboardExperimentData', 'writeTensorboardRunData', 'exportTensorboardTimeSeriesData']; + for (const methodName of tensorboardServiceStubMethods) { + const callPromise = this.tensorboardServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough(); + setImmediate(() => { + stream.emit('error', new GoogleError('The client has already been closed.')); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.tensorboardServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets a Tensorboard. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Tensorboard resource. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Tensorboard]{@link google.cloud.aiplatform.v1beta1.Tensorboard}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_GetTensorboard_async + */ + getTensorboard( + request?: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboard, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest|undefined, {}|undefined + ]>; + getTensorboard( + request: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboard, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest|null|undefined, + {}|null|undefined>): void; + getTensorboard( + request: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboard, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest|null|undefined, + {}|null|undefined>): void; + getTensorboard( + request?: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboard, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboard, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboard, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getTensorboard(request, options, callback); + } +/** + * Creates a TensorboardExperiment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Tensorboard to create the TensorboardExperiment + * in. Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + * @param {google.cloud.aiplatform.v1beta1.TensorboardExperiment} request.tensorboardExperiment + * The TensorboardExperiment to create. + * @param {string} request.tensorboardExperimentId + * Required. The ID to use for the Tensorboard experiment, which will become the final + * component of the Tensorboard experiment's resource name. + * + * This value should be 1-128 characters, and valid characters + * are /{@link 0-9|a-z}-/. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TensorboardExperiment]{@link google.cloud.aiplatform.v1beta1.TensorboardExperiment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_CreateTensorboardExperiment_async + */ + createTensorboardExperiment( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest|undefined, {}|undefined + ]>; + createTensorboardExperiment( + request: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest|null|undefined, + {}|null|undefined>): void; + createTensorboardExperiment( + request: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest|null|undefined, + {}|null|undefined>): void; + createTensorboardExperiment( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createTensorboardExperiment(request, options, callback); + } +/** + * Gets a TensorboardExperiment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TensorboardExperiment resource. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TensorboardExperiment]{@link google.cloud.aiplatform.v1beta1.TensorboardExperiment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_GetTensorboardExperiment_async + */ + getTensorboardExperiment( + request?: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest|undefined, {}|undefined + ]>; + getTensorboardExperiment( + request: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest|null|undefined, + {}|null|undefined>): void; + getTensorboardExperiment( + request: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest|null|undefined, + {}|null|undefined>): void; + getTensorboardExperiment( + request?: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getTensorboardExperiment(request, options, callback); + } +/** + * Updates a TensorboardExperiment. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * TensorboardExperiment resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten if new + * values are specified. + * @param {google.cloud.aiplatform.v1beta1.TensorboardExperiment} request.tensorboardExperiment + * Required. The TensorboardExperiment's `name` field is used to identify the + * TensorboardExperiment to be updated. Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TensorboardExperiment]{@link google.cloud.aiplatform.v1beta1.TensorboardExperiment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_UpdateTensorboardExperiment_async + */ + updateTensorboardExperiment( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest|undefined, {}|undefined + ]>; + updateTensorboardExperiment( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest|null|undefined, + {}|null|undefined>): void; + updateTensorboardExperiment( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest|null|undefined, + {}|null|undefined>): void; + updateTensorboardExperiment( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, + protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard_experiment.name': request.tensorboardExperiment!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateTensorboardExperiment(request, options, callback); + } +/** + * Creates a TensorboardRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardExperiment to create the TensorboardRun + * in. Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + * @param {google.cloud.aiplatform.v1beta1.TensorboardRun} request.tensorboardRun + * Required. The TensorboardRun to create. + * @param {string} request.tensorboardRunId + * Required. The ID to use for the Tensorboard run, which will become the final + * component of the Tensorboard run's resource name. + * + * This value should be 1-128 characters, and valid characters + * are /{@link 0-9|a-z}-/. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TensorboardRun]{@link google.cloud.aiplatform.v1beta1.TensorboardRun}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_CreateTensorboardRun_async + */ + createTensorboardRun( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, + protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest|undefined, {}|undefined + ]>; + createTensorboardRun( + request: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, + protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest|null|undefined, + {}|null|undefined>): void; + createTensorboardRun( + request: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, + protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest|null|undefined, + {}|null|undefined>): void; + createTensorboardRun( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, + protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, + protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, + protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createTensorboardRun(request, options, callback); + } +/** + * Batch create TensorboardRuns. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardExperiment to create the + * TensorboardRuns in. Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + * The parent field in the CreateTensorboardRunRequest messages must match + * this field. + * @param {number[]} request.requests + * Required. The request message specifying the TensorboardRuns to create. + * A maximum of 1000 TensorboardRuns can be created in a batch. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchCreateTensorboardRunsResponse]{@link google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_BatchCreateTensorboardRuns_async + */ + batchCreateTensorboardRuns( + request?: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest|undefined, {}|undefined + ]>; + batchCreateTensorboardRuns( + request: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest|null|undefined, + {}|null|undefined>): void; + batchCreateTensorboardRuns( + request: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest|null|undefined, + {}|null|undefined>): void; + batchCreateTensorboardRuns( + request?: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.batchCreateTensorboardRuns(request, options, callback); + } +/** + * Gets a TensorboardRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TensorboardRun resource. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TensorboardRun]{@link google.cloud.aiplatform.v1beta1.TensorboardRun}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_GetTensorboardRun_async + */ + getTensorboardRun( + request?: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest|undefined, {}|undefined + ]>; + getTensorboardRun( + request: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest|null|undefined, + {}|null|undefined>): void; + getTensorboardRun( + request: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest|null|undefined, + {}|null|undefined>): void; + getTensorboardRun( + request?: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getTensorboardRun(request, options, callback); + } +/** + * Updates a TensorboardRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * TensorboardRun resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten if new + * values are specified. + * @param {google.cloud.aiplatform.v1beta1.TensorboardRun} request.tensorboardRun + * Required. The TensorboardRun's `name` field is used to identify the TensorboardRun to + * be updated. Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TensorboardRun]{@link google.cloud.aiplatform.v1beta1.TensorboardRun}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_UpdateTensorboardRun_async + */ + updateTensorboardRun( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, + protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest|undefined, {}|undefined + ]>; + updateTensorboardRun( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, + protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest|null|undefined, + {}|null|undefined>): void; + updateTensorboardRun( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, + protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest|null|undefined, + {}|null|undefined>): void; + updateTensorboardRun( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, + protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, + protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, + protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard_run.name': request.tensorboardRun!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateTensorboardRun(request, options, callback); + } +/** + * Batch create TensorboardTimeSeries that belong to a TensorboardExperiment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardExperiment to create the + * TensorboardTimeSeries in. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + * The TensorboardRuns referenced by the parent fields in the + * CreateTensorboardTimeSeriesRequest messages must be sub resources of this + * TensorboardExperiment. + * @param {number[]} request.requests + * Required. The request message specifying the TensorboardTimeSeries to create. + * A maximum of 1000 TensorboardTimeSeries can be created in a batch. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchCreateTensorboardTimeSeriesResponse]{@link google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_BatchCreateTensorboardTimeSeries_async + */ + batchCreateTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest|undefined, {}|undefined + ]>; + batchCreateTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): void; + batchCreateTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): void; + batchCreateTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.batchCreateTensorboardTimeSeries(request, options, callback); + } +/** + * Creates a TensorboardTimeSeries. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardRun to create the + * TensorboardTimeSeries in. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + * @param {string} [request.tensorboardTimeSeriesId] + * Optional. The user specified unique ID to use for the TensorboardTimeSeries, which + * will become the final component of the TensorboardTimeSeries's resource + * name. + * This value should match "{@link a-z0-9-|a-z0-9}{0, 127}" + * @param {google.cloud.aiplatform.v1beta1.TensorboardTimeSeries} request.tensorboardTimeSeries + * Required. The TensorboardTimeSeries to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_CreateTensorboardTimeSeries_async + */ + createTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest|undefined, {}|undefined + ]>; + createTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): void; + createTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): void; + createTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createTensorboardTimeSeries(request, options, callback); + } +/** + * Gets a TensorboardTimeSeries. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TensorboardTimeSeries resource. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_GetTensorboardTimeSeries_async + */ + getTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest|undefined, {}|undefined + ]>; + getTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): void; + getTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): void; + getTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getTensorboardTimeSeries(request, options, callback); + } +/** + * Updates a TensorboardTimeSeries. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * TensorboardTimeSeries resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten if new + * values are specified. + * @param {google.cloud.aiplatform.v1beta1.TensorboardTimeSeries} request.tensorboardTimeSeries + * Required. The TensorboardTimeSeries' `name` field is used to identify the + * TensorboardTimeSeries to be updated. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_UpdateTensorboardTimeSeries_async + */ + updateTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest|undefined, {}|undefined + ]>; + updateTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): void; + updateTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): void; + updateTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, + protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard_time_series.name': request.tensorboardTimeSeries!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateTensorboardTimeSeries(request, options, callback); + } +/** + * Reads multiple TensorboardTimeSeries' data. The data point number limit is + * 1000 for scalars, 100 for tensors and blob references. If the number of + * data points stored is less than the limit, all data will be returned. + * Otherwise, that limit number of data points will be randomly selected from + * this time series and returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tensorboard + * Required. The resource name of the Tensorboard containing TensorboardTimeSeries to + * read data from. Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}`. + * The TensorboardTimeSeries referenced by {@link google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataRequest.time_series|time_series} must be sub + * resources of this Tensorboard. + * @param {string[]} request.timeSeries + * Required. The resource names of the TensorboardTimeSeries to read data from. Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchReadTensorboardTimeSeriesDataResponse]{@link google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_BatchReadTensorboardTimeSeriesData_async + */ + batchReadTensorboardTimeSeriesData( + request?: protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest|undefined, {}|undefined + ]>; + batchReadTensorboardTimeSeriesData( + request: protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest|null|undefined, + {}|null|undefined>): void; + batchReadTensorboardTimeSeriesData( + request: protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest|null|undefined, + {}|null|undefined>): void; + batchReadTensorboardTimeSeriesData( + request?: protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard': request.tensorboard || '', + }); + this.initialize(); + return this.innerApiCalls.batchReadTensorboardTimeSeriesData(request, options, callback); + } +/** + * Reads a TensorboardTimeSeries' data. By default, if the number of data + * points stored is less than 1000, all data will be returned. Otherwise, 1000 + * data points will be randomly selected from this time series and returned. + * This value can be changed by changing max_data_points, which can't be + * greater than 10k. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tensorboardTimeSeries + * Required. The resource name of the TensorboardTimeSeries to read data from. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + * @param {number} request.maxDataPoints + * The maximum number of TensorboardTimeSeries' data to return. + * + * This value should be a positive integer. + * This value can be set to -1 to return all data. + * @param {string} request.filter + * Reads the TensorboardTimeSeries' data that match the filter expression. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ReadTensorboardTimeSeriesDataResponse]{@link google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_ReadTensorboardTimeSeriesData_async + */ + readTensorboardTimeSeriesData( + request?: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest|undefined, {}|undefined + ]>; + readTensorboardTimeSeriesData( + request: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest|null|undefined, + {}|null|undefined>): void; + readTensorboardTimeSeriesData( + request: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest|null|undefined, + {}|null|undefined>): void; + readTensorboardTimeSeriesData( + request?: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataResponse, + protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard_time_series': request.tensorboardTimeSeries || '', + }); + this.initialize(); + return this.innerApiCalls.readTensorboardTimeSeriesData(request, options, callback); + } +/** + * Write time series data points of multiple TensorboardTimeSeries in multiple + * TensorboardRun's. If any data fail to be ingested, an error will be + * returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tensorboardExperiment + * Required. The resource name of the TensorboardExperiment to write data to. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + * @param {number[]} request.writeRunDataRequests + * Required. Requests containing per-run TensorboardTimeSeries data to write. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [WriteTensorboardExperimentDataResponse]{@link google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_WriteTensorboardExperimentData_async + */ + writeTensorboardExperimentData( + request?: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataResponse, + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest|undefined, {}|undefined + ]>; + writeTensorboardExperimentData( + request: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataResponse, + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest|null|undefined, + {}|null|undefined>): void; + writeTensorboardExperimentData( + request: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataResponse, + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest|null|undefined, + {}|null|undefined>): void; + writeTensorboardExperimentData( + request?: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataResponse, + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataResponse, + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataResponse, + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard_experiment': request.tensorboardExperiment || '', + }); + this.initialize(); + return this.innerApiCalls.writeTensorboardExperimentData(request, options, callback); + } +/** + * Write time series data points into multiple TensorboardTimeSeries under + * a TensorboardRun. If any data fail to be ingested, an error will be + * returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tensorboardRun + * Required. The resource name of the TensorboardRun to write data to. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + * @param {number[]} request.timeSeriesData + * Required. The TensorboardTimeSeries data to write. + * Values with in a time series are indexed by their step value. + * Repeated writes to the same step will overwrite the existing value for that + * step. + * The upper limit of data points per write request is 5000. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [WriteTensorboardRunDataResponse]{@link google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_WriteTensorboardRunData_async + */ + writeTensorboardRunData( + request?: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataResponse, + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest|undefined, {}|undefined + ]>; + writeTensorboardRunData( + request: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataResponse, + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest|null|undefined, + {}|null|undefined>): void; + writeTensorboardRunData( + request: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataResponse, + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest|null|undefined, + {}|null|undefined>): void; + writeTensorboardRunData( + request?: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataResponse, + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataResponse, + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataResponse, + protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard_run': request.tensorboardRun || '', + }); + this.initialize(); + return this.innerApiCalls.writeTensorboardRunData(request, options, callback); + } + +/** + * Gets bytes of TensorboardBlobs. + * This is to allow reading blob data stored in consumer project's Cloud + * Storage bucket without users having to obtain Cloud Storage access + * permission. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.timeSeries + * Required. The resource name of the TensorboardTimeSeries to list Blobs. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + * @param {string[]} request.blobIds + * IDs of the blobs to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits [ReadTensorboardBlobDataResponse]{@link google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataResponse} on 'data' event. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_ReadTensorboardBlobData_async + */ + readTensorboardBlobData( + request?: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardBlobDataRequest, + options?: CallOptions): + gax.CancellableStream{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'time_series': request.timeSeries || '', + }); + this.initialize(); + return this.innerApiCalls.readTensorboardBlobData(request, options); + } + +/** + * Creates a Tensorboard. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the Tensorboard in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.Tensorboard} request.tensorboard + * Required. The Tensorboard to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_CreateTensorboard_async + */ + createTensorboard( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createTensorboard( + request: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createTensorboard( + request: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createTensorboard( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createTensorboard(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createTensorboard()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_CreateTensorboard_async + */ + async checkCreateTensorboardProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createTensorboard, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates a Tensorboard. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * Tensorboard resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten if new + * values are specified. + * @param {google.cloud.aiplatform.v1beta1.Tensorboard} request.tensorboard + * Required. The Tensorboard's `name` field is used to identify the + * Tensorboard to be updated. Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_UpdateTensorboard_async + */ + updateTensorboard( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateTensorboard( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateTensorboard( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateTensorboard( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard.name': request.tensorboard!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateTensorboard(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateTensorboard()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_UpdateTensorboard_async + */ + async checkUpdateTensorboardProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateTensorboard, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a Tensorboard. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Tensorboard to be deleted. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_DeleteTensorboard_async + */ + deleteTensorboard( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteTensorboard( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTensorboard( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTensorboard( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteTensorboard(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteTensorboard()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_DeleteTensorboard_async + */ + async checkDeleteTensorboardProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTensorboard, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a TensorboardExperiment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TensorboardExperiment to be deleted. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_DeleteTensorboardExperiment_async + */ + deleteTensorboardExperiment( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardExperimentRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteTensorboardExperiment( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardExperimentRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTensorboardExperiment( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardExperimentRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTensorboardExperiment( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardExperimentRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteTensorboardExperiment(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteTensorboardExperiment()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_DeleteTensorboardExperiment_async + */ + async checkDeleteTensorboardExperimentProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTensorboardExperiment, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a TensorboardRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TensorboardRun to be deleted. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_DeleteTensorboardRun_async + */ + deleteTensorboardRun( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardRunRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteTensorboardRun( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardRunRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTensorboardRun( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardRunRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTensorboardRun( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardRunRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteTensorboardRun(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteTensorboardRun()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_DeleteTensorboardRun_async + */ + async checkDeleteTensorboardRunProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTensorboardRun, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a TensorboardTimeSeries. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TensorboardTimeSeries to be deleted. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_DeleteTensorboardTimeSeries_async + */ + deleteTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardTimeSeriesRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardTimeSeriesRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardTimeSeriesRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardTimeSeriesRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteTensorboardTimeSeries(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteTensorboardTimeSeries()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_DeleteTensorboardTimeSeries_async + */ + async checkDeleteTensorboardTimeSeriesProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTensorboardTimeSeries, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Tensorboards in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list Tensorboards. + * Format: + * `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the Tensorboards that match the filter expression. + * @param {number} request.pageSize + * The maximum number of Tensorboards to return. The service may return + * fewer than this value. If unspecified, at most 100 Tensorboards will be + * returned. The maximum value is 100; values above 100 will be coerced to + * 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Tensorboard]{@link google.cloud.aiplatform.v1beta1.Tensorboard}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTensorboardsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTensorboards( + request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboard[], + protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardsResponse + ]>; + listTensorboards( + request: protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITensorboard>): void; + listTensorboards( + request: protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITensorboard>): void; + listTensorboards( + request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITensorboard>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITensorboard>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboard[], + protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listTensorboards(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list Tensorboards. + * Format: + * `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the Tensorboards that match the filter expression. + * @param {number} request.pageSize + * The maximum number of Tensorboards to return. The service may return + * fewer than this value. If unspecified, at most 100 Tensorboards will be + * returned. The maximum value is 100; values above 100 will be coerced to + * 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Tensorboard]{@link google.cloud.aiplatform.v1beta1.Tensorboard} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTensorboardsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTensorboardsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTensorboards']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTensorboards.createStream( + this.innerApiCalls.listTensorboards as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTensorboards`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list Tensorboards. + * Format: + * `projects/{project}/locations/{location}` + * @param {string} request.filter + * Lists the Tensorboards that match the filter expression. + * @param {number} request.pageSize + * The maximum number of Tensorboards to return. The service may return + * fewer than this value. If unspecified, at most 100 Tensorboards will be + * returned. The maximum value is 100; values above 100 will be coerced to + * 100. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Tensorboard]{@link google.cloud.aiplatform.v1beta1.Tensorboard}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_ListTensorboards_async + */ + listTensorboardsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTensorboards']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTensorboards.asyncIterate( + this.innerApiCalls['listTensorboards'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists TensorboardExperiments in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Tensorboard to list TensorboardExperiments. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + * @param {string} request.filter + * Lists the TensorboardExperiments that match the filter expression. + * @param {number} request.pageSize + * The maximum number of TensorboardExperiments to return. The service may + * return fewer than this value. If unspecified, at most 50 + * TensorboardExperiments will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [TensorboardExperiment]{@link google.cloud.aiplatform.v1beta1.TensorboardExperiment}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTensorboardExperimentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTensorboardExperiments( + request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment[], + protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsResponse + ]>; + listTensorboardExperiments( + request: protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment>): void; + listTensorboardExperiments( + request: protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment>): void; + listTensorboardExperiments( + request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment[], + protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listTensorboardExperiments(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Tensorboard to list TensorboardExperiments. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + * @param {string} request.filter + * Lists the TensorboardExperiments that match the filter expression. + * @param {number} request.pageSize + * The maximum number of TensorboardExperiments to return. The service may + * return fewer than this value. If unspecified, at most 50 + * TensorboardExperiments will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [TensorboardExperiment]{@link google.cloud.aiplatform.v1beta1.TensorboardExperiment} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTensorboardExperimentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTensorboardExperimentsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTensorboardExperiments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTensorboardExperiments.createStream( + this.innerApiCalls.listTensorboardExperiments as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTensorboardExperiments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Tensorboard to list TensorboardExperiments. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + * @param {string} request.filter + * Lists the TensorboardExperiments that match the filter expression. + * @param {number} request.pageSize + * The maximum number of TensorboardExperiments to return. The service may + * return fewer than this value. If unspecified, at most 50 + * TensorboardExperiments will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TensorboardExperiment]{@link google.cloud.aiplatform.v1beta1.TensorboardExperiment}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_ListTensorboardExperiments_async + */ + listTensorboardExperimentsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTensorboardExperiments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTensorboardExperiments.asyncIterate( + this.innerApiCalls['listTensorboardExperiments'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists TensorboardRuns in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardExperiment to list TensorboardRuns. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + * @param {string} request.filter + * Lists the TensorboardRuns that match the filter expression. + * @param {number} request.pageSize + * The maximum number of TensorboardRuns to return. The service may return + * fewer than this value. If unspecified, at most 50 TensorboardRuns will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [TensorboardRun]{@link google.cloud.aiplatform.v1beta1.TensorboardRun}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTensorboardRunsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTensorboardRuns( + request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun[], + protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsResponse + ]>; + listTensorboardRuns( + request: protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun>): void; + listTensorboardRuns( + request: protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun>): void; + listTensorboardRuns( + request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardRun[], + protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listTensorboardRuns(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardExperiment to list TensorboardRuns. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + * @param {string} request.filter + * Lists the TensorboardRuns that match the filter expression. + * @param {number} request.pageSize + * The maximum number of TensorboardRuns to return. The service may return + * fewer than this value. If unspecified, at most 50 TensorboardRuns will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [TensorboardRun]{@link google.cloud.aiplatform.v1beta1.TensorboardRun} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTensorboardRunsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTensorboardRunsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTensorboardRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTensorboardRuns.createStream( + this.innerApiCalls.listTensorboardRuns as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTensorboardRuns`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardExperiment to list TensorboardRuns. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + * @param {string} request.filter + * Lists the TensorboardRuns that match the filter expression. + * @param {number} request.pageSize + * The maximum number of TensorboardRuns to return. The service may return + * fewer than this value. If unspecified, at most 50 TensorboardRuns will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TensorboardRun]{@link google.cloud.aiplatform.v1beta1.TensorboardRun}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_ListTensorboardRuns_async + */ + listTensorboardRunsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTensorboardRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTensorboardRuns.asyncIterate( + this.innerApiCalls['listTensorboardRuns'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists TensorboardTimeSeries in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardRun to list TensorboardTimeSeries. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + * @param {string} request.filter + * Lists the TensorboardTimeSeries that match the filter expression. + * @param {number} request.pageSize + * The maximum number of TensorboardTimeSeries to return. The service may + * return fewer than this value. If unspecified, at most 50 + * TensorboardTimeSeries will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTensorboardTimeSeriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries[], + protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesResponse + ]>; + listTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries>): void; + listTensorboardTimeSeries( + request: protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries>): void; + listTensorboardTimeSeries( + request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries[], + protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listTensorboardTimeSeries(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardRun to list TensorboardTimeSeries. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + * @param {string} request.filter + * Lists the TensorboardTimeSeries that match the filter expression. + * @param {number} request.pageSize + * The maximum number of TensorboardTimeSeries to return. The service may + * return fewer than this value. If unspecified, at most 50 + * TensorboardTimeSeries will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTensorboardTimeSeriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTensorboardTimeSeriesStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTensorboardTimeSeries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTensorboardTimeSeries.createStream( + this.innerApiCalls.listTensorboardTimeSeries as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTensorboardTimeSeries`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the TensorboardRun to list TensorboardTimeSeries. + * Format: + * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + * @param {string} request.filter + * Lists the TensorboardTimeSeries that match the filter expression. + * @param {number} request.pageSize + * The maximum number of TensorboardTimeSeries to return. The service may + * return fewer than this value. If unspecified, at most 50 + * TensorboardTimeSeries will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the list. + * @param {google.protobuf.FieldMask} request.readMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_ListTensorboardTimeSeries_async + */ + listTensorboardTimeSeriesAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTensorboardTimeSeries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTensorboardTimeSeries.asyncIterate( + this.innerApiCalls['listTensorboardTimeSeries'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Exports a TensorboardTimeSeries' data. Data is returned in paginated + * responses. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tensorboardTimeSeries + * Required. The resource name of the TensorboardTimeSeries to export data from. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + * @param {string} request.filter + * Exports the TensorboardTimeSeries' data that match the filter expression. + * @param {number} request.pageSize + * The maximum number of data points to return per page. + * The default page_size will be 1000. Values must be between 1 and 10000. + * Values above 10000 will be coerced to 10000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link |TensorboardService.ExportTensorboardTimeSeries} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link |TensorboardService.ExportTensorboardTimeSeries} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the TensorboardTimeSeries' data. + * By default, TensorboardTimeSeries' data will be returned in a pseudo random + * order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [TimeSeriesDataPoint]{@link google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `exportTensorboardTimeSeriesDataAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + exportTensorboardTimeSeriesData( + request?: protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITimeSeriesDataPoint[], + protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest|null, + protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataResponse + ]>; + exportTensorboardTimeSeriesData( + request: protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, + protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITimeSeriesDataPoint>): void; + exportTensorboardTimeSeriesData( + request: protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, + protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITimeSeriesDataPoint>): void; + exportTensorboardTimeSeriesData( + request?: protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, + protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITimeSeriesDataPoint>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, + protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITimeSeriesDataPoint>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITimeSeriesDataPoint[], + protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest|null, + protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard_time_series': request.tensorboardTimeSeries || '', + }); + this.initialize(); + return this.innerApiCalls.exportTensorboardTimeSeriesData(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tensorboardTimeSeries + * Required. The resource name of the TensorboardTimeSeries to export data from. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + * @param {string} request.filter + * Exports the TensorboardTimeSeries' data that match the filter expression. + * @param {number} request.pageSize + * The maximum number of data points to return per page. + * The default page_size will be 1000. Values must be between 1 and 10000. + * Values above 10000 will be coerced to 10000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link |TensorboardService.ExportTensorboardTimeSeries} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link |TensorboardService.ExportTensorboardTimeSeries} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the TensorboardTimeSeries' data. + * By default, TensorboardTimeSeries' data will be returned in a pseudo random + * order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [TimeSeriesDataPoint]{@link google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `exportTensorboardTimeSeriesDataAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + exportTensorboardTimeSeriesDataStream( + request?: protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard_time_series': request.tensorboardTimeSeries || '', + }); + const defaultCallSettings = this._defaults['exportTensorboardTimeSeriesData']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.exportTensorboardTimeSeriesData.createStream( + this.innerApiCalls.exportTensorboardTimeSeriesData as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `exportTensorboardTimeSeriesData`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tensorboardTimeSeries + * Required. The resource name of the TensorboardTimeSeries to export data from. + * Format: + * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` + * @param {string} request.filter + * Exports the TensorboardTimeSeries' data that match the filter expression. + * @param {number} request.pageSize + * The maximum number of data points to return per page. + * The default page_size will be 1000. Values must be between 1 and 10000. + * Values above 10000 will be coerced to 10000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link |TensorboardService.ExportTensorboardTimeSeries} call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * {@link |TensorboardService.ExportTensorboardTimeSeries} must + * match the call that provided the page token. + * @param {string} request.orderBy + * Field to use to sort the TensorboardTimeSeries' data. + * By default, TensorboardTimeSeries' data will be returned in a pseudo random + * order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TimeSeriesDataPoint]{@link google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_TensorboardService_ExportTensorboardTimeSeriesData_async + */ + exportTensorboardTimeSeriesDataAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'tensorboard_time_series': request.tensorboardTimeSeries || '', + }); + const defaultCallSettings = this._defaults['exportTensorboardTimeSeriesData']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate( + this.innerApiCalls['exportTensorboardTimeSeriesData'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.tensorboardServiceStub && !this._terminated) { + return this.tensorboardServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_client_config.json new file mode 100644 index 00000000..96886a76 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_client_config.json @@ -0,0 +1,138 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.TensorboardService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateTensorboard": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTensorboard": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTensorboard": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTensorboards": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTensorboard": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateTensorboardExperiment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTensorboardExperiment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTensorboardExperiment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTensorboardExperiments": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTensorboardExperiment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateTensorboardRun": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchCreateTensorboardRuns": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTensorboardRun": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTensorboardRun": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTensorboardRuns": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTensorboardRun": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchCreateTensorboardTimeSeries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateTensorboardTimeSeries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTensorboardTimeSeries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTensorboardTimeSeries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTensorboardTimeSeries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTensorboardTimeSeries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchReadTensorboardTimeSeriesData": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReadTensorboardTimeSeriesData": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReadTensorboardBlobData": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "WriteTensorboardExperimentData": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "WriteTensorboardRunData": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportTensorboardTimeSeriesData": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_proto_list.json new file mode 100644 index 00000000..c916ab12 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_proto_list.json @@ -0,0 +1,117 @@ +[ + "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/context.proto", + "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1beta1/event.proto", + "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/io.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/study.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/types.proto", + "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1beta1/value.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_client.ts new file mode 100644 index 00000000..d71258b2 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_client.ts @@ -0,0 +1,3713 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/vizier_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './vizier_service_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * Vertex AI Vizier API. + * + * Vertex AI Vizier is a service to solve blackbox optimization problems, + * such as tuning machine learning hyperparameters and searching over deep + * learning architectures. + * @class + * @memberof v1beta1 + */ +export class VizierServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + vizierServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of VizierServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof VizierServiceClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + endpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featurePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listStudies: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'studies'), + listTrials: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'trials') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const suggestTrialsResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.SuggestTrialsResponse') as gax.protobuf.Type; + const suggestTrialsMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.SuggestTrialsMetadata') as gax.protobuf.Type; + const checkTrialEarlyStoppingStateResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.CheckTrialEarlyStoppingStateResponse') as gax.protobuf.Type; + const checkTrialEarlyStoppingStateMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.CheckTrialEarlyStoppingStateMetatdata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + suggestTrials: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + suggestTrialsResponse.decode.bind(suggestTrialsResponse), + suggestTrialsMetadata.decode.bind(suggestTrialsMetadata)), + checkTrialEarlyStoppingState: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + checkTrialEarlyStoppingStateResponse.decode.bind(checkTrialEarlyStoppingStateResponse), + checkTrialEarlyStoppingStateMetadata.decode.bind(checkTrialEarlyStoppingStateMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.VizierService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.vizierServiceStub) { + return this.vizierServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1beta1.VizierService. + this.vizierServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.VizierService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1beta1.VizierService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const vizierServiceStubMethods = + ['createStudy', 'getStudy', 'listStudies', 'deleteStudy', 'lookupStudy', 'suggestTrials', 'createTrial', 'getTrial', 'listTrials', 'addTrialMeasurement', 'completeTrial', 'deleteTrial', 'checkTrialEarlyStoppingState', 'stopTrial', 'listOptimalTrials']; + for (const methodName of vizierServiceStubMethods) { + const callPromise = this.vizierServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.vizierServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'aiplatform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'aiplatform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Creates a Study. A resource name will be generated after creation of the + * Study. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the CustomJob in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.Study} request.study + * Required. The Study configuration used to create the Study. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Study]{@link google.cloud.aiplatform.v1beta1.Study}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_VizierService_CreateStudy_async + */ + createStudy( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IStudy, + protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest|undefined, {}|undefined + ]>; + createStudy( + request: protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IStudy, + protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest|null|undefined, + {}|null|undefined>): void; + createStudy( + request: protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IStudy, + protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest|null|undefined, + {}|null|undefined>): void; + createStudy( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IStudy, + protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IStudy, + protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IStudy, + protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createStudy(request, options, callback); + } +/** + * Gets a Study by name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Study resource. + * Format: `projects/{project}/locations/{location}/studies/{study}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Study]{@link google.cloud.aiplatform.v1beta1.Study}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_VizierService_GetStudy_async + */ + getStudy( + request?: protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IStudy, + protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest|undefined, {}|undefined + ]>; + getStudy( + request: protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IStudy, + protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest|null|undefined, + {}|null|undefined>): void; + getStudy( + request: protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IStudy, + protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest|null|undefined, + {}|null|undefined>): void; + getStudy( + request?: protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IStudy, + protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IStudy, + protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IStudy, + protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getStudy(request, options, callback); + } +/** + * Deletes a Study. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Study resource to be deleted. + * Format: `projects/{project}/locations/{location}/studies/{study}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_VizierService_DeleteStudy_async + */ + deleteStudy( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest|undefined, {}|undefined + ]>; + deleteStudy( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest|null|undefined, + {}|null|undefined>): void; + deleteStudy( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest|null|undefined, + {}|null|undefined>): void; + deleteStudy( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteStudy(request, options, callback); + } +/** + * Looks a study up using the user-defined display_name field instead of the + * fully qualified resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to get the Study from. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.displayName + * Required. The user-defined display name of the Study + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Study]{@link google.cloud.aiplatform.v1beta1.Study}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_VizierService_LookupStudy_async + */ + lookupStudy( + request?: protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IStudy, + protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest|undefined, {}|undefined + ]>; + lookupStudy( + request: protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IStudy, + protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest|null|undefined, + {}|null|undefined>): void; + lookupStudy( + request: protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IStudy, + protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest|null|undefined, + {}|null|undefined>): void; + lookupStudy( + request?: protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IStudy, + protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IStudy, + protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IStudy, + protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.lookupStudy(request, options, callback); + } +/** + * Adds a user provided Trial to a Study. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Study to create the Trial in. + * Format: `projects/{project}/locations/{location}/studies/{study}` + * @param {google.cloud.aiplatform.v1beta1.Trial} request.trial + * Required. The Trial to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1beta1.Trial}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_VizierService_CreateTrial_async + */ + createTrial( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest|undefined, {}|undefined + ]>; + createTrial( + request: protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest|null|undefined, + {}|null|undefined>): void; + createTrial( + request: protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest|null|undefined, + {}|null|undefined>): void; + createTrial( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createTrial(request, options, callback); + } +/** + * Gets a Trial. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Trial resource. + * Format: + * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1beta1.Trial}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_VizierService_GetTrial_async + */ + getTrial( + request?: protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest|undefined, {}|undefined + ]>; + getTrial( + request: protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest|null|undefined, + {}|null|undefined>): void; + getTrial( + request: protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest|null|undefined, + {}|null|undefined>): void; + getTrial( + request?: protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getTrial(request, options, callback); + } +/** + * Adds a measurement of the objective metrics to a Trial. This measurement + * is assumed to have been taken before the Trial is complete. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.trialName + * Required. The name of the trial to add measurement. + * Format: + * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + * @param {google.cloud.aiplatform.v1beta1.Measurement} request.measurement + * Required. The measurement to be added to a Trial. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1beta1.Trial}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_VizierService_AddTrialMeasurement_async + */ + addTrialMeasurement( + request?: protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest|undefined, {}|undefined + ]>; + addTrialMeasurement( + request: protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest|null|undefined, + {}|null|undefined>): void; + addTrialMeasurement( + request: protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest|null|undefined, + {}|null|undefined>): void; + addTrialMeasurement( + request?: protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'trial_name': request.trialName || '', + }); + this.initialize(); + return this.innerApiCalls.addTrialMeasurement(request, options, callback); + } +/** + * Marks a Trial as complete. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The Trial's name. + * Format: + * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + * @param {google.cloud.aiplatform.v1beta1.Measurement} [request.finalMeasurement] + * Optional. If provided, it will be used as the completed Trial's + * final_measurement; Otherwise, the service will auto-select a + * previously reported measurement as the final-measurement + * @param {boolean} [request.trialInfeasible] + * Optional. True if the Trial cannot be run with the given Parameter, and + * final_measurement will be ignored. + * @param {string} [request.infeasibleReason] + * Optional. A human readable reason why the trial was infeasible. This should + * only be provided if `trial_infeasible` is true. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1beta1.Trial}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_VizierService_CompleteTrial_async + */ + completeTrial( + request?: protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest|undefined, {}|undefined + ]>; + completeTrial( + request: protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest|null|undefined, + {}|null|undefined>): void; + completeTrial( + request: protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest|null|undefined, + {}|null|undefined>): void; + completeTrial( + request?: protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.completeTrial(request, options, callback); + } +/** + * Deletes a Trial. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The Trial's name. + * Format: + * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_VizierService_DeleteTrial_async + */ + deleteTrial( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest|undefined, {}|undefined + ]>; + deleteTrial( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest|null|undefined, + {}|null|undefined>): void; + deleteTrial( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest|null|undefined, + {}|null|undefined>): void; + deleteTrial( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteTrial(request, options, callback); + } +/** + * Stops a Trial. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The Trial's name. + * Format: + * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1beta1.Trial}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_VizierService_StopTrial_async + */ + stopTrial( + request?: protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest|undefined, {}|undefined + ]>; + stopTrial( + request: protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest|null|undefined, + {}|null|undefined>): void; + stopTrial( + request: protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest|null|undefined, + {}|null|undefined>): void; + stopTrial( + request?: protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITrial, + protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.stopTrial(request, options, callback); + } +/** + * Lists the pareto-optimal Trials for multi-objective Study or the + * optimal Trials for single-objective Study. The definition of + * pareto-optimal can be checked in wiki page. + * https://en.wikipedia.org/wiki/Pareto_efficiency + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the Study that the optimal Trial belongs to. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ListOptimalTrialsResponse]{@link google.cloud.aiplatform.v1beta1.ListOptimalTrialsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_VizierService_ListOptimalTrials_async + */ + listOptimalTrials( + request?: protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsResponse, + protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest|undefined, {}|undefined + ]>; + listOptimalTrials( + request: protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsResponse, + protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest|null|undefined, + {}|null|undefined>): void; + listOptimalTrials( + request: protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsResponse, + protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest|null|undefined, + {}|null|undefined>): void; + listOptimalTrials( + request?: protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsResponse, + protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsResponse, + protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsResponse, + protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listOptimalTrials(request, options, callback); + } + +/** + * Adds one or more Trials to a Study, with parameter values + * suggested by Vertex AI Vizier. Returns a long-running + * operation associated with the generation of Trial suggestions. + * When this long-running operation succeeds, it will contain + * a {@link google.cloud.ml.v1.SuggestTrialsResponse|SuggestTrialsResponse}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location that the Study belongs to. + * Format: `projects/{project}/locations/{location}/studies/{study}` + * @param {number} request.suggestionCount + * Required. The number of suggestions requested. + * @param {string} request.clientId + * Required. The identifier of the client that is requesting the suggestion. + * + * If multiple SuggestTrialsRequests have the same `client_id`, + * the service will return the identical suggested Trial if the Trial is + * pending, and provide a new Trial if the last suggested Trial was completed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_VizierService_SuggestTrials_async + */ + suggestTrials( + request?: protos.google.cloud.aiplatform.v1beta1.ISuggestTrialsRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + suggestTrials( + request: protos.google.cloud.aiplatform.v1beta1.ISuggestTrialsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + suggestTrials( + request: protos.google.cloud.aiplatform.v1beta1.ISuggestTrialsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + suggestTrials( + request?: protos.google.cloud.aiplatform.v1beta1.ISuggestTrialsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.suggestTrials(request, options, callback); + } +/** + * Check the status of the long running operation returned by `suggestTrials()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_VizierService_SuggestTrials_async + */ + async checkSuggestTrialsProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.suggestTrials, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Checks whether a Trial should stop or not. Returns a + * long-running operation. When the operation is successful, + * it will contain a + * {@link google.cloud.ml.v1.CheckTrialEarlyStoppingStateResponse|CheckTrialEarlyStoppingStateResponse}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.trialName + * Required. The Trial's name. + * Format: + * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_VizierService_CheckTrialEarlyStoppingState_async + */ + checkTrialEarlyStoppingState( + request?: protos.google.cloud.aiplatform.v1beta1.ICheckTrialEarlyStoppingStateRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + checkTrialEarlyStoppingState( + request: protos.google.cloud.aiplatform.v1beta1.ICheckTrialEarlyStoppingStateRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + checkTrialEarlyStoppingState( + request: protos.google.cloud.aiplatform.v1beta1.ICheckTrialEarlyStoppingStateRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + checkTrialEarlyStoppingState( + request?: protos.google.cloud.aiplatform.v1beta1.ICheckTrialEarlyStoppingStateRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'trial_name': request.trialName || '', + }); + this.initialize(); + return this.innerApiCalls.checkTrialEarlyStoppingState(request, options, callback); + } +/** + * Check the status of the long running operation returned by `checkTrialEarlyStoppingState()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_VizierService_CheckTrialEarlyStoppingState_async + */ + async checkCheckTrialEarlyStoppingStateProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.checkTrialEarlyStoppingState, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists all the studies in a region for an associated project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the Study from. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.pageToken] + * Optional. A page token to request the next page of results. + * If unspecified, there are no subsequent pages. + * @param {number} [request.pageSize] + * Optional. The maximum number of studies to return per "page" of results. + * If unspecified, service will pick an appropriate default. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Study]{@link google.cloud.aiplatform.v1beta1.Study}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listStudiesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listStudies( + request?: protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IStudy[], + protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListStudiesResponse + ]>; + listStudies( + request: protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, + protos.google.cloud.aiplatform.v1beta1.IListStudiesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IStudy>): void; + listStudies( + request: protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, + protos.google.cloud.aiplatform.v1beta1.IListStudiesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IStudy>): void; + listStudies( + request?: protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, + protos.google.cloud.aiplatform.v1beta1.IListStudiesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IStudy>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, + protos.google.cloud.aiplatform.v1beta1.IListStudiesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IStudy>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IStudy[], + protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListStudiesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listStudies(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the Study from. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.pageToken] + * Optional. A page token to request the next page of results. + * If unspecified, there are no subsequent pages. + * @param {number} [request.pageSize] + * Optional. The maximum number of studies to return per "page" of results. + * If unspecified, service will pick an appropriate default. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Study]{@link google.cloud.aiplatform.v1beta1.Study} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listStudiesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listStudiesStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listStudies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listStudies.createStream( + this.innerApiCalls.listStudies as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listStudies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the Study from. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.pageToken] + * Optional. A page token to request the next page of results. + * If unspecified, there are no subsequent pages. + * @param {number} [request.pageSize] + * Optional. The maximum number of studies to return per "page" of results. + * If unspecified, service will pick an appropriate default. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Study]{@link google.cloud.aiplatform.v1beta1.Study}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_VizierService_ListStudies_async + */ + listStudiesAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listStudies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listStudies.asyncIterate( + this.innerApiCalls['listStudies'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + /** + * Lists the Trials associated with a Study. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Study to list the Trial from. + * Format: `projects/{project}/locations/{location}/studies/{study}` + * @param {string} [request.pageToken] + * Optional. A page token to request the next page of results. + * If unspecified, there are no subsequent pages. + * @param {number} [request.pageSize] + * Optional. The number of Trials to retrieve per "page" of results. + * If unspecified, the service will pick an appropriate default. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Trial]{@link google.cloud.aiplatform.v1beta1.Trial}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTrialsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTrials( + request?: protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITrial[], + protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListTrialsResponse + ]>; + listTrials( + request: protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, + protos.google.cloud.aiplatform.v1beta1.IListTrialsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITrial>): void; + listTrials( + request: protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, + protos.google.cloud.aiplatform.v1beta1.IListTrialsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITrial>): void; + listTrials( + request?: protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, + protos.google.cloud.aiplatform.v1beta1.IListTrialsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITrial>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, + protos.google.cloud.aiplatform.v1beta1.IListTrialsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ITrial>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ITrial[], + protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListTrialsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listTrials(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Study to list the Trial from. + * Format: `projects/{project}/locations/{location}/studies/{study}` + * @param {string} [request.pageToken] + * Optional. A page token to request the next page of results. + * If unspecified, there are no subsequent pages. + * @param {number} [request.pageSize] + * Optional. The number of Trials to retrieve per "page" of results. + * If unspecified, the service will pick an appropriate default. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Trial]{@link google.cloud.aiplatform.v1beta1.Trial} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTrialsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTrialsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTrials']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTrials.createStream( + this.innerApiCalls.listTrials as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTrials`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Study to list the Trial from. + * Format: `projects/{project}/locations/{location}/studies/{study}` + * @param {string} [request.pageToken] + * Optional. A page token to request the next page of results. + * If unspecified, there are no subsequent pages. + * @param {number} [request.pageSize] + * Optional. The number of Trials to retrieve per "page" of results. + * If unspecified, the service will pick an appropriate default. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Trial]{@link google.cloud.aiplatform.v1beta1.Trial}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_VizierService_ListTrials_async + */ + listTrialsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listTrials']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTrials.asyncIterate( + this.innerApiCalls['listTrials'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath(project:string,location:string,metadataStore:string,artifact:string) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath(project:string,location:string,metadataStore:string,context:string) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project:string,location:string,customJob:string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath(project:string,location:string,dataset:string,dataItem:string) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,dataset:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified endpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + endpointPath(project:string,location:string,endpoint:string) { + return this.pathTemplates.endpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).project; + } + + /** + * Parse the location from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).location; + } + + /** + * Parse the endpoint from Endpoint resource. + * + * @param {string} endpointName + * A fully-qualified path representing Endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromEndpointName(endpointName: string) { + return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project:string,location:string,featurestore:string,entityType:string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,metadataStore:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified feature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { + return this.pathTemplates.featurePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + }); + } + + /** + * Parse the project from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).project; + } + + /** + * Parse the location from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).location; + } + + /** + * Parse the featurestore from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; + } + + /** + * Parse the entity_type from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; + } + + /** + * Parse the feature from Feature resource. + * + * @param {string} featureName + * A fully-qualified path representing Feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromFeatureName(featureName: string) { + return this.pathTemplates.featurePathTemplate.match(featureName).feature; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project:string,location:string,featurestore:string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project:string,location:string,index:string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project:string,location:string,indexEndpoint:string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project:string,location:string,metadataStore:string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project:string,location:string,model:string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project:string,location:string,pipelineJob:string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath(project:string,location:string,specialistPool:string) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project:string,location:string,study:string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project:string,location:string,tensorboard:string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath(project:string,location:string,trainingPipeline:string) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project:string,location:string,study:string,trial:string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.vizierServiceStub && !this._terminated) { + return this.vizierServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_client_config.json new file mode 100644 index 00000000..89e31e02 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_client_config.json @@ -0,0 +1,101 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.VizierService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateStudy": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetStudy": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListStudies": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteStudy": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "LookupStudy": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SuggestTrials": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateTrial": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTrial": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTrials": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AddTrialMeasurement": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CompleteTrial": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTrial": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CheckTrialEarlyStoppingState": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StopTrial": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListOptimalTrials": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_proto_list.json new file mode 100644 index 00000000..c916ab12 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_proto_list.json @@ -0,0 +1,117 @@ +[ + "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/context.proto", + "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1beta1/event.proto", + "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/io.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/study.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1beta1/types.proto", + "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1beta1/value.proto", + "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" +] diff --git a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000..ffac9b16 --- /dev/null +++ b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,41 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const aiplatform = require('@google-cloud/aiplatform'); + +function main() { + const datasetServiceClient = new aiplatform.DatasetServiceClient(); + const endpointServiceClient = new aiplatform.EndpointServiceClient(); + const featurestoreOnlineServingServiceClient = new aiplatform.FeaturestoreOnlineServingServiceClient(); + const featurestoreServiceClient = new aiplatform.FeaturestoreServiceClient(); + const indexEndpointServiceClient = new aiplatform.IndexEndpointServiceClient(); + const indexServiceClient = new aiplatform.IndexServiceClient(); + const jobServiceClient = new aiplatform.JobServiceClient(); + const metadataServiceClient = new aiplatform.MetadataServiceClient(); + const migrationServiceClient = new aiplatform.MigrationServiceClient(); + const modelServiceClient = new aiplatform.ModelServiceClient(); + const pipelineServiceClient = new aiplatform.PipelineServiceClient(); + const predictionServiceClient = new aiplatform.PredictionServiceClient(); + const specialistPoolServiceClient = new aiplatform.SpecialistPoolServiceClient(); + const tensorboardServiceClient = new aiplatform.TensorboardServiceClient(); + const vizierServiceClient = new aiplatform.VizierServiceClient(); +} + +main(); diff --git a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000..6d8165e0 --- /dev/null +++ b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,116 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {DatasetServiceClient, EndpointServiceClient, FeaturestoreOnlineServingServiceClient, FeaturestoreServiceClient, IndexEndpointServiceClient, IndexServiceClient, JobServiceClient, MetadataServiceClient, MigrationServiceClient, ModelServiceClient, PipelineServiceClient, PredictionServiceClient, SpecialistPoolServiceClient, TensorboardServiceClient, VizierServiceClient} from '@google-cloud/aiplatform'; + +// check that the client class type name can be used +function doStuffWithDatasetServiceClient(client: DatasetServiceClient) { + client.close(); +} +function doStuffWithEndpointServiceClient(client: EndpointServiceClient) { + client.close(); +} +function doStuffWithFeaturestoreOnlineServingServiceClient(client: FeaturestoreOnlineServingServiceClient) { + client.close(); +} +function doStuffWithFeaturestoreServiceClient(client: FeaturestoreServiceClient) { + client.close(); +} +function doStuffWithIndexEndpointServiceClient(client: IndexEndpointServiceClient) { + client.close(); +} +function doStuffWithIndexServiceClient(client: IndexServiceClient) { + client.close(); +} +function doStuffWithJobServiceClient(client: JobServiceClient) { + client.close(); +} +function doStuffWithMetadataServiceClient(client: MetadataServiceClient) { + client.close(); +} +function doStuffWithMigrationServiceClient(client: MigrationServiceClient) { + client.close(); +} +function doStuffWithModelServiceClient(client: ModelServiceClient) { + client.close(); +} +function doStuffWithPipelineServiceClient(client: PipelineServiceClient) { + client.close(); +} +function doStuffWithPredictionServiceClient(client: PredictionServiceClient) { + client.close(); +} +function doStuffWithSpecialistPoolServiceClient(client: SpecialistPoolServiceClient) { + client.close(); +} +function doStuffWithTensorboardServiceClient(client: TensorboardServiceClient) { + client.close(); +} +function doStuffWithVizierServiceClient(client: VizierServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const datasetServiceClient = new DatasetServiceClient(); + doStuffWithDatasetServiceClient(datasetServiceClient); + // check that the client instance can be created + const endpointServiceClient = new EndpointServiceClient(); + doStuffWithEndpointServiceClient(endpointServiceClient); + // check that the client instance can be created + const featurestoreOnlineServingServiceClient = new FeaturestoreOnlineServingServiceClient(); + doStuffWithFeaturestoreOnlineServingServiceClient(featurestoreOnlineServingServiceClient); + // check that the client instance can be created + const featurestoreServiceClient = new FeaturestoreServiceClient(); + doStuffWithFeaturestoreServiceClient(featurestoreServiceClient); + // check that the client instance can be created + const indexEndpointServiceClient = new IndexEndpointServiceClient(); + doStuffWithIndexEndpointServiceClient(indexEndpointServiceClient); + // check that the client instance can be created + const indexServiceClient = new IndexServiceClient(); + doStuffWithIndexServiceClient(indexServiceClient); + // check that the client instance can be created + const jobServiceClient = new JobServiceClient(); + doStuffWithJobServiceClient(jobServiceClient); + // check that the client instance can be created + const metadataServiceClient = new MetadataServiceClient(); + doStuffWithMetadataServiceClient(metadataServiceClient); + // check that the client instance can be created + const migrationServiceClient = new MigrationServiceClient(); + doStuffWithMigrationServiceClient(migrationServiceClient); + // check that the client instance can be created + const modelServiceClient = new ModelServiceClient(); + doStuffWithModelServiceClient(modelServiceClient); + // check that the client instance can be created + const pipelineServiceClient = new PipelineServiceClient(); + doStuffWithPipelineServiceClient(pipelineServiceClient); + // check that the client instance can be created + const predictionServiceClient = new PredictionServiceClient(); + doStuffWithPredictionServiceClient(predictionServiceClient); + // check that the client instance can be created + const specialistPoolServiceClient = new SpecialistPoolServiceClient(); + doStuffWithSpecialistPoolServiceClient(specialistPoolServiceClient); + // check that the client instance can be created + const tensorboardServiceClient = new TensorboardServiceClient(); + doStuffWithTensorboardServiceClient(tensorboardServiceClient); + // check that the client instance can be created + const vizierServiceClient = new VizierServiceClient(); + doStuffWithVizierServiceClient(vizierServiceClient); +} + +main(); diff --git a/owl-bot-staging/v1beta1/system-test/install.ts b/owl-bot-staging/v1beta1/system-test/install.ts new file mode 100644 index 00000000..8ec45222 --- /dev/null +++ b/owl-bot-staging/v1beta1/system-test/install.ts @@ -0,0 +1,49 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import { packNTest } from 'pack-n-play'; +import { readFileSync } from 'fs'; +import { describe, it } from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/v1beta1/test/gapic_dataset_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_dataset_service_v1beta1.ts new file mode 100644 index 00000000..6ce3823d --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_dataset_service_v1beta1.ts @@ -0,0 +1,3419 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as datasetserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.DatasetServiceClient', () => { + it('has servicePath', () => { + const servicePath = datasetserviceModule.v1beta1.DatasetServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = datasetserviceModule.v1beta1.DatasetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = datasetserviceModule.v1beta1.DatasetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.datasetServiceStub, undefined); + await client.initialize(); + assert(client.datasetServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.datasetServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.datasetServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getDataset', () => { + it('invokes getDataset without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetDatasetRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()); + client.innerApiCalls.getDataset = stubSimpleCall(expectedResponse); + const [response] = await client.getDataset(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDataset without error using callback', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetDatasetRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()); + client.innerApiCalls.getDataset = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataset( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDataset|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getDataset with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetDatasetRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataset(request), expectedError); + assert((client.innerApiCalls.getDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDataset with closed client', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetDatasetRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataset(request), expectedError); + }); + }); + + describe('updateDataset', () => { + it('invokes updateDataset without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateDatasetRequest()); + request.dataset = {}; + request.dataset.name = ''; + const expectedHeaderRequestParams = "dataset.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()); + client.innerApiCalls.updateDataset = stubSimpleCall(expectedResponse); + const [response] = await client.updateDataset(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateDataset without error using callback', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateDatasetRequest()); + request.dataset = {}; + request.dataset.name = ''; + const expectedHeaderRequestParams = "dataset.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()); + client.innerApiCalls.updateDataset = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataset( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDataset|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateDataset with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateDatasetRequest()); + request.dataset = {}; + request.dataset.name = ''; + const expectedHeaderRequestParams = "dataset.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDataset(request), expectedError); + assert((client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateDataset with closed client', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateDatasetRequest()); + request.dataset = {}; + request.dataset.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDataset(request), expectedError); + }); + }); + + describe('getAnnotationSpec', () => { + it('invokes getAnnotationSpec without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetAnnotationSpecRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AnnotationSpec()); + client.innerApiCalls.getAnnotationSpec = stubSimpleCall(expectedResponse); + const [response] = await client.getAnnotationSpec(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getAnnotationSpec as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getAnnotationSpec without error using callback', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetAnnotationSpecRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AnnotationSpec()); + client.innerApiCalls.getAnnotationSpec = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAnnotationSpec( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IAnnotationSpec|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getAnnotationSpec as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getAnnotationSpec with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetAnnotationSpecRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getAnnotationSpec = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAnnotationSpec(request), expectedError); + assert((client.innerApiCalls.getAnnotationSpec as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getAnnotationSpec with closed client', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetAnnotationSpecRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAnnotationSpec(request), expectedError); + }); + }); + + describe('createDataset', () => { + it('invokes createDataset without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateDatasetRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createDataset = stubLongRunningCall(expectedResponse); + const [operation] = await client.createDataset(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createDataset without error using callback', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateDatasetRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createDataset = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDataset( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createDataset with call error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateDatasetRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataset = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createDataset(request), expectedError); + assert((client.innerApiCalls.createDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createDataset with LRO error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateDatasetRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataset = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createDataset(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateDatasetProgress without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateDatasetProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateDatasetProgress with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateDatasetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteDataset', () => { + it('invokes deleteDataset without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteDatasetRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteDataset = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteDataset(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteDataset without error using callback', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteDatasetRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteDataset = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDataset( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteDataset with call error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteDatasetRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteDataset(request), expectedError); + assert((client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteDataset with LRO error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteDatasetRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteDataset(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteDatasetProgress without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteDatasetProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteDatasetProgress with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteDatasetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('importData', () => { + it('invokes importData without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportDataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.importData = stubLongRunningCall(expectedResponse); + const [operation] = await client.importData(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.importData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes importData without error using callback', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportDataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.importData = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importData( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.importData as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes importData with call error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportDataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.importData = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.importData(request), expectedError); + assert((client.innerApiCalls.importData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes importData with LRO error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportDataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.importData = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.importData(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.importData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkImportDataProgress without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkImportDataProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportDataProgress with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkImportDataProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('exportData', () => { + it('invokes exportData without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportDataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.exportData = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportData(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.exportData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes exportData without error using callback', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportDataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.exportData = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportData( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.exportData as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes exportData with call error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportDataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportData = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportData(request), expectedError); + assert((client.innerApiCalls.exportData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes exportData with LRO error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportDataRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportData = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportData(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.exportData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkExportDataProgress without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkExportDataProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportDataProgress with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkExportDataProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listDatasets', () => { + it('invokes listDatasets without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDatasetsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), + ]; + client.innerApiCalls.listDatasets = stubSimpleCall(expectedResponse); + const [response] = await client.listDatasets(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDatasets as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDatasets without error using callback', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDatasetsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), + ]; + client.innerApiCalls.listDatasets = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDatasets( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDataset[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDatasets as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listDatasets with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDatasetsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listDatasets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDatasets(request), expectedError); + assert((client.innerApiCalls.listDatasets as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDatasetsStream without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDatasetsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), + ]; + client.descriptors.page.listDatasets.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Dataset[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Dataset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDatasets, request)); + assert.strictEqual( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listDatasetsStream with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDatasetsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listDatasets.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Dataset[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Dataset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDatasets, request)); + assert.strictEqual( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDatasets without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDatasetsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), + ]; + client.descriptors.page.listDatasets.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IDataset[] = []; + const iterable = client.listDatasetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDatasets with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDatasetsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listDatasets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDatasetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IDataset[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listDataItems', () => { + it('invokes listDataItems without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataItemsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), + ]; + client.innerApiCalls.listDataItems = stubSimpleCall(expectedResponse); + const [response] = await client.listDataItems(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDataItems as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDataItems without error using callback', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataItemsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), + ]; + client.innerApiCalls.listDataItems = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDataItems( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDataItem[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDataItems as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listDataItems with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataItemsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataItems = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDataItems(request), expectedError); + assert((client.innerApiCalls.listDataItems as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDataItemsStream without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataItemsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), + ]; + client.descriptors.page.listDataItems.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDataItemsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.DataItem[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DataItem) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDataItems, request)); + assert.strictEqual( + (client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listDataItemsStream with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataItemsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listDataItems.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDataItemsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.DataItem[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DataItem) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDataItems, request)); + assert.strictEqual( + (client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDataItems without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataItemsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), + ]; + client.descriptors.page.listDataItems.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IDataItem[] = []; + const iterable = client.listDataItemsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDataItems.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDataItems.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDataItems with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataItemsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listDataItems.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDataItemsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IDataItem[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDataItems.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDataItems.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listAnnotations', () => { + it('invokes listAnnotations without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListAnnotationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), + ]; + client.innerApiCalls.listAnnotations = stubSimpleCall(expectedResponse); + const [response] = await client.listAnnotations(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listAnnotations as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listAnnotations without error using callback', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListAnnotationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), + ]; + client.innerApiCalls.listAnnotations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAnnotations( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IAnnotation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listAnnotations as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listAnnotations with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListAnnotationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAnnotations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAnnotations(request), expectedError); + assert((client.innerApiCalls.listAnnotations as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listAnnotationsStream without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListAnnotationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), + ]; + client.descriptors.page.listAnnotations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAnnotationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Annotation[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Annotation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAnnotations, request)); + assert.strictEqual( + (client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listAnnotationsStream with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListAnnotationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listAnnotations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAnnotationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Annotation[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Annotation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAnnotations, request)); + assert.strictEqual( + (client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAnnotations without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListAnnotationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), + ]; + client.descriptors.page.listAnnotations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IAnnotation[] = []; + const iterable = client.listAnnotationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAnnotations with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListAnnotationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listAnnotations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAnnotationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IAnnotation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1beta1/test/gapic_endpoint_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_endpoint_service_v1beta1.ts new file mode 100644 index 00000000..8a797c84 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_endpoint_service_v1beta1.ts @@ -0,0 +1,2876 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as endpointserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.EndpointServiceClient', () => { + it('has servicePath', () => { + const servicePath = endpointserviceModule.v1beta1.EndpointServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = endpointserviceModule.v1beta1.EndpointServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = endpointserviceModule.v1beta1.EndpointServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.endpointServiceStub, undefined); + await client.initialize(); + assert(client.endpointServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.endpointServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.endpointServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getEndpoint', () => { + it('invokes getEndpoint without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()); + client.innerApiCalls.getEndpoint = stubSimpleCall(expectedResponse); + const [response] = await client.getEndpoint(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getEndpoint without error using callback', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()); + client.innerApiCalls.getEndpoint = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEndpoint( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IEndpoint|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getEndpoint with error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getEndpoint = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEndpoint(request), expectedError); + assert((client.innerApiCalls.getEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getEndpoint with closed client', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetEndpointRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getEndpoint(request), expectedError); + }); + }); + + describe('updateEndpoint', () => { + it('invokes updateEndpoint without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateEndpointRequest()); + request.endpoint = {}; + request.endpoint.name = ''; + const expectedHeaderRequestParams = "endpoint.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()); + client.innerApiCalls.updateEndpoint = stubSimpleCall(expectedResponse); + const [response] = await client.updateEndpoint(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateEndpoint without error using callback', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateEndpointRequest()); + request.endpoint = {}; + request.endpoint.name = ''; + const expectedHeaderRequestParams = "endpoint.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()); + client.innerApiCalls.updateEndpoint = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEndpoint( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IEndpoint|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateEndpoint with error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateEndpointRequest()); + request.endpoint = {}; + request.endpoint.name = ''; + const expectedHeaderRequestParams = "endpoint.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEndpoint = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateEndpoint(request), expectedError); + assert((client.innerApiCalls.updateEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateEndpoint with closed client', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateEndpointRequest()); + request.endpoint = {}; + request.endpoint.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateEndpoint(request), expectedError); + }); + }); + + describe('createEndpoint', () => { + it('invokes createEndpoint without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateEndpointRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createEndpoint = stubLongRunningCall(expectedResponse); + const [operation] = await client.createEndpoint(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createEndpoint without error using callback', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateEndpointRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createEndpoint = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEndpoint( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createEndpoint with call error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateEndpointRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createEndpoint(request), expectedError); + assert((client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createEndpoint with LRO error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateEndpointRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateEndpointProgress without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateEndpointProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateEndpointProgress with error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateEndpointProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteEndpoint', () => { + it('invokes deleteEndpoint without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteEndpoint = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteEndpoint(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteEndpoint without error using callback', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteEndpoint = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEndpoint( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteEndpoint with call error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteEndpoint(request), expectedError); + assert((client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteEndpoint with LRO error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteEndpointProgress without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteEndpointProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteEndpointProgress with error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteEndpointProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deployModel', () => { + it('invokes deployModel without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployModelRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deployModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.deployModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deployModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deployModel without error using callback', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployModelRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deployModel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deployModel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deployModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deployModel with call error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployModelRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deployModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deployModel(request), expectedError); + assert((client.innerApiCalls.deployModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deployModel with LRO error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployModelRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deployModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deployModel(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deployModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeployModelProgress without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeployModelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeployModelProgress with error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeployModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('undeployModel', () => { + it('invokes undeployModel without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UndeployModelRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.undeployModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.undeployModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes undeployModel without error using callback', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UndeployModelRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.undeployModel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeployModel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes undeployModel with call error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UndeployModelRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.undeployModel(request), expectedError); + assert((client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes undeployModel with LRO error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UndeployModelRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.undeployModel(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUndeployModelProgress without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUndeployModelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeployModelProgress with error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUndeployModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listEndpoints', () => { + it('invokes listEndpoints without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), + ]; + client.innerApiCalls.listEndpoints = stubSimpleCall(expectedResponse); + const [response] = await client.listEndpoints(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listEndpoints as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listEndpoints without error using callback', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), + ]; + client.innerApiCalls.listEndpoints = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEndpoints( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IEndpoint[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listEndpoints as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listEndpoints with error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listEndpoints = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEndpoints(request), expectedError); + assert((client.innerApiCalls.listEndpoints as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listEndpointsStream without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), + ]; + client.descriptors.page.listEndpoints.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listEndpointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Endpoint[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Endpoint) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listEndpoints.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEndpoints, request)); + assert.strictEqual( + (client.descriptors.page.listEndpoints.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listEndpointsStream with error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listEndpoints.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listEndpointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Endpoint[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Endpoint) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listEndpoints.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEndpoints, request)); + assert.strictEqual( + (client.descriptors.page.listEndpoints.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listEndpoints without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), + ]; + client.descriptors.page.listEndpoints.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IEndpoint[] = []; + const iterable = client.listEndpointsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listEndpoints with error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listEndpoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEndpointsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IEndpoint[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts new file mode 100644 index 00000000..a2f8a678 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts @@ -0,0 +1,1978 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as featurestoreonlineservingserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubServerStreamingCall(response?: ResponseType, error?: Error) { + const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // write something to the stream to trigger transformStub and send the response back to the client + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + return sinon.stub().returns(mockStream); +} + +describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { + it('has servicePath', () => { + const servicePath = featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.featurestoreOnlineServingServiceStub, undefined); + await client.initialize(); + assert(client.featurestoreOnlineServingServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.featurestoreOnlineServingServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.featurestoreOnlineServingServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('readFeatureValues', () => { + it('invokes readFeatureValues without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse()); + client.innerApiCalls.readFeatureValues = stubSimpleCall(expectedResponse); + const [response] = await client.readFeatureValues(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.readFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes readFeatureValues without error using callback', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse()); + client.innerApiCalls.readFeatureValues = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.readFeatureValues( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.readFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes readFeatureValues with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.readFeatureValues = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.readFeatureValues(request), expectedError); + assert((client.innerApiCalls.readFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes readFeatureValues with closed client', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesRequest()); + request.entityType = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.readFeatureValues(request), expectedError); + }); + }); + + describe('streamingReadFeatureValues', () => { + it('invokes streamingReadFeatureValues without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.StreamingReadFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse()); + client.innerApiCalls.streamingReadFeatureValues = stubServerStreamingCall(expectedResponse); + const stream = client.streamingReadFeatureValues(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.streamingReadFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions)); + }); + + it('invokes streamingReadFeatureValues with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.StreamingReadFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.streamingReadFeatureValues = stubServerStreamingCall(undefined, expectedError); + const stream = client.streamingReadFeatureValues(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.innerApiCalls.streamingReadFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions)); + }); + + it('invokes streamingReadFeatureValues with closed client', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.StreamingReadFeatureValuesRequest()); + request.entityType = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + const stream = client.streamingReadFeatureValues(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1beta1/test/gapic_featurestore_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_featurestore_service_v1beta1.ts new file mode 100644 index 00000000..3d2e0fbc --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_featurestore_service_v1beta1.ts @@ -0,0 +1,4882 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as featurestoreserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.FeaturestoreServiceClient', () => { + it('has servicePath', () => { + const servicePath = featurestoreserviceModule.v1beta1.FeaturestoreServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = featurestoreserviceModule.v1beta1.FeaturestoreServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = featurestoreserviceModule.v1beta1.FeaturestoreServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.featurestoreServiceStub, undefined); + await client.initialize(); + assert(client.featurestoreServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.featurestoreServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.featurestoreServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getFeaturestore', () => { + it('invokes getFeaturestore without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetFeaturestoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()); + client.innerApiCalls.getFeaturestore = stubSimpleCall(expectedResponse); + const [response] = await client.getFeaturestore(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getFeaturestore without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetFeaturestoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()); + client.innerApiCalls.getFeaturestore = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFeaturestore( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IFeaturestore|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getFeaturestore with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetFeaturestoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getFeaturestore = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getFeaturestore(request), expectedError); + assert((client.innerApiCalls.getFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getFeaturestore with closed client', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetFeaturestoreRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getFeaturestore(request), expectedError); + }); + }); + + describe('getEntityType', () => { + it('invokes getEntityType without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetEntityTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()); + client.innerApiCalls.getEntityType = stubSimpleCall(expectedResponse); + const [response] = await client.getEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getEntityType without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetEntityTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()); + client.innerApiCalls.getEntityType = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEntityType( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IEntityType|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getEntityType with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetEntityTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getEntityType = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEntityType(request), expectedError); + assert((client.innerApiCalls.getEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getEntityType with closed client', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetEntityTypeRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getEntityType(request), expectedError); + }); + }); + + describe('updateEntityType', () => { + it('invokes updateEntityType without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateEntityTypeRequest()); + request.entityType = {}; + request.entityType.name = ''; + const expectedHeaderRequestParams = "entity_type.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()); + client.innerApiCalls.updateEntityType = stubSimpleCall(expectedResponse); + const [response] = await client.updateEntityType(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateEntityType without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateEntityTypeRequest()); + request.entityType = {}; + request.entityType.name = ''; + const expectedHeaderRequestParams = "entity_type.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()); + client.innerApiCalls.updateEntityType = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEntityType( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IEntityType|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateEntityType with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateEntityTypeRequest()); + request.entityType = {}; + request.entityType.name = ''; + const expectedHeaderRequestParams = "entity_type.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEntityType = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateEntityType(request), expectedError); + assert((client.innerApiCalls.updateEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateEntityType with closed client', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateEntityTypeRequest()); + request.entityType = {}; + request.entityType.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateEntityType(request), expectedError); + }); + }); + + describe('getFeature', () => { + it('invokes getFeature without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetFeatureRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()); + client.innerApiCalls.getFeature = stubSimpleCall(expectedResponse); + const [response] = await client.getFeature(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getFeature without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetFeatureRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()); + client.innerApiCalls.getFeature = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFeature( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IFeature|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getFeature with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetFeatureRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getFeature = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getFeature(request), expectedError); + assert((client.innerApiCalls.getFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getFeature with closed client', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetFeatureRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getFeature(request), expectedError); + }); + }); + + describe('updateFeature', () => { + it('invokes updateFeature without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateFeatureRequest()); + request.feature = {}; + request.feature.name = ''; + const expectedHeaderRequestParams = "feature.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()); + client.innerApiCalls.updateFeature = stubSimpleCall(expectedResponse); + const [response] = await client.updateFeature(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateFeature without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateFeatureRequest()); + request.feature = {}; + request.feature.name = ''; + const expectedHeaderRequestParams = "feature.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()); + client.innerApiCalls.updateFeature = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateFeature( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IFeature|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateFeature with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateFeatureRequest()); + request.feature = {}; + request.feature.name = ''; + const expectedHeaderRequestParams = "feature.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFeature = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateFeature(request), expectedError); + assert((client.innerApiCalls.updateFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateFeature with closed client', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateFeatureRequest()); + request.feature = {}; + request.feature.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateFeature(request), expectedError); + }); + }); + + describe('createFeaturestore', () => { + it('invokes createFeaturestore without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateFeaturestoreRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createFeaturestore = stubLongRunningCall(expectedResponse); + const [operation] = await client.createFeaturestore(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createFeaturestore without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateFeaturestoreRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createFeaturestore = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFeaturestore( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createFeaturestore with call error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateFeaturestoreRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeaturestore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createFeaturestore(request), expectedError); + assert((client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createFeaturestore with LRO error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateFeaturestoreRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createFeaturestore(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateFeaturestoreProgress without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateFeaturestoreProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateFeaturestoreProgress with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateFeaturestoreProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateFeaturestore', () => { + it('invokes updateFeaturestore without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateFeaturestoreRequest()); + request.featurestore = {}; + request.featurestore.name = ''; + const expectedHeaderRequestParams = "featurestore.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateFeaturestore = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateFeaturestore(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateFeaturestore without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateFeaturestoreRequest()); + request.featurestore = {}; + request.featurestore.name = ''; + const expectedHeaderRequestParams = "featurestore.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateFeaturestore = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateFeaturestore( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateFeaturestore with call error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateFeaturestoreRequest()); + request.featurestore = {}; + request.featurestore.name = ''; + const expectedHeaderRequestParams = "featurestore.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFeaturestore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateFeaturestore(request), expectedError); + assert((client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateFeaturestore with LRO error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateFeaturestoreRequest()); + request.featurestore = {}; + request.featurestore.name = ''; + const expectedHeaderRequestParams = "featurestore.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateFeaturestore(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUpdateFeaturestoreProgress without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateFeaturestoreProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateFeaturestoreProgress with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateFeaturestoreProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteFeaturestore', () => { + it('invokes deleteFeaturestore without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteFeaturestoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteFeaturestore(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteFeaturestore without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteFeaturestoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteFeaturestore = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteFeaturestore( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteFeaturestore with call error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteFeaturestoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteFeaturestore(request), expectedError); + assert((client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteFeaturestore with LRO error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteFeaturestoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteFeaturestore(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteFeaturestoreProgress without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteFeaturestoreProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteFeaturestoreProgress with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteFeaturestoreProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createEntityType', () => { + it('invokes createEntityType without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateEntityTypeRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createEntityType = stubLongRunningCall(expectedResponse); + const [operation] = await client.createEntityType(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createEntityType without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateEntityTypeRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createEntityType = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEntityType( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createEntityType with call error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateEntityTypeRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createEntityType = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createEntityType(request), expectedError); + assert((client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createEntityType with LRO error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateEntityTypeRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createEntityType = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createEntityType(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateEntityTypeProgress without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateEntityTypeProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateEntityTypeProgress with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateEntityTypeProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteEntityType', () => { + it('invokes deleteEntityType without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteEntityTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteEntityType = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteEntityType(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteEntityType without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteEntityTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteEntityType = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEntityType( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteEntityType with call error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteEntityTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEntityType = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteEntityType(request), expectedError); + assert((client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteEntityType with LRO error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteEntityTypeRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEntityType = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteEntityType(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteEntityTypeProgress without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteEntityTypeProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteEntityTypeProgress with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteEntityTypeProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createFeature', () => { + it('invokes createFeature without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateFeatureRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createFeature = stubLongRunningCall(expectedResponse); + const [operation] = await client.createFeature(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createFeature without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateFeatureRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createFeature = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFeature( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createFeature with call error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateFeatureRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeature = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createFeature(request), expectedError); + assert((client.innerApiCalls.createFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createFeature with LRO error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateFeatureRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeature = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createFeature(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateFeatureProgress without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateFeatureProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateFeatureProgress with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateFeatureProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('batchCreateFeatures', () => { + it('invokes batchCreateFeatures without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchCreateFeatures(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchCreateFeatures without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.batchCreateFeatures = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchCreateFeatures( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes batchCreateFeatures with call error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchCreateFeatures(request), expectedError); + assert((client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchCreateFeatures with LRO error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchCreateFeatures(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkBatchCreateFeaturesProgress without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchCreateFeaturesProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchCreateFeaturesProgress with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkBatchCreateFeaturesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteFeature', () => { + it('invokes deleteFeature without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteFeatureRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteFeature = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteFeature(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteFeature without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteFeatureRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteFeature = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteFeature( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteFeature with call error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteFeatureRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeature = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteFeature(request), expectedError); + assert((client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteFeature with LRO error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteFeatureRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeature = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteFeature(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteFeatureProgress without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteFeatureProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteFeatureProgress with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteFeatureProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('importFeatureValues', () => { + it('invokes importFeatureValues without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.importFeatureValues = stubLongRunningCall(expectedResponse); + const [operation] = await client.importFeatureValues(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes importFeatureValues without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.importFeatureValues = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importFeatureValues( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes importFeatureValues with call error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.importFeatureValues = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.importFeatureValues(request), expectedError); + assert((client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes importFeatureValues with LRO error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.importFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.importFeatureValues(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkImportFeatureValuesProgress without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkImportFeatureValuesProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportFeatureValuesProgress with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkImportFeatureValuesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('batchReadFeatureValues', () => { + it('invokes batchReadFeatureValues without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadFeatureValuesRequest()); + request.featurestore = ''; + const expectedHeaderRequestParams = "featurestore="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchReadFeatureValues(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchReadFeatureValues without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadFeatureValuesRequest()); + request.featurestore = ''; + const expectedHeaderRequestParams = "featurestore="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.batchReadFeatureValues = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchReadFeatureValues( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes batchReadFeatureValues with call error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadFeatureValuesRequest()); + request.featurestore = ''; + const expectedHeaderRequestParams = "featurestore="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchReadFeatureValues(request), expectedError); + assert((client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchReadFeatureValues with LRO error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadFeatureValuesRequest()); + request.featurestore = ''; + const expectedHeaderRequestParams = "featurestore="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchReadFeatureValues(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkBatchReadFeatureValuesProgress without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchReadFeatureValuesProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchReadFeatureValuesProgress with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkBatchReadFeatureValuesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('exportFeatureValues', () => { + it('invokes exportFeatureValues without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.exportFeatureValues = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportFeatureValues(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes exportFeatureValues without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.exportFeatureValues = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportFeatureValues( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes exportFeatureValues with call error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportFeatureValues = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportFeatureValues(request), expectedError); + assert((client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes exportFeatureValues with LRO error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportFeatureValuesRequest()); + request.entityType = ''; + const expectedHeaderRequestParams = "entity_type="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportFeatureValues(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkExportFeatureValuesProgress without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkExportFeatureValuesProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportFeatureValuesProgress with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkExportFeatureValuesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listFeaturestores', () => { + it('invokes listFeaturestores without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), + ]; + client.innerApiCalls.listFeaturestores = stubSimpleCall(expectedResponse); + const [response] = await client.listFeaturestores(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listFeaturestores as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listFeaturestores without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), + ]; + client.innerApiCalls.listFeaturestores = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFeaturestores( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IFeaturestore[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listFeaturestores as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listFeaturestores with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listFeaturestores = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFeaturestores(request), expectedError); + assert((client.innerApiCalls.listFeaturestores as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listFeaturestoresStream without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), + ]; + client.descriptors.page.listFeaturestores.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listFeaturestoresStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Featurestore[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Featurestore) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listFeaturestores.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFeaturestores, request)); + assert.strictEqual( + (client.descriptors.page.listFeaturestores.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listFeaturestoresStream with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listFeaturestores.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listFeaturestoresStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Featurestore[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Featurestore) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listFeaturestores.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFeaturestores, request)); + assert.strictEqual( + (client.descriptors.page.listFeaturestores.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listFeaturestores without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), + ]; + client.descriptors.page.listFeaturestores.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IFeaturestore[] = []; + const iterable = client.listFeaturestoresAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listFeaturestores with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listFeaturestores.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listFeaturestoresAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IFeaturestore[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listEntityTypes', () => { + it('invokes listEntityTypes without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEntityTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), + ]; + client.innerApiCalls.listEntityTypes = stubSimpleCall(expectedResponse); + const [response] = await client.listEntityTypes(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listEntityTypes as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listEntityTypes without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEntityTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), + ]; + client.innerApiCalls.listEntityTypes = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEntityTypes( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IEntityType[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listEntityTypes as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listEntityTypes with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEntityTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listEntityTypes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEntityTypes(request), expectedError); + assert((client.innerApiCalls.listEntityTypes as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listEntityTypesStream without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEntityTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), + ]; + client.descriptors.page.listEntityTypes.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listEntityTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.EntityType[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.EntityType) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEntityTypes, request)); + assert.strictEqual( + (client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listEntityTypesStream with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEntityTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listEntityTypes.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listEntityTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.EntityType[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.EntityType) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEntityTypes, request)); + assert.strictEqual( + (client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listEntityTypes without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEntityTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), + ]; + client.descriptors.page.listEntityTypes.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IEntityType[] = []; + const iterable = client.listEntityTypesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listEntityTypes with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEntityTypesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listEntityTypes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEntityTypesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IEntityType[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listFeatures', () => { + it('invokes listFeatures without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + ]; + client.innerApiCalls.listFeatures = stubSimpleCall(expectedResponse); + const [response] = await client.listFeatures(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listFeatures without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + ]; + client.innerApiCalls.listFeatures = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFeatures( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IFeature[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listFeatures with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listFeatures = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFeatures(request), expectedError); + assert((client.innerApiCalls.listFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listFeaturesStream without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + ]; + client.descriptors.page.listFeatures.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listFeaturesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Feature[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Feature) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listFeatures.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFeatures, request)); + assert.strictEqual( + (client.descriptors.page.listFeatures.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listFeaturesStream with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listFeatures.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listFeaturesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Feature[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Feature) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listFeatures.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFeatures, request)); + assert.strictEqual( + (client.descriptors.page.listFeatures.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listFeatures without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + ]; + client.descriptors.page.listFeatures.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IFeature[] = []; + const iterable = client.listFeaturesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listFeatures.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listFeatures.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listFeatures with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listFeatures.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listFeaturesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IFeature[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listFeatures.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listFeatures.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('searchFeatures', () => { + it('invokes searchFeatures without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchFeaturesRequest()); + request.location = ''; + const expectedHeaderRequestParams = "location="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + ]; + client.innerApiCalls.searchFeatures = stubSimpleCall(expectedResponse); + const [response] = await client.searchFeatures(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.searchFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes searchFeatures without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchFeaturesRequest()); + request.location = ''; + const expectedHeaderRequestParams = "location="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + ]; + client.innerApiCalls.searchFeatures = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchFeatures( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IFeature[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.searchFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes searchFeatures with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchFeaturesRequest()); + request.location = ''; + const expectedHeaderRequestParams = "location="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.searchFeatures = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchFeatures(request), expectedError); + assert((client.innerApiCalls.searchFeatures as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes searchFeaturesStream without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchFeaturesRequest()); + request.location = ''; + const expectedHeaderRequestParams = "location="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + ]; + client.descriptors.page.searchFeatures.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchFeaturesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Feature[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Feature) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.searchFeatures.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchFeatures, request)); + assert.strictEqual( + (client.descriptors.page.searchFeatures.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes searchFeaturesStream with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchFeaturesRequest()); + request.location = ''; + const expectedHeaderRequestParams = "location="; + const expectedError = new Error('expected'); + client.descriptors.page.searchFeatures.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchFeaturesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Feature[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Feature) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchFeatures.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchFeatures, request)); + assert.strictEqual( + (client.descriptors.page.searchFeatures.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchFeatures without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchFeaturesRequest()); + request.location = ''; + const expectedHeaderRequestParams = "location="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), + ]; + client.descriptors.page.searchFeatures.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IFeature[] = []; + const iterable = client.searchFeaturesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchFeatures with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchFeaturesRequest()); + request.location = ''; + const expectedHeaderRequestParams = "location=";const expectedError = new Error('expected'); + client.descriptors.page.searchFeatures.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchFeaturesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IFeature[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts new file mode 100644 index 00000000..d462fff9 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts @@ -0,0 +1,3020 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as indexendpointserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.IndexEndpointServiceClient', () => { + it('has servicePath', () => { + const servicePath = indexendpointserviceModule.v1beta1.IndexEndpointServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = indexendpointserviceModule.v1beta1.IndexEndpointServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = indexendpointserviceModule.v1beta1.IndexEndpointServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.indexEndpointServiceStub, undefined); + await client.initialize(); + assert(client.indexEndpointServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.indexEndpointServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.indexEndpointServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getIndexEndpoint', () => { + it('invokes getIndexEndpoint without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetIndexEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()); + client.innerApiCalls.getIndexEndpoint = stubSimpleCall(expectedResponse); + const [response] = await client.getIndexEndpoint(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getIndexEndpoint without error using callback', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetIndexEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()); + client.innerApiCalls.getIndexEndpoint = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIndexEndpoint( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getIndexEndpoint with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetIndexEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIndexEndpoint = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIndexEndpoint(request), expectedError); + assert((client.innerApiCalls.getIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getIndexEndpoint with closed client', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetIndexEndpointRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIndexEndpoint(request), expectedError); + }); + }); + + describe('updateIndexEndpoint', () => { + it('invokes updateIndexEndpoint without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateIndexEndpointRequest()); + request.indexEndpoint = {}; + request.indexEndpoint.name = ''; + const expectedHeaderRequestParams = "index_endpoint.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()); + client.innerApiCalls.updateIndexEndpoint = stubSimpleCall(expectedResponse); + const [response] = await client.updateIndexEndpoint(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateIndexEndpoint without error using callback', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateIndexEndpointRequest()); + request.indexEndpoint = {}; + request.indexEndpoint.name = ''; + const expectedHeaderRequestParams = "index_endpoint.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()); + client.innerApiCalls.updateIndexEndpoint = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateIndexEndpoint( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateIndexEndpoint with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateIndexEndpointRequest()); + request.indexEndpoint = {}; + request.indexEndpoint.name = ''; + const expectedHeaderRequestParams = "index_endpoint.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateIndexEndpoint = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateIndexEndpoint(request), expectedError); + assert((client.innerApiCalls.updateIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateIndexEndpoint with closed client', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateIndexEndpointRequest()); + request.indexEndpoint = {}; + request.indexEndpoint.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateIndexEndpoint(request), expectedError); + }); + }); + + describe('createIndexEndpoint', () => { + it('invokes createIndexEndpoint without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateIndexEndpointRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(expectedResponse); + const [operation] = await client.createIndexEndpoint(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createIndexEndpoint without error using callback', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateIndexEndpointRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createIndexEndpoint = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createIndexEndpoint( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createIndexEndpoint with call error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateIndexEndpointRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createIndexEndpoint(request), expectedError); + assert((client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createIndexEndpoint with LRO error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateIndexEndpointRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createIndexEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateIndexEndpointProgress without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateIndexEndpointProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateIndexEndpointProgress with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateIndexEndpointProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteIndexEndpoint', () => { + it('invokes deleteIndexEndpoint without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteIndexEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteIndexEndpoint(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteIndexEndpoint without error using callback', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteIndexEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteIndexEndpoint( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteIndexEndpoint with call error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteIndexEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteIndexEndpoint(request), expectedError); + assert((client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteIndexEndpoint with LRO error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteIndexEndpointRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteIndexEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteIndexEndpointProgress without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteIndexEndpointProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteIndexEndpointProgress with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteIndexEndpointProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deployIndex', () => { + it('invokes deployIndex without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deployIndex = stubLongRunningCall(expectedResponse); + const [operation] = await client.deployIndex(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deployIndex without error using callback', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deployIndex = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deployIndex( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deployIndex with call error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deployIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deployIndex(request), expectedError); + assert((client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deployIndex with LRO error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deployIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deployIndex(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeployIndexProgress without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeployIndexProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeployIndexProgress with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeployIndexProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('undeployIndex', () => { + it('invokes undeployIndex without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UndeployIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.undeployIndex = stubLongRunningCall(expectedResponse); + const [operation] = await client.undeployIndex(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes undeployIndex without error using callback', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UndeployIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.undeployIndex = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeployIndex( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes undeployIndex with call error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UndeployIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.undeployIndex(request), expectedError); + assert((client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes undeployIndex with LRO error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UndeployIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.undeployIndex(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUndeployIndexProgress without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUndeployIndexProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeployIndexProgress with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUndeployIndexProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('mutateDeployedIndex', () => { + it('invokes mutateDeployedIndex without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MutateDeployedIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(expectedResponse); + const [operation] = await client.mutateDeployedIndex(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes mutateDeployedIndex without error using callback', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MutateDeployedIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.mutateDeployedIndex = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.mutateDeployedIndex( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes mutateDeployedIndex with call error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MutateDeployedIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.mutateDeployedIndex(request), expectedError); + assert((client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes mutateDeployedIndex with LRO error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MutateDeployedIndexRequest()); + request.indexEndpoint = ''; + const expectedHeaderRequestParams = "index_endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.mutateDeployedIndex(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkMutateDeployedIndexProgress without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkMutateDeployedIndexProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkMutateDeployedIndexProgress with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkMutateDeployedIndexProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listIndexEndpoints', () => { + it('invokes listIndexEndpoints without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), + ]; + client.innerApiCalls.listIndexEndpoints = stubSimpleCall(expectedResponse); + const [response] = await client.listIndexEndpoints(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listIndexEndpoints as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listIndexEndpoints without error using callback', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), + ]; + client.innerApiCalls.listIndexEndpoints = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listIndexEndpoints( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listIndexEndpoints as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listIndexEndpoints with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listIndexEndpoints = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listIndexEndpoints(request), expectedError); + assert((client.innerApiCalls.listIndexEndpoints as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listIndexEndpointsStream without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), + ]; + client.descriptors.page.listIndexEndpoints.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listIndexEndpointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.IndexEndpoint[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.IndexEndpoint) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listIndexEndpoints.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listIndexEndpoints, request)); + assert.strictEqual( + (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listIndexEndpointsStream with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listIndexEndpoints.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listIndexEndpointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.IndexEndpoint[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.IndexEndpoint) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listIndexEndpoints.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listIndexEndpoints, request)); + assert.strictEqual( + (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listIndexEndpoints without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), + ]; + client.descriptors.page.listIndexEndpoints.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint[] = []; + const iterable = client.listIndexEndpointsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listIndexEndpoints with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listIndexEndpoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listIndexEndpointsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1beta1/test/gapic_index_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_index_service_v1beta1.ts new file mode 100644 index 00000000..bb10c504 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_index_service_v1beta1.ts @@ -0,0 +1,2635 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as indexserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.IndexServiceClient', () => { + it('has servicePath', () => { + const servicePath = indexserviceModule.v1beta1.IndexServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = indexserviceModule.v1beta1.IndexServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = indexserviceModule.v1beta1.IndexServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.indexServiceStub, undefined); + await client.initialize(); + assert(client.indexServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.indexServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.indexServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getIndex', () => { + it('invokes getIndex without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetIndexRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()); + client.innerApiCalls.getIndex = stubSimpleCall(expectedResponse); + const [response] = await client.getIndex(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getIndex without error using callback', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetIndexRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()); + client.innerApiCalls.getIndex = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIndex( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IIndex|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getIndex with error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetIndexRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIndex = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIndex(request), expectedError); + assert((client.innerApiCalls.getIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getIndex with closed client', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetIndexRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIndex(request), expectedError); + }); + }); + + describe('createIndex', () => { + it('invokes createIndex without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateIndexRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createIndex = stubLongRunningCall(expectedResponse); + const [operation] = await client.createIndex(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createIndex without error using callback', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateIndexRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createIndex = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createIndex( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createIndex with call error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateIndexRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createIndex(request), expectedError); + assert((client.innerApiCalls.createIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createIndex with LRO error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateIndexRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createIndex(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateIndexProgress without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateIndexProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateIndexProgress with error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateIndexProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateIndex', () => { + it('invokes updateIndex without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateIndexRequest()); + request.index = {}; + request.index.name = ''; + const expectedHeaderRequestParams = "index.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateIndex = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateIndex(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateIndex without error using callback', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateIndexRequest()); + request.index = {}; + request.index.name = ''; + const expectedHeaderRequestParams = "index.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateIndex = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateIndex( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateIndex with call error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateIndexRequest()); + request.index = {}; + request.index.name = ''; + const expectedHeaderRequestParams = "index.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateIndex(request), expectedError); + assert((client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateIndex with LRO error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateIndexRequest()); + request.index = {}; + request.index.name = ''; + const expectedHeaderRequestParams = "index.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateIndex(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUpdateIndexProgress without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateIndexProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateIndexProgress with error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateIndexProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteIndex', () => { + it('invokes deleteIndex without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteIndexRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteIndex = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteIndex(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteIndex without error using callback', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteIndexRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteIndex = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteIndex( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteIndex with call error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteIndexRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteIndex(request), expectedError); + assert((client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteIndex with LRO error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteIndexRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteIndex(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteIndexProgress without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteIndexProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteIndexProgress with error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteIndexProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listIndexes', () => { + it('invokes listIndexes without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), + ]; + client.innerApiCalls.listIndexes = stubSimpleCall(expectedResponse); + const [response] = await client.listIndexes(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listIndexes as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listIndexes without error using callback', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), + ]; + client.innerApiCalls.listIndexes = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listIndexes( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IIndex[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listIndexes as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listIndexes with error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listIndexes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listIndexes(request), expectedError); + assert((client.innerApiCalls.listIndexes as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listIndexesStream without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), + ]; + client.descriptors.page.listIndexes.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listIndexesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Index[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Index) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listIndexes.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listIndexes, request)); + assert.strictEqual( + (client.descriptors.page.listIndexes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listIndexesStream with error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listIndexes.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listIndexesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Index[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Index) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listIndexes.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listIndexes, request)); + assert.strictEqual( + (client.descriptors.page.listIndexes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listIndexes without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), + ]; + client.descriptors.page.listIndexes.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IIndex[] = []; + const iterable = client.listIndexesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listIndexes.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listIndexes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listIndexes with error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listIndexes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listIndexesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IIndex[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listIndexes.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listIndexes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1beta1/test/gapic_job_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_job_service_v1beta1.ts new file mode 100644 index 00000000..a5eaabea --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_job_service_v1beta1.ts @@ -0,0 +1,5637 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as jobserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.JobServiceClient', () => { + it('has servicePath', () => { + const servicePath = jobserviceModule.v1beta1.JobServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = jobserviceModule.v1beta1.JobServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = jobserviceModule.v1beta1.JobServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new jobserviceModule.v1beta1.JobServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.jobServiceStub, undefined); + await client.initialize(); + assert(client.jobServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.jobServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.jobServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('createCustomJob', () => { + it('invokes createCustomJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateCustomJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()); + client.innerApiCalls.createCustomJob = stubSimpleCall(expectedResponse); + const [response] = await client.createCustomJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createCustomJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateCustomJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()); + client.innerApiCalls.createCustomJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCustomJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ICustomJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createCustomJob with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateCustomJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCustomJob(request), expectedError); + assert((client.innerApiCalls.createCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createCustomJob with closed client', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateCustomJobRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createCustomJob(request), expectedError); + }); + }); + + describe('getCustomJob', () => { + it('invokes getCustomJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()); + client.innerApiCalls.getCustomJob = stubSimpleCall(expectedResponse); + const [response] = await client.getCustomJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getCustomJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()); + client.innerApiCalls.getCustomJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCustomJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ICustomJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getCustomJob with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getCustomJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCustomJob(request), expectedError); + assert((client.innerApiCalls.getCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getCustomJob with closed client', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetCustomJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCustomJob(request), expectedError); + }); + }); + + describe('cancelCustomJob', () => { + it('invokes cancelCustomJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelCustomJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelCustomJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelCustomJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelCustomJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelCustomJob( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes cancelCustomJob with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelCustomJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelCustomJob(request), expectedError); + assert((client.innerApiCalls.cancelCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelCustomJob with closed client', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelCustomJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelCustomJob(request), expectedError); + }); + }); + + describe('createDataLabelingJob', () => { + it('invokes createDataLabelingJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateDataLabelingJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()); + client.innerApiCalls.createDataLabelingJob = stubSimpleCall(expectedResponse); + const [response] = await client.createDataLabelingJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createDataLabelingJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateDataLabelingJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()); + client.innerApiCalls.createDataLabelingJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDataLabelingJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createDataLabelingJob with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateDataLabelingJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataLabelingJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDataLabelingJob(request), expectedError); + assert((client.innerApiCalls.createDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createDataLabelingJob with closed client', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateDataLabelingJobRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDataLabelingJob(request), expectedError); + }); + }); + + describe('getDataLabelingJob', () => { + it('invokes getDataLabelingJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()); + client.innerApiCalls.getDataLabelingJob = stubSimpleCall(expectedResponse); + const [response] = await client.getDataLabelingJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDataLabelingJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()); + client.innerApiCalls.getDataLabelingJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataLabelingJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getDataLabelingJob with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataLabelingJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataLabelingJob(request), expectedError); + assert((client.innerApiCalls.getDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getDataLabelingJob with closed client', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetDataLabelingJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataLabelingJob(request), expectedError); + }); + }); + + describe('cancelDataLabelingJob', () => { + it('invokes cancelDataLabelingJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelDataLabelingJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelDataLabelingJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelDataLabelingJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelDataLabelingJob( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes cancelDataLabelingJob with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelDataLabelingJob(request), expectedError); + assert((client.innerApiCalls.cancelDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelDataLabelingJob with closed client', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelDataLabelingJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelDataLabelingJob(request), expectedError); + }); + }); + + describe('createHyperparameterTuningJob', () => { + it('invokes createHyperparameterTuningJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateHyperparameterTuningJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()); + client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCall(expectedResponse); + const [response] = await client.createHyperparameterTuningJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createHyperparameterTuningJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateHyperparameterTuningJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()); + client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createHyperparameterTuningJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createHyperparameterTuningJob with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateHyperparameterTuningJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createHyperparameterTuningJob(request), expectedError); + assert((client.innerApiCalls.createHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createHyperparameterTuningJob with closed client', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateHyperparameterTuningJobRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createHyperparameterTuningJob(request), expectedError); + }); + }); + + describe('getHyperparameterTuningJob', () => { + it('invokes getHyperparameterTuningJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()); + client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCall(expectedResponse); + const [response] = await client.getHyperparameterTuningJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getHyperparameterTuningJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()); + client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getHyperparameterTuningJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getHyperparameterTuningJob with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getHyperparameterTuningJob(request), expectedError); + assert((client.innerApiCalls.getHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getHyperparameterTuningJob with closed client', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetHyperparameterTuningJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getHyperparameterTuningJob(request), expectedError); + }); + }); + + describe('cancelHyperparameterTuningJob', () => { + it('invokes cancelHyperparameterTuningJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelHyperparameterTuningJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelHyperparameterTuningJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelHyperparameterTuningJob( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes cancelHyperparameterTuningJob with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelHyperparameterTuningJob(request), expectedError); + assert((client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelHyperparameterTuningJob with closed client', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelHyperparameterTuningJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelHyperparameterTuningJob(request), expectedError); + }); + }); + + describe('createBatchPredictionJob', () => { + it('invokes createBatchPredictionJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateBatchPredictionJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()); + client.innerApiCalls.createBatchPredictionJob = stubSimpleCall(expectedResponse); + const [response] = await client.createBatchPredictionJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createBatchPredictionJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateBatchPredictionJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()); + client.innerApiCalls.createBatchPredictionJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBatchPredictionJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createBatchPredictionJob with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateBatchPredictionJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createBatchPredictionJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createBatchPredictionJob(request), expectedError); + assert((client.innerApiCalls.createBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createBatchPredictionJob with closed client', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateBatchPredictionJobRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createBatchPredictionJob(request), expectedError); + }); + }); + + describe('getBatchPredictionJob', () => { + it('invokes getBatchPredictionJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()); + client.innerApiCalls.getBatchPredictionJob = stubSimpleCall(expectedResponse); + const [response] = await client.getBatchPredictionJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getBatchPredictionJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()); + client.innerApiCalls.getBatchPredictionJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBatchPredictionJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getBatchPredictionJob with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getBatchPredictionJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBatchPredictionJob(request), expectedError); + assert((client.innerApiCalls.getBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getBatchPredictionJob with closed client', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetBatchPredictionJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBatchPredictionJob(request), expectedError); + }); + }); + + describe('cancelBatchPredictionJob', () => { + it('invokes cancelBatchPredictionJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelBatchPredictionJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelBatchPredictionJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelBatchPredictionJob( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes cancelBatchPredictionJob with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelBatchPredictionJob(request), expectedError); + assert((client.innerApiCalls.cancelBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelBatchPredictionJob with closed client', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelBatchPredictionJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelBatchPredictionJob(request), expectedError); + }); + }); + + describe('createModelDeploymentMonitoringJob', () => { + it('invokes createModelDeploymentMonitoringJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateModelDeploymentMonitoringJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()); + client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); + const [response] = await client.createModelDeploymentMonitoringJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createModelDeploymentMonitoringJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateModelDeploymentMonitoringJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()); + client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createModelDeploymentMonitoringJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createModelDeploymentMonitoringJob with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateModelDeploymentMonitoringJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createModelDeploymentMonitoringJob(request), expectedError); + assert((client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createModelDeploymentMonitoringJob with closed client', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateModelDeploymentMonitoringJobRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createModelDeploymentMonitoringJob(request), expectedError); + }); + }); + + describe('getModelDeploymentMonitoringJob', () => { + it('invokes getModelDeploymentMonitoringJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()); + client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); + const [response] = await client.getModelDeploymentMonitoringJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getModelDeploymentMonitoringJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()); + client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModelDeploymentMonitoringJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getModelDeploymentMonitoringJob with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModelDeploymentMonitoringJob(request), expectedError); + assert((client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getModelDeploymentMonitoringJob with closed client', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getModelDeploymentMonitoringJob(request), expectedError); + }); + }); + + describe('pauseModelDeploymentMonitoringJob', () => { + it('invokes pauseModelDeploymentMonitoringJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PauseModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); + const [response] = await client.pauseModelDeploymentMonitoringJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes pauseModelDeploymentMonitoringJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PauseModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pauseModelDeploymentMonitoringJob( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes pauseModelDeploymentMonitoringJob with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PauseModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.pauseModelDeploymentMonitoringJob(request), expectedError); + assert((client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes pauseModelDeploymentMonitoringJob with closed client', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PauseModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.pauseModelDeploymentMonitoringJob(request), expectedError); + }); + }); + + describe('resumeModelDeploymentMonitoringJob', () => { + it('invokes resumeModelDeploymentMonitoringJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ResumeModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); + const [response] = await client.resumeModelDeploymentMonitoringJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes resumeModelDeploymentMonitoringJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ResumeModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resumeModelDeploymentMonitoringJob( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes resumeModelDeploymentMonitoringJob with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ResumeModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.resumeModelDeploymentMonitoringJob(request), expectedError); + assert((client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes resumeModelDeploymentMonitoringJob with closed client', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ResumeModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.resumeModelDeploymentMonitoringJob(request), expectedError); + }); + }); + + describe('deleteCustomJob', () => { + it('invokes deleteCustomJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteCustomJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCustomJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteCustomJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteCustomJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCustomJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteCustomJob with call error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteCustomJob(request), expectedError); + assert((client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteCustomJob with LRO error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteCustomJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteCustomJob(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteCustomJobProgress without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteCustomJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteCustomJobProgress with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteCustomJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteDataLabelingJob', () => { + it('invokes deleteDataLabelingJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteDataLabelingJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteDataLabelingJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDataLabelingJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteDataLabelingJob with call error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteDataLabelingJob(request), expectedError); + assert((client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteDataLabelingJob with LRO error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteDataLabelingJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteDataLabelingJob(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteDataLabelingJobProgress without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteDataLabelingJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteDataLabelingJobProgress with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteDataLabelingJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteHyperparameterTuningJob', () => { + it('invokes deleteHyperparameterTuningJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteHyperparameterTuningJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteHyperparameterTuningJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteHyperparameterTuningJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteHyperparameterTuningJob with call error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteHyperparameterTuningJob(request), expectedError); + assert((client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteHyperparameterTuningJob with LRO error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteHyperparameterTuningJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteHyperparameterTuningJob(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteHyperparameterTuningJobProgress without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteHyperparameterTuningJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteHyperparameterTuningJobProgress with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteHyperparameterTuningJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteBatchPredictionJob', () => { + it('invokes deleteBatchPredictionJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBatchPredictionJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteBatchPredictionJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBatchPredictionJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteBatchPredictionJob with call error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteBatchPredictionJob(request), expectedError); + assert((client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteBatchPredictionJob with LRO error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteBatchPredictionJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteBatchPredictionJob(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteBatchPredictionJobProgress without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteBatchPredictionJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBatchPredictionJobProgress with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteBatchPredictionJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateModelDeploymentMonitoringJob', () => { + it('invokes updateModelDeploymentMonitoringJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateModelDeploymentMonitoringJobRequest()); + request.modelDeploymentMonitoringJob = {}; + request.modelDeploymentMonitoringJob.name = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateModelDeploymentMonitoringJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateModelDeploymentMonitoringJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateModelDeploymentMonitoringJobRequest()); + request.modelDeploymentMonitoringJob = {}; + request.modelDeploymentMonitoringJob.name = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateModelDeploymentMonitoringJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateModelDeploymentMonitoringJob with call error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateModelDeploymentMonitoringJobRequest()); + request.modelDeploymentMonitoringJob = {}; + request.modelDeploymentMonitoringJob.name = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateModelDeploymentMonitoringJob(request), expectedError); + assert((client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateModelDeploymentMonitoringJob with LRO error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateModelDeploymentMonitoringJobRequest()); + request.modelDeploymentMonitoringJob = {}; + request.modelDeploymentMonitoringJob.name = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateModelDeploymentMonitoringJob(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUpdateModelDeploymentMonitoringJobProgress without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateModelDeploymentMonitoringJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateModelDeploymentMonitoringJobProgress with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateModelDeploymentMonitoringJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteModelDeploymentMonitoringJob', () => { + it('invokes deleteModelDeploymentMonitoringJob without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteModelDeploymentMonitoringJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteModelDeploymentMonitoringJob without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteModelDeploymentMonitoringJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteModelDeploymentMonitoringJob with call error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteModelDeploymentMonitoringJob(request), expectedError); + assert((client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteModelDeploymentMonitoringJob with LRO error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelDeploymentMonitoringJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteModelDeploymentMonitoringJob(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteModelDeploymentMonitoringJobProgress without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteModelDeploymentMonitoringJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteModelDeploymentMonitoringJobProgress with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteModelDeploymentMonitoringJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listCustomJobs', () => { + it('invokes listCustomJobs without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListCustomJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), + ]; + client.innerApiCalls.listCustomJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listCustomJobs(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listCustomJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listCustomJobs without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListCustomJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), + ]; + client.innerApiCalls.listCustomJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCustomJobs( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ICustomJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listCustomJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listCustomJobs with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListCustomJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listCustomJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCustomJobs(request), expectedError); + assert((client.innerApiCalls.listCustomJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listCustomJobsStream without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListCustomJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), + ]; + client.descriptors.page.listCustomJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listCustomJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.CustomJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.CustomJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listCustomJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomJobs, request)); + assert.strictEqual( + (client.descriptors.page.listCustomJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listCustomJobsStream with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListCustomJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listCustomJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.CustomJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.CustomJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listCustomJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCustomJobs, request)); + assert.strictEqual( + (client.descriptors.page.listCustomJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listCustomJobs without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListCustomJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), + ]; + client.descriptors.page.listCustomJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.ICustomJob[] = []; + const iterable = client.listCustomJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listCustomJobs with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListCustomJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listCustomJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCustomJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.ICustomJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listDataLabelingJobs', () => { + it('invokes listDataLabelingJobs without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataLabelingJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), + ]; + client.innerApiCalls.listDataLabelingJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listDataLabelingJobs(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDataLabelingJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDataLabelingJobs without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataLabelingJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), + ]; + client.innerApiCalls.listDataLabelingJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDataLabelingJobs( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDataLabelingJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listDataLabelingJobs with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataLabelingJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataLabelingJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDataLabelingJobs(request), expectedError); + assert((client.innerApiCalls.listDataLabelingJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDataLabelingJobsStream without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataLabelingJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), + ]; + client.descriptors.page.listDataLabelingJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDataLabelingJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.DataLabelingJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DataLabelingJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDataLabelingJobs, request)); + assert.strictEqual( + (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listDataLabelingJobsStream with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataLabelingJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listDataLabelingJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDataLabelingJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.DataLabelingJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DataLabelingJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDataLabelingJobs, request)); + assert.strictEqual( + (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDataLabelingJobs without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataLabelingJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), + ]; + client.descriptors.page.listDataLabelingJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob[] = []; + const iterable = client.listDataLabelingJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDataLabelingJobs with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataLabelingJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listDataLabelingJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDataLabelingJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listHyperparameterTuningJobs', () => { + it('invokes listHyperparameterTuningJobs without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), + ]; + client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listHyperparameterTuningJobs(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listHyperparameterTuningJobs without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), + ]; + client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listHyperparameterTuningJobs( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listHyperparameterTuningJobs with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listHyperparameterTuningJobs(request), expectedError); + assert((client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listHyperparameterTuningJobsStream without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), + ]; + client.descriptors.page.listHyperparameterTuningJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listHyperparameterTuningJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listHyperparameterTuningJobs, request)); + assert.strictEqual( + (client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listHyperparameterTuningJobsStream with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listHyperparameterTuningJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listHyperparameterTuningJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listHyperparameterTuningJobs, request)); + assert.strictEqual( + (client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listHyperparameterTuningJobs without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), + ]; + client.descriptors.page.listHyperparameterTuningJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob[] = []; + const iterable = client.listHyperparameterTuningJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listHyperparameterTuningJobs with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listHyperparameterTuningJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listHyperparameterTuningJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listBatchPredictionJobs', () => { + it('invokes listBatchPredictionJobs without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), + ]; + client.innerApiCalls.listBatchPredictionJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listBatchPredictionJobs(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listBatchPredictionJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listBatchPredictionJobs without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), + ]; + client.innerApiCalls.listBatchPredictionJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBatchPredictionJobs( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listBatchPredictionJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listBatchPredictionJobs with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listBatchPredictionJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBatchPredictionJobs(request), expectedError); + assert((client.innerApiCalls.listBatchPredictionJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listBatchPredictionJobsStream without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), + ]; + client.descriptors.page.listBatchPredictionJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBatchPredictionJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBatchPredictionJobs, request)); + assert.strictEqual( + (client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listBatchPredictionJobsStream with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listBatchPredictionJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listBatchPredictionJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBatchPredictionJobs, request)); + assert.strictEqual( + (client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listBatchPredictionJobs without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), + ]; + client.descriptors.page.listBatchPredictionJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob[] = []; + const iterable = client.listBatchPredictionJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listBatchPredictionJobs with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listBatchPredictionJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBatchPredictionJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('searchModelDeploymentMonitoringStatsAnomalies', () => { + it('invokes searchModelDeploymentMonitoringStatsAnomalies without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); + request.modelDeploymentMonitoringJob = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), + ]; + client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCall(expectedResponse); + const [response] = await client.searchModelDeploymentMonitoringStatsAnomalies(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes searchModelDeploymentMonitoringStatsAnomalies without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); + request.modelDeploymentMonitoringJob = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), + ]; + client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchModelDeploymentMonitoringStatsAnomalies( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModelMonitoringStatsAnomalies[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes searchModelDeploymentMonitoringStatsAnomalies with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); + request.modelDeploymentMonitoringJob = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchModelDeploymentMonitoringStatsAnomalies(request), expectedError); + assert((client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes searchModelDeploymentMonitoringStatsAnomaliesStream without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); + request.modelDeploymentMonitoringJob = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), + ]; + client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchModelDeploymentMonitoringStatsAnomaliesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies, request)); + assert.strictEqual( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes searchModelDeploymentMonitoringStatsAnomaliesStream with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); + request.modelDeploymentMonitoringJob = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job="; + const expectedError = new Error('expected'); + client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchModelDeploymentMonitoringStatsAnomaliesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies, request)); + assert.strictEqual( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchModelDeploymentMonitoringStatsAnomalies without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); + request.modelDeploymentMonitoringJob = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), + ]; + client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IModelMonitoringStatsAnomalies[] = []; + const iterable = client.searchModelDeploymentMonitoringStatsAnomaliesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchModelDeploymentMonitoringStatsAnomalies with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); + request.modelDeploymentMonitoringJob = ''; + const expectedHeaderRequestParams = "model_deployment_monitoring_job=";const expectedError = new Error('expected'); + client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchModelDeploymentMonitoringStatsAnomaliesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IModelMonitoringStatsAnomalies[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listModelDeploymentMonitoringJobs', () => { + it('invokes listModelDeploymentMonitoringJobs without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelDeploymentMonitoringJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), + ]; + client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listModelDeploymentMonitoringJobs(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listModelDeploymentMonitoringJobs without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelDeploymentMonitoringJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), + ]; + client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModelDeploymentMonitoringJobs( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listModelDeploymentMonitoringJobs with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelDeploymentMonitoringJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModelDeploymentMonitoringJobs(request), expectedError); + assert((client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listModelDeploymentMonitoringJobsStream without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelDeploymentMonitoringJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), + ]; + client.descriptors.page.listModelDeploymentMonitoringJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listModelDeploymentMonitoringJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModelDeploymentMonitoringJobs, request)); + assert.strictEqual( + (client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listModelDeploymentMonitoringJobsStream with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelDeploymentMonitoringJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listModelDeploymentMonitoringJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listModelDeploymentMonitoringJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModelDeploymentMonitoringJobs, request)); + assert.strictEqual( + (client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listModelDeploymentMonitoringJobs without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelDeploymentMonitoringJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), + ]; + client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob[] = []; + const iterable = client.listModelDeploymentMonitoringJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listModelDeploymentMonitoringJobs with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelDeploymentMonitoringJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listModelDeploymentMonitoringJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1beta1/test/gapic_metadata_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_metadata_service_v1beta1.ts new file mode 100644 index 00000000..b8e83757 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_metadata_service_v1beta1.ts @@ -0,0 +1,5934 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as metadataserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.MetadataServiceClient', () => { + it('has servicePath', () => { + const servicePath = metadataserviceModule.v1beta1.MetadataServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = metadataserviceModule.v1beta1.MetadataServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = metadataserviceModule.v1beta1.MetadataServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.metadataServiceStub, undefined); + await client.initialize(); + assert(client.metadataServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.metadataServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.metadataServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getMetadataStore', () => { + it('invokes getMetadataStore without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetMetadataStoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()); + client.innerApiCalls.getMetadataStore = stubSimpleCall(expectedResponse); + const [response] = await client.getMetadataStore(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getMetadataStore without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetMetadataStoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()); + client.innerApiCalls.getMetadataStore = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMetadataStore( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IMetadataStore|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getMetadataStore with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetMetadataStoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getMetadataStore = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMetadataStore(request), expectedError); + assert((client.innerApiCalls.getMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getMetadataStore with closed client', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetMetadataStoreRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMetadataStore(request), expectedError); + }); + }); + + describe('createArtifact', () => { + it('invokes createArtifact without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateArtifactRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()); + client.innerApiCalls.createArtifact = stubSimpleCall(expectedResponse); + const [response] = await client.createArtifact(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createArtifact without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateArtifactRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()); + client.innerApiCalls.createArtifact = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createArtifact( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IArtifact|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createArtifact with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateArtifactRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createArtifact = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createArtifact(request), expectedError); + assert((client.innerApiCalls.createArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createArtifact with closed client', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateArtifactRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createArtifact(request), expectedError); + }); + }); + + describe('getArtifact', () => { + it('invokes getArtifact without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetArtifactRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()); + client.innerApiCalls.getArtifact = stubSimpleCall(expectedResponse); + const [response] = await client.getArtifact(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getArtifact without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetArtifactRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()); + client.innerApiCalls.getArtifact = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getArtifact( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IArtifact|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getArtifact with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetArtifactRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getArtifact = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getArtifact(request), expectedError); + assert((client.innerApiCalls.getArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getArtifact with closed client', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetArtifactRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getArtifact(request), expectedError); + }); + }); + + describe('updateArtifact', () => { + it('invokes updateArtifact without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateArtifactRequest()); + request.artifact = {}; + request.artifact.name = ''; + const expectedHeaderRequestParams = "artifact.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()); + client.innerApiCalls.updateArtifact = stubSimpleCall(expectedResponse); + const [response] = await client.updateArtifact(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateArtifact without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateArtifactRequest()); + request.artifact = {}; + request.artifact.name = ''; + const expectedHeaderRequestParams = "artifact.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()); + client.innerApiCalls.updateArtifact = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateArtifact( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IArtifact|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateArtifact with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateArtifactRequest()); + request.artifact = {}; + request.artifact.name = ''; + const expectedHeaderRequestParams = "artifact.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateArtifact = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateArtifact(request), expectedError); + assert((client.innerApiCalls.updateArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateArtifact with closed client', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateArtifactRequest()); + request.artifact = {}; + request.artifact.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateArtifact(request), expectedError); + }); + }); + + describe('createContext', () => { + it('invokes createContext without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateContextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()); + client.innerApiCalls.createContext = stubSimpleCall(expectedResponse); + const [response] = await client.createContext(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createContext without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateContextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()); + client.innerApiCalls.createContext = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createContext( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IContext|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createContext with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateContextRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createContext = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createContext(request), expectedError); + assert((client.innerApiCalls.createContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createContext with closed client', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateContextRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createContext(request), expectedError); + }); + }); + + describe('getContext', () => { + it('invokes getContext without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetContextRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()); + client.innerApiCalls.getContext = stubSimpleCall(expectedResponse); + const [response] = await client.getContext(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getContext without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetContextRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()); + client.innerApiCalls.getContext = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getContext( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IContext|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getContext with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetContextRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getContext = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getContext(request), expectedError); + assert((client.innerApiCalls.getContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getContext with closed client', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetContextRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getContext(request), expectedError); + }); + }); + + describe('updateContext', () => { + it('invokes updateContext without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateContextRequest()); + request.context = {}; + request.context.name = ''; + const expectedHeaderRequestParams = "context.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()); + client.innerApiCalls.updateContext = stubSimpleCall(expectedResponse); + const [response] = await client.updateContext(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateContext without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateContextRequest()); + request.context = {}; + request.context.name = ''; + const expectedHeaderRequestParams = "context.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()); + client.innerApiCalls.updateContext = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateContext( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IContext|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateContext with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateContextRequest()); + request.context = {}; + request.context.name = ''; + const expectedHeaderRequestParams = "context.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateContext = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateContext(request), expectedError); + assert((client.innerApiCalls.updateContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateContext with closed client', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateContextRequest()); + request.context = {}; + request.context.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateContext(request), expectedError); + }); + }); + + describe('addContextArtifactsAndExecutions', () => { + it('invokes addContextArtifactsAndExecutions without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsRequest()); + request.context = ''; + const expectedHeaderRequestParams = "context="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsResponse()); + client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCall(expectedResponse); + const [response] = await client.addContextArtifactsAndExecutions(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes addContextArtifactsAndExecutions without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsRequest()); + request.context = ''; + const expectedHeaderRequestParams = "context="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsResponse()); + client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addContextArtifactsAndExecutions( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes addContextArtifactsAndExecutions with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsRequest()); + request.context = ''; + const expectedHeaderRequestParams = "context="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addContextArtifactsAndExecutions(request), expectedError); + assert((client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes addContextArtifactsAndExecutions with closed client', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsRequest()); + request.context = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.addContextArtifactsAndExecutions(request), expectedError); + }); + }); + + describe('addContextChildren', () => { + it('invokes addContextChildren without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextChildrenRequest()); + request.context = ''; + const expectedHeaderRequestParams = "context="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextChildrenResponse()); + client.innerApiCalls.addContextChildren = stubSimpleCall(expectedResponse); + const [response] = await client.addContextChildren(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addContextChildren as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes addContextChildren without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextChildrenRequest()); + request.context = ''; + const expectedHeaderRequestParams = "context="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextChildrenResponse()); + client.innerApiCalls.addContextChildren = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addContextChildren( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addContextChildren as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes addContextChildren with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextChildrenRequest()); + request.context = ''; + const expectedHeaderRequestParams = "context="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addContextChildren = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addContextChildren(request), expectedError); + assert((client.innerApiCalls.addContextChildren as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes addContextChildren with closed client', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextChildrenRequest()); + request.context = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.addContextChildren(request), expectedError); + }); + }); + + describe('queryContextLineageSubgraph', () => { + it('invokes queryContextLineageSubgraph without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryContextLineageSubgraphRequest()); + request.context = ''; + const expectedHeaderRequestParams = "context="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph()); + client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCall(expectedResponse); + const [response] = await client.queryContextLineageSubgraph(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryContextLineageSubgraph as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryContextLineageSubgraph without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryContextLineageSubgraphRequest()); + request.context = ''; + const expectedHeaderRequestParams = "context="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph()); + client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryContextLineageSubgraph( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryContextLineageSubgraph as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes queryContextLineageSubgraph with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryContextLineageSubgraphRequest()); + request.context = ''; + const expectedHeaderRequestParams = "context="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryContextLineageSubgraph(request), expectedError); + assert((client.innerApiCalls.queryContextLineageSubgraph as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryContextLineageSubgraph with closed client', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryContextLineageSubgraphRequest()); + request.context = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.queryContextLineageSubgraph(request), expectedError); + }); + }); + + describe('createExecution', () => { + it('invokes createExecution without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateExecutionRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()); + client.innerApiCalls.createExecution = stubSimpleCall(expectedResponse); + const [response] = await client.createExecution(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createExecution without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateExecutionRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()); + client.innerApiCalls.createExecution = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createExecution( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IExecution|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createExecution with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateExecutionRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createExecution = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createExecution(request), expectedError); + assert((client.innerApiCalls.createExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createExecution with closed client', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateExecutionRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createExecution(request), expectedError); + }); + }); + + describe('getExecution', () => { + it('invokes getExecution without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetExecutionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()); + client.innerApiCalls.getExecution = stubSimpleCall(expectedResponse); + const [response] = await client.getExecution(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getExecution without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetExecutionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()); + client.innerApiCalls.getExecution = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getExecution( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IExecution|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getExecution with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetExecutionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getExecution = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getExecution(request), expectedError); + assert((client.innerApiCalls.getExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getExecution with closed client', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetExecutionRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getExecution(request), expectedError); + }); + }); + + describe('updateExecution', () => { + it('invokes updateExecution without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateExecutionRequest()); + request.execution = {}; + request.execution.name = ''; + const expectedHeaderRequestParams = "execution.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()); + client.innerApiCalls.updateExecution = stubSimpleCall(expectedResponse); + const [response] = await client.updateExecution(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateExecution without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateExecutionRequest()); + request.execution = {}; + request.execution.name = ''; + const expectedHeaderRequestParams = "execution.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()); + client.innerApiCalls.updateExecution = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExecution( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IExecution|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateExecution with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateExecutionRequest()); + request.execution = {}; + request.execution.name = ''; + const expectedHeaderRequestParams = "execution.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExecution = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateExecution(request), expectedError); + assert((client.innerApiCalls.updateExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateExecution with closed client', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateExecutionRequest()); + request.execution = {}; + request.execution.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateExecution(request), expectedError); + }); + }); + + describe('addExecutionEvents', () => { + it('invokes addExecutionEvents without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddExecutionEventsRequest()); + request.execution = ''; + const expectedHeaderRequestParams = "execution="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddExecutionEventsResponse()); + client.innerApiCalls.addExecutionEvents = stubSimpleCall(expectedResponse); + const [response] = await client.addExecutionEvents(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addExecutionEvents as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes addExecutionEvents without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddExecutionEventsRequest()); + request.execution = ''; + const expectedHeaderRequestParams = "execution="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddExecutionEventsResponse()); + client.innerApiCalls.addExecutionEvents = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addExecutionEvents( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addExecutionEvents as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes addExecutionEvents with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddExecutionEventsRequest()); + request.execution = ''; + const expectedHeaderRequestParams = "execution="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addExecutionEvents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addExecutionEvents(request), expectedError); + assert((client.innerApiCalls.addExecutionEvents as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes addExecutionEvents with closed client', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddExecutionEventsRequest()); + request.execution = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.addExecutionEvents(request), expectedError); + }); + }); + + describe('queryExecutionInputsAndOutputs', () => { + it('invokes queryExecutionInputsAndOutputs without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryExecutionInputsAndOutputsRequest()); + request.execution = ''; + const expectedHeaderRequestParams = "execution="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph()); + client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCall(expectedResponse); + const [response] = await client.queryExecutionInputsAndOutputs(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryExecutionInputsAndOutputs without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryExecutionInputsAndOutputsRequest()); + request.execution = ''; + const expectedHeaderRequestParams = "execution="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph()); + client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryExecutionInputsAndOutputs( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes queryExecutionInputsAndOutputs with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryExecutionInputsAndOutputsRequest()); + request.execution = ''; + const expectedHeaderRequestParams = "execution="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryExecutionInputsAndOutputs(request), expectedError); + assert((client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryExecutionInputsAndOutputs with closed client', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryExecutionInputsAndOutputsRequest()); + request.execution = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.queryExecutionInputsAndOutputs(request), expectedError); + }); + }); + + describe('createMetadataSchema', () => { + it('invokes createMetadataSchema without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateMetadataSchemaRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()); + client.innerApiCalls.createMetadataSchema = stubSimpleCall(expectedResponse); + const [response] = await client.createMetadataSchema(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createMetadataSchema as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createMetadataSchema without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateMetadataSchemaRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()); + client.innerApiCalls.createMetadataSchema = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMetadataSchema( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IMetadataSchema|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createMetadataSchema as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createMetadataSchema with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateMetadataSchemaRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createMetadataSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createMetadataSchema(request), expectedError); + assert((client.innerApiCalls.createMetadataSchema as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createMetadataSchema with closed client', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateMetadataSchemaRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createMetadataSchema(request), expectedError); + }); + }); + + describe('getMetadataSchema', () => { + it('invokes getMetadataSchema without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetMetadataSchemaRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()); + client.innerApiCalls.getMetadataSchema = stubSimpleCall(expectedResponse); + const [response] = await client.getMetadataSchema(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getMetadataSchema as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getMetadataSchema without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetMetadataSchemaRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()); + client.innerApiCalls.getMetadataSchema = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMetadataSchema( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IMetadataSchema|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getMetadataSchema as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getMetadataSchema with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetMetadataSchemaRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getMetadataSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMetadataSchema(request), expectedError); + assert((client.innerApiCalls.getMetadataSchema as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getMetadataSchema with closed client', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetMetadataSchemaRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMetadataSchema(request), expectedError); + }); + }); + + describe('queryArtifactLineageSubgraph', () => { + it('invokes queryArtifactLineageSubgraph without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryArtifactLineageSubgraphRequest()); + request.artifact = ''; + const expectedHeaderRequestParams = "artifact="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph()); + client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCall(expectedResponse); + const [response] = await client.queryArtifactLineageSubgraph(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryArtifactLineageSubgraph without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryArtifactLineageSubgraphRequest()); + request.artifact = ''; + const expectedHeaderRequestParams = "artifact="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph()); + client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryArtifactLineageSubgraph( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes queryArtifactLineageSubgraph with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryArtifactLineageSubgraphRequest()); + request.artifact = ''; + const expectedHeaderRequestParams = "artifact="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryArtifactLineageSubgraph(request), expectedError); + assert((client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryArtifactLineageSubgraph with closed client', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryArtifactLineageSubgraphRequest()); + request.artifact = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.queryArtifactLineageSubgraph(request), expectedError); + }); + }); + + describe('createMetadataStore', () => { + it('invokes createMetadataStore without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateMetadataStoreRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createMetadataStore = stubLongRunningCall(expectedResponse); + const [operation] = await client.createMetadataStore(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createMetadataStore without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateMetadataStoreRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createMetadataStore = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMetadataStore( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createMetadataStore with call error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateMetadataStoreRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createMetadataStore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createMetadataStore(request), expectedError); + assert((client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createMetadataStore with LRO error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateMetadataStoreRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createMetadataStore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createMetadataStore(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateMetadataStoreProgress without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateMetadataStoreProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateMetadataStoreProgress with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateMetadataStoreProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteMetadataStore', () => { + it('invokes deleteMetadataStore without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteMetadataStoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteMetadataStore(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteMetadataStore without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteMetadataStoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteMetadataStore = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteMetadataStore( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteMetadataStore with call error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteMetadataStoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteMetadataStore(request), expectedError); + assert((client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteMetadataStore with LRO error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteMetadataStoreRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteMetadataStore(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteMetadataStoreProgress without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteMetadataStoreProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteMetadataStoreProgress with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteMetadataStoreProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteArtifact', () => { + it('invokes deleteArtifact without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteArtifactRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteArtifact = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteArtifact(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteArtifact without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteArtifactRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteArtifact = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteArtifact( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteArtifact with call error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteArtifactRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteArtifact = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteArtifact(request), expectedError); + assert((client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteArtifact with LRO error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteArtifactRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteArtifact = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteArtifact(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteArtifactProgress without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteArtifactProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteArtifactProgress with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteArtifactProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('purgeArtifacts', () => { + it('invokes purgeArtifacts without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.purgeArtifacts = stubLongRunningCall(expectedResponse); + const [operation] = await client.purgeArtifacts(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes purgeArtifacts without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.purgeArtifacts = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.purgeArtifacts( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes purgeArtifacts with call error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeArtifacts = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.purgeArtifacts(request), expectedError); + assert((client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes purgeArtifacts with LRO error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeArtifacts = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.purgeArtifacts(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkPurgeArtifactsProgress without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkPurgeArtifactsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkPurgeArtifactsProgress with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkPurgeArtifactsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteContext', () => { + it('invokes deleteContext without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteContextRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteContext = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteContext(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteContext without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteContextRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteContext = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteContext( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteContext with call error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteContextRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteContext = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteContext(request), expectedError); + assert((client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteContext with LRO error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteContextRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteContext = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteContext(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteContextProgress without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteContextProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteContextProgress with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteContextProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('purgeContexts', () => { + it('invokes purgeContexts without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.purgeContexts = stubLongRunningCall(expectedResponse); + const [operation] = await client.purgeContexts(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes purgeContexts without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.purgeContexts = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.purgeContexts( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes purgeContexts with call error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeContexts = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.purgeContexts(request), expectedError); + assert((client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes purgeContexts with LRO error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeContexts = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.purgeContexts(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkPurgeContextsProgress without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkPurgeContextsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkPurgeContextsProgress with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkPurgeContextsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteExecution', () => { + it('invokes deleteExecution without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteExecutionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteExecution = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteExecution(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteExecution without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteExecutionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteExecution = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteExecution( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteExecution with call error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteExecutionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteExecution(request), expectedError); + assert((client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteExecution with LRO error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteExecutionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteExecution(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteExecutionProgress without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteExecutionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteExecutionProgress with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteExecutionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('purgeExecutions', () => { + it('invokes purgeExecutions without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.purgeExecutions = stubLongRunningCall(expectedResponse); + const [operation] = await client.purgeExecutions(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes purgeExecutions without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.purgeExecutions = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.purgeExecutions( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes purgeExecutions with call error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeExecutions = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.purgeExecutions(request), expectedError); + assert((client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes purgeExecutions with LRO error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeExecutions = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.purgeExecutions(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkPurgeExecutionsProgress without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkPurgeExecutionsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkPurgeExecutionsProgress with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkPurgeExecutionsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listMetadataStores', () => { + it('invokes listMetadataStores without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), + ]; + client.innerApiCalls.listMetadataStores = stubSimpleCall(expectedResponse); + const [response] = await client.listMetadataStores(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listMetadataStores as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listMetadataStores without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), + ]; + client.innerApiCalls.listMetadataStores = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMetadataStores( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IMetadataStore[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listMetadataStores as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listMetadataStores with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listMetadataStores = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMetadataStores(request), expectedError); + assert((client.innerApiCalls.listMetadataStores as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listMetadataStoresStream without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), + ]; + client.descriptors.page.listMetadataStores.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listMetadataStoresStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.MetadataStore[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.MetadataStore) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listMetadataStores.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMetadataStores, request)); + assert.strictEqual( + (client.descriptors.page.listMetadataStores.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listMetadataStoresStream with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listMetadataStores.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listMetadataStoresStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.MetadataStore[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.MetadataStore) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listMetadataStores.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMetadataStores, request)); + assert.strictEqual( + (client.descriptors.page.listMetadataStores.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listMetadataStores without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), + ]; + client.descriptors.page.listMetadataStores.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IMetadataStore[] = []; + const iterable = client.listMetadataStoresAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listMetadataStores with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listMetadataStores.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMetadataStoresAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IMetadataStore[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listArtifacts', () => { + it('invokes listArtifacts without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), + ]; + client.innerApiCalls.listArtifacts = stubSimpleCall(expectedResponse); + const [response] = await client.listArtifacts(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listArtifacts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listArtifacts without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), + ]; + client.innerApiCalls.listArtifacts = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listArtifacts( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IArtifact[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listArtifacts as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listArtifacts with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listArtifacts = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listArtifacts(request), expectedError); + assert((client.innerApiCalls.listArtifacts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listArtifactsStream without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), + ]; + client.descriptors.page.listArtifacts.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listArtifactsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Artifact[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Artifact) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listArtifacts, request)); + assert.strictEqual( + (client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listArtifactsStream with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listArtifacts.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listArtifactsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Artifact[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Artifact) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listArtifacts, request)); + assert.strictEqual( + (client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listArtifacts without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), + ]; + client.descriptors.page.listArtifacts.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IArtifact[] = []; + const iterable = client.listArtifactsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listArtifacts with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListArtifactsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listArtifacts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listArtifactsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IArtifact[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listContexts', () => { + it('invokes listContexts without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), + ]; + client.innerApiCalls.listContexts = stubSimpleCall(expectedResponse); + const [response] = await client.listContexts(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listContexts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listContexts without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), + ]; + client.innerApiCalls.listContexts = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listContexts( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IContext[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listContexts as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listContexts with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listContexts = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listContexts(request), expectedError); + assert((client.innerApiCalls.listContexts as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listContextsStream without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), + ]; + client.descriptors.page.listContexts.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listContextsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Context[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Context) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listContexts.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listContexts, request)); + assert.strictEqual( + (client.descriptors.page.listContexts.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listContextsStream with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listContexts.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listContextsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Context[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Context) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listContexts.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listContexts, request)); + assert.strictEqual( + (client.descriptors.page.listContexts.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listContexts without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), + ]; + client.descriptors.page.listContexts.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IContext[] = []; + const iterable = client.listContextsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listContexts.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listContexts.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listContexts with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListContextsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listContexts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listContextsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IContext[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listContexts.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listContexts.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listExecutions', () => { + it('invokes listExecutions without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), + ]; + client.innerApiCalls.listExecutions = stubSimpleCall(expectedResponse); + const [response] = await client.listExecutions(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listExecutions without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), + ]; + client.innerApiCalls.listExecutions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listExecutions( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IExecution[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listExecutions with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listExecutions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listExecutions(request), expectedError); + assert((client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listExecutionsStream without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), + ]; + client.descriptors.page.listExecutions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listExecutionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Execution[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Execution) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listExecutions, request)); + assert.strictEqual( + (client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listExecutionsStream with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listExecutions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listExecutionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Execution[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Execution) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listExecutions, request)); + assert.strictEqual( + (client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listExecutions without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), + ]; + client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IExecution[] = []; + const iterable = client.listExecutionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listExecutions with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListExecutionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listExecutionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IExecution[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listMetadataSchemas', () => { + it('invokes listMetadataSchemas without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), + ]; + client.innerApiCalls.listMetadataSchemas = stubSimpleCall(expectedResponse); + const [response] = await client.listMetadataSchemas(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listMetadataSchemas as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listMetadataSchemas without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), + ]; + client.innerApiCalls.listMetadataSchemas = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMetadataSchemas( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IMetadataSchema[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listMetadataSchemas as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listMetadataSchemas with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listMetadataSchemas = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMetadataSchemas(request), expectedError); + assert((client.innerApiCalls.listMetadataSchemas as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listMetadataSchemasStream without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), + ]; + client.descriptors.page.listMetadataSchemas.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listMetadataSchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.MetadataSchema[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.MetadataSchema) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listMetadataSchemas.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMetadataSchemas, request)); + assert.strictEqual( + (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listMetadataSchemasStream with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listMetadataSchemas.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listMetadataSchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.MetadataSchema[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.MetadataSchema) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listMetadataSchemas.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMetadataSchemas, request)); + assert.strictEqual( + (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listMetadataSchemas without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), + ]; + client.descriptors.page.listMetadataSchemas.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IMetadataSchema[] = []; + const iterable = client.listMetadataSchemasAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listMetadataSchemas with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listMetadataSchemas.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMetadataSchemasAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IMetadataSchema[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1beta1/test/gapic_migration_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_migration_service_v1beta1.ts new file mode 100644 index 00000000..72c49a1a --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_migration_service_v1beta1.ts @@ -0,0 +1,2246 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as migrationserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.MigrationServiceClient', () => { + it('has servicePath', () => { + const servicePath = migrationserviceModule.v1beta1.MigrationServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = migrationserviceModule.v1beta1.MigrationServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = migrationserviceModule.v1beta1.MigrationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.migrationServiceStub, undefined); + await client.initialize(); + assert(client.migrationServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.migrationServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.migrationServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('batchMigrateResources', () => { + it('invokes batchMigrateResources without error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchMigrateResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.batchMigrateResources = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchMigrateResources(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchMigrateResources without error using callback', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchMigrateResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.batchMigrateResources = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchMigrateResources( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes batchMigrateResources with call error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchMigrateResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchMigrateResources = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchMigrateResources(request), expectedError); + assert((client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchMigrateResources with LRO error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchMigrateResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchMigrateResources = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchMigrateResources(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkBatchMigrateResourcesProgress without error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchMigrateResourcesProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchMigrateResourcesProgress with error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkBatchMigrateResourcesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('searchMigratableResources', () => { + it('invokes searchMigratableResources without error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchMigratableResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), + ]; + client.innerApiCalls.searchMigratableResources = stubSimpleCall(expectedResponse); + const [response] = await client.searchMigratableResources(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.searchMigratableResources as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes searchMigratableResources without error using callback', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchMigratableResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), + ]; + client.innerApiCalls.searchMigratableResources = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchMigratableResources( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IMigratableResource[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.searchMigratableResources as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes searchMigratableResources with error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchMigratableResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.searchMigratableResources = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchMigratableResources(request), expectedError); + assert((client.innerApiCalls.searchMigratableResources as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes searchMigratableResourcesStream without error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchMigratableResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), + ]; + client.descriptors.page.searchMigratableResources.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchMigratableResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.MigratableResource[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.MigratableResource) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.searchMigratableResources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchMigratableResources, request)); + assert.strictEqual( + (client.descriptors.page.searchMigratableResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes searchMigratableResourcesStream with error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchMigratableResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.searchMigratableResources.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchMigratableResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.MigratableResource[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.MigratableResource) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchMigratableResources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchMigratableResources, request)); + assert.strictEqual( + (client.descriptors.page.searchMigratableResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchMigratableResources without error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchMigratableResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), + ]; + client.descriptors.page.searchMigratableResources.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IMigratableResource[] = []; + const iterable = client.searchMigratableResourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchMigratableResources with error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchMigratableResourcesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.searchMigratableResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchMigratableResourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IMigratableResource[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1beta1/test/gapic_model_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_model_service_v1beta1.ts new file mode 100644 index 00000000..d21ab56e --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_model_service_v1beta1.ts @@ -0,0 +1,4077 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as modelserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.ModelServiceClient', () => { + it('has servicePath', () => { + const servicePath = modelserviceModule.v1beta1.ModelServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = modelserviceModule.v1beta1.ModelServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = modelserviceModule.v1beta1.ModelServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.modelServiceStub, undefined); + await client.initialize(); + assert(client.modelServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.modelServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.modelServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getModel', () => { + it('invokes getModel without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()); + client.innerApiCalls.getModel = stubSimpleCall(expectedResponse); + const [response] = await client.getModel(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getModel without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()); + client.innerApiCalls.getModel = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModel( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModel|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getModel with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModel(request), expectedError); + assert((client.innerApiCalls.getModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getModel with closed client', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getModel(request), expectedError); + }); + }); + + describe('updateModel', () => { + it('invokes updateModel without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateModelRequest()); + request.model = {}; + request.model.name = ''; + const expectedHeaderRequestParams = "model.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()); + client.innerApiCalls.updateModel = stubSimpleCall(expectedResponse); + const [response] = await client.updateModel(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateModel without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateModelRequest()); + request.model = {}; + request.model.name = ''; + const expectedHeaderRequestParams = "model.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()); + client.innerApiCalls.updateModel = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateModel( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModel|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateModel with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateModelRequest()); + request.model = {}; + request.model.name = ''; + const expectedHeaderRequestParams = "model.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateModel = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateModel(request), expectedError); + assert((client.innerApiCalls.updateModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateModel with closed client', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateModelRequest()); + request.model = {}; + request.model.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateModel(request), expectedError); + }); + }); + + describe('mergeVersionAliases', () => { + it('invokes mergeVersionAliases without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MergeVersionAliasesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()); + client.innerApiCalls.mergeVersionAliases = stubSimpleCall(expectedResponse); + const [response] = await client.mergeVersionAliases(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.mergeVersionAliases as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes mergeVersionAliases without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MergeVersionAliasesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()); + client.innerApiCalls.mergeVersionAliases = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.mergeVersionAliases( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModel|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.mergeVersionAliases as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes mergeVersionAliases with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MergeVersionAliasesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.mergeVersionAliases = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.mergeVersionAliases(request), expectedError); + assert((client.innerApiCalls.mergeVersionAliases as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes mergeVersionAliases with closed client', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MergeVersionAliasesRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.mergeVersionAliases(request), expectedError); + }); + }); + + describe('importModelEvaluation', () => { + it('invokes importModelEvaluation without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportModelEvaluationRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()); + client.innerApiCalls.importModelEvaluation = stubSimpleCall(expectedResponse); + const [response] = await client.importModelEvaluation(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.importModelEvaluation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes importModelEvaluation without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportModelEvaluationRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()); + client.innerApiCalls.importModelEvaluation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importModelEvaluation( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModelEvaluation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.importModelEvaluation as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes importModelEvaluation with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportModelEvaluationRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.importModelEvaluation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.importModelEvaluation(request), expectedError); + assert((client.innerApiCalls.importModelEvaluation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes importModelEvaluation with closed client', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportModelEvaluationRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.importModelEvaluation(request), expectedError); + }); + }); + + describe('getModelEvaluation', () => { + it('invokes getModelEvaluation without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelEvaluationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()); + client.innerApiCalls.getModelEvaluation = stubSimpleCall(expectedResponse); + const [response] = await client.getModelEvaluation(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getModelEvaluation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getModelEvaluation without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelEvaluationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()); + client.innerApiCalls.getModelEvaluation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModelEvaluation( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModelEvaluation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getModelEvaluation as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getModelEvaluation with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelEvaluationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getModelEvaluation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModelEvaluation(request), expectedError); + assert((client.innerApiCalls.getModelEvaluation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getModelEvaluation with closed client', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelEvaluationRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getModelEvaluation(request), expectedError); + }); + }); + + describe('getModelEvaluationSlice', () => { + it('invokes getModelEvaluationSlice without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelEvaluationSliceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()); + client.innerApiCalls.getModelEvaluationSlice = stubSimpleCall(expectedResponse); + const [response] = await client.getModelEvaluationSlice(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getModelEvaluationSlice as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getModelEvaluationSlice without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelEvaluationSliceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()); + client.innerApiCalls.getModelEvaluationSlice = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModelEvaluationSlice( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getModelEvaluationSlice as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getModelEvaluationSlice with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelEvaluationSliceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getModelEvaluationSlice = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModelEvaluationSlice(request), expectedError); + assert((client.innerApiCalls.getModelEvaluationSlice as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getModelEvaluationSlice with closed client', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelEvaluationSliceRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getModelEvaluationSlice(request), expectedError); + }); + }); + + describe('uploadModel', () => { + it('invokes uploadModel without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UploadModelRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.uploadModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.uploadModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes uploadModel without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UploadModelRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.uploadModel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.uploadModel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes uploadModel with call error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UploadModelRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.uploadModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.uploadModel(request), expectedError); + assert((client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes uploadModel with LRO error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UploadModelRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.uploadModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.uploadModel(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUploadModelProgress without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUploadModelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUploadModelProgress with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUploadModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateExplanationDataset', () => { + it('invokes updateExplanationDataset without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest()); + request.model = ''; + const expectedHeaderRequestParams = "model="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateExplanationDataset = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateExplanationDataset(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateExplanationDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateExplanationDataset without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest()); + request.model = ''; + const expectedHeaderRequestParams = "model="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateExplanationDataset = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExplanationDataset( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateExplanationDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateExplanationDataset with call error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest()); + request.model = ''; + const expectedHeaderRequestParams = "model="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExplanationDataset = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateExplanationDataset(request), expectedError); + assert((client.innerApiCalls.updateExplanationDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateExplanationDataset with LRO error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest()); + request.model = ''; + const expectedHeaderRequestParams = "model="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExplanationDataset = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateExplanationDataset(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.updateExplanationDataset as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUpdateExplanationDatasetProgress without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateExplanationDatasetProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateExplanationDatasetProgress with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateExplanationDatasetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteModel', () => { + it('invokes deleteModel without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteModel without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteModel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteModel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteModel with call error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteModel(request), expectedError); + assert((client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteModel with LRO error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteModel(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteModelProgress without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteModelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteModelProgress with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteModelVersion', () => { + it('invokes deleteModelVersion without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelVersionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteModelVersion = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteModelVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteModelVersion without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelVersionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteModelVersion = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteModelVersion( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteModelVersion with call error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelVersionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModelVersion = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteModelVersion(request), expectedError); + assert((client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteModelVersion with LRO error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelVersionRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModelVersion = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteModelVersion(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteModelVersionProgress without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteModelVersionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteModelVersionProgress with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteModelVersionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('exportModel', () => { + it('invokes exportModel without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.exportModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.exportModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes exportModel without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.exportModel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportModel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.exportModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes exportModel with call error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportModel(request), expectedError); + assert((client.innerApiCalls.exportModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes exportModel with LRO error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportModelRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportModel(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.exportModel as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkExportModelProgress without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkExportModelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportModelProgress with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkExportModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listModels', () => { + it('invokes listModels without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + ]; + client.innerApiCalls.listModels = stubSimpleCall(expectedResponse); + const [response] = await client.listModels(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listModels as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listModels without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + ]; + client.innerApiCalls.listModels = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModels( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModel[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listModels as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listModels with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listModels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModels(request), expectedError); + assert((client.innerApiCalls.listModels as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listModelsStream without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + ]; + client.descriptors.page.listModels.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Model[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Model) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModels, request)); + assert.strictEqual( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listModelsStream with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listModels.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Model[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Model) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModels, request)); + assert.strictEqual( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listModels without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + ]; + client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IModel[] = []; + const iterable = client.listModelsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listModels with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listModelsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IModel[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listModelVersions', () => { + it('invokes listModelVersions without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + ]; + client.innerApiCalls.listModelVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listModelVersions(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listModelVersions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listModelVersions without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + ]; + client.innerApiCalls.listModelVersions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModelVersions( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModel[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listModelVersions as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listModelVersions with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelVersions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModelVersions(request), expectedError); + assert((client.innerApiCalls.listModelVersions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listModelVersionsStream without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + ]; + client.descriptors.page.listModelVersions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listModelVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Model[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Model) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listModelVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModelVersions, request)); + assert.strictEqual( + (client.descriptors.page.listModelVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listModelVersionsStream with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedError = new Error('expected'); + client.descriptors.page.listModelVersions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listModelVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Model[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Model) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listModelVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModelVersions, request)); + assert.strictEqual( + (client.descriptors.page.listModelVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listModelVersions without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), + ]; + client.descriptors.page.listModelVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IModel[] = []; + const iterable = client.listModelVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listModelVersions with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name=";const expectedError = new Error('expected'); + client.descriptors.page.listModelVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listModelVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IModel[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listModelEvaluations', () => { + it('invokes listModelEvaluations without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), + ]; + client.innerApiCalls.listModelEvaluations = stubSimpleCall(expectedResponse); + const [response] = await client.listModelEvaluations(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listModelEvaluations as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listModelEvaluations without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), + ]; + client.innerApiCalls.listModelEvaluations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModelEvaluations( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModelEvaluation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listModelEvaluations as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listModelEvaluations with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelEvaluations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModelEvaluations(request), expectedError); + assert((client.innerApiCalls.listModelEvaluations as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listModelEvaluationsStream without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), + ]; + client.descriptors.page.listModelEvaluations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listModelEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.ModelEvaluation[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ModelEvaluation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModelEvaluations, request)); + assert.strictEqual( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listModelEvaluationsStream with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listModelEvaluations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listModelEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.ModelEvaluation[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ModelEvaluation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModelEvaluations, request)); + assert.strictEqual( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listModelEvaluations without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), + ]; + client.descriptors.page.listModelEvaluations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IModelEvaluation[] = []; + const iterable = client.listModelEvaluationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listModelEvaluations with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listModelEvaluations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listModelEvaluationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IModelEvaluation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listModelEvaluationSlices', () => { + it('invokes listModelEvaluationSlices without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), + ]; + client.innerApiCalls.listModelEvaluationSlices = stubSimpleCall(expectedResponse); + const [response] = await client.listModelEvaluationSlices(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listModelEvaluationSlices as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listModelEvaluationSlices without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), + ]; + client.innerApiCalls.listModelEvaluationSlices = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModelEvaluationSlices( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listModelEvaluationSlices as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listModelEvaluationSlices with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelEvaluationSlices = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModelEvaluationSlices(request), expectedError); + assert((client.innerApiCalls.listModelEvaluationSlices as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listModelEvaluationSlicesStream without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), + ]; + client.descriptors.page.listModelEvaluationSlices.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listModelEvaluationSlicesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModelEvaluationSlices, request)); + assert.strictEqual( + (client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listModelEvaluationSlicesStream with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listModelEvaluationSlices.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listModelEvaluationSlicesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModelEvaluationSlices, request)); + assert.strictEqual( + (client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listModelEvaluationSlices without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), + ]; + client.descriptors.page.listModelEvaluationSlices.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice[] = []; + const iterable = client.listModelEvaluationSlicesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listModelEvaluationSlices with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listModelEvaluationSlices.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listModelEvaluationSlicesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1beta1/test/gapic_pipeline_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_pipeline_service_v1beta1.ts new file mode 100644 index 00000000..ae4bfd2c --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_pipeline_service_v1beta1.ts @@ -0,0 +1,3195 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as pipelineserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.PipelineServiceClient', () => { + it('has servicePath', () => { + const servicePath = pipelineserviceModule.v1beta1.PipelineServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = pipelineserviceModule.v1beta1.PipelineServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = pipelineserviceModule.v1beta1.PipelineServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.pipelineServiceStub, undefined); + await client.initialize(); + assert(client.pipelineServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.pipelineServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.pipelineServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('createTrainingPipeline', () => { + it('invokes createTrainingPipeline without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTrainingPipelineRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()); + client.innerApiCalls.createTrainingPipeline = stubSimpleCall(expectedResponse); + const [response] = await client.createTrainingPipeline(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTrainingPipeline without error using callback', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTrainingPipelineRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()); + client.innerApiCalls.createTrainingPipeline = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTrainingPipeline( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createTrainingPipeline with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTrainingPipelineRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createTrainingPipeline = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTrainingPipeline(request), expectedError); + assert((client.innerApiCalls.createTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTrainingPipeline with closed client', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTrainingPipelineRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createTrainingPipeline(request), expectedError); + }); + }); + + describe('getTrainingPipeline', () => { + it('invokes getTrainingPipeline without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()); + client.innerApiCalls.getTrainingPipeline = stubSimpleCall(expectedResponse); + const [response] = await client.getTrainingPipeline(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTrainingPipeline without error using callback', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()); + client.innerApiCalls.getTrainingPipeline = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTrainingPipeline( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getTrainingPipeline with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getTrainingPipeline = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTrainingPipeline(request), expectedError); + assert((client.innerApiCalls.getTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTrainingPipeline with closed client', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTrainingPipelineRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTrainingPipeline(request), expectedError); + }); + }); + + describe('cancelTrainingPipeline', () => { + it('invokes cancelTrainingPipeline without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall(expectedResponse); + const [response] = await client.cancelTrainingPipeline(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelTrainingPipeline without error using callback', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelTrainingPipeline = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelTrainingPipeline( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes cancelTrainingPipeline with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelTrainingPipeline(request), expectedError); + assert((client.innerApiCalls.cancelTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelTrainingPipeline with closed client', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelTrainingPipelineRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelTrainingPipeline(request), expectedError); + }); + }); + + describe('createPipelineJob', () => { + it('invokes createPipelineJob without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreatePipelineJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()); + client.innerApiCalls.createPipelineJob = stubSimpleCall(expectedResponse); + const [response] = await client.createPipelineJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createPipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createPipelineJob without error using callback', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreatePipelineJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()); + client.innerApiCalls.createPipelineJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPipelineJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IPipelineJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createPipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createPipelineJob with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreatePipelineJobRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createPipelineJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createPipelineJob(request), expectedError); + assert((client.innerApiCalls.createPipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createPipelineJob with closed client', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreatePipelineJobRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createPipelineJob(request), expectedError); + }); + }); + + describe('getPipelineJob', () => { + it('invokes getPipelineJob without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetPipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()); + client.innerApiCalls.getPipelineJob = stubSimpleCall(expectedResponse); + const [response] = await client.getPipelineJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getPipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getPipelineJob without error using callback', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetPipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()); + client.innerApiCalls.getPipelineJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPipelineJob( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IPipelineJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getPipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getPipelineJob with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetPipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getPipelineJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getPipelineJob(request), expectedError); + assert((client.innerApiCalls.getPipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getPipelineJob with closed client', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetPipelineJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getPipelineJob(request), expectedError); + }); + }); + + describe('cancelPipelineJob', () => { + it('invokes cancelPipelineJob without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelPipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelPipelineJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelPipelineJob(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelPipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelPipelineJob without error using callback', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelPipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelPipelineJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelPipelineJob( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelPipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes cancelPipelineJob with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelPipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelPipelineJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelPipelineJob(request), expectedError); + assert((client.innerApiCalls.cancelPipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelPipelineJob with closed client', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelPipelineJobRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelPipelineJob(request), expectedError); + }); + }); + + describe('deleteTrainingPipeline', () => { + it('invokes deleteTrainingPipeline without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTrainingPipeline(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTrainingPipeline without error using callback', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTrainingPipeline( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteTrainingPipeline with call error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTrainingPipeline(request), expectedError); + assert((client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTrainingPipeline with LRO error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTrainingPipelineRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTrainingPipeline(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteTrainingPipelineProgress without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteTrainingPipelineProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTrainingPipelineProgress with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteTrainingPipelineProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deletePipelineJob', () => { + it('invokes deletePipelineJob without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeletePipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deletePipelineJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deletePipelineJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deletePipelineJob without error using callback', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeletePipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deletePipelineJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePipelineJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deletePipelineJob with call error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeletePipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePipelineJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deletePipelineJob(request), expectedError); + assert((client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deletePipelineJob with LRO error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeletePipelineJobRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePipelineJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deletePipelineJob(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeletePipelineJobProgress without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeletePipelineJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeletePipelineJobProgress with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeletePipelineJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listTrainingPipelines', () => { + it('invokes listTrainingPipelines without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), + ]; + client.innerApiCalls.listTrainingPipelines = stubSimpleCall(expectedResponse); + const [response] = await client.listTrainingPipelines(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTrainingPipelines as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTrainingPipelines without error using callback', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), + ]; + client.innerApiCalls.listTrainingPipelines = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTrainingPipelines( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTrainingPipelines as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listTrainingPipelines with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listTrainingPipelines = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTrainingPipelines(request), expectedError); + assert((client.innerApiCalls.listTrainingPipelines as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTrainingPipelinesStream without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), + ]; + client.descriptors.page.listTrainingPipelines.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTrainingPipelinesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.TrainingPipeline[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TrainingPipeline) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listTrainingPipelines.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTrainingPipelines, request)); + assert.strictEqual( + (client.descriptors.page.listTrainingPipelines.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listTrainingPipelinesStream with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listTrainingPipelines.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTrainingPipelinesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.TrainingPipeline[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TrainingPipeline) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTrainingPipelines.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTrainingPipelines, request)); + assert.strictEqual( + (client.descriptors.page.listTrainingPipelines.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTrainingPipelines without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), + ]; + client.descriptors.page.listTrainingPipelines.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline[] = []; + const iterable = client.listTrainingPipelinesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTrainingPipelines with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listTrainingPipelines.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTrainingPipelinesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listPipelineJobs', () => { + it('invokes listPipelineJobs without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), + ]; + client.innerApiCalls.listPipelineJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listPipelineJobs(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listPipelineJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listPipelineJobs without error using callback', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), + ]; + client.innerApiCalls.listPipelineJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPipelineJobs( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IPipelineJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listPipelineJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listPipelineJobs with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listPipelineJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listPipelineJobs(request), expectedError); + assert((client.innerApiCalls.listPipelineJobs as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listPipelineJobsStream without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), + ]; + client.descriptors.page.listPipelineJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listPipelineJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.PipelineJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.PipelineJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listPipelineJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPipelineJobs, request)); + assert.strictEqual( + (client.descriptors.page.listPipelineJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listPipelineJobsStream with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listPipelineJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listPipelineJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.PipelineJob[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.PipelineJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listPipelineJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPipelineJobs, request)); + assert.strictEqual( + (client.descriptors.page.listPipelineJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listPipelineJobs without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), + ]; + client.descriptors.page.listPipelineJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IPipelineJob[] = []; + const iterable = client.listPipelineJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listPipelineJobs with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listPipelineJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPipelineJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IPipelineJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1beta1/test/gapic_prediction_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_prediction_service_v1beta1.ts new file mode 100644 index 00000000..5678ae35 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_prediction_service_v1beta1.ts @@ -0,0 +1,2069 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as predictionserviceModule from '../src'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +describe('v1beta1.PredictionServiceClient', () => { + it('has servicePath', () => { + const servicePath = predictionserviceModule.v1beta1.PredictionServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = predictionserviceModule.v1beta1.PredictionServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = predictionserviceModule.v1beta1.PredictionServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.predictionServiceStub, undefined); + await client.initialize(); + assert(client.predictionServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.predictionServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.predictionServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('predict', () => { + it('invokes predict without error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PredictRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PredictResponse()); + client.innerApiCalls.predict = stubSimpleCall(expectedResponse); + const [response] = await client.predict(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.predict as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes predict without error using callback', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PredictRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PredictResponse()); + client.innerApiCalls.predict = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.predict( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IPredictResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.predict as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes predict with error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PredictRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.predict = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.predict(request), expectedError); + assert((client.innerApiCalls.predict as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes predict with closed client', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PredictRequest()); + request.endpoint = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.predict(request), expectedError); + }); + }); + + describe('rawPredict', () => { + it('invokes rawPredict without error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.RawPredictRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.api.HttpBody()); + client.innerApiCalls.rawPredict = stubSimpleCall(expectedResponse); + const [response] = await client.rawPredict(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.rawPredict as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes rawPredict without error using callback', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.RawPredictRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.api.HttpBody()); + client.innerApiCalls.rawPredict = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rawPredict( + request, + (err?: Error|null, result?: protos.google.api.IHttpBody|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.rawPredict as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes rawPredict with error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.RawPredictRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.rawPredict = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.rawPredict(request), expectedError); + assert((client.innerApiCalls.rawPredict as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes rawPredict with closed client', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.RawPredictRequest()); + request.endpoint = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.rawPredict(request), expectedError); + }); + }); + + describe('explain', () => { + it('invokes explain without error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExplainRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExplainResponse()); + client.innerApiCalls.explain = stubSimpleCall(expectedResponse); + const [response] = await client.explain(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.explain as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes explain without error using callback', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExplainRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExplainResponse()); + client.innerApiCalls.explain = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.explain( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IExplainResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.explain as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes explain with error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExplainRequest()); + request.endpoint = ''; + const expectedHeaderRequestParams = "endpoint="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.explain = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.explain(request), expectedError); + assert((client.innerApiCalls.explain as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes explain with closed client', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExplainRequest()); + request.endpoint = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.explain(request), expectedError); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts new file mode 100644 index 00000000..deb7af9a --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts @@ -0,0 +1,2635 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as specialistpoolserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.SpecialistPoolServiceClient', () => { + it('has servicePath', () => { + const servicePath = specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.specialistPoolServiceStub, undefined); + await client.initialize(); + assert(client.specialistPoolServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.specialistPoolServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.specialistPoolServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getSpecialistPool', () => { + it('invokes getSpecialistPool without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetSpecialistPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()); + client.innerApiCalls.getSpecialistPool = stubSimpleCall(expectedResponse); + const [response] = await client.getSpecialistPool(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getSpecialistPool without error using callback', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetSpecialistPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()); + client.innerApiCalls.getSpecialistPool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSpecialistPool( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ISpecialistPool|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getSpecialistPool with error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetSpecialistPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getSpecialistPool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSpecialistPool(request), expectedError); + assert((client.innerApiCalls.getSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getSpecialistPool with closed client', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetSpecialistPoolRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSpecialistPool(request), expectedError); + }); + }); + + describe('createSpecialistPool', () => { + it('invokes createSpecialistPool without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateSpecialistPoolRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createSpecialistPool = stubLongRunningCall(expectedResponse); + const [operation] = await client.createSpecialistPool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createSpecialistPool without error using callback', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateSpecialistPoolRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createSpecialistPool = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSpecialistPool( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createSpecialistPool with call error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateSpecialistPoolRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createSpecialistPool = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createSpecialistPool(request), expectedError); + assert((client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createSpecialistPool with LRO error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateSpecialistPoolRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createSpecialistPool(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateSpecialistPoolProgress without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateSpecialistPoolProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateSpecialistPoolProgress with error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateSpecialistPoolProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteSpecialistPool', () => { + it('invokes deleteSpecialistPool without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteSpecialistPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteSpecialistPool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteSpecialistPool without error using callback', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteSpecialistPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteSpecialistPool = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSpecialistPool( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteSpecialistPool with call error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteSpecialistPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteSpecialistPool(request), expectedError); + assert((client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteSpecialistPool with LRO error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteSpecialistPoolRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteSpecialistPool(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteSpecialistPoolProgress without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteSpecialistPoolProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteSpecialistPoolProgress with error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteSpecialistPoolProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateSpecialistPool', () => { + it('invokes updateSpecialistPool without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateSpecialistPoolRequest()); + request.specialistPool = {}; + request.specialistPool.name = ''; + const expectedHeaderRequestParams = "specialist_pool.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateSpecialistPool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateSpecialistPool without error using callback', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateSpecialistPoolRequest()); + request.specialistPool = {}; + request.specialistPool.name = ''; + const expectedHeaderRequestParams = "specialist_pool.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateSpecialistPool = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSpecialistPool( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateSpecialistPool with call error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateSpecialistPoolRequest()); + request.specialistPool = {}; + request.specialistPool.name = ''; + const expectedHeaderRequestParams = "specialist_pool.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateSpecialistPool(request), expectedError); + assert((client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateSpecialistPool with LRO error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateSpecialistPoolRequest()); + request.specialistPool = {}; + request.specialistPool.name = ''; + const expectedHeaderRequestParams = "specialist_pool.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateSpecialistPool(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUpdateSpecialistPoolProgress without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateSpecialistPoolProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateSpecialistPoolProgress with error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateSpecialistPoolProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listSpecialistPools', () => { + it('invokes listSpecialistPools without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListSpecialistPoolsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), + ]; + client.innerApiCalls.listSpecialistPools = stubSimpleCall(expectedResponse); + const [response] = await client.listSpecialistPools(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listSpecialistPools as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listSpecialistPools without error using callback', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListSpecialistPoolsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), + ]; + client.innerApiCalls.listSpecialistPools = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSpecialistPools( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ISpecialistPool[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listSpecialistPools as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listSpecialistPools with error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListSpecialistPoolsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listSpecialistPools = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSpecialistPools(request), expectedError); + assert((client.innerApiCalls.listSpecialistPools as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listSpecialistPoolsStream without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListSpecialistPoolsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), + ]; + client.descriptors.page.listSpecialistPools.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSpecialistPoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.SpecialistPool[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.SpecialistPool) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listSpecialistPools.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSpecialistPools, request)); + assert.strictEqual( + (client.descriptors.page.listSpecialistPools.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listSpecialistPoolsStream with error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListSpecialistPoolsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listSpecialistPools.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSpecialistPoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.SpecialistPool[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.SpecialistPool) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSpecialistPools.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSpecialistPools, request)); + assert.strictEqual( + (client.descriptors.page.listSpecialistPools.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listSpecialistPools without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListSpecialistPoolsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), + ]; + client.descriptors.page.listSpecialistPools.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.ISpecialistPool[] = []; + const iterable = client.listSpecialistPoolsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listSpecialistPools with error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListSpecialistPoolsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listSpecialistPools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSpecialistPoolsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.ISpecialistPool[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1beta1/test/gapic_tensorboard_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_tensorboard_service_v1beta1.ts new file mode 100644 index 00000000..f5f87213 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_tensorboard_service_v1beta1.ts @@ -0,0 +1,5557 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as tensorboardserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubServerStreamingCall(response?: ResponseType, error?: Error) { + const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // write something to the stream to trigger transformStub and send the response back to the client + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + return sinon.stub().returns(mockStream); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.TensorboardServiceClient', () => { + it('has servicePath', () => { + const servicePath = tensorboardserviceModule.v1beta1.TensorboardServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = tensorboardserviceModule.v1beta1.TensorboardServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = tensorboardserviceModule.v1beta1.TensorboardServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.tensorboardServiceStub, undefined); + await client.initialize(); + assert(client.tensorboardServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.tensorboardServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.tensorboardServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getTensorboard', () => { + it('invokes getTensorboard without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()); + client.innerApiCalls.getTensorboard = stubSimpleCall(expectedResponse); + const [response] = await client.getTensorboard(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTensorboard without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()); + client.innerApiCalls.getTensorboard = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTensorboard( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboard|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getTensorboard with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getTensorboard = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTensorboard(request), expectedError); + assert((client.innerApiCalls.getTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTensorboard with closed client', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTensorboard(request), expectedError); + }); + }); + + describe('createTensorboardExperiment', () => { + it('invokes createTensorboardExperiment without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardExperimentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()); + client.innerApiCalls.createTensorboardExperiment = stubSimpleCall(expectedResponse); + const [response] = await client.createTensorboardExperiment(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTensorboardExperiment without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardExperimentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()); + client.innerApiCalls.createTensorboardExperiment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTensorboardExperiment( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createTensorboardExperiment with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardExperimentRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboardExperiment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTensorboardExperiment(request), expectedError); + assert((client.innerApiCalls.createTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTensorboardExperiment with closed client', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardExperimentRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createTensorboardExperiment(request), expectedError); + }); + }); + + describe('getTensorboardExperiment', () => { + it('invokes getTensorboardExperiment without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardExperimentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()); + client.innerApiCalls.getTensorboardExperiment = stubSimpleCall(expectedResponse); + const [response] = await client.getTensorboardExperiment(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTensorboardExperiment without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardExperimentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()); + client.innerApiCalls.getTensorboardExperiment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTensorboardExperiment( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getTensorboardExperiment with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardExperimentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getTensorboardExperiment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTensorboardExperiment(request), expectedError); + assert((client.innerApiCalls.getTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTensorboardExperiment with closed client', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardExperimentRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTensorboardExperiment(request), expectedError); + }); + }); + + describe('updateTensorboardExperiment', () => { + it('invokes updateTensorboardExperiment without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardExperimentRequest()); + request.tensorboardExperiment = {}; + request.tensorboardExperiment.name = ''; + const expectedHeaderRequestParams = "tensorboard_experiment.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()); + client.innerApiCalls.updateTensorboardExperiment = stubSimpleCall(expectedResponse); + const [response] = await client.updateTensorboardExperiment(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateTensorboardExperiment without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardExperimentRequest()); + request.tensorboardExperiment = {}; + request.tensorboardExperiment.name = ''; + const expectedHeaderRequestParams = "tensorboard_experiment.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()); + client.innerApiCalls.updateTensorboardExperiment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTensorboardExperiment( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateTensorboardExperiment with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardExperimentRequest()); + request.tensorboardExperiment = {}; + request.tensorboardExperiment.name = ''; + const expectedHeaderRequestParams = "tensorboard_experiment.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboardExperiment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateTensorboardExperiment(request), expectedError); + assert((client.innerApiCalls.updateTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateTensorboardExperiment with closed client', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardExperimentRequest()); + request.tensorboardExperiment = {}; + request.tensorboardExperiment.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateTensorboardExperiment(request), expectedError); + }); + }); + + describe('createTensorboardRun', () => { + it('invokes createTensorboardRun without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardRunRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()); + client.innerApiCalls.createTensorboardRun = stubSimpleCall(expectedResponse); + const [response] = await client.createTensorboardRun(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTensorboardRun without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardRunRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()); + client.innerApiCalls.createTensorboardRun = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTensorboardRun( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardRun|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createTensorboardRun with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardRunRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboardRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTensorboardRun(request), expectedError); + assert((client.innerApiCalls.createTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTensorboardRun with closed client', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardRunRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createTensorboardRun(request), expectedError); + }); + }); + + describe('batchCreateTensorboardRuns', () => { + it('invokes batchCreateTensorboardRuns without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsResponse()); + client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCall(expectedResponse); + const [response] = await client.batchCreateTensorboardRuns(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchCreateTensorboardRuns without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsResponse()); + client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchCreateTensorboardRuns( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes batchCreateTensorboardRuns with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchCreateTensorboardRuns(request), expectedError); + assert((client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchCreateTensorboardRuns with closed client', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchCreateTensorboardRuns(request), expectedError); + }); + }); + + describe('getTensorboardRun', () => { + it('invokes getTensorboardRun without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardRunRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()); + client.innerApiCalls.getTensorboardRun = stubSimpleCall(expectedResponse); + const [response] = await client.getTensorboardRun(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTensorboardRun without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardRunRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()); + client.innerApiCalls.getTensorboardRun = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTensorboardRun( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardRun|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getTensorboardRun with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardRunRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getTensorboardRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTensorboardRun(request), expectedError); + assert((client.innerApiCalls.getTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTensorboardRun with closed client', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardRunRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTensorboardRun(request), expectedError); + }); + }); + + describe('updateTensorboardRun', () => { + it('invokes updateTensorboardRun without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardRunRequest()); + request.tensorboardRun = {}; + request.tensorboardRun.name = ''; + const expectedHeaderRequestParams = "tensorboard_run.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()); + client.innerApiCalls.updateTensorboardRun = stubSimpleCall(expectedResponse); + const [response] = await client.updateTensorboardRun(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateTensorboardRun without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardRunRequest()); + request.tensorboardRun = {}; + request.tensorboardRun.name = ''; + const expectedHeaderRequestParams = "tensorboard_run.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()); + client.innerApiCalls.updateTensorboardRun = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTensorboardRun( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardRun|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateTensorboardRun with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardRunRequest()); + request.tensorboardRun = {}; + request.tensorboardRun.name = ''; + const expectedHeaderRequestParams = "tensorboard_run.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboardRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateTensorboardRun(request), expectedError); + assert((client.innerApiCalls.updateTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateTensorboardRun with closed client', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardRunRequest()); + request.tensorboardRun = {}; + request.tensorboardRun.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateTensorboardRun(request), expectedError); + }); + }); + + describe('batchCreateTensorboardTimeSeries', () => { + it('invokes batchCreateTensorboardTimeSeries without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesResponse()); + client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCall(expectedResponse); + const [response] = await client.batchCreateTensorboardTimeSeries(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchCreateTensorboardTimeSeries without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesResponse()); + client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchCreateTensorboardTimeSeries( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes batchCreateTensorboardTimeSeries with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchCreateTensorboardTimeSeries(request), expectedError); + assert((client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchCreateTensorboardTimeSeries with closed client', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchCreateTensorboardTimeSeries(request), expectedError); + }); + }); + + describe('createTensorboardTimeSeries', () => { + it('invokes createTensorboardTimeSeries without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()); + client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCall(expectedResponse); + const [response] = await client.createTensorboardTimeSeries(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTensorboardTimeSeries without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()); + client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTensorboardTimeSeries( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createTensorboardTimeSeries with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTensorboardTimeSeries(request), expectedError); + assert((client.innerApiCalls.createTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTensorboardTimeSeries with closed client', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createTensorboardTimeSeries(request), expectedError); + }); + }); + + describe('getTensorboardTimeSeries', () => { + it('invokes getTensorboardTimeSeries without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardTimeSeriesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()); + client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCall(expectedResponse); + const [response] = await client.getTensorboardTimeSeries(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTensorboardTimeSeries without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardTimeSeriesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()); + client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTensorboardTimeSeries( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getTensorboardTimeSeries with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardTimeSeriesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTensorboardTimeSeries(request), expectedError); + assert((client.innerApiCalls.getTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTensorboardTimeSeries with closed client', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardTimeSeriesRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTensorboardTimeSeries(request), expectedError); + }); + }); + + describe('updateTensorboardTimeSeries', () => { + it('invokes updateTensorboardTimeSeries without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardTimeSeriesRequest()); + request.tensorboardTimeSeries = {}; + request.tensorboardTimeSeries.name = ''; + const expectedHeaderRequestParams = "tensorboard_time_series.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()); + client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCall(expectedResponse); + const [response] = await client.updateTensorboardTimeSeries(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateTensorboardTimeSeries without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardTimeSeriesRequest()); + request.tensorboardTimeSeries = {}; + request.tensorboardTimeSeries.name = ''; + const expectedHeaderRequestParams = "tensorboard_time_series.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()); + client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTensorboardTimeSeries( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateTensorboardTimeSeries with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardTimeSeriesRequest()); + request.tensorboardTimeSeries = {}; + request.tensorboardTimeSeries.name = ''; + const expectedHeaderRequestParams = "tensorboard_time_series.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateTensorboardTimeSeries(request), expectedError); + assert((client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateTensorboardTimeSeries with closed client', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardTimeSeriesRequest()); + request.tensorboardTimeSeries = {}; + request.tensorboardTimeSeries.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateTensorboardTimeSeries(request), expectedError); + }); + }); + + describe('batchReadTensorboardTimeSeriesData', () => { + it('invokes batchReadTensorboardTimeSeriesData without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataRequest()); + request.tensorboard = ''; + const expectedHeaderRequestParams = "tensorboard="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataResponse()); + client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCall(expectedResponse); + const [response] = await client.batchReadTensorboardTimeSeriesData(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchReadTensorboardTimeSeriesData without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataRequest()); + request.tensorboard = ''; + const expectedHeaderRequestParams = "tensorboard="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataResponse()); + client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchReadTensorboardTimeSeriesData( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes batchReadTensorboardTimeSeriesData with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataRequest()); + request.tensorboard = ''; + const expectedHeaderRequestParams = "tensorboard="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchReadTensorboardTimeSeriesData(request), expectedError); + assert((client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes batchReadTensorboardTimeSeriesData with closed client', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataRequest()); + request.tensorboard = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchReadTensorboardTimeSeriesData(request), expectedError); + }); + }); + + describe('readTensorboardTimeSeriesData', () => { + it('invokes readTensorboardTimeSeriesData without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataResponse()); + client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCall(expectedResponse); + const [response] = await client.readTensorboardTimeSeriesData(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes readTensorboardTimeSeriesData without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataResponse()); + client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.readTensorboardTimeSeriesData( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes readTensorboardTimeSeriesData with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.readTensorboardTimeSeriesData(request), expectedError); + assert((client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes readTensorboardTimeSeriesData with closed client', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.readTensorboardTimeSeriesData(request), expectedError); + }); + }); + + describe('writeTensorboardExperimentData', () => { + it('invokes writeTensorboardExperimentData without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataRequest()); + request.tensorboardExperiment = ''; + const expectedHeaderRequestParams = "tensorboard_experiment="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataResponse()); + client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCall(expectedResponse); + const [response] = await client.writeTensorboardExperimentData(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.writeTensorboardExperimentData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes writeTensorboardExperimentData without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataRequest()); + request.tensorboardExperiment = ''; + const expectedHeaderRequestParams = "tensorboard_experiment="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataResponse()); + client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.writeTensorboardExperimentData( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.writeTensorboardExperimentData as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes writeTensorboardExperimentData with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataRequest()); + request.tensorboardExperiment = ''; + const expectedHeaderRequestParams = "tensorboard_experiment="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.writeTensorboardExperimentData(request), expectedError); + assert((client.innerApiCalls.writeTensorboardExperimentData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes writeTensorboardExperimentData with closed client', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataRequest()); + request.tensorboardExperiment = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.writeTensorboardExperimentData(request), expectedError); + }); + }); + + describe('writeTensorboardRunData', () => { + it('invokes writeTensorboardRunData without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataRequest()); + request.tensorboardRun = ''; + const expectedHeaderRequestParams = "tensorboard_run="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataResponse()); + client.innerApiCalls.writeTensorboardRunData = stubSimpleCall(expectedResponse); + const [response] = await client.writeTensorboardRunData(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.writeTensorboardRunData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes writeTensorboardRunData without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataRequest()); + request.tensorboardRun = ''; + const expectedHeaderRequestParams = "tensorboard_run="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataResponse()); + client.innerApiCalls.writeTensorboardRunData = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.writeTensorboardRunData( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.writeTensorboardRunData as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes writeTensorboardRunData with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataRequest()); + request.tensorboardRun = ''; + const expectedHeaderRequestParams = "tensorboard_run="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.writeTensorboardRunData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.writeTensorboardRunData(request), expectedError); + assert((client.innerApiCalls.writeTensorboardRunData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes writeTensorboardRunData with closed client', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataRequest()); + request.tensorboardRun = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.writeTensorboardRunData(request), expectedError); + }); + }); + + describe('createTensorboard', () => { + it('invokes createTensorboard without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createTensorboard = stubLongRunningCall(expectedResponse); + const [operation] = await client.createTensorboard(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTensorboard without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createTensorboard = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTensorboard( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createTensorboard with call error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboard = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createTensorboard(request), expectedError); + assert((client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTensorboard with LRO error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboard = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createTensorboard(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateTensorboardProgress without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateTensorboardProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateTensorboardProgress with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateTensorboardProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateTensorboard', () => { + it('invokes updateTensorboard without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardRequest()); + request.tensorboard = {}; + request.tensorboard.name = ''; + const expectedHeaderRequestParams = "tensorboard.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateTensorboard = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateTensorboard(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateTensorboard without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardRequest()); + request.tensorboard = {}; + request.tensorboard.name = ''; + const expectedHeaderRequestParams = "tensorboard.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateTensorboard = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTensorboard( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateTensorboard with call error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardRequest()); + request.tensorboard = {}; + request.tensorboard.name = ''; + const expectedHeaderRequestParams = "tensorboard.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboard = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateTensorboard(request), expectedError); + assert((client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateTensorboard with LRO error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardRequest()); + request.tensorboard = {}; + request.tensorboard.name = ''; + const expectedHeaderRequestParams = "tensorboard.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboard = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateTensorboard(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUpdateTensorboardProgress without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateTensorboardProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateTensorboardProgress with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateTensorboardProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteTensorboard', () => { + it('invokes deleteTensorboard without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTensorboard = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTensorboard(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTensorboard without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTensorboard = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTensorboard( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteTensorboard with call error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboard = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTensorboard(request), expectedError); + assert((client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTensorboard with LRO error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboard = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTensorboard(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteTensorboardProgress without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteTensorboardProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTensorboardProgress with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteTensorboardProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteTensorboardExperiment', () => { + it('invokes deleteTensorboardExperiment without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardExperimentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTensorboardExperiment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTensorboardExperiment without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardExperimentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTensorboardExperiment( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteTensorboardExperiment with call error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardExperimentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTensorboardExperiment(request), expectedError); + assert((client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTensorboardExperiment with LRO error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardExperimentRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTensorboardExperiment(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteTensorboardExperimentProgress without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteTensorboardExperimentProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTensorboardExperimentProgress with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteTensorboardExperimentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteTensorboardRun', () => { + it('invokes deleteTensorboardRun without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardRunRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTensorboardRun(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTensorboardRun without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardRunRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTensorboardRun = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTensorboardRun( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteTensorboardRun with call error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardRunRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTensorboardRun(request), expectedError); + assert((client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTensorboardRun with LRO error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardRunRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTensorboardRun(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteTensorboardRunProgress without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteTensorboardRunProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTensorboardRunProgress with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteTensorboardRunProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteTensorboardTimeSeries', () => { + it('invokes deleteTensorboardTimeSeries without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardTimeSeriesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTensorboardTimeSeries(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTensorboardTimeSeries without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardTimeSeriesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTensorboardTimeSeries( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteTensorboardTimeSeries with call error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardTimeSeriesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTensorboardTimeSeries(request), expectedError); + assert((client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTensorboardTimeSeries with LRO error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardTimeSeriesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTensorboardTimeSeries(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteTensorboardTimeSeriesProgress without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteTensorboardTimeSeriesProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTensorboardTimeSeriesProgress with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteTensorboardTimeSeriesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('readTensorboardBlobData', () => { + it('invokes readTensorboardBlobData without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataRequest()); + request.timeSeries = ''; + const expectedHeaderRequestParams = "time_series="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataResponse()); + client.innerApiCalls.readTensorboardBlobData = stubServerStreamingCall(expectedResponse); + const stream = client.readTensorboardBlobData(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.readTensorboardBlobData as SinonStub) + .getCall(0).calledWith(request, expectedOptions)); + }); + + it('invokes readTensorboardBlobData with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataRequest()); + request.timeSeries = ''; + const expectedHeaderRequestParams = "time_series="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.readTensorboardBlobData = stubServerStreamingCall(undefined, expectedError); + const stream = client.readTensorboardBlobData(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.innerApiCalls.readTensorboardBlobData as SinonStub) + .getCall(0).calledWith(request, expectedOptions)); + }); + + it('invokes readTensorboardBlobData with closed client', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataRequest()); + request.timeSeries = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + const stream = client.readTensorboardBlobData(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataResponse) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + }); + + describe('listTensorboards', () => { + it('invokes listTensorboards without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), + ]; + client.innerApiCalls.listTensorboards = stubSimpleCall(expectedResponse); + const [response] = await client.listTensorboards(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTensorboards as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTensorboards without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), + ]; + client.innerApiCalls.listTensorboards = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTensorboards( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboard[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTensorboards as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listTensorboards with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listTensorboards = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTensorboards(request), expectedError); + assert((client.innerApiCalls.listTensorboards as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTensorboardsStream without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), + ]; + client.descriptors.page.listTensorboards.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTensorboardsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Tensorboard[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Tensorboard) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listTensorboards.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTensorboards, request)); + assert.strictEqual( + (client.descriptors.page.listTensorboards.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listTensorboardsStream with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listTensorboards.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTensorboardsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Tensorboard[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Tensorboard) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTensorboards.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTensorboards, request)); + assert.strictEqual( + (client.descriptors.page.listTensorboards.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTensorboards without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), + ]; + client.descriptors.page.listTensorboards.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.ITensorboard[] = []; + const iterable = client.listTensorboardsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTensorboards with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listTensorboards.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTensorboardsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.ITensorboard[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listTensorboardExperiments', () => { + it('invokes listTensorboardExperiments without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), + ]; + client.innerApiCalls.listTensorboardExperiments = stubSimpleCall(expectedResponse); + const [response] = await client.listTensorboardExperiments(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTensorboardExperiments as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTensorboardExperiments without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), + ]; + client.innerApiCalls.listTensorboardExperiments = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTensorboardExperiments( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTensorboardExperiments as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listTensorboardExperiments with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listTensorboardExperiments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTensorboardExperiments(request), expectedError); + assert((client.innerApiCalls.listTensorboardExperiments as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTensorboardExperimentsStream without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), + ]; + client.descriptors.page.listTensorboardExperiments.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTensorboardExperimentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTensorboardExperiments, request)); + assert.strictEqual( + (client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listTensorboardExperimentsStream with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listTensorboardExperiments.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTensorboardExperimentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTensorboardExperiments, request)); + assert.strictEqual( + (client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTensorboardExperiments without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), + ]; + client.descriptors.page.listTensorboardExperiments.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment[] = []; + const iterable = client.listTensorboardExperimentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTensorboardExperiments with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listTensorboardExperiments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTensorboardExperimentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listTensorboardRuns', () => { + it('invokes listTensorboardRuns without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), + ]; + client.innerApiCalls.listTensorboardRuns = stubSimpleCall(expectedResponse); + const [response] = await client.listTensorboardRuns(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTensorboardRuns as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTensorboardRuns without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), + ]; + client.innerApiCalls.listTensorboardRuns = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTensorboardRuns( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardRun[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTensorboardRuns as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listTensorboardRuns with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listTensorboardRuns = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTensorboardRuns(request), expectedError); + assert((client.innerApiCalls.listTensorboardRuns as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTensorboardRunsStream without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), + ]; + client.descriptors.page.listTensorboardRuns.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTensorboardRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.TensorboardRun[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TensorboardRun) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listTensorboardRuns.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTensorboardRuns, request)); + assert.strictEqual( + (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listTensorboardRunsStream with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listTensorboardRuns.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTensorboardRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.TensorboardRun[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TensorboardRun) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTensorboardRuns.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTensorboardRuns, request)); + assert.strictEqual( + (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTensorboardRuns without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), + ]; + client.descriptors.page.listTensorboardRuns.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.ITensorboardRun[] = []; + const iterable = client.listTensorboardRunsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTensorboardRuns with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listTensorboardRuns.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTensorboardRunsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.ITensorboardRun[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listTensorboardTimeSeries', () => { + it('invokes listTensorboardTimeSeries without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), + ]; + client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCall(expectedResponse); + const [response] = await client.listTensorboardTimeSeries(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTensorboardTimeSeries without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), + ]; + client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTensorboardTimeSeries( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listTensorboardTimeSeries with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTensorboardTimeSeries(request), expectedError); + assert((client.innerApiCalls.listTensorboardTimeSeries as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTensorboardTimeSeriesStream without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), + ]; + client.descriptors.page.listTensorboardTimeSeries.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTensorboardTimeSeriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTensorboardTimeSeries, request)); + assert.strictEqual( + (client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listTensorboardTimeSeriesStream with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listTensorboardTimeSeries.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTensorboardTimeSeriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTensorboardTimeSeries, request)); + assert.strictEqual( + (client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTensorboardTimeSeries without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), + ]; + client.descriptors.page.listTensorboardTimeSeries.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries[] = []; + const iterable = client.listTensorboardTimeSeriesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTensorboardTimeSeries with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listTensorboardTimeSeries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTensorboardTimeSeriesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('exportTensorboardTimeSeriesData', () => { + it('invokes exportTensorboardTimeSeriesData without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), + ]; + client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCall(expectedResponse); + const [response] = await client.exportTensorboardTimeSeriesData(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes exportTensorboardTimeSeriesData without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), + ]; + client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportTensorboardTimeSeriesData( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITimeSeriesDataPoint[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes exportTensorboardTimeSeriesData with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.exportTensorboardTimeSeriesData(request), expectedError); + assert((client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes exportTensorboardTimeSeriesDataStream without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), + ]; + client.descriptors.page.exportTensorboardTimeSeriesData.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.exportTensorboardTimeSeriesDataStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.exportTensorboardTimeSeriesData, request)); + assert.strictEqual( + (client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes exportTensorboardTimeSeriesDataStream with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series="; + const expectedError = new Error('expected'); + client.descriptors.page.exportTensorboardTimeSeriesData.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.exportTensorboardTimeSeriesDataStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.exportTensorboardTimeSeriesData, request)); + assert.strictEqual( + (client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with exportTensorboardTimeSeriesData without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), + ]; + client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.ITimeSeriesDataPoint[] = []; + const iterable = client.exportTensorboardTimeSeriesDataAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with exportTensorboardTimeSeriesData with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest()); + request.tensorboardTimeSeries = ''; + const expectedHeaderRequestParams = "tensorboard_time_series=";const expectedError = new Error('expected'); + client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.exportTensorboardTimeSeriesDataAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.ITimeSeriesDataPoint[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1beta1/test/gapic_vizier_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_vizier_service_v1beta1.ts new file mode 100644 index 00000000..cc9db7ec --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_vizier_service_v1beta1.ts @@ -0,0 +1,3680 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as vizierserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.VizierServiceClient', () => { + it('has servicePath', () => { + const servicePath = vizierserviceModule.v1beta1.VizierServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = vizierserviceModule.v1beta1.VizierServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = vizierserviceModule.v1beta1.VizierServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.vizierServiceStub, undefined); + await client.initialize(); + assert(client.vizierServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.vizierServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.vizierServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('createStudy', () => { + it('invokes createStudy without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateStudyRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()); + client.innerApiCalls.createStudy = stubSimpleCall(expectedResponse); + const [response] = await client.createStudy(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createStudy without error using callback', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateStudyRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()); + client.innerApiCalls.createStudy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createStudy( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IStudy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createStudy with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateStudyRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createStudy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createStudy(request), expectedError); + assert((client.innerApiCalls.createStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createStudy with closed client', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateStudyRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createStudy(request), expectedError); + }); + }); + + describe('getStudy', () => { + it('invokes getStudy without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetStudyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()); + client.innerApiCalls.getStudy = stubSimpleCall(expectedResponse); + const [response] = await client.getStudy(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getStudy without error using callback', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetStudyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()); + client.innerApiCalls.getStudy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getStudy( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IStudy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getStudy with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetStudyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getStudy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getStudy(request), expectedError); + assert((client.innerApiCalls.getStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getStudy with closed client', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetStudyRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getStudy(request), expectedError); + }); + }); + + describe('deleteStudy', () => { + it('invokes deleteStudy without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteStudyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteStudy = stubSimpleCall(expectedResponse); + const [response] = await client.deleteStudy(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteStudy without error using callback', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteStudyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteStudy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteStudy( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteStudy with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteStudyRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteStudy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteStudy(request), expectedError); + assert((client.innerApiCalls.deleteStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteStudy with closed client', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteStudyRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteStudy(request), expectedError); + }); + }); + + describe('lookupStudy', () => { + it('invokes lookupStudy without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LookupStudyRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()); + client.innerApiCalls.lookupStudy = stubSimpleCall(expectedResponse); + const [response] = await client.lookupStudy(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.lookupStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes lookupStudy without error using callback', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LookupStudyRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()); + client.innerApiCalls.lookupStudy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.lookupStudy( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IStudy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.lookupStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes lookupStudy with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LookupStudyRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.lookupStudy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.lookupStudy(request), expectedError); + assert((client.innerApiCalls.lookupStudy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes lookupStudy with closed client', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LookupStudyRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.lookupStudy(request), expectedError); + }); + }); + + describe('createTrial', () => { + it('invokes createTrial without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTrialRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); + client.innerApiCalls.createTrial = stubSimpleCall(expectedResponse); + const [response] = await client.createTrial(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTrial without error using callback', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTrialRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); + client.innerApiCalls.createTrial = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTrial( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITrial|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createTrial with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTrialRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTrial(request), expectedError); + assert((client.innerApiCalls.createTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createTrial with closed client', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTrialRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createTrial(request), expectedError); + }); + }); + + describe('getTrial', () => { + it('invokes getTrial without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); + client.innerApiCalls.getTrial = stubSimpleCall(expectedResponse); + const [response] = await client.getTrial(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTrial without error using callback', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); + client.innerApiCalls.getTrial = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTrial( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITrial|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getTrial with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTrial(request), expectedError); + assert((client.innerApiCalls.getTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getTrial with closed client', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTrialRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTrial(request), expectedError); + }); + }); + + describe('addTrialMeasurement', () => { + it('invokes addTrialMeasurement without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddTrialMeasurementRequest()); + request.trialName = ''; + const expectedHeaderRequestParams = "trial_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); + client.innerApiCalls.addTrialMeasurement = stubSimpleCall(expectedResponse); + const [response] = await client.addTrialMeasurement(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addTrialMeasurement as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes addTrialMeasurement without error using callback', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddTrialMeasurementRequest()); + request.trialName = ''; + const expectedHeaderRequestParams = "trial_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); + client.innerApiCalls.addTrialMeasurement = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addTrialMeasurement( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITrial|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addTrialMeasurement as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes addTrialMeasurement with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddTrialMeasurementRequest()); + request.trialName = ''; + const expectedHeaderRequestParams = "trial_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addTrialMeasurement = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addTrialMeasurement(request), expectedError); + assert((client.innerApiCalls.addTrialMeasurement as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes addTrialMeasurement with closed client', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddTrialMeasurementRequest()); + request.trialName = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.addTrialMeasurement(request), expectedError); + }); + }); + + describe('completeTrial', () => { + it('invokes completeTrial without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CompleteTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); + client.innerApiCalls.completeTrial = stubSimpleCall(expectedResponse); + const [response] = await client.completeTrial(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.completeTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes completeTrial without error using callback', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CompleteTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); + client.innerApiCalls.completeTrial = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.completeTrial( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITrial|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.completeTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes completeTrial with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CompleteTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.completeTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.completeTrial(request), expectedError); + assert((client.innerApiCalls.completeTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes completeTrial with closed client', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CompleteTrialRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.completeTrial(request), expectedError); + }); + }); + + describe('deleteTrial', () => { + it('invokes deleteTrial without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteTrial = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTrial(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTrial without error using callback', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteTrial = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTrial( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteTrial with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteTrial(request), expectedError); + assert((client.innerApiCalls.deleteTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteTrial with closed client', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTrialRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteTrial(request), expectedError); + }); + }); + + describe('stopTrial', () => { + it('invokes stopTrial without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.StopTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); + client.innerApiCalls.stopTrial = stubSimpleCall(expectedResponse); + const [response] = await client.stopTrial(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.stopTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes stopTrial without error using callback', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.StopTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); + client.innerApiCalls.stopTrial = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.stopTrial( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITrial|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.stopTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes stopTrial with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.StopTrialRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.stopTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.stopTrial(request), expectedError); + assert((client.innerApiCalls.stopTrial as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes stopTrial with closed client', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.StopTrialRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.stopTrial(request), expectedError); + }); + }); + + describe('listOptimalTrials', () => { + it('invokes listOptimalTrials without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListOptimalTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListOptimalTrialsResponse()); + client.innerApiCalls.listOptimalTrials = stubSimpleCall(expectedResponse); + const [response] = await client.listOptimalTrials(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listOptimalTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listOptimalTrials without error using callback', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListOptimalTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListOptimalTrialsResponse()); + client.innerApiCalls.listOptimalTrials = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listOptimalTrials( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listOptimalTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listOptimalTrials with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListOptimalTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listOptimalTrials = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listOptimalTrials(request), expectedError); + assert((client.innerApiCalls.listOptimalTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listOptimalTrials with closed client', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListOptimalTrialsRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listOptimalTrials(request), expectedError); + }); + }); + + describe('suggestTrials', () => { + it('invokes suggestTrials without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SuggestTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.suggestTrials = stubLongRunningCall(expectedResponse); + const [operation] = await client.suggestTrials(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes suggestTrials without error using callback', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SuggestTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.suggestTrials = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.suggestTrials( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes suggestTrials with call error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SuggestTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.suggestTrials = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.suggestTrials(request), expectedError); + assert((client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes suggestTrials with LRO error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SuggestTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.suggestTrials = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.suggestTrials(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkSuggestTrialsProgress without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkSuggestTrialsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkSuggestTrialsProgress with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkSuggestTrialsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('checkTrialEarlyStoppingState', () => { + it('invokes checkTrialEarlyStoppingState without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CheckTrialEarlyStoppingStateRequest()); + request.trialName = ''; + const expectedHeaderRequestParams = "trial_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(expectedResponse); + const [operation] = await client.checkTrialEarlyStoppingState(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkTrialEarlyStoppingState without error using callback', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CheckTrialEarlyStoppingStateRequest()); + request.trialName = ''; + const expectedHeaderRequestParams = "trial_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.checkTrialEarlyStoppingState( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes checkTrialEarlyStoppingState with call error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CheckTrialEarlyStoppingStateRequest()); + request.trialName = ''; + const expectedHeaderRequestParams = "trial_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.checkTrialEarlyStoppingState(request), expectedError); + assert((client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkTrialEarlyStoppingState with LRO error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CheckTrialEarlyStoppingStateRequest()); + request.trialName = ''; + const expectedHeaderRequestParams = "trial_name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.checkTrialEarlyStoppingState(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCheckTrialEarlyStoppingStateProgress without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCheckTrialEarlyStoppingStateProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCheckTrialEarlyStoppingStateProgress with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCheckTrialEarlyStoppingStateProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listStudies', () => { + it('invokes listStudies without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListStudiesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), + ]; + client.innerApiCalls.listStudies = stubSimpleCall(expectedResponse); + const [response] = await client.listStudies(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listStudies as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listStudies without error using callback', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListStudiesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), + ]; + client.innerApiCalls.listStudies = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listStudies( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IStudy[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listStudies as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listStudies with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListStudiesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listStudies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listStudies(request), expectedError); + assert((client.innerApiCalls.listStudies as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listStudiesStream without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListStudiesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), + ]; + client.descriptors.page.listStudies.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listStudiesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Study[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Study) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listStudies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listStudies, request)); + assert.strictEqual( + (client.descriptors.page.listStudies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStudiesStream with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListStudiesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listStudies.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listStudiesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Study[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Study) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listStudies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listStudies, request)); + assert.strictEqual( + (client.descriptors.page.listStudies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listStudies without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListStudiesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), + ]; + client.descriptors.page.listStudies.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IStudy[] = []; + const iterable = client.listStudiesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listStudies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listStudies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listStudies with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListStudiesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listStudies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listStudiesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IStudy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listStudies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listStudies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listTrials', () => { + it('invokes listTrials without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), + ]; + client.innerApiCalls.listTrials = stubSimpleCall(expectedResponse); + const [response] = await client.listTrials(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTrials without error using callback', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), + ]; + client.innerApiCalls.listTrials = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTrials( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITrial[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listTrials with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listTrials = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTrials(request), expectedError); + assert((client.innerApiCalls.listTrials as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listTrialsStream without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), + ]; + client.descriptors.page.listTrials.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTrialsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Trial[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Trial) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listTrials.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTrials, request)); + assert.strictEqual( + (client.descriptors.page.listTrials.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listTrialsStream with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listTrials.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTrialsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.Trial[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Trial) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTrials.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTrials, request)); + assert.strictEqual( + (client.descriptors.page.listTrials.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTrials without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), + ]; + client.descriptors.page.listTrials.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.ITrial[] = []; + const iterable = client.listTrialsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTrials.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTrials.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTrials with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrialsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listTrials.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTrialsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.ITrial[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTrials.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listTrials.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('annotation', () => { + const fakePath = "/rendered/path/annotation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + annotation: "annotationValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, "annotationValue"); + assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('annotationSpec', () => { + const fakePath = "/rendered/path/annotationSpec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + annotation_spec: "annotationSpecValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, "annotationSpecValue"); + assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('artifact', () => { + const fakePath = "/rendered/path/artifact"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + artifact: "artifactValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, "artifactValue"); + assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = "/rendered/path/batchPredictionJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch_prediction_job: "batchPredictionJobValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, "batchPredictionJobValue"); + assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('context', () => { + const fakePath = "/rendered/path/context"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + context: "contextValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.contextPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, "contextValue"); + assert((client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('customJob', () => { + const fakePath = "/rendered/path/customJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + custom_job: "customJobValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, "customJobValue"); + assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataItem', () => { + const fakePath = "/rendered/path/dataItem"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + data_item: "dataItemValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, "dataItemValue"); + assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = "/rendered/path/dataLabelingJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_labeling_job: "dataLabelingJobValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, "dataLabelingJobValue"); + assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataset', () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('endpoint', () => { + const fakePath = "/rendered/path/endpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + endpoint: "endpointValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.endpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('endpointPath', () => { + const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEndpointName', () => { + const result = client.matchProjectFromEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEndpointName', () => { + const result = client.matchLocationFromEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEndpointFromEndpointName', () => { + const result = client.matchEndpointFromEndpointName(fakePath); + assert.strictEqual(result, "endpointValue"); + assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('entityType', () => { + const fakePath = "/rendered/path/entityType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + execution: "executionValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('feature', () => { + const fakePath = "/rendered/path/feature"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + entity_type: "entityTypeValue", + feature: "featureValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurePath', () => { + const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeatureName', () => { + const result = client.matchProjectFromFeatureName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeatureName', () => { + const result = client.matchLocationFromFeatureName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeatureName', () => { + const result = client.matchFeaturestoreFromFeatureName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEntityTypeFromFeatureName', () => { + const result = client.matchEntityTypeFromFeatureName(fakePath); + assert.strictEqual(result, "entityTypeValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeatureFromFeatureName', () => { + const result = client.matchFeatureFromFeatureName(fakePath); + assert.strictEqual(result, "featureValue"); + assert((client.pathTemplates.featurePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('featurestore', () => { + const fakePath = "/rendered/path/featurestore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + featurestore: "featurestoreValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, "featurestoreValue"); + assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = "/rendered/path/hyperparameterTuningJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + hyperparameter_tuning_job: "hyperparameterTuningJobValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, "hyperparameterTuningJobValue"); + assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('index', () => { + const fakePath = "/rendered/path/index"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index: "indexValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath("projectValue", "locationValue", "indexValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, "indexValue"); + assert((client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = "/rendered/path/indexEndpoint"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + index_endpoint: "indexEndpointValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, "indexEndpointValue"); + assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataSchema', () => { + const fakePath = "/rendered/path/metadataSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + metadata_schema: "metadataSchemaValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, "metadataSchemaValue"); + assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('metadataStore', () => { + const fakePath = "/rendered/path/metadataStore"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + metadata_store: "metadataStoreValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, "metadataStoreValue"); + assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('model', () => { + const fakePath = "/rendered/path/model"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath("projectValue", "locationValue", "modelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); + assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = "/rendered/path/modelEvaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = "/rendered/path/modelEvaluationSlice"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + model: "modelValue", + evaluation: "evaluationValue", + slice: "sliceValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "modelValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, "sliceValue"); + assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('pipelineJob', () => { + const fakePath = "/rendered/path/pipelineJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + pipeline_job: "pipelineJobValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, "pipelineJobValue"); + assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('specialistPool', () => { + const fakePath = "/rendered/path/specialistPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + specialist_pool: "specialistPoolValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, "specialistPoolValue"); + assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('study', () => { + const fakePath = "/rendered/path/study"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.studyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath("projectValue", "locationValue", "studyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboard', () => { + const fakePath = "/rendered/path/tensorboard"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = "/rendered/path/tensorboardExperiment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = "/rendered/path/tensorboardRun"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = "/rendered/path/tensorboardTimeSeries"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tensorboard: "tensorboardValue", + experiment: "experimentValue", + run: "runValue", + time_series: "timeSeriesValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "tensorboardValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "experimentValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "runValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, "timeSeriesValue"); + assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = "/rendered/path/trainingPipeline"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + training_pipeline: "trainingPipelineValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, "trainingPipelineValue"); + assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('trial', () => { + const fakePath = "/rendered/path/trial"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + study: "studyValue", + trial: "trialValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.trialPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, "studyValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, "trialValue"); + assert((client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1beta1/tsconfig.json b/owl-bot-staging/v1beta1/tsconfig.json new file mode 100644 index 00000000..c78f1c88 --- /dev/null +++ b/owl-bot-staging/v1beta1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/v1beta1/webpack.config.js b/owl-bot-staging/v1beta1/webpack.config.js new file mode 100644 index 00000000..f4947d41 --- /dev/null +++ b/owl-bot-staging/v1beta1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 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 +// +// https://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. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'DatasetService', + filename: './dataset-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From 9f5d2b8f164c90de3edda9b613f8a62d2cc9c82b Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 19 May 2022 02:14:35 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- owl-bot-staging/v1/.eslintignore | 7 - owl-bot-staging/v1/.eslintrc.json | 3 - owl-bot-staging/v1/.gitignore | 14 - owl-bot-staging/v1/.jsdoc.js | 55 - owl-bot-staging/v1/.mocharc.js | 33 - owl-bot-staging/v1/.prettierrc.js | 22 - owl-bot-staging/v1/README.md | 1 - owl-bot-staging/v1/linkinator.config.json | 16 - owl-bot-staging/v1/package.json | 78 - .../aiplatform/v1/accelerator_type.proto | 55 - .../cloud/aiplatform/v1/annotation.proto | 90 - .../cloud/aiplatform/v1/annotation_spec.proto | 55 - .../google/cloud/aiplatform/v1/artifact.proto | 109 - .../aiplatform/v1/batch_prediction_job.proto | 286 - .../aiplatform/v1/completion_stats.proto | 44 - .../google/cloud/aiplatform/v1/context.proto | 94 - .../cloud/aiplatform/v1/custom_job.proto | 277 - .../cloud/aiplatform/v1/data_item.proto | 70 - .../aiplatform/v1/data_labeling_job.proto | 207 - .../google/cloud/aiplatform/v1/dataset.proto | 144 - .../cloud/aiplatform/v1/dataset_service.proto | 412 - .../aiplatform/v1/deployed_index_ref.proto | 42 - .../aiplatform/v1/deployed_model_ref.proto | 42 - .../cloud/aiplatform/v1/encryption_spec.proto | 38 - .../google/cloud/aiplatform/v1/endpoint.proto | 252 - .../aiplatform/v1/endpoint_service.proto | 325 - .../cloud/aiplatform/v1/entity_type.proto | 86 - .../google/cloud/aiplatform/v1/env_var.proto | 42 - .../google/cloud/aiplatform/v1/event.proto | 80 - .../cloud/aiplatform/v1/execution.proto | 115 - .../cloud/aiplatform/v1/explanation.proto | 401 - .../aiplatform/v1/explanation_metadata.proto | 395 - .../google/cloud/aiplatform/v1/feature.proto | 154 - .../v1/feature_monitoring_stats.proto | 86 - .../aiplatform/v1/feature_selector.proto | 44 - .../cloud/aiplatform/v1/featurestore.proto | 111 - .../v1/featurestore_monitoring.proto | 149 - .../v1/featurestore_online_service.proto | 225 - .../aiplatform/v1/featurestore_service.proto | 1225 --- .../v1/hyperparameter_tuning_job.proto | 110 - .../google/cloud/aiplatform/v1/index.proto | 96 - .../cloud/aiplatform/v1/index_endpoint.proto | 245 - .../v1/index_endpoint_service.proto | 335 - .../cloud/aiplatform/v1/index_service.proto | 277 - .../google/cloud/aiplatform/v1/io.proto | 108 - .../cloud/aiplatform/v1/job_service.proto | 1003 -- .../cloud/aiplatform/v1/job_state.proto | 66 - .../aiplatform/v1/lineage_subgraph.proto | 42 - .../aiplatform/v1/machine_resources.proto | 204 - .../v1/manual_batch_tuning_parameters.proto | 39 - .../cloud/aiplatform/v1/metadata_schema.proto | 79 - .../aiplatform/v1/metadata_service.proto | 1257 --- .../cloud/aiplatform/v1/metadata_store.proto | 65 - .../aiplatform/v1/migratable_resource.proto | 150 - .../aiplatform/v1/migration_service.proto | 314 - .../google/cloud/aiplatform/v1/model.proto | 559 -- .../v1/model_deployment_monitoring_job.proto | 300 - .../aiplatform/v1/model_evaluation.proto | 116 - .../v1/model_evaluation_slice.proto | 71 - .../aiplatform/v1/model_monitoring.proto | 202 - .../cloud/aiplatform/v1/model_service.proto | 480 - .../cloud/aiplatform/v1/operation.proto | 52 - .../cloud/aiplatform/v1/pipeline_job.proto | 319 - .../aiplatform/v1/pipeline_service.proto | 403 - .../cloud/aiplatform/v1/pipeline_state.proto | 58 - .../aiplatform/v1/prediction_service.proto | 227 - .../instance/image_classification.proto | 44 - .../instance/image_object_detection.proto | 44 - .../predict/instance/image_segmentation.proto | 39 - .../instance/text_classification.proto | 38 - .../predict/instance/text_extraction.proto | 45 - .../predict/instance/text_sentiment.proto | 38 - .../instance/video_action_recognition.proto | 51 - .../instance/video_classification.proto | 51 - .../instance/video_object_tracking.proto | 51 - .../predict/params/image_classification.proto | 39 - .../params/image_object_detection.proto | 39 - .../predict/params/image_segmentation.proto | 36 - .../params/video_action_recognition.proto | 39 - .../predict/params/video_classification.proto | 64 - .../params/video_object_tracking.proto | 43 - .../predict/prediction/classification.proto | 41 - .../prediction/image_object_detection.proto | 51 - .../prediction/image_segmentation.proto | 45 - .../prediction/tabular_classification.proto | 39 - .../prediction/tabular_regression.proto | 39 - .../predict/prediction/text_extraction.proto | 52 - .../predict/prediction/text_sentiment.proto | 37 - .../prediction/video_action_recognition.proto | 54 - .../prediction/video_classification.proto | 67 - .../prediction/video_object_tracking.proto | 82 - .../automl_image_classification.proto | 128 - .../automl_image_object_detection.proto | 120 - .../automl_image_segmentation.proto | 106 - .../definition/automl_tables.proto | 285 - .../automl_text_classification.proto | 37 - .../definition/automl_text_extraction.proto | 37 - .../definition/automl_text_sentiment.proto | 44 - .../automl_video_action_recognition.proto | 62 - .../automl_video_classification.proto | 56 - .../automl_video_object_tracking.proto | 67 - .../export_evaluated_data_items_config.proto | 43 - .../cloud/aiplatform/v1/specialist_pool.proto | 62 - .../v1/specialist_pool_service.proto | 210 - .../google/cloud/aiplatform/v1/study.proto | 559 -- .../cloud/aiplatform/v1/tensorboard.proto | 86 - .../aiplatform/v1/tensorboard_data.proto | 101 - .../v1/tensorboard_experiment.proto | 78 - .../cloud/aiplatform/v1/tensorboard_run.proto | 81 - .../aiplatform/v1/tensorboard_service.proto | 1006 -- .../v1/tensorboard_time_series.proto | 106 - .../aiplatform/v1/training_pipeline.proto | 388 - .../google/cloud/aiplatform/v1/types.proto | 49 - .../v1/unmanaged_container_model.proto | 43 - .../aiplatform/v1/user_action_reference.proto | 47 - .../google/cloud/aiplatform/v1/value.proto | 39 - .../cloud/aiplatform/v1/vizier_service.proto | 505 - .../v1/dataset_service.create_dataset.js | 65 - .../v1/dataset_service.delete_dataset.js | 61 - .../v1/dataset_service.export_data.js | 66 - .../v1/dataset_service.get_annotation_spec.js | 64 - .../v1/dataset_service.get_dataset.js | 62 - .../v1/dataset_service.import_data.js | 67 - .../v1/dataset_service.list_annotations.js | 83 - .../v1/dataset_service.list_data_items.js | 83 - .../v1/dataset_service.list_datasets.js | 96 - .../v1/dataset_service.update_dataset.js | 68 - .../v1/endpoint_service.create_endpoint.js | 76 - .../v1/endpoint_service.delete_endpoint.js | 61 - .../v1/endpoint_service.deploy_model.js | 81 - .../v1/endpoint_service.get_endpoint.js | 60 - .../v1/endpoint_service.list_endpoints.js | 102 - .../v1/endpoint_service.undeploy_model.js | 76 - .../v1/endpoint_service.update_endpoint.js | 63 - ...ine_serving_service.read_feature_values.js | 74 - ...g_service.streaming_read_feature_values.js | 78 - ...turestore_service.batch_create_features.js | 69 - ...store_service.batch_read_feature_values.js | 108 - ...featurestore_service.create_entity_type.js | 74 - .../v1/featurestore_service.create_feature.js | 75 - ...eaturestore_service.create_featurestore.js | 75 - ...featurestore_service.delete_entity_type.js | 66 - .../v1/featurestore_service.delete_feature.js | 61 - ...eaturestore_service.delete_featurestore.js | 67 - ...turestore_service.export_feature_values.js | 85 - .../featurestore_service.get_entity_type.js | 60 - .../v1/featurestore_service.get_feature.js | 60 - .../featurestore_service.get_featurestore.js | 58 - ...turestore_service.import_feature_values.js | 111 - .../featurestore_service.list_entity_types.js | 109 - .../v1/featurestore_service.list_features.js | 119 - ...featurestore_service.list_featurestores.js | 110 - .../featurestore_service.search_features.js | 129 - ...featurestore_service.update_entity_type.js | 81 - .../v1/featurestore_service.update_feature.js | 75 - ...eaturestore_service.update_featurestore.js | 75 - ..._endpoint_service.create_index_endpoint.js | 65 - ..._endpoint_service.delete_index_endpoint.js | 61 - .../v1/index_endpoint_service.deploy_index.js | 66 - ...dex_endpoint_service.get_index_endpoint.js | 60 - ...x_endpoint_service.list_index_endpoints.js | 95 - ..._endpoint_service.mutate_deployed_index.js | 68 - .../index_endpoint_service.undeploy_index.js | 66 - ..._endpoint_service.update_index_endpoint.js | 63 - .../v1/index_service.create_index.js | 65 - .../v1/index_service.delete_index.js | 61 - .../generated/v1/index_service.get_index.js | 60 - .../v1/index_service.list_indexes.js | 80 - .../v1/index_service.update_index.js | 64 - ...job_service.cancel_batch_prediction_job.js | 60 - .../v1/job_service.cancel_custom_job.js | 60 - .../job_service.cancel_data_labeling_job.js | 60 - ...ervice.cancel_hyperparameter_tuning_job.js | 60 - ...job_service.create_batch_prediction_job.js | 64 - .../v1/job_service.create_custom_job.js | 64 - .../job_service.create_data_labeling_job.js | 64 - ...ervice.create_hyperparameter_tuning_job.js | 64 - ....create_model_deployment_monitoring_job.js | 64 - ...job_service.delete_batch_prediction_job.js | 61 - .../v1/job_service.delete_custom_job.js | 61 - .../job_service.delete_data_labeling_job.js | 61 - ...ervice.delete_hyperparameter_tuning_job.js | 61 - ....delete_model_deployment_monitoring_job.js | 61 - .../job_service.get_batch_prediction_job.js | 60 - .../v1/job_service.get_custom_job.js | 60 - .../v1/job_service.get_data_labeling_job.js | 60 - ...b_service.get_hyperparameter_tuning_job.js | 60 - ...ice.get_model_deployment_monitoring_job.js | 60 - .../job_service.list_batch_prediction_jobs.js | 89 - .../v1/job_service.list_custom_jobs.js | 88 - .../v1/job_service.list_data_labeling_jobs.js | 94 - ...service.list_hyperparameter_tuning_jobs.js | 88 - ...e.list_model_deployment_monitoring_jobs.js | 77 - ...e.pause_model_deployment_monitoring_job.js | 60 - ....resume_model_deployment_monitoring_job.js | 60 - ...l_deployment_monitoring_stats_anomalies.js | 100 - ....update_model_deployment_monitoring_job.js | 89 - ...ce.add_context_artifacts_and_executions.js | 74 - .../metadata_service.add_context_children.js | 64 - .../metadata_service.add_execution_events.js | 65 - .../v1/metadata_service.create_artifact.js | 76 - .../v1/metadata_service.create_context.js | 76 - .../v1/metadata_service.create_execution.js | 77 - ...metadata_service.create_metadata_schema.js | 77 - .../metadata_service.create_metadata_store.js | 77 - .../v1/metadata_service.delete_artifact.js | 67 - .../v1/metadata_service.delete_context.js | 72 - .../v1/metadata_service.delete_execution.js | 67 - .../metadata_service.delete_metadata_store.js | 61 - .../v1/metadata_service.get_artifact.js | 60 - .../v1/metadata_service.get_context.js | 60 - .../v1/metadata_service.get_execution.js | 60 - .../metadata_service.get_metadata_schema.js | 60 - .../v1/metadata_service.get_metadata_store.js | 60 - .../v1/metadata_service.list_artifacts.js | 102 - .../v1/metadata_service.list_contexts.js | 105 - .../v1/metadata_service.list_executions.js | 102 - .../metadata_service.list_metadata_schemas.js | 81 - .../metadata_service.list_metadata_stores.js | 77 - .../v1/metadata_service.purge_artifacts.js | 73 - .../v1/metadata_service.purge_contexts.js | 73 - .../v1/metadata_service.purge_executions.js | 73 - ...service.query_artifact_lineage_subgraph.js | 93 - ..._service.query_context_lineage_subgraph.js | 64 - ...vice.query_execution_inputs_and_outputs.js | 61 - .../v1/metadata_service.update_artifact.js | 72 - .../v1/metadata_service.update_context.js | 72 - .../v1/metadata_service.update_execution.js | 72 - ...gration_service.batch_migrate_resources.js | 67 - ...ion_service.search_migratable_resources.js | 87 - .../v1/model_service.delete_model.js | 60 - .../v1/model_service.export_model.js | 64 - .../generated/v1/model_service.get_model.js | 59 - .../v1/model_service.get_model_evaluation.js | 60 - ...odel_service.get_model_evaluation_slice.js | 60 - .../model_service.import_model_evaluation.js | 64 - ...el_service.list_model_evaluation_slices.js | 82 - .../model_service.list_model_evaluations.js | 80 - .../generated/v1/model_service.list_models.js | 102 - .../v1/model_service.update_model.js | 81 - .../v1/model_service.upload_model.js | 65 - .../pipeline_service.cancel_pipeline_job.js | 60 - ...peline_service.cancel_training_pipeline.js | 60 - .../pipeline_service.create_pipeline_job.js | 72 - ...peline_service.create_training_pipeline.js | 64 - .../pipeline_service.delete_pipeline_job.js | 61 - ...peline_service.delete_training_pipeline.js | 61 - .../v1/pipeline_service.get_pipeline_job.js | 60 - .../pipeline_service.get_training_pipeline.js | 60 - .../v1/pipeline_service.list_pipeline_jobs.js | 119 - ...ipeline_service.list_training_pipelines.js | 88 - .../v1/prediction_service.explain.js | 96 - .../v1/prediction_service.predict.js | 80 - .../v1/prediction_service.raw_predict.js | 74 - ...t_metadata.google.cloud.aiplatform.v1.json | 8555 ---------------- ...ist_pool_service.create_specialist_pool.js | 65 - ...ist_pool_service.delete_specialist_pool.js | 66 - ...ialist_pool_service.get_specialist_pool.js | 60 - ...list_pool_service.list_specialist_pools.js | 76 - ...ist_pool_service.update_specialist_pool.js | 64 - ...d_service.batch_create_tensorboard_runs.js | 68 - ...ce.batch_create_tensorboard_time_series.js | 70 - ...batch_read_tensorboard_time_series_data.js | 68 - .../tensorboard_service.create_tensorboard.js | 65 - ...d_service.create_tensorboard_experiment.js | 72 - ...sorboard_service.create_tensorboard_run.js | 73 - ..._service.create_tensorboard_time_series.js | 73 - .../tensorboard_service.delete_tensorboard.js | 61 - ...d_service.delete_tensorboard_experiment.js | 61 - ...sorboard_service.delete_tensorboard_run.js | 61 - ..._service.delete_tensorboard_time_series.js | 61 - ...ice.export_tensorboard_time_series_data.js | 87 - .../v1/tensorboard_service.get_tensorboard.js | 60 - ...oard_service.get_tensorboard_experiment.js | 60 - ...tensorboard_service.get_tensorboard_run.js | 60 - ...ard_service.get_tensorboard_time_series.js | 60 - ...rd_service.list_tensorboard_experiments.js | 90 - ...nsorboard_service.list_tensorboard_runs.js | 90 - ...rd_service.list_tensorboard_time_series.js | 90 - .../tensorboard_service.list_tensorboards.js | 90 - ...oard_service.read_tensorboard_blob_data.js | 66 - ...rvice.read_tensorboard_time_series_data.js | 70 - .../tensorboard_service.update_tensorboard.js | 71 - ...d_service.update_tensorboard_experiment.js | 70 - ...sorboard_service.update_tensorboard_run.js | 70 - ..._service.update_tensorboard_time_series.js | 71 - ...rvice.write_tensorboard_experiment_data.js | 65 - ...oard_service.write_tensorboard_run_data.js | 69 - .../vizier_service.add_trial_measurement.js | 65 - ...ervice.check_trial_early_stopping_state.js | 61 - .../v1/vizier_service.complete_trial.js | 76 - .../v1/vizier_service.create_study.js | 64 - .../v1/vizier_service.create_trial.js | 64 - .../v1/vizier_service.delete_study.js | 59 - .../v1/vizier_service.delete_trial.js | 60 - .../generated/v1/vizier_service.get_study.js | 59 - .../generated/v1/vizier_service.get_trial.js | 60 - .../v1/vizier_service.list_optimal_trials.js | 58 - .../v1/vizier_service.list_studies.js | 71 - .../v1/vizier_service.list_trials.js | 71 - .../v1/vizier_service.lookup_study.js | 64 - .../generated/v1/vizier_service.stop_trial.js | 60 - .../v1/vizier_service.suggest_trials.js | 73 - owl-bot-staging/v1/src/index.ts | 53 - .../v1/src/v1/dataset_service_client.ts | 3594 ------- .../src/v1/dataset_service_client_config.json | 66 - .../v1/src/v1/dataset_service_proto_list.json | 110 - .../v1/src/v1/endpoint_service_client.ts | 3161 ------ .../v1/endpoint_service_client_config.json | 54 - .../src/v1/endpoint_service_proto_list.json | 110 - ...turestore_online_serving_service_client.ts | 2386 ----- ..._online_serving_service_client_config.json | 34 - ...ore_online_serving_service_proto_list.json | 110 - .../v1/src/v1/featurestore_service_client.ts | 5310 ---------- .../featurestore_service_client_config.json | 106 - .../v1/featurestore_service_proto_list.json | 110 - owl-bot-staging/v1/src/v1/gapic_metadata.json | 2199 ----- owl-bot-staging/v1/src/v1/index.ts | 33 - .../src/v1/index_endpoint_service_client.ts | 3218 ------ .../index_endpoint_service_client_config.json | 58 - .../v1/index_endpoint_service_proto_list.json | 110 - .../v1/src/v1/index_service_client.ts | 2884 ------ .../src/v1/index_service_client_config.json | 46 - .../v1/src/v1/index_service_proto_list.json | 110 - .../v1/src/v1/job_service_client.ts | 5577 ----------- .../v1/src/v1/job_service_client_config.json | 138 - .../v1/src/v1/job_service_proto_list.json | 110 - .../v1/src/v1/metadata_service_client.ts | 5917 ----------- .../v1/metadata_service_client_config.json | 150 - .../src/v1/metadata_service_proto_list.json | 110 - .../v1/src/v1/migration_service_client.ts | 2642 ----- .../v1/migration_service_client_config.json | 34 - .../src/v1/migration_service_proto_list.json | 110 - .../v1/src/v1/model_service_client.ts | 3672 ------- .../src/v1/model_service_client_config.json | 70 - .../v1/src/v1/model_service_proto_list.json | 110 - .../v1/src/v1/pipeline_service_client.ts | 3550 ------- .../v1/pipeline_service_client_config.json | 66 - .../src/v1/pipeline_service_proto_list.json | 110 - .../v1/src/v1/prediction_service_client.ts | 2532 ----- .../v1/prediction_service_client_config.json | 38 - .../src/v1/prediction_service_proto_list.json | 110 - .../src/v1/specialist_pool_service_client.ts | 2883 ------ ...specialist_pool_service_client_config.json | 46 - .../specialist_pool_service_proto_list.json | 110 - .../v1/src/v1/tensorboard_service_client.ts | 5388 ---------- .../v1/tensorboard_service_client_config.json | 138 - .../v1/tensorboard_service_proto_list.json | 110 - .../v1/src/v1/vizier_service_client.ts | 3713 ------- .../src/v1/vizier_service_client_config.json | 86 - .../v1/src/v1/vizier_service_proto_list.json | 110 - .../system-test/fixtures/sample/src/index.js | 41 - .../system-test/fixtures/sample/src/index.ts | 116 - owl-bot-staging/v1/system-test/install.ts | 49 - .../v1/test/gapic_dataset_service_v1.ts | 3419 ------- .../v1/test/gapic_endpoint_service_v1.ts | 2876 ------ ..._featurestore_online_serving_service_v1.ts | 1978 ---- .../v1/test/gapic_featurestore_service_v1.ts | 4882 --------- .../test/gapic_index_endpoint_service_v1.ts | 3020 ------ .../v1/test/gapic_index_service_v1.ts | 2635 ----- .../v1/test/gapic_job_service_v1.ts | 5637 ----------- .../v1/test/gapic_metadata_service_v1.ts | 5934 ----------- .../v1/test/gapic_migration_service_v1.ts | 2246 ----- .../v1/test/gapic_model_service_v1.ts | 3469 ------- .../v1/test/gapic_pipeline_service_v1.ts | 3195 ------ .../v1/test/gapic_prediction_service_v1.ts | 2069 ---- .../test/gapic_specialist_pool_service_v1.ts | 2635 ----- .../v1/test/gapic_tensorboard_service_v1.ts | 5557 ----------- .../v1/test/gapic_vizier_service_v1.ts | 3680 ------- owl-bot-staging/v1/tsconfig.json | 19 - owl-bot-staging/v1/webpack.config.js | 64 - owl-bot-staging/v1beta1/.eslintignore | 7 - owl-bot-staging/v1beta1/.eslintrc.json | 3 - owl-bot-staging/v1beta1/.gitignore | 14 - owl-bot-staging/v1beta1/.jsdoc.js | 55 - owl-bot-staging/v1beta1/.mocharc.js | 33 - owl-bot-staging/v1beta1/.prettierrc.js | 22 - owl-bot-staging/v1beta1/README.md | 1 - .../v1beta1/linkinator.config.json | 16 - owl-bot-staging/v1beta1/package.json | 78 - .../aiplatform/v1beta1/accelerator_type.proto | 55 - .../cloud/aiplatform/v1beta1/annotation.proto | 90 - .../aiplatform/v1beta1/annotation_spec.proto | 55 - .../cloud/aiplatform/v1beta1/artifact.proto | 109 - .../v1beta1/batch_prediction_job.proto | 298 - .../aiplatform/v1beta1/completion_stats.proto | 44 - .../cloud/aiplatform/v1beta1/context.proto | 94 - .../cloud/aiplatform/v1beta1/custom_job.proto | 268 - .../cloud/aiplatform/v1beta1/data_item.proto | 70 - .../v1beta1/data_labeling_job.proto | 207 - .../cloud/aiplatform/v1beta1/dataset.proto | 144 - .../aiplatform/v1beta1/dataset_service.proto | 412 - .../v1beta1/deployed_index_ref.proto | 42 - .../v1beta1/deployed_model_ref.proto | 42 - .../aiplatform/v1beta1/encryption_spec.proto | 38 - .../cloud/aiplatform/v1beta1/endpoint.proto | 252 - .../aiplatform/v1beta1/endpoint_service.proto | 315 - .../aiplatform/v1beta1/entity_type.proto | 86 - .../cloud/aiplatform/v1beta1/env_var.proto | 42 - .../cloud/aiplatform/v1beta1/event.proto | 80 - .../cloud/aiplatform/v1beta1/execution.proto | 115 - .../aiplatform/v1beta1/explanation.proto | 520 - .../v1beta1/explanation_metadata.proto | 398 - .../cloud/aiplatform/v1beta1/feature.proto | 178 - .../v1beta1/feature_monitoring_stats.proto | 86 - .../aiplatform/v1beta1/feature_selector.proto | 44 - .../aiplatform/v1beta1/featurestore.proto | 129 - .../v1beta1/featurestore_monitoring.proto | 155 - .../v1beta1/featurestore_online_service.proto | 225 - .../v1beta1/featurestore_service.proto | 1225 --- .../v1beta1/hyperparameter_tuning_job.proto | 110 - .../cloud/aiplatform/v1beta1/index.proto | 96 - .../aiplatform/v1beta1/index_endpoint.proto | 245 - .../v1beta1/index_endpoint_service.proto | 335 - .../aiplatform/v1beta1/index_service.proto | 277 - .../google/cloud/aiplatform/v1beta1/io.proto | 108 - .../aiplatform/v1beta1/job_service.proto | 1003 -- .../cloud/aiplatform/v1beta1/job_state.proto | 66 - .../aiplatform/v1beta1/lineage_subgraph.proto | 42 - .../v1beta1/machine_resources.proto | 204 - .../manual_batch_tuning_parameters.proto | 39 - .../aiplatform/v1beta1/metadata_schema.proto | 79 - .../aiplatform/v1beta1/metadata_service.proto | 1257 --- .../aiplatform/v1beta1/metadata_store.proto | 65 - .../v1beta1/migratable_resource.proto | 150 - .../v1beta1/migration_service.proto | 314 - .../cloud/aiplatform/v1beta1/model.proto | 588 -- .../model_deployment_monitoring_job.proto | 300 - .../aiplatform/v1beta1/model_evaluation.proto | 94 - .../v1beta1/model_evaluation_slice.proto | 71 - .../aiplatform/v1beta1/model_monitoring.proto | 202 - .../aiplatform/v1beta1/model_service.proto | 660 -- .../cloud/aiplatform/v1beta1/operation.proto | 52 - .../aiplatform/v1beta1/pipeline_job.proto | 340 - .../aiplatform/v1beta1/pipeline_service.proto | 403 - .../aiplatform/v1beta1/pipeline_state.proto | 58 - .../v1beta1/prediction_service.proto | 231 - .../v1beta1/schema/annotation_payload.proto | 231 - .../schema/annotation_spec_color.proto | 43 - .../v1beta1/schema/data_item_payload.proto | 69 - .../v1beta1/schema/dataset_metadata.proto | 127 - .../aiplatform/v1beta1/schema/geometry.proto | 38 - .../instance/image_classification.proto | 44 - .../instance/image_object_detection.proto | 44 - .../predict/instance/image_segmentation.proto | 39 - .../instance/text_classification.proto | 38 - .../predict/instance/text_extraction.proto | 45 - .../predict/instance/text_sentiment.proto | 38 - .../instance/video_action_recognition.proto | 51 - .../instance/video_classification.proto | 51 - .../instance/video_object_tracking.proto | 51 - .../predict/params/image_classification.proto | 39 - .../params/image_object_detection.proto | 39 - .../predict/params/image_segmentation.proto | 36 - .../params/video_action_recognition.proto | 39 - .../predict/params/video_classification.proto | 64 - .../params/video_object_tracking.proto | 43 - .../predict/prediction/classification.proto | 41 - .../prediction/image_object_detection.proto | 51 - .../prediction/image_segmentation.proto | 45 - .../prediction/tabular_classification.proto | 39 - .../prediction/tabular_regression.proto | 39 - .../predict/prediction/text_extraction.proto | 52 - .../predict/prediction/text_sentiment.proto | 37 - .../prediction/time_series_forecasting.proto | 33 - .../prediction/video_action_recognition.proto | 54 - .../prediction/video_classification.proto | 67 - .../prediction/video_object_tracking.proto | 82 - .../automl_image_classification.proto | 128 - .../automl_image_object_detection.proto | 120 - .../automl_image_segmentation.proto | 106 - .../definition/automl_tables.proto | 284 - .../automl_text_classification.proto | 37 - .../definition/automl_text_extraction.proto | 37 - .../definition/automl_text_sentiment.proto | 44 - .../automl_time_series_forecasting.proto | 287 - .../automl_video_action_recognition.proto | 62 - .../automl_video_classification.proto | 56 - .../automl_video_object_tracking.proto | 67 - .../export_evaluated_data_items_config.proto | 43 - .../aiplatform/v1beta1/specialist_pool.proto | 62 - .../v1beta1/specialist_pool_service.proto | 210 - .../cloud/aiplatform/v1beta1/study.proto | 602 -- .../aiplatform/v1beta1/tensorboard.proto | 86 - .../aiplatform/v1beta1/tensorboard_data.proto | 101 - .../v1beta1/tensorboard_experiment.proto | 78 - .../aiplatform/v1beta1/tensorboard_run.proto | 81 - .../v1beta1/tensorboard_service.proto | 1004 -- .../v1beta1/tensorboard_time_series.proto | 106 - .../v1beta1/training_pipeline.proto | 399 - .../cloud/aiplatform/v1beta1/types.proto | 49 - .../v1beta1/unmanaged_container_model.proto | 43 - .../v1beta1/user_action_reference.proto | 47 - .../cloud/aiplatform/v1beta1/value.proto | 39 - .../aiplatform/v1beta1/vizier_service.proto | 505 - .../v1beta1/dataset_service.create_dataset.js | 65 - .../v1beta1/dataset_service.delete_dataset.js | 61 - .../v1beta1/dataset_service.export_data.js | 66 - .../dataset_service.get_annotation_spec.js | 64 - .../v1beta1/dataset_service.get_dataset.js | 62 - .../v1beta1/dataset_service.import_data.js | 67 - .../dataset_service.list_annotations.js | 83 - .../dataset_service.list_data_items.js | 83 - .../v1beta1/dataset_service.list_datasets.js | 96 - .../v1beta1/dataset_service.update_dataset.js | 68 - .../endpoint_service.create_endpoint.js | 76 - .../endpoint_service.delete_endpoint.js | 61 - .../v1beta1/endpoint_service.deploy_model.js | 81 - .../v1beta1/endpoint_service.get_endpoint.js | 60 - .../endpoint_service.list_endpoints.js | 92 - .../endpoint_service.undeploy_model.js | 76 - .../endpoint_service.update_endpoint.js | 63 - ...ine_serving_service.read_feature_values.js | 74 - ...g_service.streaming_read_feature_values.js | 78 - ...turestore_service.batch_create_features.js | 69 - ...store_service.batch_read_feature_values.js | 108 - ...featurestore_service.create_entity_type.js | 74 - .../featurestore_service.create_feature.js | 75 - ...eaturestore_service.create_featurestore.js | 75 - ...featurestore_service.delete_entity_type.js | 66 - .../featurestore_service.delete_feature.js | 61 - ...eaturestore_service.delete_featurestore.js | 67 - ...turestore_service.export_feature_values.js | 85 - .../featurestore_service.get_entity_type.js | 60 - .../featurestore_service.get_feature.js | 60 - .../featurestore_service.get_featurestore.js | 58 - ...turestore_service.import_feature_values.js | 111 - .../featurestore_service.list_entity_types.js | 109 - .../featurestore_service.list_features.js | 119 - ...featurestore_service.list_featurestores.js | 110 - .../featurestore_service.search_features.js | 129 - ...featurestore_service.update_entity_type.js | 81 - .../featurestore_service.update_feature.js | 75 - ...eaturestore_service.update_featurestore.js | 75 - ..._endpoint_service.create_index_endpoint.js | 65 - ..._endpoint_service.delete_index_endpoint.js | 61 - .../index_endpoint_service.deploy_index.js | 66 - ...dex_endpoint_service.get_index_endpoint.js | 60 - ...x_endpoint_service.list_index_endpoints.js | 95 - ..._endpoint_service.mutate_deployed_index.js | 68 - .../index_endpoint_service.undeploy_index.js | 66 - ..._endpoint_service.update_index_endpoint.js | 63 - .../v1beta1/index_service.create_index.js | 65 - .../v1beta1/index_service.delete_index.js | 61 - .../v1beta1/index_service.get_index.js | 60 - .../v1beta1/index_service.list_indexes.js | 80 - .../v1beta1/index_service.update_index.js | 64 - ...job_service.cancel_batch_prediction_job.js | 60 - .../v1beta1/job_service.cancel_custom_job.js | 60 - .../job_service.cancel_data_labeling_job.js | 60 - ...ervice.cancel_hyperparameter_tuning_job.js | 60 - ...job_service.create_batch_prediction_job.js | 64 - .../v1beta1/job_service.create_custom_job.js | 64 - .../job_service.create_data_labeling_job.js | 64 - ...ervice.create_hyperparameter_tuning_job.js | 64 - ....create_model_deployment_monitoring_job.js | 64 - ...job_service.delete_batch_prediction_job.js | 61 - .../v1beta1/job_service.delete_custom_job.js | 61 - .../job_service.delete_data_labeling_job.js | 61 - ...ervice.delete_hyperparameter_tuning_job.js | 61 - ....delete_model_deployment_monitoring_job.js | 61 - .../job_service.get_batch_prediction_job.js | 60 - .../v1beta1/job_service.get_custom_job.js | 60 - .../job_service.get_data_labeling_job.js | 60 - ...b_service.get_hyperparameter_tuning_job.js | 60 - ...ice.get_model_deployment_monitoring_job.js | 60 - .../job_service.list_batch_prediction_jobs.js | 89 - .../v1beta1/job_service.list_custom_jobs.js | 88 - .../job_service.list_data_labeling_jobs.js | 94 - ...service.list_hyperparameter_tuning_jobs.js | 88 - ...e.list_model_deployment_monitoring_jobs.js | 77 - ...e.pause_model_deployment_monitoring_job.js | 60 - ....resume_model_deployment_monitoring_job.js | 60 - ...l_deployment_monitoring_stats_anomalies.js | 100 - ....update_model_deployment_monitoring_job.js | 89 - ...ce.add_context_artifacts_and_executions.js | 74 - .../metadata_service.add_context_children.js | 64 - .../metadata_service.add_execution_events.js | 65 - .../metadata_service.create_artifact.js | 76 - .../metadata_service.create_context.js | 76 - .../metadata_service.create_execution.js | 77 - ...metadata_service.create_metadata_schema.js | 77 - .../metadata_service.create_metadata_store.js | 77 - .../metadata_service.delete_artifact.js | 67 - .../metadata_service.delete_context.js | 72 - .../metadata_service.delete_execution.js | 67 - .../metadata_service.delete_metadata_store.js | 61 - .../v1beta1/metadata_service.get_artifact.js | 60 - .../v1beta1/metadata_service.get_context.js | 60 - .../v1beta1/metadata_service.get_execution.js | 60 - .../metadata_service.get_metadata_schema.js | 60 - .../metadata_service.get_metadata_store.js | 60 - .../metadata_service.list_artifacts.js | 102 - .../v1beta1/metadata_service.list_contexts.js | 105 - .../metadata_service.list_executions.js | 102 - .../metadata_service.list_metadata_schemas.js | 81 - .../metadata_service.list_metadata_stores.js | 77 - .../metadata_service.purge_artifacts.js | 73 - .../metadata_service.purge_contexts.js | 73 - .../metadata_service.purge_executions.js | 73 - ...service.query_artifact_lineage_subgraph.js | 93 - ..._service.query_context_lineage_subgraph.js | 64 - ...vice.query_execution_inputs_and_outputs.js | 61 - .../metadata_service.update_artifact.js | 72 - .../metadata_service.update_context.js | 72 - .../metadata_service.update_execution.js | 72 - ...gration_service.batch_migrate_resources.js | 67 - ...ion_service.search_migratable_resources.js | 87 - .../v1beta1/model_service.delete_model.js | 60 - .../model_service.delete_model_version.js | 61 - .../v1beta1/model_service.export_model.js | 66 - .../v1beta1/model_service.get_model.js | 68 - .../model_service.get_model_evaluation.js | 60 - ...odel_service.get_model_evaluation_slice.js | 60 - .../model_service.import_model_evaluation.js | 64 - ...el_service.list_model_evaluation_slices.js | 82 - .../model_service.list_model_evaluations.js | 80 - .../model_service.list_model_versions.js | 86 - .../v1beta1/model_service.list_models.js | 92 - .../model_service.merge_version_aliases.js | 75 - .../v1beta1/model_service.update_model.js | 81 - .../v1beta1/model_service.upload_model.js | 77 - .../pipeline_service.cancel_pipeline_job.js | 60 - ...peline_service.cancel_training_pipeline.js | 60 - .../pipeline_service.create_pipeline_job.js | 72 - ...peline_service.create_training_pipeline.js | 64 - .../pipeline_service.delete_pipeline_job.js | 61 - ...peline_service.delete_training_pipeline.js | 61 - .../pipeline_service.get_pipeline_job.js | 60 - .../pipeline_service.get_training_pipeline.js | 60 - .../pipeline_service.list_pipeline_jobs.js | 119 - ...ipeline_service.list_training_pipelines.js | 88 - .../v1beta1/prediction_service.explain.js | 96 - .../v1beta1/prediction_service.predict.js | 80 - .../v1beta1/prediction_service.raw_predict.js | 74 - ...adata.google.cloud.aiplatform.v1beta1.json | 8739 ----------------- ...ist_pool_service.create_specialist_pool.js | 65 - ...ist_pool_service.delete_specialist_pool.js | 66 - ...ialist_pool_service.get_specialist_pool.js | 60 - ...list_pool_service.list_specialist_pools.js | 76 - ...ist_pool_service.update_specialist_pool.js | 64 - ...d_service.batch_create_tensorboard_runs.js | 68 - ...ce.batch_create_tensorboard_time_series.js | 70 - ...batch_read_tensorboard_time_series_data.js | 68 - .../tensorboard_service.create_tensorboard.js | 65 - ...d_service.create_tensorboard_experiment.js | 72 - ...sorboard_service.create_tensorboard_run.js | 73 - ..._service.create_tensorboard_time_series.js | 73 - .../tensorboard_service.delete_tensorboard.js | 61 - ...d_service.delete_tensorboard_experiment.js | 61 - ...sorboard_service.delete_tensorboard_run.js | 61 - ..._service.delete_tensorboard_time_series.js | 61 - ...ice.export_tensorboard_time_series_data.js | 87 - .../tensorboard_service.get_tensorboard.js | 60 - ...oard_service.get_tensorboard_experiment.js | 60 - ...tensorboard_service.get_tensorboard_run.js | 60 - ...ard_service.get_tensorboard_time_series.js | 60 - ...rd_service.list_tensorboard_experiments.js | 90 - ...nsorboard_service.list_tensorboard_runs.js | 90 - ...rd_service.list_tensorboard_time_series.js | 90 - .../tensorboard_service.list_tensorboards.js | 90 - ...oard_service.read_tensorboard_blob_data.js | 66 - ...rvice.read_tensorboard_time_series_data.js | 70 - .../tensorboard_service.update_tensorboard.js | 71 - ...d_service.update_tensorboard_experiment.js | 70 - ...sorboard_service.update_tensorboard_run.js | 70 - ..._service.update_tensorboard_time_series.js | 71 - ...rvice.write_tensorboard_experiment_data.js | 65 - ...oard_service.write_tensorboard_run_data.js | 69 - .../vizier_service.add_trial_measurement.js | 65 - ...ervice.check_trial_early_stopping_state.js | 61 - .../v1beta1/vizier_service.complete_trial.js | 76 - .../v1beta1/vizier_service.create_study.js | 64 - .../v1beta1/vizier_service.create_trial.js | 64 - .../v1beta1/vizier_service.delete_study.js | 59 - .../v1beta1/vizier_service.delete_trial.js | 60 - .../v1beta1/vizier_service.get_study.js | 59 - .../v1beta1/vizier_service.get_trial.js | 60 - .../vizier_service.list_optimal_trials.js | 58 - .../v1beta1/vizier_service.list_studies.js | 71 - .../v1beta1/vizier_service.list_trials.js | 71 - .../v1beta1/vizier_service.lookup_study.js | 64 - .../v1beta1/vizier_service.stop_trial.js | 60 - .../v1beta1/vizier_service.suggest_trials.js | 73 - owl-bot-staging/v1beta1/src/index.ts | 53 - .../src/v1beta1/dataset_service_client.ts | 3594 ------- .../dataset_service_client_config.json | 76 - .../v1beta1/dataset_service_proto_list.json | 117 - .../src/v1beta1/endpoint_service_client.ts | 3134 ------ .../endpoint_service_client_config.json | 61 - .../v1beta1/endpoint_service_proto_list.json | 117 - ...turestore_online_serving_service_client.ts | 2386 ----- ..._online_serving_service_client_config.json | 36 - ...ore_online_serving_service_proto_list.json | 117 - .../v1beta1/featurestore_service_client.ts | 5310 ---------- .../featurestore_service_client_config.json | 125 - .../featurestore_service_proto_list.json | 117 - .../v1beta1/src/v1beta1/gapic_metadata.json | 2243 ----- owl-bot-staging/v1beta1/src/v1beta1/index.ts | 33 - .../v1beta1/index_endpoint_service_client.ts | 3218 ------ .../index_endpoint_service_client_config.json | 65 - .../index_endpoint_service_proto_list.json | 117 - .../src/v1beta1/index_service_client.ts | 2884 ------ .../v1beta1/index_service_client_config.json | 51 - .../src/v1beta1/index_service_proto_list.json | 117 - .../v1beta1/src/v1beta1/job_service_client.ts | 5577 ----------- .../v1beta1/job_service_client_config.json | 166 - .../src/v1beta1/job_service_proto_list.json | 117 - .../src/v1beta1/metadata_service_client.ts | 5917 ----------- .../metadata_service_client_config.json | 175 - .../v1beta1/metadata_service_proto_list.json | 117 - .../src/v1beta1/migration_service_client.ts | 2642 ----- .../migration_service_client_config.json | 34 - .../v1beta1/migration_service_proto_list.json | 117 - .../src/v1beta1/model_service_client.ts | 4184 -------- .../v1beta1/model_service_client_config.json | 96 - .../src/v1beta1/model_service_proto_list.json | 117 - .../src/v1beta1/pipeline_service_client.ts | 3550 ------- .../pipeline_service_client_config.json | 71 - .../v1beta1/pipeline_service_proto_list.json | 117 - .../src/v1beta1/prediction_service_client.ts | 2532 ----- .../prediction_service_client_config.json | 40 - .../prediction_service_proto_list.json | 117 - .../v1beta1/specialist_pool_service_client.ts | 2883 ------ ...specialist_pool_service_client_config.json | 51 - .../specialist_pool_service_proto_list.json | 117 - .../src/v1beta1/tensorboard_service_client.ts | 5387 ---------- .../tensorboard_service_client_config.json | 138 - .../tensorboard_service_proto_list.json | 117 - .../src/v1beta1/vizier_service_client.ts | 3713 ------- .../v1beta1/vizier_service_client_config.json | 101 - .../v1beta1/vizier_service_proto_list.json | 117 - .../system-test/fixtures/sample/src/index.js | 41 - .../system-test/fixtures/sample/src/index.ts | 116 - .../v1beta1/system-test/install.ts | 49 - .../test/gapic_dataset_service_v1beta1.ts | 3419 ------- .../test/gapic_endpoint_service_v1beta1.ts | 2876 ------ ...urestore_online_serving_service_v1beta1.ts | 1978 ---- .../gapic_featurestore_service_v1beta1.ts | 4882 --------- .../gapic_index_endpoint_service_v1beta1.ts | 3020 ------ .../test/gapic_index_service_v1beta1.ts | 2635 ----- .../v1beta1/test/gapic_job_service_v1beta1.ts | 5637 ----------- .../test/gapic_metadata_service_v1beta1.ts | 5934 ----------- .../test/gapic_migration_service_v1beta1.ts | 2246 ----- .../test/gapic_model_service_v1beta1.ts | 4077 -------- .../test/gapic_pipeline_service_v1beta1.ts | 3195 ------ .../test/gapic_prediction_service_v1beta1.ts | 2069 ---- .../gapic_specialist_pool_service_v1beta1.ts | 2635 ----- .../test/gapic_tensorboard_service_v1beta1.ts | 5557 ----------- .../test/gapic_vizier_service_v1beta1.ts | 3680 ------- owl-bot-staging/v1beta1/tsconfig.json | 19 - owl-bot-staging/v1beta1/webpack.config.js | 64 - .../aiplatform/v1beta1/explanation.proto | 108 +- .../v1beta1/explanation_metadata.proto | 3 + .../aiplatform/v1beta1/model_service.proto | 54 + protos/protos.d.ts | 768 +- protos/protos.js | 1899 +++- protos/protos.json | 199 +- .../v1beta1/model_service.export_model.js | 2 + .../v1beta1/model_service.get_model.js | 9 + ...odel_service.update_explanation_dataset.js | 0 ...adata.google.cloud.aiplatform.v1beta1.json | 48 +- src/v1beta1/gapic_metadata.json | 10 + src/v1beta1/model_service_client.ts | 172 + src/v1beta1/model_service_client_config.json | 4 + test/gapic_model_service_v1beta1.ts | 198 + 766 files changed, 3434 insertions(+), 313912 deletions(-) delete mode 100644 owl-bot-staging/v1/.eslintignore delete mode 100644 owl-bot-staging/v1/.eslintrc.json delete mode 100644 owl-bot-staging/v1/.gitignore delete mode 100644 owl-bot-staging/v1/.jsdoc.js delete mode 100644 owl-bot-staging/v1/.mocharc.js delete mode 100644 owl-bot-staging/v1/.prettierrc.js delete mode 100644 owl-bot-staging/v1/README.md delete mode 100644 owl-bot-staging/v1/linkinator.config.json delete mode 100644 owl-bot-staging/v1/package.json delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/accelerator_type.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/annotation.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/annotation_spec.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/artifact.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/completion_stats.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/context.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/custom_job.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/data_item.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/data_labeling_job.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/dataset.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/dataset_service.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/deployed_index_ref.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/deployed_model_ref.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/encryption_spec.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/endpoint.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/endpoint_service.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/entity_type.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/env_var.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/event.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/execution.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/explanation.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/explanation_metadata.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature_selector.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_service.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_endpoint.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_endpoint_service.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_service.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/io.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/job_service.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/job_state.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/lineage_subgraph.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/machine_resources.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_schema.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_service.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_store.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/migratable_resource.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/migration_service.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_evaluation.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_monitoring.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_service.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/operation.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_job.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_service.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_state.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/prediction_service.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/specialist_pool.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/specialist_pool_service.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/study.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_data.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_run.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_service.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/training_pipeline.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/types.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/user_action_reference.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/value.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/vizier_service.proto delete mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.create_dataset.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.delete_dataset.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.export_data.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.get_annotation_spec.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.get_dataset.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.import_data.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.list_annotations.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.list_data_items.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.list_datasets.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/dataset_service.update_dataset.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/endpoint_service.create_endpoint.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/endpoint_service.delete_endpoint.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/endpoint_service.deploy_model.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/endpoint_service.get_endpoint.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/endpoint_service.list_endpoints.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/endpoint_service.undeploy_model.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/endpoint_service.update_endpoint.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_online_serving_service.read_feature_values.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_online_serving_service.streaming_read_feature_values.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.batch_create_features.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.batch_read_feature_values.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.create_entity_type.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.create_feature.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.create_featurestore.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.delete_entity_type.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.delete_feature.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.delete_featurestore.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.export_feature_values.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.get_entity_type.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.get_feature.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.get_featurestore.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.import_feature_values.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.list_entity_types.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.list_features.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.list_featurestores.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.search_features.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.update_entity_type.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.update_feature.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/featurestore_service.update_featurestore.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/index_endpoint_service.create_index_endpoint.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/index_endpoint_service.delete_index_endpoint.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/index_endpoint_service.deploy_index.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/index_endpoint_service.get_index_endpoint.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/index_endpoint_service.list_index_endpoints.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/index_endpoint_service.mutate_deployed_index.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/index_endpoint_service.undeploy_index.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/index_endpoint_service.update_index_endpoint.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/index_service.create_index.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/index_service.delete_index.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/index_service.get_index.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/index_service.list_indexes.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/index_service.update_index.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.cancel_batch_prediction_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.cancel_custom_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.cancel_data_labeling_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.cancel_hyperparameter_tuning_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.create_batch_prediction_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.create_custom_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.create_data_labeling_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.create_hyperparameter_tuning_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.create_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.delete_batch_prediction_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.delete_custom_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.delete_data_labeling_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.delete_hyperparameter_tuning_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.delete_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.get_batch_prediction_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.get_custom_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.get_data_labeling_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.get_hyperparameter_tuning_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.get_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.list_batch_prediction_jobs.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.list_custom_jobs.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.list_data_labeling_jobs.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.list_hyperparameter_tuning_jobs.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.list_model_deployment_monitoring_jobs.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.pause_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.resume_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.search_model_deployment_monitoring_stats_anomalies.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/job_service.update_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.add_context_artifacts_and_executions.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.add_context_children.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.add_execution_events.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.create_artifact.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.create_context.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.create_execution.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.create_metadata_schema.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.create_metadata_store.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.delete_artifact.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.delete_context.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.delete_execution.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.delete_metadata_store.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.get_artifact.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.get_context.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.get_execution.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.get_metadata_schema.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.get_metadata_store.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.list_artifacts.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.list_contexts.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.list_executions.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.list_metadata_schemas.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.list_metadata_stores.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.purge_artifacts.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.purge_contexts.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.purge_executions.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.query_artifact_lineage_subgraph.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.query_context_lineage_subgraph.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.query_execution_inputs_and_outputs.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.update_artifact.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.update_context.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/metadata_service.update_execution.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/migration_service.batch_migrate_resources.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/migration_service.search_migratable_resources.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.delete_model.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.export_model.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.get_model.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.get_model_evaluation.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.get_model_evaluation_slice.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.import_model_evaluation.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.list_model_evaluation_slices.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.list_model_evaluations.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.list_models.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.update_model.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/model_service.upload_model.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.cancel_pipeline_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.cancel_training_pipeline.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.create_pipeline_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.create_training_pipeline.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.delete_pipeline_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.delete_training_pipeline.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.get_pipeline_job.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.get_training_pipeline.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.list_pipeline_jobs.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/pipeline_service.list_training_pipelines.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/prediction_service.explain.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/prediction_service.predict.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/prediction_service.raw_predict.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json delete mode 100644 owl-bot-staging/v1/samples/generated/v1/specialist_pool_service.create_specialist_pool.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/specialist_pool_service.delete_specialist_pool.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/specialist_pool_service.get_specialist_pool.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/specialist_pool_service.list_specialist_pools.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/specialist_pool_service.update_specialist_pool.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.batch_create_tensorboard_runs.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.batch_create_tensorboard_time_series.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.batch_read_tensorboard_time_series_data.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.create_tensorboard.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.create_tensorboard_experiment.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.create_tensorboard_run.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.create_tensorboard_time_series.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.delete_tensorboard.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.delete_tensorboard_experiment.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.delete_tensorboard_run.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.delete_tensorboard_time_series.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.export_tensorboard_time_series_data.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.get_tensorboard.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.get_tensorboard_experiment.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.get_tensorboard_run.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.get_tensorboard_time_series.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.list_tensorboard_experiments.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.list_tensorboard_runs.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.list_tensorboard_time_series.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.list_tensorboards.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.read_tensorboard_blob_data.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.read_tensorboard_time_series_data.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.update_tensorboard.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.update_tensorboard_experiment.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.update_tensorboard_run.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.update_tensorboard_time_series.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.write_tensorboard_experiment_data.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/tensorboard_service.write_tensorboard_run_data.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.add_trial_measurement.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.check_trial_early_stopping_state.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.complete_trial.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.create_study.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.create_trial.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.delete_study.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.delete_trial.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.get_study.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.get_trial.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.list_optimal_trials.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.list_studies.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.list_trials.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.lookup_study.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.stop_trial.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/vizier_service.suggest_trials.js delete mode 100644 owl-bot-staging/v1/src/index.ts delete mode 100644 owl-bot-staging/v1/src/v1/dataset_service_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/dataset_service_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/dataset_service_proto_list.json delete mode 100644 owl-bot-staging/v1/src/v1/endpoint_service_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/endpoint_service_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/endpoint_service_proto_list.json delete mode 100644 owl-bot-staging/v1/src/v1/featurestore_online_serving_service_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/featurestore_online_serving_service_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/featurestore_online_serving_service_proto_list.json delete mode 100644 owl-bot-staging/v1/src/v1/featurestore_service_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/featurestore_service_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/featurestore_service_proto_list.json delete mode 100644 owl-bot-staging/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/v1/src/v1/index_endpoint_service_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/index_endpoint_service_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/index_endpoint_service_proto_list.json delete mode 100644 owl-bot-staging/v1/src/v1/index_service_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/index_service_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/index_service_proto_list.json delete mode 100644 owl-bot-staging/v1/src/v1/job_service_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/job_service_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/job_service_proto_list.json delete mode 100644 owl-bot-staging/v1/src/v1/metadata_service_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/metadata_service_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/metadata_service_proto_list.json delete mode 100644 owl-bot-staging/v1/src/v1/migration_service_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/migration_service_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/migration_service_proto_list.json delete mode 100644 owl-bot-staging/v1/src/v1/model_service_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/model_service_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/model_service_proto_list.json delete mode 100644 owl-bot-staging/v1/src/v1/pipeline_service_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/pipeline_service_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/pipeline_service_proto_list.json delete mode 100644 owl-bot-staging/v1/src/v1/prediction_service_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/prediction_service_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/prediction_service_proto_list.json delete mode 100644 owl-bot-staging/v1/src/v1/specialist_pool_service_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/specialist_pool_service_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/specialist_pool_service_proto_list.json delete mode 100644 owl-bot-staging/v1/src/v1/tensorboard_service_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/tensorboard_service_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/tensorboard_service_proto_list.json delete mode 100644 owl-bot-staging/v1/src/v1/vizier_service_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/vizier_service_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/vizier_service_proto_list.json delete mode 100644 owl-bot-staging/v1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/v1/system-test/install.ts delete mode 100644 owl-bot-staging/v1/test/gapic_dataset_service_v1.ts delete mode 100644 owl-bot-staging/v1/test/gapic_endpoint_service_v1.ts delete mode 100644 owl-bot-staging/v1/test/gapic_featurestore_online_serving_service_v1.ts delete mode 100644 owl-bot-staging/v1/test/gapic_featurestore_service_v1.ts delete mode 100644 owl-bot-staging/v1/test/gapic_index_endpoint_service_v1.ts delete mode 100644 owl-bot-staging/v1/test/gapic_index_service_v1.ts delete mode 100644 owl-bot-staging/v1/test/gapic_job_service_v1.ts delete mode 100644 owl-bot-staging/v1/test/gapic_metadata_service_v1.ts delete mode 100644 owl-bot-staging/v1/test/gapic_migration_service_v1.ts delete mode 100644 owl-bot-staging/v1/test/gapic_model_service_v1.ts delete mode 100644 owl-bot-staging/v1/test/gapic_pipeline_service_v1.ts delete mode 100644 owl-bot-staging/v1/test/gapic_prediction_service_v1.ts delete mode 100644 owl-bot-staging/v1/test/gapic_specialist_pool_service_v1.ts delete mode 100644 owl-bot-staging/v1/test/gapic_tensorboard_service_v1.ts delete mode 100644 owl-bot-staging/v1/test/gapic_vizier_service_v1.ts delete mode 100644 owl-bot-staging/v1/tsconfig.json delete mode 100644 owl-bot-staging/v1/webpack.config.js delete mode 100644 owl-bot-staging/v1beta1/.eslintignore delete mode 100644 owl-bot-staging/v1beta1/.eslintrc.json delete mode 100644 owl-bot-staging/v1beta1/.gitignore delete mode 100644 owl-bot-staging/v1beta1/.jsdoc.js delete mode 100644 owl-bot-staging/v1beta1/.mocharc.js delete mode 100644 owl-bot-staging/v1beta1/.prettierrc.js delete mode 100644 owl-bot-staging/v1beta1/README.md delete mode 100644 owl-bot-staging/v1beta1/linkinator.config.json delete mode 100644 owl-bot-staging/v1beta1/package.json delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/artifact.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/completion_stats.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/context.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_item.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset_service.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/entity_type.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/env_var.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/event.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/execution.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_selector.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_service.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/io.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_service.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_state.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_store.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/migration_service.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/operation.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/study.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/types.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/value.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/vizier_service.proto delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.create_dataset.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.delete_dataset.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.export_data.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.get_annotation_spec.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.get_dataset.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.import_data.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.list_annotations.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.list_data_items.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.list_datasets.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataset_service.update_dataset.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/endpoint_service.create_endpoint.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/endpoint_service.delete_endpoint.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/endpoint_service.deploy_model.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/endpoint_service.get_endpoint.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/endpoint_service.list_endpoints.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/endpoint_service.undeploy_model.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/endpoint_service.update_endpoint.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_online_serving_service.read_feature_values.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_online_serving_service.streaming_read_feature_values.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.batch_create_features.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.batch_read_feature_values.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.create_entity_type.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.create_feature.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.create_featurestore.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.delete_entity_type.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.delete_feature.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.delete_featurestore.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.export_feature_values.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.get_entity_type.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.get_feature.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.get_featurestore.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.import_feature_values.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.list_entity_types.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.list_features.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.list_featurestores.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.search_features.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.update_entity_type.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.update_feature.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/featurestore_service.update_featurestore.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_endpoint_service.create_index_endpoint.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_endpoint_service.delete_index_endpoint.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_endpoint_service.deploy_index.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_endpoint_service.get_index_endpoint.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_endpoint_service.list_index_endpoints.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_endpoint_service.mutate_deployed_index.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_endpoint_service.undeploy_index.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_endpoint_service.update_index_endpoint.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_service.create_index.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_service.delete_index.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_service.get_index.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_service.list_indexes.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/index_service.update_index.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.cancel_batch_prediction_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.cancel_custom_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.cancel_data_labeling_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.cancel_hyperparameter_tuning_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.create_batch_prediction_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.create_custom_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.create_data_labeling_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.create_hyperparameter_tuning_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.create_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.delete_batch_prediction_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.delete_custom_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.delete_data_labeling_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.delete_hyperparameter_tuning_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.delete_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.get_batch_prediction_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.get_custom_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.get_data_labeling_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.get_hyperparameter_tuning_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.get_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.list_batch_prediction_jobs.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.list_custom_jobs.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.list_data_labeling_jobs.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.list_hyperparameter_tuning_jobs.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.list_model_deployment_monitoring_jobs.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.pause_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.resume_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.search_model_deployment_monitoring_stats_anomalies.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/job_service.update_model_deployment_monitoring_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.add_context_artifacts_and_executions.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.add_context_children.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.add_execution_events.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.create_artifact.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.create_context.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.create_execution.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.create_metadata_schema.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.create_metadata_store.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.delete_artifact.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.delete_context.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.delete_execution.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.delete_metadata_store.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.get_artifact.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.get_context.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.get_execution.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.get_metadata_schema.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.get_metadata_store.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.list_artifacts.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.list_contexts.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.list_executions.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.list_metadata_schemas.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.list_metadata_stores.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.purge_artifacts.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.purge_contexts.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.purge_executions.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.query_artifact_lineage_subgraph.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.query_context_lineage_subgraph.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.query_execution_inputs_and_outputs.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.update_artifact.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.update_context.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/metadata_service.update_execution.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/migration_service.batch_migrate_resources.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/migration_service.search_migratable_resources.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.delete_model.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.delete_model_version.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.export_model.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.get_model.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.get_model_evaluation.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.get_model_evaluation_slice.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.import_model_evaluation.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.list_model_evaluation_slices.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.list_model_evaluations.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.list_model_versions.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.list_models.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.merge_version_aliases.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.update_model.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.upload_model.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.cancel_pipeline_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.cancel_training_pipeline.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.create_pipeline_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.create_training_pipeline.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.delete_pipeline_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.delete_training_pipeline.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.get_pipeline_job.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.get_training_pipeline.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.list_pipeline_jobs.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/pipeline_service.list_training_pipelines.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/prediction_service.explain.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/prediction_service.predict.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/prediction_service.raw_predict.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/specialist_pool_service.create_specialist_pool.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/specialist_pool_service.delete_specialist_pool.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/specialist_pool_service.get_specialist_pool.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/specialist_pool_service.list_specialist_pools.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/specialist_pool_service.update_specialist_pool.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_runs.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_time_series.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.batch_read_tensorboard_time_series_data.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.create_tensorboard.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.create_tensorboard_experiment.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.create_tensorboard_run.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.create_tensorboard_time_series.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.delete_tensorboard.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_experiment.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_run.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_time_series.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.get_tensorboard.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.get_tensorboard_experiment.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.get_tensorboard_run.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.get_tensorboard_time_series.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.list_tensorboard_experiments.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.list_tensorboard_runs.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.list_tensorboard_time_series.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.list_tensorboards.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.read_tensorboard_blob_data.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.read_tensorboard_time_series_data.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.update_tensorboard.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.update_tensorboard_experiment.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.update_tensorboard_run.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.update_tensorboard_time_series.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.write_tensorboard_experiment_data.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/tensorboard_service.write_tensorboard_run_data.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.add_trial_measurement.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.check_trial_early_stopping_state.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.complete_trial.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.create_study.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.create_trial.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.delete_study.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.delete_trial.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.get_study.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.get_trial.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.list_optimal_trials.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.list_studies.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.list_trials.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.lookup_study.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.stop_trial.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/vizier_service.suggest_trials.js delete mode 100644 owl-bot-staging/v1beta1/src/index.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/dataset_service_client.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/dataset_service_client_config.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/dataset_service_proto_list.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_client.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_client_config.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_proto_list.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client_config.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_proto_list.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_client.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_client_config.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_proto_list.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/index.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_client.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_client_config.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_proto_list.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/index_service_client.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/index_service_client_config.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/index_service_proto_list.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/job_service_client.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/job_service_client_config.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/job_service_proto_list.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/metadata_service_client.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/metadata_service_client_config.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/metadata_service_proto_list.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/migration_service_client.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/migration_service_client_config.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/migration_service_proto_list.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/model_service_client.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/model_service_client_config.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/model_service_proto_list.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_client.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_client_config.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_proto_list.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/prediction_service_client.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/prediction_service_client_config.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/prediction_service_proto_list.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_client.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_client_config.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_proto_list.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_client.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_client_config.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_proto_list.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/vizier_service_client.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/vizier_service_client_config.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/vizier_service_proto_list.json delete mode 100644 owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/v1beta1/system-test/install.ts delete mode 100644 owl-bot-staging/v1beta1/test/gapic_dataset_service_v1beta1.ts delete mode 100644 owl-bot-staging/v1beta1/test/gapic_endpoint_service_v1beta1.ts delete mode 100644 owl-bot-staging/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts delete mode 100644 owl-bot-staging/v1beta1/test/gapic_featurestore_service_v1beta1.ts delete mode 100644 owl-bot-staging/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts delete mode 100644 owl-bot-staging/v1beta1/test/gapic_index_service_v1beta1.ts delete mode 100644 owl-bot-staging/v1beta1/test/gapic_job_service_v1beta1.ts delete mode 100644 owl-bot-staging/v1beta1/test/gapic_metadata_service_v1beta1.ts delete mode 100644 owl-bot-staging/v1beta1/test/gapic_migration_service_v1beta1.ts delete mode 100644 owl-bot-staging/v1beta1/test/gapic_model_service_v1beta1.ts delete mode 100644 owl-bot-staging/v1beta1/test/gapic_pipeline_service_v1beta1.ts delete mode 100644 owl-bot-staging/v1beta1/test/gapic_prediction_service_v1beta1.ts delete mode 100644 owl-bot-staging/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts delete mode 100644 owl-bot-staging/v1beta1/test/gapic_tensorboard_service_v1beta1.ts delete mode 100644 owl-bot-staging/v1beta1/test/gapic_vizier_service_v1beta1.ts delete mode 100644 owl-bot-staging/v1beta1/tsconfig.json delete mode 100644 owl-bot-staging/v1beta1/webpack.config.js rename {owl-bot-staging/v1beta1/samples => samples}/generated/v1beta1/model_service.update_explanation_dataset.js (100%) diff --git a/owl-bot-staging/v1/.eslintignore b/owl-bot-staging/v1/.eslintignore deleted file mode 100644 index cfc348ec..00000000 --- a/owl-bot-staging/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/v1/.eslintrc.json b/owl-bot-staging/v1/.eslintrc.json deleted file mode 100644 index 78215349..00000000 --- a/owl-bot-staging/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/v1/.gitignore b/owl-bot-staging/v1/.gitignore deleted file mode 100644 index 5d32b237..00000000 --- a/owl-bot-staging/v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -.coverage -coverage -.nyc_output -docs/ -out/ -build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/v1/.jsdoc.js b/owl-bot-staging/v1/.jsdoc.js deleted file mode 100644 index a5ec80d7..00000000 --- a/owl-bot-staging/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2022 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/aiplatform', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/v1/.mocharc.js b/owl-bot-staging/v1/.mocharc.js deleted file mode 100644 index 481c522b..00000000 --- a/owl-bot-staging/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/v1/.prettierrc.js b/owl-bot-staging/v1/.prettierrc.js deleted file mode 100644 index 494e1478..00000000 --- a/owl-bot-staging/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/v1/README.md b/owl-bot-staging/v1/README.md deleted file mode 100644 index 7f057918..00000000 --- a/owl-bot-staging/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Aiplatform: Nodejs Client diff --git a/owl-bot-staging/v1/linkinator.config.json b/owl-bot-staging/v1/linkinator.config.json deleted file mode 100644 index befd23c8..00000000 --- a/owl-bot-staging/v1/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io", - "https://console.cloud.google.com/cloudshell", - "https://support.google.com" - ], - "silent": true, - "concurrency": 5, - "retry": true, - "retryErrors": true, - "retryErrorsCount": 5, - "retryErrorsJitter": 3000 -} diff --git a/owl-bot-staging/v1/package.json b/owl-bot-staging/v1/package.json deleted file mode 100644 index b8fe84e8..00000000 --- a/owl-bot-staging/v1/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "@google-cloud/aiplatform", - "version": "0.1.0", - "description": "Aiplatform client for Node.js", - "repository": "googleapis/nodejs-aiplatform", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google aiplatform", - "aiplatform", - "dataset service", - "endpoint service", - "featurestore online serving service", - "featurestore service", - "index endpoint service", - "index service", - "job service", - "metadata service", - "migration service", - "model service", - "pipeline service", - "prediction service", - "specialist pool service", - "tensorboard service", - "vizier service" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^2.29.4" - }, - "devDependencies": { - "@types/mocha": "^9.1.0", - "@types/node": "^16.0.0", - "@types/sinon": "^10.0.8", - "c8": "^7.11.0", - "gts": "^3.1.0", - "jsdoc": "^3.6.7", - "jsdoc-fresh": "^1.1.1", - "jsdoc-region-tag": "^1.3.1", - "linkinator": "^3.0.0", - "mocha": "^9.1.4", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^13.0.0", - "ts-loader": "^9.2.6", - "typescript": "^4.5.5", - "webpack": "^5.67.0", - "webpack-cli": "^4.9.1" - }, - "engines": { - "node": ">=v10.24.0" - } -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/accelerator_type.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/accelerator_type.proto deleted file mode 100644 index 726ec203..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/accelerator_type.proto +++ /dev/null @@ -1,55 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "AcceleratorTypeProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Represents a hardware accelerator type. -enum AcceleratorType { - // Unspecified accelerator type, which means no accelerator. - ACCELERATOR_TYPE_UNSPECIFIED = 0; - - // Nvidia Tesla K80 GPU. - NVIDIA_TESLA_K80 = 1; - - // Nvidia Tesla P100 GPU. - NVIDIA_TESLA_P100 = 2; - - // Nvidia Tesla V100 GPU. - NVIDIA_TESLA_V100 = 3; - - // Nvidia Tesla P4 GPU. - NVIDIA_TESLA_P4 = 4; - - // Nvidia Tesla T4 GPU. - NVIDIA_TESLA_T4 = 5; - - // Nvidia Tesla A100 GPU. - NVIDIA_TESLA_A100 = 8; - - // TPU v2. - TPU_V2 = 6; - - // TPU v3. - TPU_V3 = 7; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/annotation.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/annotation.proto deleted file mode 100644 index 3a104809..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/annotation.proto +++ /dev/null @@ -1,90 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/user_action_reference.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "AnnotationProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Used to assign specific AnnotationSpec to a particular area of a DataItem or -// the whole part of the DataItem. -message Annotation { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Annotation" - pattern: "projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}" - }; - - // Output only. Resource name of the Annotation. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Google Cloud Storage URI points to a YAML file describing [payload][google.cloud.aiplatform.v1.Annotation.payload]. The - // schema is defined as an [OpenAPI 3.0.2 Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - // The schema files that can be used here are found in - // gs://google-cloud-aiplatform/schema/dataset/annotation/, note that the - // chosen schema must be consistent with the parent Dataset's - // [metadata][google.cloud.aiplatform.v1.Dataset.metadata_schema_uri]. - string payload_schema_uri = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The schema of the payload can be found in - // [payload_schema][google.cloud.aiplatform.v1.Annotation.payload_schema_uri]. - google.protobuf.Value payload = 3 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Timestamp when this Annotation was created. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Annotation was last updated. - google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The source of the Annotation. - UserActionReference annotation_source = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The labels with user-defined metadata to organize your Annotations. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one Annotation(System - // labels are excluded). - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. Following system labels exist for each Annotation: - // - // * "aiplatform.googleapis.com/annotation_set_name": - // optional, name of the UI's annotation set this Annotation belongs to. - // If not set, the Annotation is not visible in the UI. - // - // * "aiplatform.googleapis.com/payload_schema": - // output only, its value is the [payload_schema's][google.cloud.aiplatform.v1.Annotation.payload_schema_uri] - // title. - map labels = 6 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/annotation_spec.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/annotation_spec.proto deleted file mode 100644 index 3082e3ee..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/annotation_spec.proto +++ /dev/null @@ -1,55 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "AnnotationSpecProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Identifies a concept with which DataItems may be annotated with. -message AnnotationSpec { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/AnnotationSpec" - pattern: "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}" - }; - - // Output only. Resource name of the AnnotationSpec. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The user-defined name of the AnnotationSpec. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Timestamp when this AnnotationSpec was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when AnnotationSpec was last updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 5 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/artifact.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/artifact.proto deleted file mode 100644 index d7ef997a..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/artifact.proto +++ /dev/null @@ -1,109 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ArtifactProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Instance of a general artifact. -message Artifact { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Artifact" - pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}" - }; - - // Describes the state of the Artifact. - enum State { - // Unspecified state for the Artifact. - STATE_UNSPECIFIED = 0; - - // A state used by systems like Vertex AI Pipelines to indicate that the - // underlying data item represented by this Artifact is being created. - PENDING = 1; - - // A state indicating that the Artifact should exist, unless something - // external to the system deletes it. - LIVE = 2; - } - - // Output only. The resource name of the Artifact. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User provided display name of the Artifact. - // May be up to 128 Unicode characters. - string display_name = 2; - - // The uniform resource identifier of the artifact file. - // May be empty if there is no actual artifact file. - string uri = 6; - - // An eTag used to perform consistent read-modify-write updates. If not set, a - // blind "overwrite" update happens. - string etag = 9; - - // The labels with user-defined metadata to organize your Artifacts. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one Artifact (System - // labels are excluded). - map labels = 10; - - // Output only. Timestamp when this Artifact was created. - google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Artifact was last updated. - google.protobuf.Timestamp update_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The state of this Artifact. This is a property of the Artifact, and does - // not imply or capture any ongoing process. This property is managed by - // clients (such as Vertex AI Pipelines), and the system does not prescribe - // or check the validity of state transitions. - State state = 13; - - // The title of the schema describing the metadata. - // - // Schema title and version is expected to be registered in earlier Create - // Schema calls. And both are used together as unique identifiers to identify - // schemas within the local metadata store. - string schema_title = 14; - - // The version of the schema in schema_name to use. - // - // Schema title and version is expected to be registered in earlier Create - // Schema calls. And both are used together as unique identifiers to identify - // schemas within the local metadata store. - string schema_version = 15; - - // Properties of the Artifact. - // The size of this field should not exceed 200KB. - google.protobuf.Struct metadata = 16; - - // Description of the Artifact - string description = 17; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto deleted file mode 100644 index fc92ff0b..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto +++ /dev/null @@ -1,286 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/completion_stats.proto"; -import "google/cloud/aiplatform/v1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1/explanation.proto"; -import "google/cloud/aiplatform/v1/io.proto"; -import "google/cloud/aiplatform/v1/job_state.proto"; -import "google/cloud/aiplatform/v1/machine_resources.proto"; -import "google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto"; -import "google/cloud/aiplatform/v1/unmanaged_container_model.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "BatchPredictionJobProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A job that uses a [Model][google.cloud.aiplatform.v1.BatchPredictionJob.model] to produce predictions -// on multiple [input instances][google.cloud.aiplatform.v1.BatchPredictionJob.input_config]. If -// predictions for significant portion of the instances fail, the job may finish -// without attempting predictions for all remaining instances. -message BatchPredictionJob { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/BatchPredictionJob" - pattern: "projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}" - }; - - // Configures the input to [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob]. - // See [Model.supported_input_storage_formats][google.cloud.aiplatform.v1.Model.supported_input_storage_formats] for Model's supported input - // formats, and how instances should be expressed via any of them. - message InputConfig { - // Required. The source of the input. - oneof source { - // The Cloud Storage location for the input instances. - GcsSource gcs_source = 2; - - // The BigQuery location of the input table. - // The schema of the table should be in the format described by the given - // context OpenAPI Schema, if one is provided. The table may contain - // additional columns that are not described by the schema, and they will - // be ignored. - BigQuerySource bigquery_source = 3; - } - - // Required. The format in which instances are given, must be one of the - // [Model's][google.cloud.aiplatform.v1.BatchPredictionJob.model] - // [supported_input_storage_formats][google.cloud.aiplatform.v1.Model.supported_input_storage_formats]. - string instances_format = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Configures the output of [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob]. - // See [Model.supported_output_storage_formats][google.cloud.aiplatform.v1.Model.supported_output_storage_formats] for supported output - // formats, and how predictions are expressed via any of them. - message OutputConfig { - // Required. The destination of the output. - oneof destination { - // The Cloud Storage location of the directory where the output is - // to be written to. In the given directory a new directory is created. - // Its name is `prediction--`, - // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. - // Inside of it files `predictions_0001.`, - // `predictions_0002.`, ..., `predictions_N.` - // are created where `` depends on chosen - // [predictions_format][google.cloud.aiplatform.v1.BatchPredictionJob.OutputConfig.predictions_format], and N may equal 0001 and depends on the total - // number of successfully predicted instances. - // If the Model has both [instance][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri] - // and [prediction][google.cloud.aiplatform.v1.PredictSchemata.parameters_schema_uri] schemata - // defined then each such file contains predictions as per the - // [predictions_format][google.cloud.aiplatform.v1.BatchPredictionJob.OutputConfig.predictions_format]. - // If prediction for any instance failed (partially or completely), then - // an additional `errors_0001.`, `errors_0002.`,..., - // `errors_N.` files are created (N depends on total number - // of failed predictions). These files contain the failed instances, - // as per their schema, followed by an additional `error` field which as - // value has [google.rpc.Status][google.rpc.Status] - // containing only `code` and `message` fields. - GcsDestination gcs_destination = 2; - - // The BigQuery project or dataset location where the output is to be - // written to. If project is provided, a new dataset is created with name - // `prediction__` - // where is made - // BigQuery-dataset-name compatible (for example, most special characters - // become underscores), and timestamp is in - // YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In the dataset - // two tables will be created, `predictions`, and `errors`. - // If the Model has both [instance][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri] - // and [prediction][google.cloud.aiplatform.v1.PredictSchemata.parameters_schema_uri] schemata - // defined then the tables have columns as follows: The `predictions` - // table contains instances for which the prediction succeeded, it - // has columns as per a concatenation of the Model's instance and - // prediction schemata. The `errors` table contains rows for which the - // prediction has failed, it has instance columns, as per the - // instance schema, followed by a single "errors" column, which as values - // has [google.rpc.Status][google.rpc.Status] - // represented as a STRUCT, and containing only `code` and `message`. - BigQueryDestination bigquery_destination = 3; - } - - // Required. The format in which Vertex AI gives the predictions, must be one of the - // [Model's][google.cloud.aiplatform.v1.BatchPredictionJob.model] - // [supported_output_storage_formats][google.cloud.aiplatform.v1.Model.supported_output_storage_formats]. - string predictions_format = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Further describes this job's output. - // Supplements [output_config][google.cloud.aiplatform.v1.BatchPredictionJob.output_config]. - message OutputInfo { - // The output location into which prediction output is written. - oneof output_location { - // Output only. The full path of the Cloud Storage directory created, into which - // the prediction output is written. - string gcs_output_directory = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The path of the BigQuery dataset created, in - // `bq://projectId.bqDatasetId` - // format, into which the prediction output is written. - string bigquery_output_dataset = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. The name of the BigQuery table created, in - // `predictions_` - // format, into which the prediction output is written. - // Can be used by UI to generate the BigQuery output path, for example. - string bigquery_output_table = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. Resource name of the BatchPredictionJob. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The user-defined name of this BatchPredictionJob. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // The name of the Model resoure that produces the predictions via this job, - // must share the same ancestor Location. - // Starting this job has no impact on any existing deployments of the Model - // and their resources. - // Exactly one of model and unmanaged_container_model must be set. - string model = 3 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - }]; - - // Contains model information necessary to perform batch prediction without - // requiring uploading to model registry. - // Exactly one of model and unmanaged_container_model must be set. - UnmanagedContainerModel unmanaged_container_model = 28; - - // Required. Input configuration of the instances on which predictions are performed. - // The schema of any single instance may be specified via - // the [Model's][google.cloud.aiplatform.v1.BatchPredictionJob.model] - // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] - // [instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri]. - InputConfig input_config = 4 [(google.api.field_behavior) = REQUIRED]; - - // The parameters that govern the predictions. The schema of the parameters - // may be specified via the [Model's][google.cloud.aiplatform.v1.BatchPredictionJob.model] - // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] - // [parameters_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.parameters_schema_uri]. - google.protobuf.Value model_parameters = 5; - - // Required. The Configuration specifying where output predictions should - // be written. - // The schema of any single prediction may be specified as a concatenation - // of [Model's][google.cloud.aiplatform.v1.BatchPredictionJob.model] - // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] - // [instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri] - // and - // [prediction_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.prediction_schema_uri]. - OutputConfig output_config = 6 [(google.api.field_behavior) = REQUIRED]; - - // The config of resources used by the Model during the batch prediction. If - // the Model [supports][google.cloud.aiplatform.v1.Model.supported_deployment_resources_types] - // DEDICATED_RESOURCES this config may be provided (and the job will use these - // resources), if the Model doesn't support AUTOMATIC_RESOURCES, this config - // must be provided. - BatchDedicatedResources dedicated_resources = 7; - - // Immutable. Parameters configuring the batch behavior. Currently only applicable when - // [dedicated_resources][google.cloud.aiplatform.v1.BatchPredictionJob.dedicated_resources] are used (in other cases Vertex AI does - // the tuning itself). - ManualBatchTuningParameters manual_batch_tuning_parameters = 8 [(google.api.field_behavior) = IMMUTABLE]; - - // Generate explanation with the batch prediction results. - // - // When set to `true`, the batch prediction output changes based on the - // `predictions_format` field of the - // [BatchPredictionJob.output_config][google.cloud.aiplatform.v1.BatchPredictionJob.output_config] object: - // - // * `bigquery`: output includes a column named `explanation`. The value - // is a struct that conforms to the [Explanation][google.cloud.aiplatform.v1.Explanation] object. - // * `jsonl`: The JSON objects on each line include an additional entry - // keyed `explanation`. The value of the entry is a JSON object that - // conforms to the [Explanation][google.cloud.aiplatform.v1.Explanation] object. - // * `csv`: Generating explanations for CSV format is not supported. - // - // If this field is set to true, either the [Model.explanation_spec][google.cloud.aiplatform.v1.Model.explanation_spec] or - // [explanation_spec][google.cloud.aiplatform.v1.BatchPredictionJob.explanation_spec] must be populated. - bool generate_explanation = 23; - - // Explanation configuration for this BatchPredictionJob. Can be - // specified only if [generate_explanation][google.cloud.aiplatform.v1.BatchPredictionJob.generate_explanation] is set to `true`. - // - // This value overrides the value of [Model.explanation_spec][google.cloud.aiplatform.v1.Model.explanation_spec]. All fields of - // [explanation_spec][google.cloud.aiplatform.v1.BatchPredictionJob.explanation_spec] are optional in the request. If a field of the - // [explanation_spec][google.cloud.aiplatform.v1.BatchPredictionJob.explanation_spec] object is not populated, the corresponding field of - // the [Model.explanation_spec][google.cloud.aiplatform.v1.Model.explanation_spec] object is inherited. - ExplanationSpec explanation_spec = 25; - - // Output only. Information further describing the output of this job. - OutputInfo output_info = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The detailed state of the job. - JobState state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Only populated when the job's state is JOB_STATE_FAILED or - // JOB_STATE_CANCELLED. - google.rpc.Status error = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Partial failures encountered. - // For example, single files that can't be read. - // This field never exceeds 20 entries. - // Status details fields contain standard GCP error details. - repeated google.rpc.Status partial_failures = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Information about resources that had been consumed by this job. - // Provided in real time at best effort basis, as well as a final value - // once the job completes. - // - // Note: This field currently may be not populated for batch predictions that - // use AutoML Models. - ResourcesConsumed resources_consumed = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Statistics on completed and failed prediction instances. - CompletionStats completion_stats = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the BatchPredictionJob was created. - google.protobuf.Timestamp create_time = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the BatchPredictionJob for the first time entered the - // `JOB_STATE_RUNNING` state. - google.protobuf.Timestamp start_time = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the BatchPredictionJob entered any of the following states: - // `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. - google.protobuf.Timestamp end_time = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the BatchPredictionJob was most recently updated. - google.protobuf.Timestamp update_time = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize BatchPredictionJobs. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 19; - - // Customer-managed encryption key options for a BatchPredictionJob. If this - // is set, then all resources created by the BatchPredictionJob will be - // encrypted with the provided encryption key. - EncryptionSpec encryption_spec = 24; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/completion_stats.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/completion_stats.proto deleted file mode 100644 index 16310ef8..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/completion_stats.proto +++ /dev/null @@ -1,44 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "CompletionStatsProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Success and error statistics of processing multiple entities -// (for example, DataItems or structured data rows) in batch. -message CompletionStats { - // Output only. The number of entities that had been processed successfully. - int64 successful_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of entities for which any error was encountered. - int64 failed_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. In cases when enough errors are encountered a job, pipeline, or operation - // may be failed as a whole. Below is the number of entities for which the - // processing had not been finished (either in successful or failed state). - // Set to -1 if the number is unknown (for example, the operation failed - // before the total entity number could be collected). - int64 incomplete_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/context.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/context.proto deleted file mode 100644 index b602a550..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/context.proto +++ /dev/null @@ -1,94 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ContextProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Instance of a general context. -message Context { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Context" - pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}" - }; - - // Output only. The resource name of the Context. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User provided display name of the Context. - // May be up to 128 Unicode characters. - string display_name = 2; - - // An eTag used to perform consistent read-modify-write updates. If not set, a - // blind "overwrite" update happens. - string etag = 8; - - // The labels with user-defined metadata to organize your Contexts. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one Context (System - // labels are excluded). - map labels = 9; - - // Output only. Timestamp when this Context was created. - google.protobuf.Timestamp create_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Context was last updated. - google.protobuf.Timestamp update_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A list of resource names of Contexts that are parents of this Context. - // A Context may have at most 10 parent_contexts. - repeated string parent_contexts = 12 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - } - ]; - - // The title of the schema describing the metadata. - // - // Schema title and version is expected to be registered in earlier Create - // Schema calls. And both are used together as unique identifiers to identify - // schemas within the local metadata store. - string schema_title = 13; - - // The version of the schema in schema_name to use. - // - // Schema title and version is expected to be registered in earlier Create - // Schema calls. And both are used together as unique identifiers to identify - // schemas within the local metadata store. - string schema_version = 14; - - // Properties of the Context. - // The size of this field should not exceed 200KB. - google.protobuf.Struct metadata = 15; - - // Description of the Context - string description = 16; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/custom_job.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/custom_job.proto deleted file mode 100644 index 0c7f5afa..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/custom_job.proto +++ /dev/null @@ -1,277 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1/env_var.proto"; -import "google/cloud/aiplatform/v1/io.proto"; -import "google/cloud/aiplatform/v1/job_state.proto"; -import "google/cloud/aiplatform/v1/machine_resources.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "CustomJobProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Represents a job that runs custom workloads such as a Docker container or a -// Python package. A CustomJob can have multiple worker pools and each worker -// pool can have its own machine and input spec. A CustomJob will be cleaned up -// once the job enters terminal state (failed or succeeded). -message CustomJob { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/CustomJob" - pattern: "projects/{project}/locations/{location}/customJobs/{custom_job}" - }; - - // Output only. Resource name of a CustomJob. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The display name of the CustomJob. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Job spec. - CustomJobSpec job_spec = 4 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The detailed state of the job. - JobState state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the CustomJob was created. - google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the CustomJob for the first time entered the - // `JOB_STATE_RUNNING` state. - google.protobuf.Timestamp start_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the CustomJob entered any of the following states: - // `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. - google.protobuf.Timestamp end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the CustomJob was most recently updated. - google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Only populated when job's state is `JOB_STATE_FAILED` or - // `JOB_STATE_CANCELLED`. - google.rpc.Status error = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize CustomJobs. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 11; - - // Customer-managed encryption key options for a CustomJob. If this is set, - // then all resources created by the CustomJob will be encrypted with the - // provided encryption key. - EncryptionSpec encryption_spec = 12; - - // Output only. URIs for accessing [interactive - // shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) - // (one URI for each training node). Only available if - // [job_spec.enable_web_access][google.cloud.aiplatform.v1.CustomJobSpec.enable_web_access] is `true`. - // - // The keys are names of each node in the training job; for example, - // `workerpool0-0` for the primary node, `workerpool1-0` for the first node in - // the second worker pool, and `workerpool1-1` for the second node in the - // second worker pool. - // - // The values are the URIs for each node's interactive shell. - map web_access_uris = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Represents the spec of a CustomJob. -// Next Id: 14 -message CustomJobSpec { - // Required. The spec of the worker pools including machine type and Docker image. - // All worker pools except the first one are optional and can be skipped by - // providing an empty value. - repeated WorkerPoolSpec worker_pool_specs = 1 [(google.api.field_behavior) = REQUIRED]; - - // Scheduling options for a CustomJob. - Scheduling scheduling = 3; - - // Specifies the service account for workload run-as account. - // Users submitting jobs must have act-as permission on this run-as account. - // If unspecified, the [Vertex AI Custom Code Service - // Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) - // for the CustomJob's project is used. - string service_account = 4; - - // The full name of the Compute Engine - // [network](/compute/docs/networks-and-firewalls#networks) to which the Job - // should be peered. For example, `projects/12345/global/networks/myVPC`. - // [Format](/compute/docs/reference/rest/v1/networks/insert) - // is of the form `projects/{project}/global/networks/{network}`. - // Where {project} is a project number, as in `12345`, and {network} is a - // network name. - // - // To specify this field, you must have already [configured VPC Network - // Peering for Vertex - // AI](https://cloud.google.com/vertex-ai/docs/general/vpc-peering). - // - // If this field is left unspecified, the job is not peered with any network. - string network = 5 [(google.api.resource_reference) = { - type: "compute.googleapis.com/Network" - }]; - - // Optional. A list of names for the reserved ip ranges under the VPC network - // that can be used for this job. - // - // If set, we will deploy the job within the provided ip ranges. Otherwise, - // the job will be deployed to any ip ranges under the provided VPC - // network. - // - // Example: ['vertex-ai-ip-range']. - repeated string reserved_ip_ranges = 13 [(google.api.field_behavior) = OPTIONAL]; - - // The Cloud Storage location to store the output of this CustomJob or - // HyperparameterTuningJob. For HyperparameterTuningJob, - // the baseOutputDirectory of - // each child CustomJob backing a Trial is set to a subdirectory of name - // [id][google.cloud.aiplatform.v1.Trial.id] under its parent HyperparameterTuningJob's - // baseOutputDirectory. - // - // The following Vertex AI environment variables will be passed to - // containers or python modules when this field is set: - // - // For CustomJob: - // - // * AIP_MODEL_DIR = `/model/` - // * AIP_CHECKPOINT_DIR = `/checkpoints/` - // * AIP_TENSORBOARD_LOG_DIR = `/logs/` - // - // For CustomJob backing a Trial of HyperparameterTuningJob: - // - // * AIP_MODEL_DIR = `//model/` - // * AIP_CHECKPOINT_DIR = `//checkpoints/` - // * AIP_TENSORBOARD_LOG_DIR = `//logs/` - GcsDestination base_output_directory = 6; - - // Optional. The name of a Vertex AI [Tensorboard][google.cloud.aiplatform.v1.Tensorboard] resource to which this CustomJob - // will upload Tensorboard logs. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - string tensorboard = 7 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Tensorboard" - } - ]; - - // Optional. Whether you want Vertex AI to enable [interactive shell - // access](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) - // to training containers. - // - // If set to `true`, you can access interactive shells at the URIs given - // by [CustomJob.web_access_uris][google.cloud.aiplatform.v1.CustomJob.web_access_uris] or [Trial.web_access_uris][google.cloud.aiplatform.v1.Trial.web_access_uris] (within - // [HyperparameterTuningJob.trials][google.cloud.aiplatform.v1.HyperparameterTuningJob.trials]). - bool enable_web_access = 10 [(google.api.field_behavior) = OPTIONAL]; -} - -// Represents the spec of a worker pool in a job. -message WorkerPoolSpec { - // The custom task to be executed in this worker pool. - oneof task { - // The custom container task. - ContainerSpec container_spec = 6; - - // The Python packaged task. - PythonPackageSpec python_package_spec = 7; - } - - // Optional. Immutable. The specification of a single machine. - MachineSpec machine_spec = 1 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. The number of worker replicas to use for this worker pool. - int64 replica_count = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of NFS mount spec. - repeated NfsMount nfs_mounts = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Disk spec. - DiskSpec disk_spec = 5; -} - -// The spec of a Container. -message ContainerSpec { - // Required. The URI of a container image in the Container Registry that is to be run on - // each worker replica. - string image_uri = 1 [(google.api.field_behavior) = REQUIRED]; - - // The command to be invoked when the container is started. - // It overrides the entrypoint instruction in Dockerfile when provided. - repeated string command = 2; - - // The arguments to be passed when starting the container. - repeated string args = 3; - - // Environment variables to be passed to the container. - // Maximum limit is 100. - repeated EnvVar env = 4; -} - -// The spec of a Python packaged code. -message PythonPackageSpec { - // Required. The URI of a container image in Artifact Registry that will run the - // provided Python package. Vertex AI provides a wide range of executor - // images with pre-installed packages to meet users' various use cases. See - // the list of [pre-built containers for - // training](https://cloud.google.com/vertex-ai/docs/training/pre-built-containers). - // You must use an image from this list. - string executor_image_uri = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Google Cloud Storage location of the Python package files which are - // the training program and its dependent packages. - // The maximum number of package URIs is 100. - repeated string package_uris = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Python module name to run after installing the packages. - string python_module = 3 [(google.api.field_behavior) = REQUIRED]; - - // Command line arguments to be passed to the Python task. - repeated string args = 4; - - // Environment variables to be passed to the python module. - // Maximum limit is 100. - repeated EnvVar env = 5; -} - -// All parameters related to queuing and scheduling of custom jobs. -message Scheduling { - // The maximum job running time. The default is 7 days. - google.protobuf.Duration timeout = 1; - - // Restarts the entire CustomJob if a worker gets restarted. - // This feature can be used by distributed training jobs that are not - // resilient to workers leaving and joining a job. - bool restart_job_on_worker_restart = 3; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/data_item.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/data_item.proto deleted file mode 100644 index 10431e74..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/data_item.proto +++ /dev/null @@ -1,70 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "DataItemProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A piece of data in a Dataset. Could be an image, a video, a document or plain -// text. -message DataItem { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/DataItem" - pattern: "projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}" - }; - - // Output only. The resource name of the DataItem. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this DataItem was created. - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this DataItem was last updated. - google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The labels with user-defined metadata to organize your DataItems. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one DataItem(System - // labels are excluded). - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. - map labels = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The data that the DataItem represents (for example, an image or a text - // snippet). The schema of the payload is stored in the parent Dataset's - // [metadata schema's][google.cloud.aiplatform.v1.Dataset.metadata_schema_uri] dataItemSchemaUri field. - google.protobuf.Value payload = 4 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 7 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/data_labeling_job.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/data_labeling_job.proto deleted file mode 100644 index f136190b..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/data_labeling_job.proto +++ /dev/null @@ -1,207 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1/job_state.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; -import "google/type/money.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "DataLabelingJobProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// DataLabelingJob is used to trigger a human labeling job on unlabeled data -// from the following Dataset: -message DataLabelingJob { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/DataLabelingJob" - pattern: "projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}" - }; - - // Output only. Resource name of the DataLabelingJob. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The user-defined name of the DataLabelingJob. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - // Display name of a DataLabelingJob. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Dataset resource names. Right now we only support labeling from a single - // Dataset. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}` - repeated string datasets = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - } - ]; - - // Labels to assign to annotations generated by this DataLabelingJob. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. - map annotation_labels = 12; - - // Required. Number of labelers to work on each DataItem. - int32 labeler_count = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Google Cloud Storage location of the instruction pdf. This pdf is - // shared with labelers, and provides detailed description on how to label - // DataItems in Datasets. - string instruction_uri = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. Points to a YAML file stored on Google Cloud Storage describing the - // config for a specific type of DataLabelingJob. - // The schema files that can be used here are found in the - // https://storage.googleapis.com/google-cloud-aiplatform bucket in the - // /schema/datalabelingjob/inputs/ folder. - string inputs_schema_uri = 6 [(google.api.field_behavior) = REQUIRED]; - - // Required. Input config parameters for the DataLabelingJob. - google.protobuf.Value inputs = 7 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The detailed state of the job. - JobState state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Current labeling job progress percentage scaled in interval [0, 100], - // indicating the percentage of DataItems that has been finished. - int32 labeling_progress = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Estimated cost(in US dollars) that the DataLabelingJob has incurred to - // date. - google.type.Money current_spend = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this DataLabelingJob was created. - google.protobuf.Timestamp create_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this DataLabelingJob was updated most recently. - google.protobuf.Timestamp update_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. DataLabelingJob errors. It is only populated when job's state is - // `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`. - google.rpc.Status error = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize your DataLabelingJobs. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. Following system labels exist for each DataLabelingJob: - // - // * "aiplatform.googleapis.com/schema": output only, its value is the - // [inputs_schema][google.cloud.aiplatform.v1.DataLabelingJob.inputs_schema_uri]'s title. - map labels = 11; - - // The SpecialistPools' resource names associated with this job. - repeated string specialist_pools = 16; - - // Customer-managed encryption key spec for a DataLabelingJob. If set, this - // DataLabelingJob will be secured by this key. - // - // Note: Annotations created in the DataLabelingJob are associated with - // the EncryptionSpec of the Dataset they are exported to. - EncryptionSpec encryption_spec = 20; - - // Parameters that configure the active learning pipeline. Active learning - // will label the data incrementally via several iterations. For every - // iteration, it will select a batch of data based on the sampling strategy. - ActiveLearningConfig active_learning_config = 21; -} - -// Parameters that configure the active learning pipeline. Active learning will -// label the data incrementally by several iterations. For every iteration, it -// will select a batch of data based on the sampling strategy. -message ActiveLearningConfig { - // Required. Max human labeling DataItems. The rest part will be labeled by - // machine. - oneof human_labeling_budget { - // Max number of human labeled DataItems. - int64 max_data_item_count = 1; - - // Max percent of total DataItems for human labeling. - int32 max_data_item_percentage = 2; - } - - // Active learning data sampling config. For every active learning labeling - // iteration, it will select a batch of data based on the sampling strategy. - SampleConfig sample_config = 3; - - // CMLE training config. For every active learning labeling iteration, system - // will train a machine learning model on CMLE. The trained model will be used - // by data sampling algorithm to select DataItems. - TrainingConfig training_config = 4; -} - -// Active learning data sampling config. For every active learning labeling -// iteration, it will select a batch of data based on the sampling strategy. -message SampleConfig { - // Sample strategy decides which subset of DataItems should be selected for - // human labeling in every batch. - enum SampleStrategy { - // Default will be treated as UNCERTAINTY. - SAMPLE_STRATEGY_UNSPECIFIED = 0; - - // Sample the most uncertain data to label. - UNCERTAINTY = 1; - } - - // Decides sample size for the initial batch. initial_batch_sample_percentage - // is used by default. - oneof initial_batch_sample_size { - // The percentage of data needed to be labeled in the first batch. - int32 initial_batch_sample_percentage = 1; - } - - // Decides sample size for the following batches. - // following_batch_sample_percentage is used by default. - oneof following_batch_sample_size { - // The percentage of data needed to be labeled in each following batch - // (except the first batch). - int32 following_batch_sample_percentage = 3; - } - - // Field to choose sampling strategy. Sampling strategy will decide which data - // should be selected for human labeling in every batch. - SampleStrategy sample_strategy = 5; -} - -// CMLE training config. For every active learning labeling iteration, system -// will train a machine learning model on CMLE. The trained model will be used -// by data sampling algorithm to select DataItems. -message TrainingConfig { - // The timeout hours for the CMLE training job, expressed in milli hours - // i.e. 1,000 value in this field means 1 hour. - int64 timeout_training_milli_hours = 1; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/dataset.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/dataset.proto deleted file mode 100644 index 6c686986..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/dataset.proto +++ /dev/null @@ -1,144 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1/io.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "DatasetProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A collection of DataItems and Annotations on them. -message Dataset { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Dataset" - pattern: "projects/{project}/locations/{location}/datasets/{dataset}" - }; - - // Output only. The resource name of the Dataset. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The user-defined name of the Dataset. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The description of the Dataset. - string description = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Points to a YAML file stored on Google Cloud Storage describing additional - // information about the Dataset. - // The schema is defined as an OpenAPI 3.0.2 Schema Object. - // The schema files that can be used here are found in - // gs://google-cloud-aiplatform/schema/dataset/metadata/. - string metadata_schema_uri = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. Additional information about the Dataset. - google.protobuf.Value metadata = 8 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Timestamp when this Dataset was created. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Dataset was last updated. - google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 6; - - // The labels with user-defined metadata to organize your Datasets. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one Dataset (System - // labels are excluded). - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. Following system labels exist for each Dataset: - // - // * "aiplatform.googleapis.com/dataset_metadata_schema": output only, its - // value is the [metadata_schema's][google.cloud.aiplatform.v1.Dataset.metadata_schema_uri] title. - map labels = 7; - - // Customer-managed encryption key spec for a Dataset. If set, this Dataset - // and all sub-resources of this Dataset will be secured by this key. - EncryptionSpec encryption_spec = 11; -} - -// Describes the location from where we import data into a Dataset, together -// with the labels that will be applied to the DataItems and the Annotations. -message ImportDataConfig { - // The source of the input. - oneof source { - // The Google Cloud Storage location for the input content. - GcsSource gcs_source = 1; - } - - // Labels that will be applied to newly imported DataItems. If an identical - // DataItem as one being imported already exists in the Dataset, then these - // labels will be appended to these of the already existing one, and if labels - // with identical key is imported before, the old label value will be - // overwritten. If two DataItems are identical in the same import data - // operation, the labels will be combined and if key collision happens in this - // case, one of the values will be picked randomly. Two DataItems are - // considered identical if their content bytes are identical (e.g. image bytes - // or pdf bytes). - // These labels will be overridden by Annotation labels specified inside index - // file referenced by [import_schema_uri][google.cloud.aiplatform.v1.ImportDataConfig.import_schema_uri], e.g. jsonl file. - map data_item_labels = 2; - - // Required. Points to a YAML file stored on Google Cloud Storage describing the import - // format. Validation will be done against the schema. The schema is defined - // as an [OpenAPI 3.0.2 Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - string import_schema_uri = 4 [(google.api.field_behavior) = REQUIRED]; -} - -// Describes what part of the Dataset is to be exported, the destination of -// the export and how to export. -message ExportDataConfig { - // The destination of the output. - oneof destination { - // The Google Cloud Storage location where the output is to be written to. - // In the given directory a new directory will be created with name: - // `export-data--` where - // timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export - // output will be written into that directory. Inside that directory, - // annotations with the same schema will be grouped into sub directories - // which are named with the corresponding annotations' schema title. Inside - // these sub directories, a schema.yaml will be created to describe the - // output format. - GcsDestination gcs_destination = 1; - } - - // A filter on Annotations of the Dataset. Only Annotations on to-be-exported - // DataItems(specified by [data_items_filter][]) that match this filter will - // be exported. The filter syntax is the same as in - // [ListAnnotations][google.cloud.aiplatform.v1.DatasetService.ListAnnotations]. - string annotations_filter = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/dataset_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/dataset_service.proto deleted file mode 100644 index f9f82845..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/dataset_service.proto +++ /dev/null @@ -1,412 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/annotation.proto"; -import "google/cloud/aiplatform/v1/annotation_spec.proto"; -import "google/cloud/aiplatform/v1/data_item.proto"; -import "google/cloud/aiplatform/v1/dataset.proto"; -import "google/cloud/aiplatform/v1/operation.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "DatasetServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// The service that handles the CRUD of Vertex AI Dataset and its child -// resources. -service DatasetService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a Dataset. - rpc CreateDataset(CreateDatasetRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/datasets" - body: "dataset" - }; - option (google.api.method_signature) = "parent,dataset"; - option (google.longrunning.operation_info) = { - response_type: "Dataset" - metadata_type: "CreateDatasetOperationMetadata" - }; - } - - // Gets a Dataset. - rpc GetDataset(GetDatasetRequest) returns (Dataset) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/datasets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a Dataset. - rpc UpdateDataset(UpdateDatasetRequest) returns (Dataset) { - option (google.api.http) = { - patch: "/v1/{dataset.name=projects/*/locations/*/datasets/*}" - body: "dataset" - }; - option (google.api.method_signature) = "dataset,update_mask"; - } - - // Lists Datasets in a Location. - rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/datasets" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a Dataset. - rpc DeleteDataset(DeleteDatasetRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/datasets/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Imports data into a Dataset. - rpc ImportData(ImportDataRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/datasets/*}:import" - body: "*" - }; - option (google.api.method_signature) = "name,import_configs"; - option (google.longrunning.operation_info) = { - response_type: "ImportDataResponse" - metadata_type: "ImportDataOperationMetadata" - }; - } - - // Exports data from a Dataset. - rpc ExportData(ExportDataRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/datasets/*}:export" - body: "*" - }; - option (google.api.method_signature) = "name,export_config"; - option (google.longrunning.operation_info) = { - response_type: "ExportDataResponse" - metadata_type: "ExportDataOperationMetadata" - }; - } - - // Lists DataItems in a Dataset. - rpc ListDataItems(ListDataItemsRequest) returns (ListDataItemsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/datasets/*}/dataItems" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets an AnnotationSpec. - rpc GetAnnotationSpec(GetAnnotationSpecRequest) returns (AnnotationSpec) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Annotations belongs to a dataitem - rpc ListAnnotations(ListAnnotationsRequest) returns (ListAnnotationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/datasets/*/dataItems/*}/annotations" - }; - option (google.api.method_signature) = "parent"; - } -} - -// Request message for [DatasetService.CreateDataset][google.cloud.aiplatform.v1.DatasetService.CreateDataset]. -message CreateDatasetRequest { - // Required. The resource name of the Location to create the Dataset in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The Dataset to create. - Dataset dataset = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Runtime operation information for [DatasetService.CreateDataset][google.cloud.aiplatform.v1.DatasetService.CreateDataset]. -message CreateDatasetOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [DatasetService.GetDataset][google.cloud.aiplatform.v1.DatasetService.GetDataset]. -message GetDatasetRequest { - // Required. The name of the Dataset resource. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - } - ]; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 2; -} - -// Request message for [DatasetService.UpdateDataset][google.cloud.aiplatform.v1.DatasetService.UpdateDataset]. -message UpdateDatasetRequest { - // Required. The Dataset which replaces the resource on the server. - Dataset dataset = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The update mask applies to the resource. - // For the `FieldMask` definition, see [google.protobuf.FieldMask][google.protobuf.FieldMask]. - // Updatable fields: - // - // * `display_name` - // * `description` - // * `labels` - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [DatasetService.ListDatasets][google.cloud.aiplatform.v1.DatasetService.ListDatasets]. -message ListDatasetsRequest { - // Required. The name of the Dataset's parent resource. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // An expression for filtering the results of the request. For field names - // both snake_case and camelCase are supported. - // - // * `display_name`: supports = and != - // * `metadata_schema_uri`: supports = and != - // * `labels` supports general map functions that is: - // * `labels.key=value` - key:value equality - // * `labels.key:* or labels:key - key existence - // * A key including a space must be quoted. `labels."a key"`. - // - // Some examples: - // * `displayName="myDisplayName"` - // * `labels.myKey="myValue"` - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; - - // A comma-separated list of fields to order by, sorted in ascending order. - // Use "desc" after a field name for descending. - // Supported fields: - // * `display_name` - // * `create_time` - // * `update_time` - string order_by = 6; -} - -// Response message for [DatasetService.ListDatasets][google.cloud.aiplatform.v1.DatasetService.ListDatasets]. -message ListDatasetsResponse { - // A list of Datasets that matches the specified filter in the request. - repeated Dataset datasets = 1; - - // The standard List next-page token. - string next_page_token = 2; -} - -// Request message for [DatasetService.DeleteDataset][google.cloud.aiplatform.v1.DatasetService.DeleteDataset]. -message DeleteDatasetRequest { - // Required. The resource name of the Dataset to delete. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - } - ]; -} - -// Request message for [DatasetService.ImportData][google.cloud.aiplatform.v1.DatasetService.ImportData]. -message ImportDataRequest { - // Required. The name of the Dataset resource. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - } - ]; - - // Required. The desired input locations. The contents of all input locations will be - // imported in one batch. - repeated ImportDataConfig import_configs = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [DatasetService.ImportData][google.cloud.aiplatform.v1.DatasetService.ImportData]. -message ImportDataResponse { - -} - -// Runtime operation information for [DatasetService.ImportData][google.cloud.aiplatform.v1.DatasetService.ImportData]. -message ImportDataOperationMetadata { - // The common part of the operation metadata. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [DatasetService.ExportData][google.cloud.aiplatform.v1.DatasetService.ExportData]. -message ExportDataRequest { - // Required. The name of the Dataset resource. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - } - ]; - - // Required. The desired output location. - ExportDataConfig export_config = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [DatasetService.ExportData][google.cloud.aiplatform.v1.DatasetService.ExportData]. -message ExportDataResponse { - // All of the files that are exported in this export operation. - repeated string exported_files = 1; -} - -// Runtime operation information for [DatasetService.ExportData][google.cloud.aiplatform.v1.DatasetService.ExportData]. -message ExportDataOperationMetadata { - // The common part of the operation metadata. - GenericOperationMetadata generic_metadata = 1; - - // A Google Cloud Storage directory which path ends with '/'. The exported - // data is stored in the directory. - string gcs_output_directory = 2; -} - -// Request message for [DatasetService.ListDataItems][google.cloud.aiplatform.v1.DatasetService.ListDataItems]. -message ListDataItemsRequest { - // Required. The resource name of the Dataset to list DataItems from. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - } - ]; - - // The standard list filter. - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; - - // A comma-separated list of fields to order by, sorted in ascending order. - // Use "desc" after a field name for descending. - string order_by = 6; -} - -// Response message for [DatasetService.ListDataItems][google.cloud.aiplatform.v1.DatasetService.ListDataItems]. -message ListDataItemsResponse { - // A list of DataItems that matches the specified filter in the request. - repeated DataItem data_items = 1; - - // The standard List next-page token. - string next_page_token = 2; -} - -// Request message for [DatasetService.GetAnnotationSpec][google.cloud.aiplatform.v1.DatasetService.GetAnnotationSpec]. -message GetAnnotationSpecRequest { - // Required. The name of the AnnotationSpec resource. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/AnnotationSpec" - } - ]; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 2; -} - -// Request message for [DatasetService.ListAnnotations][google.cloud.aiplatform.v1.DatasetService.ListAnnotations]. -message ListAnnotationsRequest { - // Required. The resource name of the DataItem to list Annotations from. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/DataItem" - } - ]; - - // The standard list filter. - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; - - // A comma-separated list of fields to order by, sorted in ascending order. - // Use "desc" after a field name for descending. - string order_by = 6; -} - -// Response message for [DatasetService.ListAnnotations][google.cloud.aiplatform.v1.DatasetService.ListAnnotations]. -message ListAnnotationsResponse { - // A list of Annotations that matches the specified filter in the request. - repeated Annotation annotations = 1; - - // The standard List next-page token. - string next_page_token = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/deployed_index_ref.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/deployed_index_ref.proto deleted file mode 100644 index 35c8b30c..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/deployed_index_ref.proto +++ /dev/null @@ -1,42 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "DeployedIndexRefProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Points to a DeployedIndex. -message DeployedIndexRef { - // Immutable. A resource name of the IndexEndpoint. - string index_endpoint = 1 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/IndexEndpoint" - } - ]; - - // Immutable. The ID of the DeployedIndex in the above IndexEndpoint. - string deployed_index_id = 2 [(google.api.field_behavior) = IMMUTABLE]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/deployed_model_ref.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/deployed_model_ref.proto deleted file mode 100644 index 8a7b1eb7..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/deployed_model_ref.proto +++ /dev/null @@ -1,42 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "DeployedModelNameProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Points to a DeployedModel. -message DeployedModelRef { - // Immutable. A resource name of an Endpoint. - string endpoint = 1 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Endpoint" - } - ]; - - // Immutable. An ID of a DeployedModel in the above Endpoint. - string deployed_model_id = 2 [(google.api.field_behavior) = IMMUTABLE]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/encryption_spec.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/encryption_spec.proto deleted file mode 100644 index 15a79901..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/encryption_spec.proto +++ /dev/null @@ -1,38 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "EncryptionSpecProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Represents a customer-managed encryption key spec that can be applied to -// a top-level resource. -message EncryptionSpec { - // Required. The Cloud KMS resource identifier of the customer managed encryption key - // used to protect a resource. Has the form: - // `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. - // The key needs to be in the same region as where the compute resource is - // created. - string kms_key_name = 1 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/endpoint.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/endpoint.proto deleted file mode 100644 index 453cc89a..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/endpoint.proto +++ /dev/null @@ -1,252 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1/explanation.proto"; -import "google/cloud/aiplatform/v1/io.proto"; -import "google/cloud/aiplatform/v1/machine_resources.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "EndpointProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Models are deployed into it, and afterwards Endpoint is called to obtain -// predictions and explanations. -message Endpoint { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Endpoint" - pattern: "projects/{project}/locations/{location}/endpoints/{endpoint}" - }; - - // Output only. The resource name of the Endpoint. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The display name of the Endpoint. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // The description of the Endpoint. - string description = 3; - - // Output only. The models deployed in this Endpoint. - // To add or remove DeployedModels use [EndpointService.DeployModel][google.cloud.aiplatform.v1.EndpointService.DeployModel] and - // [EndpointService.UndeployModel][google.cloud.aiplatform.v1.EndpointService.UndeployModel] respectively. - repeated DeployedModel deployed_models = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // A map from a DeployedModel's ID to the percentage of this Endpoint's - // traffic that should be forwarded to that DeployedModel. - // - // If a DeployedModel's ID is not listed in this map, then it receives no - // traffic. - // - // The traffic percentage values must add up to 100, or map must be empty if - // the Endpoint is to not accept any traffic at a moment. - map traffic_split = 5; - - // Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 6; - - // The labels with user-defined metadata to organize your Endpoints. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 7; - - // Output only. Timestamp when this Endpoint was created. - google.protobuf.Timestamp create_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Endpoint was last updated. - google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Customer-managed encryption key spec for an Endpoint. If set, this - // Endpoint and all sub-resources of this Endpoint will be secured by - // this key. - EncryptionSpec encryption_spec = 10; - - // The full name of the Google Compute Engine - // [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks) - // to which the Endpoint should be peered. - // - // Private services access must already be configured for the network. If left - // unspecified, the Endpoint is not peered with any network. - // - // Only one of the fields, [network][google.cloud.aiplatform.v1.Endpoint.network] or - // [enable_private_service_connect][google.cloud.aiplatform.v1.Endpoint.enable_private_service_connect], - // can be set. - // - // [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert): - // `projects/{project}/global/networks/{network}`. - // Where `{project}` is a project number, as in `12345`, and `{network}` is - // network name. - string network = 13 [(google.api.resource_reference) = { - type: "compute.googleapis.com/Network" - }]; - - // Deprecated: If true, expose the Endpoint via private service connect. - // - // Only one of the fields, [network][google.cloud.aiplatform.v1.Endpoint.network] or - // [enable_private_service_connect][google.cloud.aiplatform.v1.Endpoint.enable_private_service_connect], - // can be set. - bool enable_private_service_connect = 17 [deprecated = true]; - - // Output only. Resource name of the Model Monitoring job associated with this Endpoint - // if monitoring is enabled by [CreateModelDeploymentMonitoringJob][]. - // Format: - // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - string model_deployment_monitoring_job = 14 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" - } - ]; - - // Configures the request-response logging for online prediction. - PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; -} - -// A deployment of a Model. Endpoints contain one or more DeployedModels. -message DeployedModel { - // The prediction (for example, the machine) resources that the DeployedModel - // uses. The user is billed for the resources (at least their minimal amount) - // even if the DeployedModel receives no traffic. - // Not all Models support all resources types. See - // [Model.supported_deployment_resources_types][google.cloud.aiplatform.v1.Model.supported_deployment_resources_types]. - oneof prediction_resources { - // A description of resources that are dedicated to the DeployedModel, and - // that need a higher degree of manual configuration. - DedicatedResources dedicated_resources = 7; - - // A description of resources that to large degree are decided by Vertex - // AI, and require only a modest additional configuration. - AutomaticResources automatic_resources = 8; - } - - // Immutable. The ID of the DeployedModel. If not provided upon deployment, Vertex AI - // will generate a value for this ID. - // - // This value should be 1-10 characters, and valid characters are /[0-9]/. - string id = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Required. The name of the Model that this is the deployment of. Note that the Model - // may be in a different location than the DeployedModel's Endpoint. - string model = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - - // The display name of the DeployedModel. If not provided upon creation, - // the Model's display_name is used. - string display_name = 3; - - // Output only. Timestamp when the DeployedModel was created. - google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Explanation configuration for this DeployedModel. - // - // When deploying a Model using [EndpointService.DeployModel][google.cloud.aiplatform.v1.EndpointService.DeployModel], this value - // overrides the value of [Model.explanation_spec][google.cloud.aiplatform.v1.Model.explanation_spec]. All fields of - // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] are optional in the request. If a field of - // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] is not populated, the value of the same field of - // [Model.explanation_spec][google.cloud.aiplatform.v1.Model.explanation_spec] is inherited. If the corresponding - // [Model.explanation_spec][google.cloud.aiplatform.v1.Model.explanation_spec] is not populated, all fields of the - // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] will be used for the explanation configuration. - ExplanationSpec explanation_spec = 9; - - // The service account that the DeployedModel's container runs as. Specify the - // email address of the service account. If this service account is not - // specified, the container runs as a service account that doesn't have access - // to the resource project. - // - // Users deploying the Model must have the `iam.serviceAccounts.actAs` - // permission on this service account. - string service_account = 11; - - // For custom-trained Models and AutoML Tabular Models, the container of the - // DeployedModel instances will send `stderr` and `stdout` streams to - // Stackdriver Logging by default. Please note that the logs incur cost, - // which are subject to [Cloud Logging - // pricing](https://cloud.google.com/stackdriver/pricing). - // - // User can disable container logging by setting this flag to true. - bool disable_container_logging = 15; - - // These logs are like standard server access logs, containing - // information like timestamp and latency for each prediction request. - // - // Note that Stackdriver logs may incur a cost, especially if your project - // receives prediction requests at a high queries per second rate (QPS). - // Estimate your costs before enabling this option. - bool enable_access_logging = 13; - - // Output only. Provide paths for users to send predict/explain/health requests directly to - // the deployed model services running on Cloud via private services access. - // This field is populated if [network][google.cloud.aiplatform.v1.Endpoint.network] is configured. - PrivateEndpoints private_endpoints = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// PrivateEndpoints proto is used to provide paths for users to send -// requests privately. -// To send request via private service access, use predict_http_uri, -// explain_http_uri or health_http_uri. To send request via private service -// connect, use service_attachment. -message PrivateEndpoints { - // Output only. Http(s) path to send prediction requests. - string predict_http_uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Http(s) path to send explain requests. - string explain_http_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Http(s) path to send health check requests. - string health_http_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The name of the service attachment resource. Populated if private service - // connect is enabled. - string service_attachment = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Configuration for logging request-response to a BigQuery table. -message PredictRequestResponseLoggingConfig { - // If logging is enabled or not. - bool enabled = 1; - - // Percentage of requests to be logged, expressed as a fraction in - // range(0,1]. - double sampling_rate = 2; - - // BigQuery table for logging. - // If only given a project, a new dataset will be created with name - // `logging__` where - // will be made BigQuery-dataset-name compatible (e.g. - // most special characters will become underscores). If no table name is - // given, a new table will be created with name `request_response_logging` - BigQueryDestination bigquery_destination = 3; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/endpoint_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/endpoint_service.proto deleted file mode 100644 index 0108728c..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/endpoint_service.proto +++ /dev/null @@ -1,325 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/endpoint.proto"; -import "google/cloud/aiplatform/v1/operation.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "EndpointServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A service for managing Vertex AI's Endpoints. -service EndpointService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates an Endpoint. - rpc CreateEndpoint(CreateEndpointRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/endpoints" - body: "endpoint" - }; - option (google.api.method_signature) = "parent,endpoint"; - option (google.api.method_signature) = "parent,endpoint,endpoint_id"; - option (google.longrunning.operation_info) = { - response_type: "Endpoint" - metadata_type: "CreateEndpointOperationMetadata" - }; - } - - // Gets an Endpoint. - rpc GetEndpoint(GetEndpointRequest) returns (Endpoint) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/endpoints/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Endpoints in a Location. - rpc ListEndpoints(ListEndpointsRequest) returns (ListEndpointsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/endpoints" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates an Endpoint. - rpc UpdateEndpoint(UpdateEndpointRequest) returns (Endpoint) { - option (google.api.http) = { - patch: "/v1/{endpoint.name=projects/*/locations/*/endpoints/*}" - body: "endpoint" - }; - option (google.api.method_signature) = "endpoint,update_mask"; - } - - // Deletes an Endpoint. - rpc DeleteEndpoint(DeleteEndpointRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/endpoints/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Deploys a Model into this Endpoint, creating a DeployedModel within it. - rpc DeployModel(DeployModelRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:deployModel" - body: "*" - }; - option (google.api.method_signature) = "endpoint,deployed_model,traffic_split"; - option (google.longrunning.operation_info) = { - response_type: "DeployModelResponse" - metadata_type: "DeployModelOperationMetadata" - }; - } - - // Undeploys a Model from an Endpoint, removing a DeployedModel from it, and - // freeing all resources it's using. - rpc UndeployModel(UndeployModelRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:undeployModel" - body: "*" - }; - option (google.api.method_signature) = "endpoint,deployed_model_id,traffic_split"; - option (google.longrunning.operation_info) = { - response_type: "UndeployModelResponse" - metadata_type: "UndeployModelOperationMetadata" - }; - } -} - -// Request message for [EndpointService.CreateEndpoint][google.cloud.aiplatform.v1.EndpointService.CreateEndpoint]. -message CreateEndpointRequest { - // Required. The resource name of the Location to create the Endpoint in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The Endpoint to create. - Endpoint endpoint = 2 [(google.api.field_behavior) = REQUIRED]; - - // Immutable. The ID to use for endpoint, which will become the final - // component of the endpoint resource name. - // If not provided, Vertex AI will generate a value for this ID. - // - // This value should be 1-10 characters, and valid characters are /[0-9]/. - // When using HTTP/JSON, this field is populated based on a query string - // argument, such as `?endpoint_id=12345`. This is the fallback for fields - // that are not included in either the URI or the body. - string endpoint_id = 4 [(google.api.field_behavior) = IMMUTABLE]; -} - -// Runtime operation information for [EndpointService.CreateEndpoint][google.cloud.aiplatform.v1.EndpointService.CreateEndpoint]. -message CreateEndpointOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [EndpointService.GetEndpoint][google.cloud.aiplatform.v1.EndpointService.GetEndpoint] -message GetEndpointRequest { - // Required. The name of the Endpoint resource. - // Format: - // `projects/{project}/locations/{location}/endpoints/{endpoint}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Endpoint" - } - ]; -} - -// Request message for [EndpointService.ListEndpoints][google.cloud.aiplatform.v1.EndpointService.ListEndpoints]. -message ListEndpointsRequest { - // Required. The resource name of the Location from which to list the Endpoints. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. An expression for filtering the results of the request. For field names - // both snake_case and camelCase are supported. - // - // * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID, - // i.e. the last segment of the Endpoint's [resource name][google.cloud.aiplatform.v1.Endpoint.name]. - // * `display_name` supports = and, != - // * `labels` supports general map functions that is: - // * `labels.key=value` - key:value equality - // * `labels.key:* or labels:key - key existence - // * A key including a space must be quoted. `labels."a key"`. - // - // Some examples: - // * `endpoint=1` - // * `displayName="myDisplayName"` - // * `labels.myKey="myValue"` - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The standard list page size. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The standard list page token. - // Typically obtained via - // [ListEndpointsResponse.next_page_token][google.cloud.aiplatform.v1.ListEndpointsResponse.next_page_token] of the previous - // [EndpointService.ListEndpoints][google.cloud.aiplatform.v1.EndpointService.ListEndpoints] call. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5 [(google.api.field_behavior) = OPTIONAL]; - - // A comma-separated list of fields to order by, sorted in ascending order. - // Use "desc" after a field name for descending. - // Supported fields: - // * `display_name` - // * `create_time` - // * `update_time` - // - // Example: `display_name, create_time desc`. - string order_by = 6; -} - -// Response message for [EndpointService.ListEndpoints][google.cloud.aiplatform.v1.EndpointService.ListEndpoints]. -message ListEndpointsResponse { - // List of Endpoints in the requested page. - repeated Endpoint endpoints = 1; - - // A token to retrieve the next page of results. - // Pass to [ListEndpointsRequest.page_token][google.cloud.aiplatform.v1.ListEndpointsRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint]. -message UpdateEndpointRequest { - // Required. The Endpoint which replaces the resource on the server. - Endpoint endpoint = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The update mask applies to the resource. See [google.protobuf.FieldMask][google.protobuf.FieldMask]. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [EndpointService.DeleteEndpoint][google.cloud.aiplatform.v1.EndpointService.DeleteEndpoint]. -message DeleteEndpointRequest { - // Required. The name of the Endpoint resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/endpoints/{endpoint}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Endpoint" - } - ]; -} - -// Request message for [EndpointService.DeployModel][google.cloud.aiplatform.v1.EndpointService.DeployModel]. -message DeployModelRequest { - // Required. The name of the Endpoint resource into which to deploy a Model. - // Format: - // `projects/{project}/locations/{location}/endpoints/{endpoint}` - string endpoint = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Endpoint" - } - ]; - - // Required. The DeployedModel to be created within the Endpoint. Note that - // [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] must be updated for the DeployedModel to start - // receiving traffic, either as part of this call, or via - // [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint]. - DeployedModel deployed_model = 2 [(google.api.field_behavior) = REQUIRED]; - - // A map from a DeployedModel's ID to the percentage of this Endpoint's - // traffic that should be forwarded to that DeployedModel. - // - // If this field is non-empty, then the Endpoint's - // [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be overwritten with it. - // To refer to the ID of the just being deployed Model, a "0" should be used, - // and the actual ID of the new DeployedModel will be filled in its place by - // this method. The traffic percentage values must add up to 100. - // - // If this field is empty, then the Endpoint's - // [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] is not updated. - map traffic_split = 3; -} - -// Response message for [EndpointService.DeployModel][google.cloud.aiplatform.v1.EndpointService.DeployModel]. -message DeployModelResponse { - // The DeployedModel that had been deployed in the Endpoint. - DeployedModel deployed_model = 1; -} - -// Runtime operation information for [EndpointService.DeployModel][google.cloud.aiplatform.v1.EndpointService.DeployModel]. -message DeployModelOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [EndpointService.UndeployModel][google.cloud.aiplatform.v1.EndpointService.UndeployModel]. -message UndeployModelRequest { - // Required. The name of the Endpoint resource from which to undeploy a Model. - // Format: - // `projects/{project}/locations/{location}/endpoints/{endpoint}` - string endpoint = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Endpoint" - } - ]; - - // Required. The ID of the DeployedModel to be undeployed from the Endpoint. - string deployed_model_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // If this field is provided, then the Endpoint's - // [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be overwritten with it. If - // last DeployedModel is being undeployed from the Endpoint, the - // [Endpoint.traffic_split] will always end up empty when this call returns. - // A DeployedModel will be successfully undeployed only if it doesn't have - // any traffic assigned to it when this method executes, or if this field - // unassigns any traffic to it. - map traffic_split = 3; -} - -// Response message for [EndpointService.UndeployModel][google.cloud.aiplatform.v1.EndpointService.UndeployModel]. -message UndeployModelResponse { - -} - -// Runtime operation information for [EndpointService.UndeployModel][google.cloud.aiplatform.v1.EndpointService.UndeployModel]. -message UndeployModelOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/entity_type.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/entity_type.proto deleted file mode 100644 index 073b5339..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/entity_type.proto +++ /dev/null @@ -1,86 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/featurestore_monitoring.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "EntityTypeProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// An entity type is a type of object in a system that needs to be modeled and -// have stored information about. For example, driver is an entity type, and -// driver0 is an instance of an entity type driver. -message EntityType { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/EntityType" - pattern: "projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}" - }; - - // Immutable. Name of the EntityType. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - // - // The last part entity_type is assigned by the client. The entity_type can be - // up to 64 characters long and can consist only of ASCII Latin letters A-Z - // and a-z and underscore(_), and ASCII digits 0-9 starting with a letter. The - // value will be unique given a featurestore. - string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Optional. Description of the EntityType. - string description = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Timestamp when this EntityType was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this EntityType was most recently updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The labels with user-defined metadata to organize your EntityTypes. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information on and examples of labels. - // No more than 64 user labels can be associated with one EntityType (System - // labels are excluded)." - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. - map labels = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Used to perform a consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The default monitoring configuration for all Features with value type - // ([Feature.ValueType][google.cloud.aiplatform.v1.Feature.ValueType]) BOOL, STRING, DOUBLE or INT64 under this - // EntityType. - // - // If this is populated with - // [FeaturestoreMonitoringConfig.monitoring_interval] specified, snapshot - // analysis monitoring is enabled. Otherwise, snapshot analysis monitoring is - // disabled. - FeaturestoreMonitoringConfig monitoring_config = 8 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/env_var.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/env_var.proto deleted file mode 100644 index 34722e36..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/env_var.proto +++ /dev/null @@ -1,42 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "EnvVarProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Represents an environment variable present in a Container or Python Module. -message EnvVar { - // Required. Name of the environment variable. Must be a valid C identifier. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Variables that reference a $(VAR_NAME) are expanded - // using the previous defined environment variables in the container and - // any service environment variables. If a variable cannot be resolved, - // the reference in the input string will be unchanged. The $(VAR_NAME) - // syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped - // references will never be expanded, regardless of whether the variable - // exists or not. - string value = 2 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/event.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/event.proto deleted file mode 100644 index f9f925db..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/event.proto +++ /dev/null @@ -1,80 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "EventProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// An edge describing the relationship between an Artifact and an Execution in -// a lineage graph. -message Event { - // Describes whether an Event's Artifact is the Execution's input or output. - enum Type { - // Unspecified whether input or output of the Execution. - TYPE_UNSPECIFIED = 0; - - // An input of the Execution. - INPUT = 1; - - // An output of the Execution. - OUTPUT = 2; - } - - // Required. The relative resource name of the Artifact in the Event. - string artifact = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Artifact" - } - ]; - - // Output only. The relative resource name of the Execution in the Event. - string execution = 2 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Execution" - } - ]; - - // Output only. Time the Event occurred. - google.protobuf.Timestamp event_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The type of the Event. - Type type = 4 [(google.api.field_behavior) = REQUIRED]; - - // The labels with user-defined metadata to annotate Events. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one Event (System - // labels are excluded). - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. - map labels = 5; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/execution.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/execution.proto deleted file mode 100644 index a2b7c2b9..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/execution.proto +++ /dev/null @@ -1,115 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ExecutionProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Instance of a general execution. -message Execution { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Execution" - pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}" - }; - - // Describes the state of the Execution. - enum State { - // Unspecified Execution state - STATE_UNSPECIFIED = 0; - - // The Execution is new - NEW = 1; - - // The Execution is running - RUNNING = 2; - - // The Execution has finished running - COMPLETE = 3; - - // The Execution has failed - FAILED = 4; - - // The Execution completed through Cache hit. - CACHED = 5; - - // The Execution was cancelled. - CANCELLED = 6; - } - - // Output only. The resource name of the Execution. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User provided display name of the Execution. - // May be up to 128 Unicode characters. - string display_name = 2; - - // The state of this Execution. This is a property of the Execution, and does - // not imply or capture any ongoing process. This property is managed by - // clients (such as Vertex AI Pipelines) and the system does not prescribe - // or check the validity of state transitions. - State state = 6; - - // An eTag used to perform consistent read-modify-write updates. If not set, a - // blind "overwrite" update happens. - string etag = 9; - - // The labels with user-defined metadata to organize your Executions. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one Execution (System - // labels are excluded). - map labels = 10; - - // Output only. Timestamp when this Execution was created. - google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Execution was last updated. - google.protobuf.Timestamp update_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The title of the schema describing the metadata. - // - // Schema title and version is expected to be registered in earlier Create - // Schema calls. And both are used together as unique identifiers to identify - // schemas within the local metadata store. - string schema_title = 13; - - // The version of the schema in `schema_title` to use. - // - // Schema title and version is expected to be registered in earlier Create - // Schema calls. And both are used together as unique identifiers to identify - // schemas within the local metadata store. - string schema_version = 14; - - // Properties of the Execution. - // The size of this field should not exceed 200KB. - google.protobuf.Struct metadata = 15; - - // Description of the Execution - string description = 16; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/explanation.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/explanation.proto deleted file mode 100644 index 55fd8394..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/explanation.proto +++ /dev/null @@ -1,401 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/cloud/aiplatform/v1/explanation_metadata.proto"; -import "google/protobuf/struct.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ExplanationProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Explanation of a prediction (provided in [PredictResponse.predictions][google.cloud.aiplatform.v1.PredictResponse.predictions]) -// produced by the Model on a given [instance][google.cloud.aiplatform.v1.ExplainRequest.instances]. -message Explanation { - // Output only. Feature attributions grouped by predicted outputs. - // - // For Models that predict only one output, such as regression Models that - // predict only one score, there is only one attibution that explains the - // predicted output. For Models that predict multiple outputs, such as - // multiclass Models that predict multiple classes, each element explains one - // specific item. [Attribution.output_index][google.cloud.aiplatform.v1.Attribution.output_index] can be used to identify which - // output this attribution is explaining. - // - // If users set [ExplanationParameters.top_k][google.cloud.aiplatform.v1.ExplanationParameters.top_k], the attributions are sorted - // by [instance_output_value][Attributions.instance_output_value] in - // descending order. If [ExplanationParameters.output_indices][google.cloud.aiplatform.v1.ExplanationParameters.output_indices] is specified, - // the attributions are stored by [Attribution.output_index][google.cloud.aiplatform.v1.Attribution.output_index] in the same - // order as they appear in the output_indices. - repeated Attribution attributions = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Aggregated explanation metrics for a Model over a set of instances. -message ModelExplanation { - // Output only. Aggregated attributions explaining the Model's prediction outputs over the - // set of instances. The attributions are grouped by outputs. - // - // For Models that predict only one output, such as regression Models that - // predict only one score, there is only one attibution that explains the - // predicted output. For Models that predict multiple outputs, such as - // multiclass Models that predict multiple classes, each element explains one - // specific item. [Attribution.output_index][google.cloud.aiplatform.v1.Attribution.output_index] can be used to identify which - // output this attribution is explaining. - // - // The [baselineOutputValue][google.cloud.aiplatform.v1.Attribution.baseline_output_value], - // [instanceOutputValue][google.cloud.aiplatform.v1.Attribution.instance_output_value] and - // [featureAttributions][google.cloud.aiplatform.v1.Attribution.feature_attributions] fields are - // averaged over the test data. - // - // NOTE: Currently AutoML tabular classification Models produce only one - // attribution, which averages attributions over all the classes it predicts. - // [Attribution.approximation_error][google.cloud.aiplatform.v1.Attribution.approximation_error] is not populated. - repeated Attribution mean_attributions = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Attribution that explains a particular prediction output. -message Attribution { - // Output only. Model predicted output if the input instance is constructed from the - // baselines of all the features defined in [ExplanationMetadata.inputs][google.cloud.aiplatform.v1.ExplanationMetadata.inputs]. - // The field name of the output is determined by the key in - // [ExplanationMetadata.outputs][google.cloud.aiplatform.v1.ExplanationMetadata.outputs]. - // - // If the Model's predicted output has multiple dimensions (rank > 1), this is - // the value in the output located by [output_index][google.cloud.aiplatform.v1.Attribution.output_index]. - // - // If there are multiple baselines, their output values are averaged. - double baseline_output_value = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Model predicted output on the corresponding [explanation - // instance][ExplainRequest.instances]. The field name of the output is - // determined by the key in [ExplanationMetadata.outputs][google.cloud.aiplatform.v1.ExplanationMetadata.outputs]. - // - // If the Model predicted output has multiple dimensions, this is the value in - // the output located by [output_index][google.cloud.aiplatform.v1.Attribution.output_index]. - double instance_output_value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Attributions of each explained feature. Features are extracted from - // the [prediction instances][google.cloud.aiplatform.v1.ExplainRequest.instances] according to - // [explanation metadata for inputs][google.cloud.aiplatform.v1.ExplanationMetadata.inputs]. - // - // The value is a struct, whose keys are the name of the feature. The values - // are how much the feature in the [instance][google.cloud.aiplatform.v1.ExplainRequest.instances] - // contributed to the predicted result. - // - // The format of the value is determined by the feature's input format: - // - // * If the feature is a scalar value, the attribution value is a - // [floating number][google.protobuf.Value.number_value]. - // - // * If the feature is an array of scalar values, the attribution value is - // an [array][google.protobuf.Value.list_value]. - // - // * If the feature is a struct, the attribution value is a - // [struct][google.protobuf.Value.struct_value]. The keys in the - // attribution value struct are the same as the keys in the feature - // struct. The formats of the values in the attribution struct are - // determined by the formats of the values in the feature struct. - // - // The [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.aiplatform.v1.ExplanationMetadata.feature_attributions_schema_uri] field, - // pointed to by the [ExplanationSpec][google.cloud.aiplatform.v1.ExplanationSpec] field of the - // [Endpoint.deployed_models][google.cloud.aiplatform.v1.Endpoint.deployed_models] object, points to the schema file that - // describes the features and their attribution values (if it is populated). - google.protobuf.Value feature_attributions = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The index that locates the explained prediction output. - // - // If the prediction output is a scalar value, output_index is not populated. - // If the prediction output has multiple dimensions, the length of the - // output_index list is the same as the number of dimensions of the output. - // The i-th element in output_index is the element index of the i-th dimension - // of the output vector. Indices start from 0. - repeated int32 output_index = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The display name of the output identified by [output_index][google.cloud.aiplatform.v1.Attribution.output_index]. For example, - // the predicted class name by a multi-classification Model. - // - // This field is only populated iff the Model predicts display names as a - // separate field along with the explained output. The predicted display name - // must has the same shape of the explained output, and can be located using - // output_index. - string output_display_name = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Error of [feature_attributions][google.cloud.aiplatform.v1.Attribution.feature_attributions] caused by approximation used in the - // explanation method. Lower value means more precise attributions. - // - // * For Sampled Shapley - // [attribution][google.cloud.aiplatform.v1.ExplanationParameters.sampled_shapley_attribution], - // increasing [path_count][google.cloud.aiplatform.v1.SampledShapleyAttribution.path_count] might reduce - // the error. - // * For Integrated Gradients - // [attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution], - // increasing [step_count][google.cloud.aiplatform.v1.IntegratedGradientsAttribution.step_count] might - // reduce the error. - // * For [XRAI attribution][google.cloud.aiplatform.v1.ExplanationParameters.xrai_attribution], - // increasing - // [step_count][google.cloud.aiplatform.v1.XraiAttribution.step_count] might reduce the error. - // - // See [this introduction](/vertex-ai/docs/explainable-ai/overview) - // for more information. - double approximation_error = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the explain output. Specified as the key in - // [ExplanationMetadata.outputs][google.cloud.aiplatform.v1.ExplanationMetadata.outputs]. - string output_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Specification of Model explanation. -message ExplanationSpec { - // Required. Parameters that configure explaining of the Model's predictions. - ExplanationParameters parameters = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Metadata describing the Model's input and output for explanation. - ExplanationMetadata metadata = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Parameters to configure explaining for Model's predictions. -message ExplanationParameters { - oneof method { - // An attribution method that approximates Shapley values for features that - // contribute to the label being predicted. A sampling strategy is used to - // approximate the value rather than considering all subsets of features. - // Refer to this paper for model details: https://arxiv.org/abs/1306.4265. - SampledShapleyAttribution sampled_shapley_attribution = 1; - - // An attribution method that computes Aumann-Shapley values taking - // advantage of the model's fully differentiable structure. Refer to this - // paper for more details: https://arxiv.org/abs/1703.01365 - IntegratedGradientsAttribution integrated_gradients_attribution = 2; - - // An attribution method that redistributes Integrated Gradients - // attribution to segmented regions, taking advantage of the model's fully - // differentiable structure. Refer to this paper for - // more details: https://arxiv.org/abs/1906.02825 - // - // XRAI currently performs better on natural images, like a picture of a - // house or an animal. If the images are taken in artificial environments, - // like a lab or manufacturing line, or from diagnostic equipment, like - // x-rays or quality-control cameras, use Integrated Gradients instead. - XraiAttribution xrai_attribution = 3; - } - - // If populated, returns attributions for top K indices of outputs - // (defaults to 1). Only applies to Models that predicts more than one outputs - // (e,g, multi-class Models). When set to -1, returns explanations for all - // outputs. - int32 top_k = 4; - - // If populated, only returns attributions that have - // [output_index][google.cloud.aiplatform.v1.Attribution.output_index] contained in output_indices. It - // must be an ndarray of integers, with the same shape of the output it's - // explaining. - // - // 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 populated, returns the argmax - // index of the outputs. - // - // Only applicable to Models that predict multiple outputs (e,g, multi-class - // Models that predict multiple classes). - google.protobuf.ListValue output_indices = 5; -} - -// An attribution method that approximates Shapley values for features that -// contribute to the label being predicted. A sampling strategy is used to -// approximate the value rather than considering all subsets of features. -message SampledShapleyAttribution { - // Required. The number of feature permutations to consider when approximating the - // Shapley values. - // - // Valid range of its value is [1, 50], inclusively. - int32 path_count = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// An attribution method that computes the Aumann-Shapley value taking advantage -// of the model's fully differentiable structure. Refer to this paper for -// more details: https://arxiv.org/abs/1703.01365 -message IntegratedGradientsAttribution { - // Required. The number of steps for approximating the path integral. - // A good value to start is 50 and gradually increase until the - // sum to diff property is within the desired error range. - // - // Valid range of its value is [1, 100], inclusively. - int32 step_count = 1 [(google.api.field_behavior) = REQUIRED]; - - // Config for SmoothGrad approximation of gradients. - // - // When enabled, the gradients are approximated by averaging the gradients - // from noisy samples in the vicinity of the inputs. Adding - // noise can help improve the computed gradients. Refer to this paper for more - // details: https://arxiv.org/pdf/1706.03825.pdf - SmoothGradConfig smooth_grad_config = 2; - - // Config for IG with blur baseline. - // - // When enabled, a linear path from the maximally blurred image to the input - // image is created. Using a blurred baseline instead of zero (black image) is - // motivated by the BlurIG approach explained here: - // https://arxiv.org/abs/2004.03383 - BlurBaselineConfig blur_baseline_config = 3; -} - -// An explanation method that redistributes Integrated Gradients -// attributions to segmented regions, taking advantage of the model's fully -// differentiable structure. Refer to this paper for more details: -// https://arxiv.org/abs/1906.02825 -// -// Supported only by image Models. -message XraiAttribution { - // Required. The number of steps for approximating the path integral. - // A good value to start is 50 and gradually increase until the - // sum to diff property is met within the desired error range. - // - // Valid range of its value is [1, 100], inclusively. - int32 step_count = 1 [(google.api.field_behavior) = REQUIRED]; - - // Config for SmoothGrad approximation of gradients. - // - // When enabled, the gradients are approximated by averaging the gradients - // from noisy samples in the vicinity of the inputs. Adding - // noise can help improve the computed gradients. Refer to this paper for more - // details: https://arxiv.org/pdf/1706.03825.pdf - SmoothGradConfig smooth_grad_config = 2; - - // Config for XRAI with blur baseline. - // - // When enabled, a linear path from the maximally blurred image to the input - // image is created. Using a blurred baseline instead of zero (black image) is - // motivated by the BlurIG approach explained here: - // https://arxiv.org/abs/2004.03383 - BlurBaselineConfig blur_baseline_config = 3; -} - -// Config for SmoothGrad approximation of gradients. -// -// When enabled, the gradients are approximated by averaging the gradients from -// noisy samples in the vicinity of the inputs. Adding noise can help improve -// the computed gradients. Refer to this paper for more details: -// https://arxiv.org/pdf/1706.03825.pdf -message SmoothGradConfig { - // Represents the standard deviation of the gaussian kernel - // that will be used to add noise to the interpolated inputs - // prior to computing gradients. - oneof GradientNoiseSigma { - // This is a single float value and will be used to add noise to all the - // features. Use this field when all features are normalized to have the - // same distribution: scale to range [0, 1], [-1, 1] or z-scoring, where - // features are normalized to have 0-mean and 1-variance. Learn more about - // [normalization](https://developers.google.com/machine-learning/data-prep/transform/normalization). - // - // For best results the recommended value is about 10% - 20% of the standard - // deviation of the input feature. Refer to section 3.2 of the SmoothGrad - // paper: https://arxiv.org/pdf/1706.03825.pdf. Defaults to 0.1. - // - // If the distribution is different per feature, set - // [feature_noise_sigma][google.cloud.aiplatform.v1.SmoothGradConfig.feature_noise_sigma] instead - // for each feature. - float noise_sigma = 1; - - // This is similar to [noise_sigma][google.cloud.aiplatform.v1.SmoothGradConfig.noise_sigma], but - // provides additional flexibility. A separate noise sigma can be provided - // for each feature, which is useful if their distributions are different. - // No noise is added to features that are not set. If this field is unset, - // [noise_sigma][google.cloud.aiplatform.v1.SmoothGradConfig.noise_sigma] will be used for all - // features. - FeatureNoiseSigma feature_noise_sigma = 2; - } - - // The number of gradient samples to use for - // approximation. The higher this number, the more accurate the gradient - // is, but the runtime complexity increases by this factor as well. - // Valid range of its value is [1, 50]. Defaults to 3. - int32 noisy_sample_count = 3; -} - -// Noise sigma by features. Noise sigma represents the standard deviation of the -// gaussian kernel that will be used to add noise to interpolated inputs prior -// to computing gradients. -message FeatureNoiseSigma { - // Noise sigma for a single feature. - message NoiseSigmaForFeature { - // The name of the input feature for which noise sigma is provided. The - // features are defined in - // [explanation metadata inputs][google.cloud.aiplatform.v1.ExplanationMetadata.inputs]. - string name = 1; - - // This represents the standard deviation of the Gaussian kernel that will - // be used to add noise to the feature prior to computing gradients. Similar - // to [noise_sigma][google.cloud.aiplatform.v1.SmoothGradConfig.noise_sigma] but represents the - // noise added to the current feature. Defaults to 0.1. - float sigma = 2; - } - - // Noise sigma per feature. No noise is added to features that are not set. - repeated NoiseSigmaForFeature noise_sigma = 1; -} - -// Config for blur baseline. -// -// When enabled, a linear path from the maximally blurred image to the input -// image is created. Using a blurred baseline instead of zero (black image) is -// motivated by the BlurIG approach explained here: -// https://arxiv.org/abs/2004.03383 -message BlurBaselineConfig { - // The standard deviation of the blur kernel for the blurred baseline. The - // same blurring parameter is used for both the height and the width - // dimension. If not set, the method defaults to the zero (i.e. black for - // images) baseline. - float max_blur_sigma = 1; -} - -// The [ExplanationSpec][google.cloud.aiplatform.v1.ExplanationSpec] entries that can be overridden at -// [online explanation][google.cloud.aiplatform.v1.PredictionService.Explain] time. -message ExplanationSpecOverride { - // The parameters to be overridden. Note that the - // [method][google.cloud.aiplatform.v1.ExplanationParameters.method] cannot be changed. If not specified, - // no parameter is overridden. - ExplanationParameters parameters = 1; - - // The metadata to be overridden. If not specified, no metadata is overridden. - ExplanationMetadataOverride metadata = 2; -} - -// The [ExplanationMetadata][google.cloud.aiplatform.v1.ExplanationMetadata] entries that can be overridden at -// [online explanation][google.cloud.aiplatform.v1.PredictionService.Explain] time. -message ExplanationMetadataOverride { - // The [input metadata][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata] entries to be - // overridden. - message InputMetadataOverride { - // Baseline inputs for this feature. - // - // This overrides the `input_baseline` field of the - // [ExplanationMetadata.InputMetadata][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata] - // object of the corresponding feature's input metadata. If it's not - // specified, the original baselines are not overridden. - repeated google.protobuf.Value input_baselines = 1; - } - - // Required. Overrides the [input metadata][google.cloud.aiplatform.v1.ExplanationMetadata.inputs] of the features. - // The key is the name of the feature to be overridden. The keys specified - // here must exist in the input metadata to be overridden. If a feature is - // not specified here, the corresponding feature's input metadata is not - // overridden. - map inputs = 1 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/explanation_metadata.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/explanation_metadata.proto deleted file mode 100644 index f0da95fe..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/explanation_metadata.proto +++ /dev/null @@ -1,395 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/struct.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ExplanationMetadataProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Metadata describing the Model's input and output for explanation. -message ExplanationMetadata { - // Metadata of the input of a feature. - // - // Fields other than [InputMetadata.input_baselines][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.input_baselines] are applicable only - // for Models that are using Vertex AI-provided images for Tensorflow. - message InputMetadata { - // Domain details of the input feature value. Provides numeric information - // about the feature, such as its range (min, max). If the feature has been - // pre-processed, for example with z-scoring, then it provides information - // about how to recover the original feature. For example, if the input - // feature is an image and it has been pre-processed to obtain 0-mean and - // stddev = 1 values, then original_mean, and original_stddev refer to the - // mean and stddev of the original feature (e.g. image tensor) from which - // input feature (with mean = 0 and stddev = 1) was obtained. - message FeatureValueDomain { - // The minimum permissible value for this feature. - float min_value = 1; - - // The maximum permissible value for this feature. - float max_value = 2; - - // If this input feature has been normalized to a mean value of 0, - // the original_mean specifies the mean value of the domain prior to - // normalization. - float original_mean = 3; - - // If this input feature has been normalized to a standard deviation of - // 1.0, the original_stddev specifies the standard deviation of the domain - // prior to normalization. - float original_stddev = 4; - } - - // Visualization configurations for image explanation. - message Visualization { - // Type of the image visualization. Only applicable to - // [Integrated Gradients attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution]. - enum Type { - // Should not be used. - TYPE_UNSPECIFIED = 0; - - // Shows which pixel contributed to the image prediction. - PIXELS = 1; - - // Shows which region contributed to the image prediction by outlining - // the region. - OUTLINES = 2; - } - - // Whether to only highlight pixels with positive contributions, negative - // or both. Defaults to POSITIVE. - enum Polarity { - // Default value. This is the same as POSITIVE. - POLARITY_UNSPECIFIED = 0; - - // Highlights the pixels/outlines that were most influential to the - // model's prediction. - POSITIVE = 1; - - // Setting polarity to negative highlights areas that does not lead to - // the models's current prediction. - NEGATIVE = 2; - - // Shows both positive and negative attributions. - BOTH = 3; - } - - // The color scheme used for highlighting areas. - enum ColorMap { - // Should not be used. - COLOR_MAP_UNSPECIFIED = 0; - - // Positive: green. Negative: pink. - PINK_GREEN = 1; - - // Viridis color map: A perceptually uniform color mapping which is - // easier to see by those with colorblindness and progresses from yellow - // to green to blue. Positive: yellow. Negative: blue. - VIRIDIS = 2; - - // Positive: red. Negative: red. - RED = 3; - - // Positive: green. Negative: green. - GREEN = 4; - - // Positive: green. Negative: red. - RED_GREEN = 6; - - // PiYG palette. - PINK_WHITE_GREEN = 5; - } - - // How the original image is displayed in the visualization. - enum OverlayType { - // Default value. This is the same as NONE. - OVERLAY_TYPE_UNSPECIFIED = 0; - - // No overlay. - NONE = 1; - - // The attributions are shown on top of the original image. - ORIGINAL = 2; - - // The attributions are shown on top of grayscaled version of the - // original image. - GRAYSCALE = 3; - - // The attributions are used as a mask to reveal predictive parts of - // the image and hide the un-predictive parts. - MASK_BLACK = 4; - } - - // Type of the image visualization. Only applicable to - // [Integrated Gradients attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution]. - // OUTLINES shows regions of attribution, while PIXELS shows per-pixel - // attribution. Defaults to OUTLINES. - Type type = 1; - - // Whether to only highlight pixels with positive contributions, negative - // or both. Defaults to POSITIVE. - Polarity polarity = 2; - - // The color scheme used for the highlighted areas. - // - // Defaults to PINK_GREEN for - // [Integrated Gradients attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution], - // which shows positive attributions in green and negative in pink. - // - // Defaults to VIRIDIS for - // [XRAI attribution][google.cloud.aiplatform.v1.ExplanationParameters.xrai_attribution], which - // highlights the most influential regions in yellow and the least - // influential in blue. - ColorMap color_map = 3; - - // Excludes attributions above the specified percentile from the - // highlighted areas. Using the clip_percent_upperbound and - // clip_percent_lowerbound together can be useful for filtering out noise - // and making it easier to see areas of strong attribution. Defaults to - // 99.9. - float clip_percent_upperbound = 4; - - // Excludes attributions below the specified percentile, from the - // highlighted areas. Defaults to 62. - float clip_percent_lowerbound = 5; - - // How the original image is displayed in the visualization. - // Adjusting the overlay can help increase visual clarity if the original - // image makes it difficult to view the visualization. Defaults to NONE. - OverlayType overlay_type = 6; - } - - // Defines how a feature is encoded. Defaults to IDENTITY. - enum Encoding { - // Default value. This is the same as IDENTITY. - ENCODING_UNSPECIFIED = 0; - - // The tensor represents one feature. - IDENTITY = 1; - - // The tensor represents a bag of features where each index maps to - // a feature. [InputMetadata.index_feature_mapping][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.index_feature_mapping] must be provided for - // this encoding. For example: - // ``` - // input = [27, 6.0, 150] - // index_feature_mapping = ["age", "height", "weight"] - // ``` - BAG_OF_FEATURES = 2; - - // The tensor represents a bag of features where each index maps to a - // feature. Zero values in the tensor indicates feature being - // non-existent. [InputMetadata.index_feature_mapping][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.index_feature_mapping] must be provided - // for this encoding. For example: - // ``` - // input = [2, 0, 5, 0, 1] - // index_feature_mapping = ["a", "b", "c", "d", "e"] - // ``` - BAG_OF_FEATURES_SPARSE = 3; - - // The tensor is a list of binaries representing whether a feature exists - // or not (1 indicates existence). [InputMetadata.index_feature_mapping][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.index_feature_mapping] - // must be provided for this encoding. For example: - // ``` - // input = [1, 0, 1, 0, 1] - // index_feature_mapping = ["a", "b", "c", "d", "e"] - // ``` - INDICATOR = 4; - - // The tensor is encoded into a 1-dimensional array represented by an - // encoded tensor. [InputMetadata.encoded_tensor_name][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.encoded_tensor_name] must be provided - // for this encoding. For example: - // ``` - // input = ["This", "is", "a", "test", "."] - // encoded = [0.1, 0.2, 0.3, 0.4, 0.5] - // ``` - COMBINED_EMBEDDING = 5; - - // Select this encoding when the input tensor is encoded into a - // 2-dimensional array represented by an encoded tensor. - // [InputMetadata.encoded_tensor_name][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.encoded_tensor_name] must be provided for this - // encoding. The first dimension of the encoded tensor's shape is the same - // as the input tensor's shape. For example: - // ``` - // input = ["This", "is", "a", "test", "."] - // encoded = [[0.1, 0.2, 0.3, 0.4, 0.5], - // [0.2, 0.1, 0.4, 0.3, 0.5], - // [0.5, 0.1, 0.3, 0.5, 0.4], - // [0.5, 0.3, 0.1, 0.2, 0.4], - // [0.4, 0.3, 0.2, 0.5, 0.1]] - // ``` - CONCAT_EMBEDDING = 6; - } - - // Baseline inputs for this feature. - // - // If no baseline is specified, Vertex AI chooses the baseline for this - // feature. If multiple baselines are specified, Vertex AI returns the - // average attributions across them in [Attribution.feature_attributions][google.cloud.aiplatform.v1.Attribution.feature_attributions]. - // - // For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape - // of each baseline must match the shape of the input tensor. If a scalar is - // provided, we broadcast to the same shape as the input tensor. - // - // For custom images, the element of the baselines must be in the same - // format as the feature's input in the - // [instance][google.cloud.aiplatform.v1.ExplainRequest.instances][]. The schema of any single instance - // may be specified via Endpoint's DeployedModels' - // [Model's][google.cloud.aiplatform.v1.DeployedModel.model] - // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] - // [instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri]. - repeated google.protobuf.Value input_baselines = 1; - - // Name of the input tensor for this feature. Required and is only - // applicable to Vertex AI-provided images for Tensorflow. - string input_tensor_name = 2; - - // Defines how the feature is encoded into the input tensor. Defaults to - // IDENTITY. - Encoding encoding = 3; - - // Modality of the feature. Valid values are: numeric, image. Defaults to - // numeric. - string modality = 4; - - // The domain details of the input feature value. Like min/max, original - // mean or standard deviation if normalized. - FeatureValueDomain feature_value_domain = 5; - - // Specifies the index of the values of the input tensor. - // Required when the input tensor is a sparse representation. Refer to - // Tensorflow documentation for more details: - // https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor. - string indices_tensor_name = 6; - - // Specifies the shape of the values of the input if the input is a sparse - // representation. Refer to Tensorflow documentation for more details: - // https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor. - string dense_shape_tensor_name = 7; - - // A list of feature names for each index in the input tensor. - // Required when the input [InputMetadata.encoding][google.cloud.aiplatform.v1.ExplanationMetadata.InputMetadata.encoding] is BAG_OF_FEATURES, - // BAG_OF_FEATURES_SPARSE, INDICATOR. - repeated string index_feature_mapping = 8; - - // Encoded tensor is a transformation of the input tensor. Must be provided - // if choosing - // [Integrated Gradients attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution] - // or [XRAI attribution][google.cloud.aiplatform.v1.ExplanationParameters.xrai_attribution] and the - // input tensor is not differentiable. - // - // An encoded tensor is generated if the input tensor is encoded by a lookup - // table. - string encoded_tensor_name = 9; - - // A list of baselines for the encoded tensor. - // - // The shape of each baseline should match the shape of the encoded tensor. - // If a scalar is provided, Vertex AI broadcasts to the same shape as the - // encoded tensor. - repeated google.protobuf.Value encoded_baselines = 10; - - // Visualization configurations for image explanation. - Visualization visualization = 11; - - // Name of the group that the input belongs to. Features with the same group - // name will be treated as one feature when computing attributions. Features - // grouped together can have different shapes in value. If provided, there - // will be one single attribution generated in - // [Attribution.feature_attributions][google.cloud.aiplatform.v1.Attribution.feature_attributions], keyed by the group name. - string group_name = 12; - } - - // Metadata of the prediction output to be explained. - message OutputMetadata { - // Defines how to map [Attribution.output_index][google.cloud.aiplatform.v1.Attribution.output_index] to - // [Attribution.output_display_name][google.cloud.aiplatform.v1.Attribution.output_display_name]. - // - // If neither of the fields are specified, - // [Attribution.output_display_name][google.cloud.aiplatform.v1.Attribution.output_display_name] will not be populated. - oneof display_name_mapping { - // Static mapping between the index and display name. - // - // Use this if the outputs are a deterministic n-dimensional array, e.g. a - // list of scores of all the classes in a pre-defined order for a - // multi-classification Model. It's not feasible if the outputs are - // non-deterministic, e.g. the Model produces top-k classes or sort the - // outputs by their values. - // - // The shape of the value must be an n-dimensional array of strings. The - // number of dimensions must match that of the outputs to be explained. - // The [Attribution.output_display_name][google.cloud.aiplatform.v1.Attribution.output_display_name] is populated by locating in the - // mapping with [Attribution.output_index][google.cloud.aiplatform.v1.Attribution.output_index]. - google.protobuf.Value index_display_name_mapping = 1; - - // Specify a field name in the prediction to look for the display name. - // - // Use this if the prediction contains the display names for the outputs. - // - // The display names in the prediction must have the same shape of the - // outputs, so that it can be located by [Attribution.output_index][google.cloud.aiplatform.v1.Attribution.output_index] for - // a specific output. - string display_name_mapping_key = 2; - } - - // Name of the output tensor. Required and is only applicable to Vertex - // AI provided images for Tensorflow. - string output_tensor_name = 3; - } - - // Required. Map from feature names to feature input metadata. Keys are the name of the - // features. Values are the specification of the feature. - // - // An empty InputMetadata is valid. It describes a text feature which has the - // name specified as the key in [ExplanationMetadata.inputs][google.cloud.aiplatform.v1.ExplanationMetadata.inputs]. The baseline - // of the empty feature is chosen by Vertex AI. - // - // For Vertex AI-provided Tensorflow images, the key can be any friendly - // name of the feature. Once specified, - // [featureAttributions][google.cloud.aiplatform.v1.Attribution.feature_attributions] are keyed by - // this key (if not grouped with another feature). - // - // For custom images, the key must match with the key in - // [instance][google.cloud.aiplatform.v1.ExplainRequest.instances]. - map inputs = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Map from output names to output metadata. - // - // For Vertex AI-provided Tensorflow images, keys can be any user defined - // string that consists of any UTF-8 characters. - // - // For custom images, keys are the name of the output field in the prediction - // to be explained. - // - // Currently only one key is allowed. - map outputs = 2 [(google.api.field_behavior) = REQUIRED]; - - // Points to a YAML file stored on Google Cloud Storage describing the format - // of the [feature attributions][google.cloud.aiplatform.v1.Attribution.feature_attributions]. - // The schema is defined as an OpenAPI 3.0.2 [Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - // AutoML tabular Models always have this field populated by Vertex AI. - // Note: The URI given on output may be different, including the URI scheme, - // than the one given on input. The output URI will point to a location where - // the user only has a read access. - string feature_attributions_schema_uri = 3; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature.proto deleted file mode 100644 index 690bb364..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature.proto +++ /dev/null @@ -1,154 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/feature_monitoring_stats.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "FeatureProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Feature Metadata information that describes an attribute of an entity type. -// For example, apple is an entity type, and color is a feature that describes -// apple. -message Feature { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Feature" - pattern: "projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}" - }; - - // A list of historical [Snapshot - // Analysis][FeaturestoreMonitoringConfig.SnapshotAnalysis] or [Import Feature - // Analysis] [FeaturestoreMonitoringConfig.ImportFeatureAnalysis] stats - // requested by user, sorted by [FeatureStatsAnomaly.start_time][google.cloud.aiplatform.v1.FeatureStatsAnomaly.start_time] descending. - message MonitoringStatsAnomaly { - // If the objective in the request is both - // Import Feature Analysis and Snapshot Analysis, this objective could be - // one of them. Otherwise, this objective should be the same as the - // objective in the request. - enum Objective { - // If it's OBJECTIVE_UNSPECIFIED, monitoring_stats will be empty. - OBJECTIVE_UNSPECIFIED = 0; - - // Stats are generated by Import Feature Analysis. - IMPORT_FEATURE_ANALYSIS = 1; - - // Stats are generated by Snapshot Analysis. - SNAPSHOT_ANALYSIS = 2; - } - - // Output only. The objective for each stats. - Objective objective = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The stats and anomalies generated at specific timestamp. - FeatureStatsAnomaly feature_stats_anomaly = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // An enum representing the value type of a feature. - enum ValueType { - // The value type is unspecified. - VALUE_TYPE_UNSPECIFIED = 0; - - // Used for Feature that is a boolean. - BOOL = 1; - - // Used for Feature that is a list of boolean. - BOOL_ARRAY = 2; - - // Used for Feature that is double. - DOUBLE = 3; - - // Used for Feature that is a list of double. - DOUBLE_ARRAY = 4; - - // Used for Feature that is INT64. - INT64 = 9; - - // Used for Feature that is a list of INT64. - INT64_ARRAY = 10; - - // Used for Feature that is string. - STRING = 11; - - // Used for Feature that is a list of String. - STRING_ARRAY = 12; - - // Used for Feature that is bytes. - BYTES = 13; - } - - // Immutable. Name of the Feature. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` - // - // The last part feature is assigned by the client. The feature can be up to - // 64 characters long and can consist only of ASCII Latin letters A-Z and a-z, - // underscore(_), and ASCII digits 0-9 starting with a letter. The value will - // be unique given an entity type. - string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Description of the Feature. - string description = 2; - - // Required. Immutable. Type of Feature value. - ValueType value_type = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Output only. Timestamp when this EntityType was created. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this EntityType was most recently updated. - google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The labels with user-defined metadata to organize your Features. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information on and examples of labels. - // No more than 64 user labels can be associated with one Feature (System - // labels are excluded)." - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. - map labels = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Used to perform a consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 7; - - // Optional. If not set, use the monitoring_config defined for the EntityType this - // Feature belongs to. - // Only Features with type ([Feature.ValueType][google.cloud.aiplatform.v1.Feature.ValueType]) BOOL, STRING, DOUBLE or - // INT64 can enable monitoring. - // - // If set to true, all types of data monitoring are disabled despite the - // config on EntityType. - bool disable_monitoring = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The list of historical stats and anomalies with specified objectives. - repeated MonitoringStatsAnomaly monitoring_stats_anomalies = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto deleted file mode 100644 index 1138ec8c..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto +++ /dev/null @@ -1,86 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "FeatureMonitoringStatsProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Stats and Anomaly generated at specific timestamp for specific Feature. -// The start_time and end_time are used to define the time range of the dataset -// that current stats belongs to, e.g. prediction traffic is bucketed into -// prediction datasets by time window. If the Dataset is not defined by time -// window, start_time = end_time. Timestamp of the stats and anomalies always -// refers to end_time. Raw stats and anomalies are stored in stats_uri or -// anomaly_uri in the tensorflow defined protos. Field data_stats contains -// almost identical information with the raw stats in Vertex AI -// defined proto, for UI to display. -message FeatureStatsAnomaly { - // Feature importance score, only populated when cross-feature monitoring is - // enabled. For now only used to represent feature attribution score within - // range [0, 1] for - // [ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_SKEW][google.cloud.aiplatform.v1.ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_SKEW] and - // [ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_DRIFT][google.cloud.aiplatform.v1.ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_DRIFT]. - double score = 1; - - // Path of the stats file for current feature values in Cloud Storage bucket. - // Format: gs:////stats. - // Example: gs://monitoring_bucket/feature_name/stats. - // Stats are stored as binary format with Protobuf message - // [tensorflow.metadata.v0.FeatureNameStatistics](https://github.com/tensorflow/metadata/blob/master/tensorflow_metadata/proto/v0/statistics.proto). - string stats_uri = 3; - - // Path of the anomaly file for current feature values in Cloud Storage - // bucket. - // Format: gs:////anomalies. - // Example: gs://monitoring_bucket/feature_name/anomalies. - // Stats are stored as binary format with Protobuf message - // Anoamlies are stored as binary format with Protobuf message - // [tensorflow.metadata.v0.AnomalyInfo] - // (https://github.com/tensorflow/metadata/blob/master/tensorflow_metadata/proto/v0/anomalies.proto). - string anomaly_uri = 4; - - // Deviation from the current stats to baseline stats. - // 1. For categorical feature, the distribution distance is calculated by - // L-inifinity norm. - // 2. For numerical feature, the distribution distance is calculated by - // Jensen–Shannon divergence. - double distribution_deviation = 5; - - // This is the threshold used when detecting anomalies. - // The threshold can be changed by user, so this one might be different from - // [ThresholdConfig.value][google.cloud.aiplatform.v1.ThresholdConfig.value]. - double anomaly_detection_threshold = 9; - - // The start timestamp of window where stats were generated. - // For objectives where time window doesn't make sense (e.g. Featurestore - // Snapshot Monitoring), start_time is only used to indicate the monitoring - // intervals, so it always equals to (end_time - monitoring_interval). - google.protobuf.Timestamp start_time = 7; - - // The end timestamp of window where stats were generated. - // For objectives where time window doesn't make sense (e.g. Featurestore - // Snapshot Monitoring), end_time indicates the timestamp of the data used to - // generate stats (e.g. timestamp we take snapshots for feature values). - google.protobuf.Timestamp end_time = 8; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature_selector.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature_selector.proto deleted file mode 100644 index 7a4a8e66..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/feature_selector.proto +++ /dev/null @@ -1,44 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "FeatureSelectorProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Matcher for Features of an EntityType by Feature ID. -message IdMatcher { - // Required. The following are accepted as `ids`: - // - // * A single-element list containing only `*`, which selects all Features - // in the target EntityType, or - // * A list containing only Feature IDs, which selects only Features with - // those IDs in the target EntityType. - repeated string ids = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Selector for Features of an EntityType. -message FeatureSelector { - // Required. Matches Features based on ID. - IdMatcher id_matcher = 1 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore.proto deleted file mode 100644 index 535ca6b9..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore.proto +++ /dev/null @@ -1,111 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/encryption_spec.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "FeaturestoreProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Vertex AI Feature Store provides a centralized repository for organizing, -// storing, and serving ML features. The Featurestore is a top-level container -// for your features and their values. -message Featurestore { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Featurestore" - pattern: "projects/{project}/locations/{location}/featurestores/{featurestore}" - }; - - // OnlineServingConfig specifies the details for provisioning online serving - // resources. - message OnlineServingConfig { - // The number of nodes for the online store. The number of nodes doesn't - // scale automatically, but you can manually update the number of - // nodes. If set to 0, the featurestore will not have an - // online store and cannot be used for online serving. - int32 fixed_node_count = 2; - } - - // Possible states a featurestore can have. - enum State { - // Default value. This value is unused. - STATE_UNSPECIFIED = 0; - - // State when the featurestore configuration is not being updated and the - // fields reflect the current configuration of the featurestore. The - // featurestore is usable in this state. - STABLE = 1; - - // The state of the featurestore configuration when it is being updated. - // During an update, the fields reflect either the original configuration - // or the updated configuration of the featurestore. For example, - // `online_serving_config.fixed_node_count` can take minutes to update. - // While the update is in progress, the featurestore is in the UPDATING - // state, and the value of `fixed_node_count` can be the original value or - // the updated value, depending on the progress of the operation. Until the - // update completes, the actual number of nodes can still be the original - // value of `fixed_node_count`. The featurestore is still usable in this - // state. - UPDATING = 2; - } - - // Output only. Name of the Featurestore. Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}` - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Featurestore was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Featurestore was last updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The labels with user-defined metadata to organize your Featurestore. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information on and examples of labels. - // No more than 64 user labels can be associated with one Featurestore(System - // labels are excluded)." - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. - map labels = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Config for online storage resources. If unset, the featurestore will - // not have an online store and cannot be used for online serving. - OnlineServingConfig online_serving_config = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. State of the featurestore. - State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Customer-managed encryption key spec for data storage. If set, both of the - // online and offline data storage will be secured by this key. - EncryptionSpec encryption_spec = 10 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto deleted file mode 100644 index 7233658b..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto +++ /dev/null @@ -1,149 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "FeaturestoreMonitoringProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Configuration of how features in Featurestore are monitored. -message FeaturestoreMonitoringConfig { - // Configuration of the Featurestore's Snapshot Analysis Based Monitoring. - // This type of analysis generates statistics for each Feature based on a - // snapshot of the latest feature value of each entities every - // monitoring_interval. - message SnapshotAnalysis { - // The monitoring schedule for snapshot analysis. - // For EntityType-level config: - // unset / disabled = true indicates disabled by - // default for Features under it; otherwise by default enable snapshot - // analysis monitoring with monitoring_interval for Features under it. - // Feature-level config: - // disabled = true indicates disabled regardless of the EntityType-level - // config; unset monitoring_interval indicates going with EntityType-level - // config; otherwise run snapshot analysis monitoring with - // monitoring_interval regardless of the EntityType-level config. - // Explicitly Disable the snapshot analysis based monitoring. - bool disabled = 1; - - // Configuration of the snapshot analysis based monitoring pipeline - // running interval. The value indicates number of days. - // If both - // [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days][google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days] - // and [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval][] - // are set when creating/updating EntityTypes/Features, - // [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days][google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days] - // will be used. - int32 monitoring_interval_days = 3; - - // Customized export features time window for snapshot analysis. Unit is one - // day. Default value is 3 weeks. Minimum value is 1 day. Maximum value is - // 4000 days. - int32 staleness_days = 4; - } - - // Configuration of the Featurestore's ImportFeature Analysis Based - // Monitoring. This type of analysis generates statistics for values of each - // Feature imported by every [ImportFeatureValues][] operation. - message ImportFeaturesAnalysis { - // The state defines whether to enable ImportFeature analysis. - enum State { - // Should not be used. - STATE_UNSPECIFIED = 0; - - // The default behavior of whether to enable the monitoring. - // EntityType-level config: disabled. - // Feature-level config: inherited from the configuration of EntityType - // this Feature belongs to. - DEFAULT = 1; - - // Explicitly enables import features analysis. - // EntityType-level config: by default enables import features analysis - // for all Features under it. Feature-level config: enables import - // features analysis regardless of the EntityType-level config. - ENABLED = 2; - - // Explicitly disables import features analysis. - // EntityType-level config: by default disables import features analysis - // for all Features under it. Feature-level config: disables import - // features analysis regardless of the EntityType-level config. - DISABLED = 3; - } - - // Defines the baseline to do anomaly detection for feature values imported - // by each [ImportFeatureValues][] operation. - enum Baseline { - // Should not be used. - BASELINE_UNSPECIFIED = 0; - - // Choose the later one statistics generated by either most recent - // snapshot analysis or previous import features analysis. If non of them - // exists, skip anomaly detection and only generate a statistics. - LATEST_STATS = 1; - - // Use the statistics generated by the most recent snapshot analysis if - // exists. - MOST_RECENT_SNAPSHOT_STATS = 2; - - // Use the statistics generated by the previous import features analysis - // if exists. - PREVIOUS_IMPORT_FEATURES_STATS = 3; - } - - // Whether to enable / disable / inherite default hebavior for import - // features analysis. - State state = 1; - - // The baseline used to do anomaly detection for the statistics generated by - // import features analysis. - Baseline anomaly_detection_baseline = 2; - } - - // The config for Featurestore Monitoring threshold. - message ThresholdConfig { - oneof threshold { - // Specify a threshold value that can trigger the alert. - // 1. For categorical feature, the distribution distance is calculated by - // L-inifinity norm. - // 2. For numerical feature, the distribution distance is calculated by - // Jensen–Shannon divergence. Each feature must have a non-zero threshold - // if they need to be monitored. Otherwise no alert will be triggered for - // that feature. - double value = 1; - } - } - - // The config for Snapshot Analysis Based Feature Monitoring. - SnapshotAnalysis snapshot_analysis = 1; - - // The config for ImportFeatures Analysis Based Feature Monitoring. - ImportFeaturesAnalysis import_features_analysis = 2; - - // Threshold for numerical features of anomaly detection. - // This is shared by all objectives of Featurestore Monitoring for numerical - // features (i.e. Features with type ([Feature.ValueType][google.cloud.aiplatform.v1.Feature.ValueType]) DOUBLE or INT64). - ThresholdConfig numerical_threshold_config = 3; - - // Threshold for categorical features of anomaly detection. - // This is shared by all types of Featurestore Monitoring for categorical - // features (i.e. Features with type ([Feature.ValueType][google.cloud.aiplatform.v1.Feature.ValueType]) BOOL or STRING). - ThresholdConfig categorical_threshold_config = 4; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto deleted file mode 100644 index 44086044..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto +++ /dev/null @@ -1,225 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/feature_selector.proto"; -import "google/cloud/aiplatform/v1/types.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "FeaturestoreOnlineServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A service for serving online feature values. -service FeaturestoreOnlineServingService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Reads Feature values of a specific entity of an EntityType. For reading - // feature values of multiple entities of an EntityType, please use - // StreamingReadFeatureValues. - rpc ReadFeatureValues(ReadFeatureValuesRequest) returns (ReadFeatureValuesResponse) { - option (google.api.http) = { - post: "/v1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:readFeatureValues" - body: "*" - }; - option (google.api.method_signature) = "entity_type"; - } - - // Reads Feature values for multiple entities. Depending on their size, data - // for different entities may be broken - // up across multiple responses. - rpc StreamingReadFeatureValues(StreamingReadFeatureValuesRequest) returns (stream ReadFeatureValuesResponse) { - option (google.api.http) = { - post: "/v1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:streamingReadFeatureValues" - body: "*" - }; - option (google.api.method_signature) = "entity_type"; - } -} - -// Request message for [FeaturestoreOnlineServingService.ReadFeatureValues][google.cloud.aiplatform.v1.FeaturestoreOnlineServingService.ReadFeatureValues]. -message ReadFeatureValuesRequest { - // Required. The resource name of the EntityType for the entity being read. - // 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`. - string entity_type = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - } - ]; - - // Required. ID for a specific entity. For example, - // for a machine learning model predicting user clicks on a website, an entity - // ID could be `user_123`. - string entity_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Selector choosing Features of the target EntityType. - FeatureSelector feature_selector = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [FeaturestoreOnlineServingService.ReadFeatureValues][google.cloud.aiplatform.v1.FeaturestoreOnlineServingService.ReadFeatureValues]. -message ReadFeatureValuesResponse { - // Metadata for requested Features. - message FeatureDescriptor { - // Feature ID. - string id = 1; - } - - // Response header with metadata for the requested - // [ReadFeatureValuesRequest.entity_type][google.cloud.aiplatform.v1.ReadFeatureValuesRequest.entity_type] and Features. - message Header { - // The resource name of the EntityType from the - // [ReadFeatureValuesRequest][google.cloud.aiplatform.v1.ReadFeatureValuesRequest]. Value format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}`. - string entity_type = 1 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - }]; - - // List of Feature metadata corresponding to each piece of - // [ReadFeatureValuesResponse.data][]. - repeated FeatureDescriptor feature_descriptors = 2; - } - - // Entity view with Feature values. - message EntityView { - // Container to hold value(s), successive in time, for one Feature from the - // request. - message Data { - oneof data { - // Feature value if a single value is requested. - FeatureValue value = 1; - - // Feature values list if values, successive in time, are requested. - // If the requested number of values is greater than the number of - // existing Feature values, nonexistent values are omitted instead of - // being returned as empty. - FeatureValueList values = 2; - } - } - - // ID of the requested entity. - string entity_id = 1; - - // Each piece of data holds the k - // requested values for one requested Feature. If no values - // for the requested Feature exist, the corresponding cell will be empty. - // This has the same size and is in the same order as the features from the - // header [ReadFeatureValuesResponse.header][google.cloud.aiplatform.v1.ReadFeatureValuesResponse.header]. - repeated Data data = 2; - } - - // Response header. - Header header = 1; - - // Entity view with Feature values. This may be the entity in the - // Featurestore if values for all Features were requested, or a projection - // of the entity in the Featurestore if values for only some Features were - // requested. - EntityView entity_view = 2; -} - -// Request message for -// [FeaturestoreOnlineServingService.StreamingFeatureValuesRead][]. -message StreamingReadFeatureValuesRequest { - // Required. The resource name of the entities' type. - // 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`. - string entity_type = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - } - ]; - - // Required. IDs of entities to read Feature values of. The maximum number of IDs is - // 100. For example, for a machine learning model predicting user clicks on a - // website, an entity ID could be `user_123`. - repeated string entity_ids = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Selector choosing Features of the target EntityType. Feature IDs will be - // deduplicated. - FeatureSelector feature_selector = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Value for a feature. -// (-- NEXT ID: 15 --) -message FeatureValue { - // Metadata of feature value. - message Metadata { - // Feature generation timestamp. Typically, it is provided by user at - // feature ingestion time. If not, feature store - // will use the system timestamp when the data is ingested into feature - // store. For streaming ingestion, the time, aligned by days, must be no - // older than five years (1825 days) and no later than one year (366 days) - // in the future. - google.protobuf.Timestamp generate_time = 1; - } - - // Value for the feature. - oneof value { - // Bool type feature value. - bool bool_value = 1; - - // Double type feature value. - double double_value = 2; - - // Int64 feature value. - int64 int64_value = 5; - - // String feature value. - string string_value = 6; - - // A list of bool type feature value. - BoolArray bool_array_value = 7; - - // A list of double type feature value. - DoubleArray double_array_value = 8; - - // A list of int64 type feature value. - Int64Array int64_array_value = 11; - - // A list of string type feature value. - StringArray string_array_value = 12; - - // Bytes feature value. - bytes bytes_value = 13; - } - - // Metadata of feature value. - Metadata metadata = 14; -} - -// Container for list of values. -message FeatureValueList { - // A list of feature values. All of them should be the same data type. - repeated FeatureValue values = 1; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_service.proto deleted file mode 100644 index 706ee62d..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_service.proto +++ /dev/null @@ -1,1225 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/entity_type.proto"; -import "google/cloud/aiplatform/v1/feature.proto"; -import "google/cloud/aiplatform/v1/feature_selector.proto"; -import "google/cloud/aiplatform/v1/featurestore.proto"; -import "google/cloud/aiplatform/v1/io.proto"; -import "google/cloud/aiplatform/v1/operation.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "FeaturestoreServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// The service that handles CRUD and List for resources for Featurestore. -service FeaturestoreService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a new Featurestore in a given project and location. - rpc CreateFeaturestore(CreateFeaturestoreRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/featurestores" - body: "featurestore" - }; - option (google.api.method_signature) = "parent,featurestore"; - option (google.api.method_signature) = "parent,featurestore,featurestore_id"; - option (google.longrunning.operation_info) = { - response_type: "Featurestore" - metadata_type: "CreateFeaturestoreOperationMetadata" - }; - } - - // Gets details of a single Featurestore. - rpc GetFeaturestore(GetFeaturestoreRequest) returns (Featurestore) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/featurestores/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Featurestores in a given project and location. - rpc ListFeaturestores(ListFeaturestoresRequest) returns (ListFeaturestoresResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/featurestores" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates the parameters of a single Featurestore. - rpc UpdateFeaturestore(UpdateFeaturestoreRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{featurestore.name=projects/*/locations/*/featurestores/*}" - body: "featurestore" - }; - option (google.api.method_signature) = "featurestore,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Featurestore" - metadata_type: "UpdateFeaturestoreOperationMetadata" - }; - } - - // Deletes a single Featurestore. The Featurestore must not contain any - // EntityTypes or `force` must be set to true for the request to succeed. - rpc DeleteFeaturestore(DeleteFeaturestoreRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/featurestores/*}" - }; - option (google.api.method_signature) = "name"; - option (google.api.method_signature) = "name,force"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Creates a new EntityType in a given Featurestore. - rpc CreateEntityType(CreateEntityTypeRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/featurestores/*}/entityTypes" - body: "entity_type" - }; - option (google.api.method_signature) = "parent,entity_type"; - option (google.api.method_signature) = "parent,entity_type,entity_type_id"; - option (google.longrunning.operation_info) = { - response_type: "EntityType" - metadata_type: "CreateEntityTypeOperationMetadata" - }; - } - - // Gets details of a single EntityType. - rpc GetEntityType(GetEntityTypeRequest) returns (EntityType) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists EntityTypes in a given Featurestore. - rpc ListEntityTypes(ListEntityTypesRequest) returns (ListEntityTypesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/featurestores/*}/entityTypes" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates the parameters of a single EntityType. - rpc UpdateEntityType(UpdateEntityTypeRequest) returns (EntityType) { - option (google.api.http) = { - patch: "/v1/{entity_type.name=projects/*/locations/*/featurestores/*/entityTypes/*}" - body: "entity_type" - }; - option (google.api.method_signature) = "entity_type,update_mask"; - } - - // Deletes a single EntityType. The EntityType must not have any Features - // or `force` must be set to true for the request to succeed. - rpc DeleteEntityType(DeleteEntityTypeRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}" - }; - option (google.api.method_signature) = "name"; - option (google.api.method_signature) = "name,force"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Creates a new Feature in a given EntityType. - rpc CreateFeature(CreateFeatureRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/featurestores/*/entityTypes/*}/features" - body: "feature" - }; - option (google.api.method_signature) = "parent,feature"; - option (google.api.method_signature) = "parent,feature,feature_id"; - option (google.longrunning.operation_info) = { - response_type: "Feature" - metadata_type: "CreateFeatureOperationMetadata" - }; - } - - // Creates a batch of Features in a given EntityType. - rpc BatchCreateFeatures(BatchCreateFeaturesRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/featurestores/*/entityTypes/*}/features:batchCreate" - body: "*" - }; - option (google.api.method_signature) = "parent,requests"; - option (google.longrunning.operation_info) = { - response_type: "BatchCreateFeaturesResponse" - metadata_type: "BatchCreateFeaturesOperationMetadata" - }; - } - - // Gets details of a single Feature. - rpc GetFeature(GetFeatureRequest) returns (Feature) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Features in a given EntityType. - rpc ListFeatures(ListFeaturesRequest) returns (ListFeaturesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/featurestores/*/entityTypes/*}/features" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates the parameters of a single Feature. - rpc UpdateFeature(UpdateFeatureRequest) returns (Feature) { - option (google.api.http) = { - patch: "/v1/{feature.name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}" - body: "feature" - }; - option (google.api.method_signature) = "feature,update_mask"; - } - - // Deletes a single Feature. - rpc DeleteFeature(DeleteFeatureRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Imports Feature values into the Featurestore from a source storage. - // - // The progress of the import is tracked by the returned operation. The - // imported features are guaranteed to be visible to subsequent read - // operations after the operation is marked as successfully done. - // - // If an import operation fails, the Feature values returned from - // reads and exports may be inconsistent. If consistency is - // required, the caller must retry the same import request again and wait till - // the new operation returned is marked as successfully done. - // - // There are also scenarios where the caller can cause inconsistency. - // - // - Source data for import contains multiple distinct Feature values for - // the same entity ID and timestamp. - // - Source is modified during an import. This includes adding, updating, or - // removing source data and/or metadata. Examples of updating metadata - // include but are not limited to changing storage location, storage class, - // or retention policy. - // - Online serving cluster is under-provisioned. - rpc ImportFeatureValues(ImportFeatureValuesRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:importFeatureValues" - body: "*" - }; - option (google.api.method_signature) = "entity_type"; - option (google.longrunning.operation_info) = { - response_type: "ImportFeatureValuesResponse" - metadata_type: "ImportFeatureValuesOperationMetadata" - }; - } - - // Batch reads Feature values from a Featurestore. - // - // This API enables batch reading Feature values, where each read - // instance in the batch may read Feature values of entities from one or - // more EntityTypes. Point-in-time correctness is guaranteed for Feature - // values of each read instance as of each instance's read timestamp. - rpc BatchReadFeatureValues(BatchReadFeatureValuesRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{featurestore=projects/*/locations/*/featurestores/*}:batchReadFeatureValues" - body: "*" - }; - option (google.api.method_signature) = "featurestore"; - option (google.longrunning.operation_info) = { - response_type: "BatchReadFeatureValuesResponse" - metadata_type: "BatchReadFeatureValuesOperationMetadata" - }; - } - - // Exports Feature values from all the entities of a target EntityType. - rpc ExportFeatureValues(ExportFeatureValuesRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:exportFeatureValues" - body: "*" - }; - option (google.api.method_signature) = "entity_type"; - option (google.longrunning.operation_info) = { - response_type: "ExportFeatureValuesResponse" - metadata_type: "ExportFeatureValuesOperationMetadata" - }; - } - - // Searches Features matching a query in a given project. - rpc SearchFeatures(SearchFeaturesRequest) returns (SearchFeaturesResponse) { - option (google.api.http) = { - get: "/v1/{location=projects/*/locations/*}/featurestores:searchFeatures" - }; - option (google.api.method_signature) = "location"; - option (google.api.method_signature) = "location,query"; - } -} - -// Request message for [FeaturestoreService.CreateFeaturestore][google.cloud.aiplatform.v1.FeaturestoreService.CreateFeaturestore]. -message CreateFeaturestoreRequest { - // Required. The resource name of the Location to create Featurestores. - // Format: - // `projects/{project}/locations/{location}'` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Featurestore" - } - ]; - - // Required. The Featurestore to create. - Featurestore featurestore = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID to use for this Featurestore, which will become the final component - // of the Featurestore's resource name. - // - // This value may be up to 60 characters, and valid characters are - // `[a-z0-9_]`. The first character cannot be a number. - // - // The value must be unique within the project and location. - string featurestore_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [FeaturestoreService.GetFeaturestore][google.cloud.aiplatform.v1.FeaturestoreService.GetFeaturestore]. -message GetFeaturestoreRequest { - // Required. The name of the Featurestore resource. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Featurestore" - } - ]; -} - -// Request message for [FeaturestoreService.ListFeaturestores][google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores]. -message ListFeaturestoresRequest { - // Required. The resource name of the Location to list Featurestores. - // Format: - // `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Featurestore" - } - ]; - - // Lists the featurestores that match the filter expression. The following - // fields are supported: - // - // * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - // Values must be - // in RFC 3339 format. - // * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - // Values must be - // in RFC 3339 format. - // * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, - // `<=`, and `>=` comparisons. - // * `labels`: Supports key-value equality and key presence. - // - // Examples: - // - // * `create_time > "2020-01-01" OR update_time > "2020-01-01"` - // Featurestores created or updated after 2020-01-01. - // * `labels.env = "prod"` - // Featurestores with label "env" set to "prod". - string filter = 2; - - // The maximum number of Featurestores to return. The service may return fewer - // than this value. If unspecified, at most 100 Featurestores will be - // returned. The maximum value is 100; any value greater than 100 will be - // coerced to 100. - int32 page_size = 3; - - // A page token, received from a previous - // [FeaturestoreService.ListFeaturestores][google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores] call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [FeaturestoreService.ListFeaturestores][google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores] must - // match the call that provided the page token. - string page_token = 4; - - // A comma-separated list of fields to order by, sorted in ascending order. - // Use "desc" after a field name for descending. - // Supported Fields: - // - // * `create_time` - // * `update_time` - // * `online_serving_config.fixed_node_count` - string order_by = 5; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 6; -} - -// Response message for [FeaturestoreService.ListFeaturestores][google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores]. -message ListFeaturestoresResponse { - // The Featurestores matching the request. - repeated Featurestore featurestores = 1; - - // A token, which can be sent as [ListFeaturestoresRequest.page_token][google.cloud.aiplatform.v1.ListFeaturestoresRequest.page_token] to - // retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [FeaturestoreService.UpdateFeaturestore][google.cloud.aiplatform.v1.FeaturestoreService.UpdateFeaturestore]. -message UpdateFeaturestoreRequest { - // Required. The Featurestore's `name` field is used to identify the Featurestore to be - // updated. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}` - Featurestore featurestore = 1 [(google.api.field_behavior) = REQUIRED]; - - // Field mask is used to specify the fields to be overwritten in the - // Featurestore resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then only the non-empty fields present in the - // request will be overwritten. Set the update_mask to `*` to override all - // fields. - // - // Updatable fields: - // - // * `labels` - // * `online_serving_config.fixed_node_count` - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for [FeaturestoreService.DeleteFeaturestore][google.cloud.aiplatform.v1.FeaturestoreService.DeleteFeaturestore]. -message DeleteFeaturestoreRequest { - // Required. The name of the Featurestore to be deleted. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Featurestore" - } - ]; - - // If set to true, any EntityTypes and Features for this Featurestore will - // also be deleted. (Otherwise, the request will only work if the Featurestore - // has no EntityTypes.) - bool force = 2; -} - -// Request message for [FeaturestoreService.ImportFeatureValues][google.cloud.aiplatform.v1.FeaturestoreService.ImportFeatureValues]. -message ImportFeatureValuesRequest { - // Defines the Feature value(s) to import. - message FeatureSpec { - // Required. ID of the Feature to import values of. This Feature must exist in the - // target EntityType, or the request will fail. - string id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Source column to get the Feature values from. If not set, uses the column - // with the same name as the Feature ID. - string source_field = 2; - } - - // Details about the source data, including the location of the storage and - // the format. - oneof source { - AvroSource avro_source = 2; - - BigQuerySource bigquery_source = 3; - - CsvSource csv_source = 4; - } - - // Source of Feature timestamp for all Feature values of each entity. - // Timestamps must be millisecond-aligned. - oneof feature_time_source { - // Source column that holds the Feature timestamp for all Feature - // values in each entity. - string feature_time_field = 6; - - // Single Feature timestamp for all entities being imported. The - // timestamp must not have higher than millisecond precision. - google.protobuf.Timestamp feature_time = 7; - } - - // Required. The resource name of the EntityType grouping the Features for which values - // are being imported. Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}` - string entity_type = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - } - ]; - - // Source column that holds entity IDs. If not provided, entity IDs are - // extracted from the column named `entity_id`. - string entity_id_field = 5; - - // Required. Specifications defining which Feature values to import from the entity. The - // request fails if no feature_specs are provided, and having multiple - // feature_specs for one Feature is not allowed. - repeated FeatureSpec feature_specs = 8 [(google.api.field_behavior) = REQUIRED]; - - // If set, data will not be imported for online serving. This - // is typically used for backfilling, where Feature generation timestamps are - // not in the timestamp range needed for online serving. - bool disable_online_serving = 9; - - // Specifies the number of workers that are used to write data to the - // Featurestore. Consider the online serving capacity that you require to - // achieve the desired import throughput without interfering with online - // serving. The value must be positive, and less than or equal to 100. - // If not set, defaults to using 1 worker. The low count ensures minimal - // impact on online serving performance. - int32 worker_count = 11; - - // If true, API doesn't start ingestion analysis pipeline. - bool disable_ingestion_analysis = 12; -} - -// Response message for [FeaturestoreService.ImportFeatureValues][google.cloud.aiplatform.v1.FeaturestoreService.ImportFeatureValues]. -message ImportFeatureValuesResponse { - // Number of entities that have been imported by the operation. - int64 imported_entity_count = 1; - - // Number of Feature values that have been imported by the operation. - int64 imported_feature_value_count = 2; - - // The number of rows in input source that weren't imported due to either - // * Not having any featureValues. - // * Having a null entityId. - // * Having a null timestamp. - // * Not being parsable (applicable for CSV sources). - int64 invalid_row_count = 6; -} - -// Request message for [FeaturestoreService.BatchReadFeatureValues][google.cloud.aiplatform.v1.FeaturestoreService.BatchReadFeatureValues]. -message BatchReadFeatureValuesRequest { - // Describe pass-through fields in read_instance source. - message PassThroughField { - // Required. The name of the field in the CSV header or the name of the column in - // BigQuery table. The naming restriction is the same as [Feature.name][google.cloud.aiplatform.v1.Feature.name]. - string field_name = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Selects Features of an EntityType to read values of and specifies read - // settings. - message EntityTypeSpec { - // Required. ID of the EntityType to select Features. The EntityType id is the - // [entity_type_id][google.cloud.aiplatform.v1.CreateEntityTypeRequest.entity_type_id] specified - // during EntityType creation. - string entity_type_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Selectors choosing which Feature values to read from the EntityType. - FeatureSelector feature_selector = 2 [(google.api.field_behavior) = REQUIRED]; - - // Per-Feature settings for the batch read. - repeated DestinationFeatureSetting settings = 3; - } - - oneof read_option { - // Each read instance consists of exactly one read timestamp and one or more - // entity IDs identifying entities of the corresponding EntityTypes whose - // Features are requested. - // - // Each output instance contains Feature values of requested entities - // concatenated together as of the read time. - // - // An example read instance may be `foo_entity_id, bar_entity_id, - // 2020-01-01T10:00:00.123Z`. - // - // An example output instance may be `foo_entity_id, bar_entity_id, - // 2020-01-01T10:00:00.123Z, foo_entity_feature1_value, - // bar_entity_feature2_value`. - // - // Timestamp in each read instance must be millisecond-aligned. - // - // `csv_read_instances` are read instances stored in a plain-text CSV file. - // The header should be: - // [ENTITY_TYPE_ID1], [ENTITY_TYPE_ID2], ..., timestamp - // - // The columns can be in any order. - // - // Values in the timestamp column must use the RFC 3339 format, e.g. - // `2012-07-30T10:43:17.123Z`. - CsvSource csv_read_instances = 3; - - // Similar to csv_read_instances, but from BigQuery source. - BigQuerySource bigquery_read_instances = 5; - } - - // Required. The resource name of the Featurestore from which to query Feature values. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}` - string featurestore = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Featurestore" - } - ]; - - // Required. Specifies output location and format. - FeatureValueDestination destination = 4 [(google.api.field_behavior) = REQUIRED]; - - // When not empty, the specified fields in the *_read_instances source will be - // joined as-is in the output, in addition to those fields from the - // Featurestore Entity. - // - // For BigQuery source, the type of the pass-through values will be - // automatically inferred. For CSV source, the pass-through values will be - // passed as opaque bytes. - repeated PassThroughField pass_through_fields = 8; - - // Required. Specifies EntityType grouping Features to read values of and settings. - // Each EntityType referenced in - // [BatchReadFeatureValuesRequest.entity_type_specs] must have a column - // specifying entity IDs in the EntityType in - // [BatchReadFeatureValuesRequest.request][] . - repeated EntityTypeSpec entity_type_specs = 7 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [FeaturestoreService.ExportFeatureValues][google.cloud.aiplatform.v1.FeaturestoreService.ExportFeatureValues]. -message ExportFeatureValuesRequest { - // Describes exporting the latest Feature values of all entities of the - // EntityType between [start_time, snapshot_time]. - message SnapshotExport { - // Exports Feature values as of this timestamp. If not set, - // retrieve values as of now. Timestamp, if present, must not have higher - // than millisecond precision. - google.protobuf.Timestamp snapshot_time = 1; - - // Excludes Feature values with feature generation timestamp before this - // timestamp. If not set, retrieve oldest values kept in Feature Store. - // Timestamp, if present, must not have higher than millisecond precision. - google.protobuf.Timestamp start_time = 2; - } - - // Describes exporting all historical Feature values of all entities of the - // EntityType between [start_time, end_time]. - message FullExport { - // Excludes Feature values with feature generation timestamp before this - // timestamp. If not set, retrieve oldest values kept in Feature Store. - // Timestamp, if present, must not have higher than millisecond precision. - google.protobuf.Timestamp start_time = 2; - - // Exports Feature values as of this timestamp. If not set, - // retrieve values as of now. Timestamp, if present, must not have higher - // than millisecond precision. - google.protobuf.Timestamp end_time = 1; - } - - // Required. The mode in which Feature values are exported. - oneof mode { - // Exports the latest Feature values of all entities of the EntityType - // within a time range. - SnapshotExport snapshot_export = 3; - - // Exports all historical values of all entities of the EntityType within a - // time range - FullExport full_export = 7; - } - - // Required. The resource name of the EntityType from which to export Feature values. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - string entity_type = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - } - ]; - - // Required. Specifies destination location and format. - FeatureValueDestination destination = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. Selects Features to export values of. - FeatureSelector feature_selector = 5 [(google.api.field_behavior) = REQUIRED]; - - // Per-Feature export settings. - repeated DestinationFeatureSetting settings = 6; -} - -message DestinationFeatureSetting { - // Required. The ID of the Feature to apply the setting to. - string feature_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Specify the field name in the export destination. If not specified, - // Feature ID is used. - string destination_field = 2; -} - -// A destination location for Feature values and format. -message FeatureValueDestination { - oneof destination { - // Output in BigQuery format. - // [BigQueryDestination.output_uri][google.cloud.aiplatform.v1.BigQueryDestination.output_uri] in - // [FeatureValueDestination.bigquery_destination][google.cloud.aiplatform.v1.FeatureValueDestination.bigquery_destination] must refer to a table. - BigQueryDestination bigquery_destination = 1; - - // Output in TFRecord format. - // - // Below are the mapping from Feature value type - // in Featurestore to Feature value type in TFRecord: - // - // Value type in Featurestore | Value type in TFRecord - // DOUBLE, DOUBLE_ARRAY | FLOAT_LIST - // INT64, INT64_ARRAY | INT64_LIST - // STRING, STRING_ARRAY, BYTES | BYTES_LIST - // true -> byte_string("true"), false -> byte_string("false") - // BOOL, BOOL_ARRAY (true, false) | BYTES_LIST - TFRecordDestination tfrecord_destination = 2; - - // Output in CSV format. Array Feature value types are not allowed in CSV - // format. - CsvDestination csv_destination = 3; - } -} - -// Response message for [FeaturestoreService.ExportFeatureValues][google.cloud.aiplatform.v1.FeaturestoreService.ExportFeatureValues]. -message ExportFeatureValuesResponse { - -} - -// Response message for [FeaturestoreService.BatchReadFeatureValues][google.cloud.aiplatform.v1.FeaturestoreService.BatchReadFeatureValues]. -message BatchReadFeatureValuesResponse { - -} - -// Request message for [FeaturestoreService.CreateEntityType][google.cloud.aiplatform.v1.FeaturestoreService.CreateEntityType]. -message CreateEntityTypeRequest { - // Required. The resource name of the Featurestore to create EntityTypes. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Featurestore" - } - ]; - - // The EntityType to create. - EntityType entity_type = 2; - - // Required. The ID to use for the EntityType, which will become the final component of - // the EntityType's resource name. - // - // This value may be up to 60 characters, and valid characters are - // `[a-z0-9_]`. The first character cannot be a number. - // - // The value must be unique within a featurestore. - string entity_type_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [FeaturestoreService.GetEntityType][google.cloud.aiplatform.v1.FeaturestoreService.GetEntityType]. -message GetEntityTypeRequest { - // Required. The name of the EntityType resource. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - } - ]; -} - -// Request message for [FeaturestoreService.ListEntityTypes][google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes]. -message ListEntityTypesRequest { - // Required. The resource name of the Featurestore to list EntityTypes. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/EntityType" - } - ]; - - // Lists the EntityTypes that match the filter expression. The following - // filters are supported: - // - // * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - // Values must be in RFC 3339 format. - // * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - // Values must be in RFC 3339 format. - // * `labels`: Supports key-value equality as well as key presence. - // - // Examples: - // - // * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - // update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - // or updated after 2020-01-31T15:30:00.000000Z. - // * `labels.active = yes AND labels.env = prod` --> EntityTypes having both - // (active: yes) and (env: prod) labels. - // * `labels.env: *` --> Any EntityType which has a label with 'env' as the - // key. - string filter = 2; - - // The maximum number of EntityTypes to return. The service may return fewer - // than this value. If unspecified, at most 1000 EntityTypes will be returned. - // The maximum value is 1000; any value greater than 1000 will be coerced to - // 1000. - int32 page_size = 3; - - // A page token, received from a previous - // [FeaturestoreService.ListEntityTypes][google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes] call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [FeaturestoreService.ListEntityTypes][google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes] must - // match the call that provided the page token. - string page_token = 4; - - // A comma-separated list of fields to order by, sorted in ascending order. - // Use "desc" after a field name for descending. - // - // Supported fields: - // - // * `entity_type_id` - // * `create_time` - // * `update_time` - string order_by = 5; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 6; -} - -// Response message for [FeaturestoreService.ListEntityTypes][google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes]. -message ListEntityTypesResponse { - // The EntityTypes matching the request. - repeated EntityType entity_types = 1; - - // A token, which can be sent as [ListEntityTypesRequest.page_token][google.cloud.aiplatform.v1.ListEntityTypesRequest.page_token] to - // retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [FeaturestoreService.UpdateEntityType][google.cloud.aiplatform.v1.FeaturestoreService.UpdateEntityType]. -message UpdateEntityTypeRequest { - // Required. The EntityType's `name` field is used to identify the EntityType to be - // updated. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - EntityType entity_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Field mask is used to specify the fields to be overwritten in the - // EntityType resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then only the non-empty fields present in the - // request will be overwritten. Set the update_mask to `*` to override all - // fields. - // - // Updatable fields: - // - // * `description` - // * `labels` - // * `monitoring_config.snapshot_analysis.disabled` - // * `monitoring_config.snapshot_analysis.monitoring_interval_days` - // * `monitoring_config.snapshot_analysis.staleness_days` - // * `monitoring_config.import_features_analysis.state` - // * `monitoring_config.import_features_analysis.anomaly_detection_baseline` - // * `monitoring_config.numerical_threshold_config.value` - // * `monitoring_config.categorical_threshold_config.value` - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for [FeaturestoreService.DeleteEntityTypes][]. -message DeleteEntityTypeRequest { - // Required. The name of the EntityType to be deleted. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - } - ]; - - // If set to true, any Features for this EntityType will also be deleted. - // (Otherwise, the request will only work if the EntityType has no Features.) - bool force = 2; -} - -// Request message for [FeaturestoreService.CreateFeature][google.cloud.aiplatform.v1.FeaturestoreService.CreateFeature]. -message CreateFeatureRequest { - // Required. The resource name of the EntityType to create a Feature. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - } - ]; - - // Required. The Feature to create. - Feature feature = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID to use for the Feature, which will become the final component of - // the Feature's resource name. - // - // This value may be up to 60 characters, and valid characters are - // `[a-z0-9_]`. The first character cannot be a number. - // - // The value must be unique within an EntityType. - string feature_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [FeaturestoreService.BatchCreateFeatures][google.cloud.aiplatform.v1.FeaturestoreService.BatchCreateFeatures]. -message BatchCreateFeaturesRequest { - // Required. The resource name of the EntityType to create the batch of Features under. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - } - ]; - - // Required. The request message specifying the Features to create. All Features must be - // created under the same parent EntityType. The `parent` field in each child - // request message can be omitted. If `parent` is set in a child request, then - // the value must match the `parent` value in this request message. - repeated CreateFeatureRequest requests = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [FeaturestoreService.BatchCreateFeatures][google.cloud.aiplatform.v1.FeaturestoreService.BatchCreateFeatures]. -message BatchCreateFeaturesResponse { - // The Features created. - repeated Feature features = 1; -} - -// Request message for [FeaturestoreService.GetFeature][google.cloud.aiplatform.v1.FeaturestoreService.GetFeature]. -message GetFeatureRequest { - // Required. The name of the Feature resource. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Feature" - } - ]; -} - -// Request message for [FeaturestoreService.ListFeatures][google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures]. -message ListFeaturesRequest { - // Required. The resource name of the Location to list Features. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Feature" - } - ]; - - // Lists the Features that match the filter expression. The following - // filters are supported: - // - // * `value_type`: Supports = and != comparisons. - // * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - // be in RFC 3339 format. - // * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - // be in RFC 3339 format. - // * `labels`: Supports key-value equality as well as key presence. - // - // Examples: - // - // * `value_type = DOUBLE` --> Features whose type is DOUBLE. - // * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - // update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - // or updated after 2020-01-31T15:30:00.000000Z. - // * `labels.active = yes AND labels.env = prod` --> Features having both - // (active: yes) and (env: prod) labels. - // * `labels.env: *` --> Any Feature which has a label with 'env' as the - // key. - string filter = 2; - - // The maximum number of Features to return. The service may return fewer - // than this value. If unspecified, at most 1000 Features will be returned. - // The maximum value is 1000; any value greater than 1000 will be coerced to - // 1000. - int32 page_size = 3; - - // A page token, received from a previous - // [FeaturestoreService.ListFeatures][google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures] call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [FeaturestoreService.ListFeatures][google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures] must - // match the call that provided the page token. - string page_token = 4; - - // A comma-separated list of fields to order by, sorted in ascending order. - // Use "desc" after a field name for descending. - // Supported fields: - // - // * `feature_id` - // * `value_type` - // * `create_time` - // * `update_time` - string order_by = 5; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 6; - - // If set, return the most recent [ListFeaturesRequest.latest_stats_count][google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count] - // of stats for each Feature in response. Valid value is [0, 10]. If number of - // stats exists < [ListFeaturesRequest.latest_stats_count][google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count], return all - // existing stats. - int32 latest_stats_count = 7; -} - -// Response message for [FeaturestoreService.ListFeatures][google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures]. -message ListFeaturesResponse { - // The Features matching the request. - repeated Feature features = 1; - - // A token, which can be sent as [ListFeaturesRequest.page_token][google.cloud.aiplatform.v1.ListFeaturesRequest.page_token] to - // retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [FeaturestoreService.SearchFeatures][google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures]. -message SearchFeaturesRequest { - // Required. The resource name of the Location to search Features. - // Format: - // `projects/{project}/locations/{location}` - string location = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Query string that is a conjunction of field-restricted queries and/or - // field-restricted filters. Field-restricted queries and filters can be - // combined using `AND` to form a conjunction. - // - // A field query is in the form FIELD:QUERY. This implicitly checks if QUERY - // exists as a substring within Feature's FIELD. The QUERY - // and the FIELD are converted to a sequence of words (i.e. tokens) for - // comparison. This is done by: - // - // * Removing leading/trailing whitespace and tokenizing the search value. - // Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore - // `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated - // as a wildcard that matches characters within a token. - // * Ignoring case. - // * Prepending an asterisk to the first and appending an asterisk to the - // last token in QUERY. - // - // A QUERY must be either a singular token or a phrase. A phrase is one or - // multiple words enclosed in double quotation marks ("). With phrases, the - // order of the words is important. Words in the phrase must be matching in - // order and consecutively. - // - // Supported FIELDs for field-restricted queries: - // - // * `feature_id` - // * `description` - // * `entity_type_id` - // - // Examples: - // - // * `feature_id: foo` --> Matches a Feature with ID containing the substring - // `foo` (eg. `foo`, `foofeature`, `barfoo`). - // * `feature_id: foo*feature` --> Matches a Feature with ID containing the - // substring `foo*feature` (eg. `foobarfeature`). - // * `feature_id: foo AND description: bar` --> Matches a Feature with ID - // containing the substring `foo` and description containing the substring - // `bar`. - // - // - // Besides field queries, the following exact-match filters are - // supported. The exact-match filters do not support wildcards. Unlike - // field-restricted queries, exact-match filters are case-sensitive. - // - // * `feature_id`: Supports = comparisons. - // * `description`: Supports = comparisons. Multi-token filters should be - // enclosed in quotes. - // * `entity_type_id`: Supports = comparisons. - // * `value_type`: Supports = and != comparisons. - // * `labels`: Supports key-value equality as well as key presence. - // * `featurestore_id`: Supports = comparisons. - // - // Examples: - // * `description = "foo bar"` --> Any Feature with description exactly equal - // to `foo bar` - // * `value_type = DOUBLE` --> Features whose type is DOUBLE. - // * `labels.active = yes AND labels.env = prod` --> Features having both - // (active: yes) and (env: prod) labels. - // * `labels.env: *` --> Any Feature which has a label with `env` as the - // key. - string query = 3; - - // The maximum number of Features to return. The service may return fewer - // than this value. If unspecified, at most 100 Features will be returned. - // The maximum value is 100; any value greater than 100 will be coerced to - // 100. - int32 page_size = 4; - - // A page token, received from a previous - // [FeaturestoreService.SearchFeatures][google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures] call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [FeaturestoreService.SearchFeatures][google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures], except `page_size`, must - // match the call that provided the page token. - string page_token = 5; -} - -// Response message for [FeaturestoreService.SearchFeatures][google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures]. -message SearchFeaturesResponse { - // The Features matching the request. - // - // Fields returned: - // - // * `name` - // * `description` - // * `labels` - // * `create_time` - // * `update_time` - repeated Feature features = 1; - - // A token, which can be sent as [SearchFeaturesRequest.page_token][google.cloud.aiplatform.v1.SearchFeaturesRequest.page_token] to - // retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [FeaturestoreService.UpdateFeature][google.cloud.aiplatform.v1.FeaturestoreService.UpdateFeature]. -message UpdateFeatureRequest { - // Required. The Feature's `name` field is used to identify the Feature to be - // updated. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` - Feature feature = 1 [(google.api.field_behavior) = REQUIRED]; - - // Field mask is used to specify the fields to be overwritten in the - // Features resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then only the non-empty fields present in the - // request will be overwritten. Set the update_mask to `*` to override all - // fields. - // - // Updatable fields: - // - // * `description` - // * `labels` - // * `disable_monitoring` - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for [FeaturestoreService.DeleteFeature][google.cloud.aiplatform.v1.FeaturestoreService.DeleteFeature]. -message DeleteFeatureRequest { - // Required. The name of the Features to be deleted. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Feature" - } - ]; -} - -// Details of operations that perform create Featurestore. -message CreateFeaturestoreOperationMetadata { - // Operation metadata for Featurestore. - GenericOperationMetadata generic_metadata = 1; -} - -// Details of operations that perform update Featurestore. -message UpdateFeaturestoreOperationMetadata { - // Operation metadata for Featurestore. - GenericOperationMetadata generic_metadata = 1; -} - -// Details of operations that perform import Feature values. -message ImportFeatureValuesOperationMetadata { - // Operation metadata for Featurestore import Feature values. - GenericOperationMetadata generic_metadata = 1; - - // Number of entities that have been imported by the operation. - int64 imported_entity_count = 2; - - // Number of Feature values that have been imported by the operation. - int64 imported_feature_value_count = 3; - - // The number of rows in input source that weren't imported due to either - // * Not having any featureValues. - // * Having a null entityId. - // * Having a null timestamp. - // * Not being parsable (applicable for CSV sources). - int64 invalid_row_count = 6; -} - -// Details of operations that exports Features values. -message ExportFeatureValuesOperationMetadata { - // Operation metadata for Featurestore export Feature values. - GenericOperationMetadata generic_metadata = 1; -} - -// Details of operations that batch reads Feature values. -message BatchReadFeatureValuesOperationMetadata { - // Operation metadata for Featurestore batch read Features values. - GenericOperationMetadata generic_metadata = 1; -} - -// Details of operations that perform create EntityType. -message CreateEntityTypeOperationMetadata { - // Operation metadata for EntityType. - GenericOperationMetadata generic_metadata = 1; -} - -// Details of operations that perform create Feature. -message CreateFeatureOperationMetadata { - // Operation metadata for Feature. - GenericOperationMetadata generic_metadata = 1; -} - -// Details of operations that perform batch create Features. -message BatchCreateFeaturesOperationMetadata { - // Operation metadata for Feature. - GenericOperationMetadata generic_metadata = 1; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto deleted file mode 100644 index dfe173dc..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto +++ /dev/null @@ -1,110 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/custom_job.proto"; -import "google/cloud/aiplatform/v1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1/job_state.proto"; -import "google/cloud/aiplatform/v1/study.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "HyperparameterTuningJobProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Represents a HyperparameterTuningJob. A HyperparameterTuningJob -// has a Study specification and multiple CustomJobs with identical -// CustomJob specification. -message HyperparameterTuningJob { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/HyperparameterTuningJob" - pattern: "projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}" - }; - - // Output only. Resource name of the HyperparameterTuningJob. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The display name of the HyperparameterTuningJob. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Study configuration of the HyperparameterTuningJob. - StudySpec study_spec = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. The desired total number of Trials. - int32 max_trial_count = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. The desired number of Trials to run in parallel. - int32 parallel_trial_count = 6 [(google.api.field_behavior) = REQUIRED]; - - // The number of failed Trials that need to be seen before failing - // the HyperparameterTuningJob. - // - // If set to 0, Vertex AI decides how many Trials must fail - // before the whole job fails. - int32 max_failed_trial_count = 7; - - // Required. The spec of a trial job. The same spec applies to the CustomJobs created - // in all the trials. - CustomJobSpec trial_job_spec = 8 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Trials of the HyperparameterTuningJob. - repeated Trial trials = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The detailed state of the job. - JobState state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the HyperparameterTuningJob was created. - google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the HyperparameterTuningJob for the first time entered the - // `JOB_STATE_RUNNING` state. - google.protobuf.Timestamp start_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the HyperparameterTuningJob entered any of the following states: - // `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. - google.protobuf.Timestamp end_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the HyperparameterTuningJob was most recently updated. - google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Only populated when job's state is JOB_STATE_FAILED or - // JOB_STATE_CANCELLED. - google.rpc.Status error = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize HyperparameterTuningJobs. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 16; - - // Customer-managed encryption key options for a HyperparameterTuningJob. - // If this is set, then all resources created by the HyperparameterTuningJob - // will be encrypted with the provided encryption key. - EncryptionSpec encryption_spec = 17; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index.proto deleted file mode 100644 index adf329aa..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index.proto +++ /dev/null @@ -1,96 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/deployed_index_ref.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "IndexProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A representation of a collection of database items organized in a way that -// allows for approximate nearest neighbor (a.k.a ANN) algorithms search. -message Index { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Index" - pattern: "projects/{project}/locations/{location}/indexes/{index}" - }; - - // Output only. The resource name of the Index. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The display name of the Index. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // The description of the Index. - string description = 3; - - // Immutable. Points to a YAML file stored on Google Cloud Storage describing additional - // information about the Index, that is specific to it. Unset if the Index - // does not have any additional information. - // The schema is defined as an OpenAPI 3.0.2 [Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - // Note: The URI given on output will be immutable and probably different, - // including the URI scheme, than the one given on input. The output URI will - // point to a location where the user only has a read access. - string metadata_schema_uri = 4 [(google.api.field_behavior) = IMMUTABLE]; - - // An additional information about the Index; the schema of the metadata can - // be found in [metadata_schema][google.cloud.aiplatform.v1.Index.metadata_schema_uri]. - google.protobuf.Value metadata = 6; - - // Output only. The pointers to DeployedIndexes created from this Index. - // An Index can be only deleted if all its DeployedIndexes had been undeployed - // first. - repeated DeployedIndexRef deployed_indexes = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 8; - - // The labels with user-defined metadata to organize your Indexes. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 9; - - // Output only. Timestamp when this Index was created. - google.protobuf.Timestamp create_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Index was most recently updated. - // This also includes any update to the contents of the Index. - // Note that Operations working on this Index may have their - // [Operations.metadata.generic_metadata.update_time] - // [google.cloud.aiplatform.v1.GenericOperationMetadata.update_time] a little after the value of this - // timestamp, yet that does not mean their results are not already reflected - // in the Index. Result of any successfully completed Operation on the Index - // is reflected in it. - google.protobuf.Timestamp update_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_endpoint.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_endpoint.proto deleted file mode 100644 index 9f1e9941..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_endpoint.proto +++ /dev/null @@ -1,245 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/machine_resources.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "IndexEndpointProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Indexes are deployed into it. An IndexEndpoint can have multiple -// DeployedIndexes. -message IndexEndpoint { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/IndexEndpoint" - pattern: "projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}" - }; - - // Output only. The resource name of the IndexEndpoint. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The display name of the IndexEndpoint. - // The name can be up to 128 characters long and can consist of any UTF-8 - // characters. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // The description of the IndexEndpoint. - string description = 3; - - // Output only. The indexes deployed in this endpoint. - repeated DeployedIndex deployed_indexes = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 5; - - // The labels with user-defined metadata to organize your IndexEndpoints. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 6; - - // Output only. Timestamp when this IndexEndpoint was created. - google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this IndexEndpoint was last updated. - // This timestamp is not updated when the endpoint's DeployedIndexes are - // updated, e.g. due to updates of the original Indexes they are the - // deployments of. - google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The full name of the Google Compute Engine - // [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) - // to which the IndexEndpoint should be peered. - // - // Private services access must already be configured for the network. If left - // unspecified, the Endpoint is not peered with any network. - // - // [network][google.cloud.aiplatform.v1.IndexEndpoint.network] and - // [private_service_connect_config][google.cloud.aiplatform.v1.IndexEndpoint.private_service_connect_config] - // are mutually exclusive. - // - // [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert): - // projects/{project}/global/networks/{network}. - // Where {project} is a project number, as in '12345', and {network} is - // network name. - string network = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Deprecated: If true, expose the IndexEndpoint via private service connect. - // - // Only one of the fields, [network][google.cloud.aiplatform.v1.IndexEndpoint.network] or - // [enable_private_service_connect][google.cloud.aiplatform.v1.IndexEndpoint.enable_private_service_connect], - // can be set. - bool enable_private_service_connect = 10 [ - deprecated = true, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// A deployment of an Index. IndexEndpoints contain one or more DeployedIndexes. -message DeployedIndex { - // Required. The user specified ID of the DeployedIndex. - // The ID can be up to 128 characters long and must start with a letter and - // only contain letters, numbers, and underscores. - // The ID must be unique within the project it is created in. - string id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the Index this is the deployment of. - // We may refer to this Index as the DeployedIndex's "original" Index. - string index = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Index" - } - ]; - - // The display name of the DeployedIndex. If not provided upon creation, - // the Index's display_name is used. - string display_name = 3; - - // Output only. Timestamp when the DeployedIndex was created. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Provides paths for users to send requests directly to the deployed index - // services running on Cloud via private services access. This field is - // populated if [network][google.cloud.aiplatform.v1.IndexEndpoint.network] is configured. - IndexPrivateEndpoints private_endpoints = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The DeployedIndex may depend on various data on its original Index. - // Additionally when certain changes to the original Index are being done - // (e.g. when what the Index contains is being changed) the DeployedIndex may - // be asynchronously updated in the background to reflect this changes. - // If this timestamp's value is at least the [Index.update_time][google.cloud.aiplatform.v1.Index.update_time] of the - // original Index, it means that this DeployedIndex and the original Index are - // in sync. If this timestamp is older, then to see which updates this - // DeployedIndex already contains (and which not), one must - // [list][Operations.ListOperations] [Operations][Operation] - // [working][Operation.name] on the original Index. Only - // the successfully completed Operations with - // [Operations.metadata.generic_metadata.update_time] - // [google.cloud.aiplatform.v1.GenericOperationMetadata.update_time] - // equal or before this sync time are contained in this DeployedIndex. - google.protobuf.Timestamp index_sync_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. A description of resources that the DeployedIndex uses, which to large - // degree are decided by Vertex AI, and optionally allows only a modest - // additional configuration. - // If min_replica_count is not set, the default value is 2 (we don't provide - // SLA when min_replica_count=1). If max_replica_count is not set, the - // default value is min_replica_count. The max allowed replica count is - // 1000. - AutomaticResources automatic_resources = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A description of resources that are dedicated to the DeployedIndex, and - // that need a higher degree of manual configuration. - // If min_replica_count is not set, the default value is 2 (we don't provide - // SLA when min_replica_count=1). If max_replica_count is not set, the - // default value is min_replica_count. The max allowed replica count is - // 1000. - // - // Available machine types: - // n1-standard-16 - // n1-standard-32 - DedicatedResources dedicated_resources = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, private endpoint's access logs are sent to StackDriver Logging. - // - // These logs are like standard server access logs, containing - // information like timestamp and latency for each MatchRequest. - // - // Note that Stackdriver logs may incur a cost, especially if the deployed - // index receives a high queries per second rate (QPS). - // Estimate your costs before enabling this option. - bool enable_access_logging = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the authentication is enabled for the private endpoint. - DeployedIndexAuthConfig deployed_index_auth_config = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A list of reserved ip ranges under the VPC network that can be - // used for this DeployedIndex. - // - // If set, we will deploy the index within the provided ip ranges. Otherwise, - // the index might be deployed to any ip ranges under the provided VPC - // network. - // - // The value sohuld be the name of the address - // (https://cloud.google.com/compute/docs/reference/rest/v1/addresses) - // Example: 'vertex-ai-ip-range'. - repeated string reserved_ip_ranges = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The deployment group can be no longer than 64 characters (eg: - // 'test', 'prod'). If not set, we will use the 'default' deployment group. - // - // Creating `deployment_groups` with `reserved_ip_ranges` is a recommended - // practice when the peered network has multiple peering ranges. This creates - // your deployments from predictable IP spaces for easier traffic - // administration. Also, one deployment_group (except 'default') can only be - // used with the same reserved_ip_ranges which means if the deployment_group - // has been used with reserved_ip_ranges: [a, b, c], using it with [a, b] or - // [d, e] is disallowed. - // - // Note: we only support up to 5 deployment groups(not including 'default'). - string deployment_group = 11 [(google.api.field_behavior) = OPTIONAL]; -} - -// Used to set up the auth on the DeployedIndex's private endpoint. -message DeployedIndexAuthConfig { - // Configuration for an authentication provider, including support for - // [JSON Web Token - // (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). - message AuthProvider { - // The list of JWT - // [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). - // that are allowed to access. A JWT containing any of these audiences will - // be accepted. - repeated string audiences = 1; - - // A list of allowed JWT issuers. Each entry must be a valid Google - // service account, in the following format: - // - // `service-account-name@project-id.iam.gserviceaccount.com` - repeated string allowed_issuers = 2; - } - - // Defines the authentication provider that the DeployedIndex uses. - AuthProvider auth_provider = 1; -} - -// IndexPrivateEndpoints proto is used to provide paths for users to send -// requests via private endpoints (e.g. private service access, private service -// connect). -// To send request via private service access, use match_grpc_address. -// To send request via private service connect, use service_attachment. -message IndexPrivateEndpoints { - // Output only. The ip address used to send match gRPC requests. - string match_grpc_address = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The name of the service attachment resource. Populated if private service - // connect is enabled. - string service_attachment = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_endpoint_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_endpoint_service.proto deleted file mode 100644 index 8acdb5bc..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_endpoint_service.proto +++ /dev/null @@ -1,335 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/index_endpoint.proto"; -import "google/cloud/aiplatform/v1/operation.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "IndexEndpointServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A service for managing Vertex AI's IndexEndpoints. -service IndexEndpointService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates an IndexEndpoint. - rpc CreateIndexEndpoint(CreateIndexEndpointRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/indexEndpoints" - body: "index_endpoint" - }; - option (google.api.method_signature) = "parent,index_endpoint"; - option (google.longrunning.operation_info) = { - response_type: "IndexEndpoint" - metadata_type: "CreateIndexEndpointOperationMetadata" - }; - } - - // Gets an IndexEndpoint. - rpc GetIndexEndpoint(GetIndexEndpointRequest) returns (IndexEndpoint) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/indexEndpoints/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists IndexEndpoints in a Location. - rpc ListIndexEndpoints(ListIndexEndpointsRequest) returns (ListIndexEndpointsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/indexEndpoints" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates an IndexEndpoint. - rpc UpdateIndexEndpoint(UpdateIndexEndpointRequest) returns (IndexEndpoint) { - option (google.api.http) = { - patch: "/v1/{index_endpoint.name=projects/*/locations/*/indexEndpoints/*}" - body: "index_endpoint" - }; - option (google.api.method_signature) = "index_endpoint,update_mask"; - } - - // Deletes an IndexEndpoint. - rpc DeleteIndexEndpoint(DeleteIndexEndpointRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/indexEndpoints/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Deploys an Index into this IndexEndpoint, creating a DeployedIndex within - // it. - // Only non-empty Indexes can be deployed. - rpc DeployIndex(DeployIndexRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:deployIndex" - body: "*" - }; - option (google.api.method_signature) = "index_endpoint,deployed_index"; - option (google.longrunning.operation_info) = { - response_type: "DeployIndexResponse" - metadata_type: "DeployIndexOperationMetadata" - }; - } - - // Undeploys an Index from an IndexEndpoint, removing a DeployedIndex from it, - // and freeing all resources it's using. - rpc UndeployIndex(UndeployIndexRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:undeployIndex" - body: "*" - }; - option (google.api.method_signature) = "index_endpoint,deployed_index_id"; - option (google.longrunning.operation_info) = { - response_type: "UndeployIndexResponse" - metadata_type: "UndeployIndexOperationMetadata" - }; - } - - // Update an existing DeployedIndex under an IndexEndpoint. - rpc MutateDeployedIndex(MutateDeployedIndexRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:mutateDeployedIndex" - body: "deployed_index" - }; - option (google.api.method_signature) = "index_endpoint,deployed_index"; - option (google.longrunning.operation_info) = { - response_type: "MutateDeployedIndexResponse" - metadata_type: "MutateDeployedIndexOperationMetadata" - }; - } -} - -// Request message for [IndexEndpointService.CreateIndexEndpoint][google.cloud.aiplatform.v1.IndexEndpointService.CreateIndexEndpoint]. -message CreateIndexEndpointRequest { - // Required. The resource name of the Location to create the IndexEndpoint in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The IndexEndpoint to create. - IndexEndpoint index_endpoint = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Runtime operation information for -// [IndexEndpointService.CreateIndexEndpoint][google.cloud.aiplatform.v1.IndexEndpointService.CreateIndexEndpoint]. -message CreateIndexEndpointOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [IndexEndpointService.GetIndexEndpoint][google.cloud.aiplatform.v1.IndexEndpointService.GetIndexEndpoint] -message GetIndexEndpointRequest { - // Required. The name of the IndexEndpoint resource. - // Format: - // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/IndexEndpoint" - } - ]; -} - -// Request message for [IndexEndpointService.ListIndexEndpoints][google.cloud.aiplatform.v1.IndexEndpointService.ListIndexEndpoints]. -message ListIndexEndpointsRequest { - // Required. The resource name of the Location from which to list the IndexEndpoints. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. An expression for filtering the results of the request. For field names - // both snake_case and camelCase are supported. - // - // * `index_endpoint` supports = and !=. `index_endpoint` represents the - // IndexEndpoint ID, ie. the last segment of the IndexEndpoint's - // [resourcename][google.cloud.aiplatform.v1.IndexEndpoint.name]. - // * `display_name` supports =, != and regex() - // (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) - // * `labels` supports general map functions that is: - // `labels.key=value` - key:value equality - // `labels.key:* or labels:key - key existence - // A key including a space must be quoted. `labels."a key"`. - // - // Some examples: - // * `index_endpoint="1"` - // * `display_name="myDisplayName"` - // * `regex(display_name, "^A") -> The display name starts with an A. - // * `labels.myKey="myValue"` - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The standard list page size. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The standard list page token. - // Typically obtained via - // [ListIndexEndpointsResponse.next_page_token][google.cloud.aiplatform.v1.ListIndexEndpointsResponse.next_page_token] of the previous - // [IndexEndpointService.ListIndexEndpoints][google.cloud.aiplatform.v1.IndexEndpointService.ListIndexEndpoints] call. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for [IndexEndpointService.ListIndexEndpoints][google.cloud.aiplatform.v1.IndexEndpointService.ListIndexEndpoints]. -message ListIndexEndpointsResponse { - // List of IndexEndpoints in the requested page. - repeated IndexEndpoint index_endpoints = 1; - - // A token to retrieve next page of results. - // Pass to [ListIndexEndpointsRequest.page_token][google.cloud.aiplatform.v1.ListIndexEndpointsRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [IndexEndpointService.UpdateIndexEndpoint][google.cloud.aiplatform.v1.IndexEndpointService.UpdateIndexEndpoint]. -message UpdateIndexEndpointRequest { - // Required. The IndexEndpoint which replaces the resource on the server. - IndexEndpoint index_endpoint = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The update mask applies to the resource. See [google.protobuf.FieldMask][google.protobuf.FieldMask]. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [IndexEndpointService.DeleteIndexEndpoint][google.cloud.aiplatform.v1.IndexEndpointService.DeleteIndexEndpoint]. -message DeleteIndexEndpointRequest { - // Required. The name of the IndexEndpoint resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/IndexEndpoint" - } - ]; -} - -// Request message for [IndexEndpointService.DeployIndex][google.cloud.aiplatform.v1.IndexEndpointService.DeployIndex]. -message DeployIndexRequest { - // Required. The name of the IndexEndpoint resource into which to deploy an Index. - // Format: - // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - string index_endpoint = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/IndexEndpoint" - } - ]; - - // Required. The DeployedIndex to be created within the IndexEndpoint. - DeployedIndex deployed_index = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [IndexEndpointService.DeployIndex][google.cloud.aiplatform.v1.IndexEndpointService.DeployIndex]. -message DeployIndexResponse { - // The DeployedIndex that had been deployed in the IndexEndpoint. - DeployedIndex deployed_index = 1; -} - -// Runtime operation information for [IndexEndpointService.DeployIndex][google.cloud.aiplatform.v1.IndexEndpointService.DeployIndex]. -message DeployIndexOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; - - // The unique index id specified by user - string deployed_index_id = 2; -} - -// Request message for [IndexEndpointService.UndeployIndex][google.cloud.aiplatform.v1.IndexEndpointService.UndeployIndex]. -message UndeployIndexRequest { - // Required. The name of the IndexEndpoint resource from which to undeploy an Index. - // Format: - // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - string index_endpoint = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/IndexEndpoint" - } - ]; - - // Required. The ID of the DeployedIndex to be undeployed from the IndexEndpoint. - string deployed_index_id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [IndexEndpointService.UndeployIndex][google.cloud.aiplatform.v1.IndexEndpointService.UndeployIndex]. -message UndeployIndexResponse { - -} - -// Runtime operation information for [IndexEndpointService.UndeployIndex][google.cloud.aiplatform.v1.IndexEndpointService.UndeployIndex]. -message UndeployIndexOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [IndexEndpointService.MutateDeployedIndex][google.cloud.aiplatform.v1.IndexEndpointService.MutateDeployedIndex]. -message MutateDeployedIndexRequest { - // Required. The name of the IndexEndpoint resource into which to deploy an Index. - // Format: - // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - string index_endpoint = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/IndexEndpoint" - } - ]; - - // Required. The DeployedIndex to be updated within the IndexEndpoint. - // Currently, the updatable fields are [DeployedIndex][automatic_resources] - // and [DeployedIndex][dedicated_resources] - DeployedIndex deployed_index = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [IndexEndpointService.MutateDeployedIndex][google.cloud.aiplatform.v1.IndexEndpointService.MutateDeployedIndex]. -message MutateDeployedIndexResponse { - // The DeployedIndex that had been updated in the IndexEndpoint. - DeployedIndex deployed_index = 1; -} - -// Runtime operation information for -// [IndexEndpointService.MutateDeployedIndex][google.cloud.aiplatform.v1.IndexEndpointService.MutateDeployedIndex]. -message MutateDeployedIndexOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; - - // The unique index id specified by user - string deployed_index_id = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_service.proto deleted file mode 100644 index f3812b98..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_service.proto +++ /dev/null @@ -1,277 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/index.proto"; -import "google/cloud/aiplatform/v1/operation.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "IndexServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A service for creating and managing Vertex AI's Index resources. -service IndexService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates an Index. - rpc CreateIndex(CreateIndexRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/indexes" - body: "index" - }; - option (google.api.method_signature) = "parent,index"; - option (google.longrunning.operation_info) = { - response_type: "Index" - metadata_type: "CreateIndexOperationMetadata" - }; - } - - // Gets an Index. - rpc GetIndex(GetIndexRequest) returns (Index) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/indexes/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Indexes in a Location. - rpc ListIndexes(ListIndexesRequest) returns (ListIndexesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/indexes" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates an Index. - rpc UpdateIndex(UpdateIndexRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{index.name=projects/*/locations/*/indexes/*}" - body: "index" - }; - option (google.api.method_signature) = "index,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Index" - metadata_type: "UpdateIndexOperationMetadata" - }; - } - - // Deletes an Index. - // An Index can only be deleted when all its - // [DeployedIndexes][google.cloud.aiplatform.v1.Index.deployed_indexes] had been undeployed. - rpc DeleteIndex(DeleteIndexRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/indexes/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } -} - -// Request message for [IndexService.CreateIndex][google.cloud.aiplatform.v1.IndexService.CreateIndex]. -message CreateIndexRequest { - // Required. The resource name of the Location to create the Index in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The Index to create. - Index index = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Runtime operation information for [IndexService.CreateIndex][google.cloud.aiplatform.v1.IndexService.CreateIndex]. -message CreateIndexOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; - - // The operation metadata with regard to Matching Engine Index operation. - NearestNeighborSearchOperationMetadata nearest_neighbor_search_operation_metadata = 2; -} - -// Request message for [IndexService.GetIndex][google.cloud.aiplatform.v1.IndexService.GetIndex] -message GetIndexRequest { - // Required. The name of the Index resource. - // Format: - // `projects/{project}/locations/{location}/indexes/{index}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Index" - } - ]; -} - -// Request message for [IndexService.ListIndexes][google.cloud.aiplatform.v1.IndexService.ListIndexes]. -message ListIndexesRequest { - // Required. The resource name of the Location from which to list the Indexes. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The standard list filter. - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListIndexesResponse.next_page_token][google.cloud.aiplatform.v1.ListIndexesResponse.next_page_token] of the previous - // [IndexService.ListIndexes][google.cloud.aiplatform.v1.IndexService.ListIndexes] call. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for [IndexService.ListIndexes][google.cloud.aiplatform.v1.IndexService.ListIndexes]. -message ListIndexesResponse { - // List of indexes in the requested page. - repeated Index indexes = 1; - - // A token to retrieve next page of results. - // Pass to [ListIndexesRequest.page_token][google.cloud.aiplatform.v1.ListIndexesRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [IndexService.UpdateIndex][google.cloud.aiplatform.v1.IndexService.UpdateIndex]. -message UpdateIndexRequest { - // Required. The Index which updates the resource on the server. - Index index = 1 [(google.api.field_behavior) = REQUIRED]; - - // The update mask applies to the resource. - // For the `FieldMask` definition, see [google.protobuf.FieldMask][google.protobuf.FieldMask]. - google.protobuf.FieldMask update_mask = 2; -} - -// Runtime operation information for [IndexService.UpdateIndex][google.cloud.aiplatform.v1.IndexService.UpdateIndex]. -message UpdateIndexOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; - - // The operation metadata with regard to Matching Engine Index operation. - NearestNeighborSearchOperationMetadata nearest_neighbor_search_operation_metadata = 2; -} - -// Request message for [IndexService.DeleteIndex][google.cloud.aiplatform.v1.IndexService.DeleteIndex]. -message DeleteIndexRequest { - // Required. The name of the Index resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/indexes/{index}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Index" - } - ]; -} - -// Runtime operation metadata with regard to Matching Engine Index. -message NearestNeighborSearchOperationMetadata { - message RecordError { - enum RecordErrorType { - // Default, shall not be used. - ERROR_TYPE_UNSPECIFIED = 0; - - // The record is empty. - EMPTY_LINE = 1; - - // Invalid json format. - INVALID_JSON_SYNTAX = 2; - - // Invalid csv format. - INVALID_CSV_SYNTAX = 3; - - // Invalid avro format. - INVALID_AVRO_SYNTAX = 4; - - // The embedding id is not valid. - INVALID_EMBEDDING_ID = 5; - - // The size of the embedding vectors does not match with the specified - // dimension. - EMBEDDING_SIZE_MISMATCH = 6; - - // The `namespace` field is missing. - NAMESPACE_MISSING = 7; - } - - // The error type of this record. - RecordErrorType error_type = 1; - - // A human-readable message that is shown to the user to help them fix the - // error. Note that this message may change from time to time, your code - // should check against error_type as the source of truth. - string error_message = 2; - - // Cloud Storage URI pointing to the original file in user's bucket. - string source_gcs_uri = 3; - - // Empty if the embedding id is failed to parse. - string embedding_id = 4; - - // The original content of this record. - string raw_record = 5; - } - - message ContentValidationStats { - // Cloud Storage URI pointing to the original file in user's bucket. - string source_gcs_uri = 1; - - // Number of records in this file that were successfully processed. - int64 valid_record_count = 2; - - // Number of records in this file we skipped due to validate errors. - int64 invalid_record_count = 3; - - // The detail information of the partial failures encountered for those - // invalid records that couldn't be parsed. - // Up to 50 partial errors will be reported. - repeated RecordError partial_errors = 4; - } - - // The validation stats of the content (per file) to be inserted or - // updated on the Matching Engine Index resource. Populated if - // contentsDeltaUri is provided as part of [Index.metadata][google.cloud.aiplatform.v1.Index.metadata]. Please note - // that, currently for those files that are broken or has unsupported file - // format, we will not have the stats for those files. - repeated ContentValidationStats content_validation_stats = 1; - - // The ingested data size in bytes. - int64 data_bytes_count = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/io.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/io.proto deleted file mode 100644 index 43d5fdc6..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/io.proto +++ /dev/null @@ -1,108 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "IoProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// The storage details for Avro input content. -message AvroSource { - // Required. Google Cloud Storage location. - GcsSource gcs_source = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The storage details for CSV input content. -message CsvSource { - // Required. Google Cloud Storage location. - GcsSource gcs_source = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The Google Cloud Storage location for the input content. -message GcsSource { - // Required. Google Cloud Storage URI(-s) to the input file(s). May contain - // wildcards. For more information on wildcards, see - // https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames. - repeated string uris = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The Google Cloud Storage location where the output is to be written to. -message GcsDestination { - // Required. Google Cloud Storage URI to output directory. If the uri doesn't end with - // '/', a '/' will be automatically appended. The directory is created if it - // doesn't exist. - string output_uri_prefix = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The BigQuery location for the input content. -message BigQuerySource { - // Required. BigQuery URI to a table, up to 2000 characters long. - // Accepted forms: - // - // * BigQuery path. For example: `bq://projectId.bqDatasetId.bqTableId`. - string input_uri = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The BigQuery location for the output content. -message BigQueryDestination { - // Required. BigQuery URI to a project or table, up to 2000 characters long. - // - // When only the project is specified, the Dataset and Table is created. - // When the full table reference is specified, the Dataset must exist and - // table must not exist. - // - // Accepted forms: - // - // * BigQuery path. For example: - // `bq://projectId` or `bq://projectId.bqDatasetId` or - // `bq://projectId.bqDatasetId.bqTableId`. - string output_uri = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The storage details for CSV output content. -message CsvDestination { - // Required. Google Cloud Storage location. - GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The storage details for TFRecord output content. -message TFRecordDestination { - // Required. Google Cloud Storage location. - GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The Container Registry location for the container image. -message ContainerRegistryDestination { - // Required. Container Registry URI of a container image. - // Only Google Container Registry and Artifact Registry are supported now. - // Accepted forms: - // - // * Google Container Registry path. For example: - // `gcr.io/projectId/imageName:tag`. - // - // * Artifact Registry path. For example: - // `us-central1-docker.pkg.dev/projectId/repoName/imageName:tag`. - // - // If a tag is not specified, "latest" will be used as the default tag. - string output_uri = 1 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/job_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/job_service.proto deleted file mode 100644 index 493ee7ad..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/job_service.proto +++ /dev/null @@ -1,1003 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/batch_prediction_job.proto"; -import "google/cloud/aiplatform/v1/custom_job.proto"; -import "google/cloud/aiplatform/v1/data_labeling_job.proto"; -import "google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto"; -import "google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto"; -import "google/cloud/aiplatform/v1/operation.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "JobServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A service for creating and managing Vertex AI's jobs. -service JobService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a CustomJob. A created CustomJob right away - // will be attempted to be run. - rpc CreateCustomJob(CreateCustomJobRequest) returns (CustomJob) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/customJobs" - body: "custom_job" - }; - option (google.api.method_signature) = "parent,custom_job"; - } - - // Gets a CustomJob. - rpc GetCustomJob(GetCustomJobRequest) returns (CustomJob) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/customJobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists CustomJobs in a Location. - rpc ListCustomJobs(ListCustomJobsRequest) returns (ListCustomJobsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/customJobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a CustomJob. - rpc DeleteCustomJob(DeleteCustomJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/customJobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Cancels a CustomJob. - // Starts asynchronous cancellation on the CustomJob. The server - // makes a best effort to cancel the job, but success is not - // guaranteed. Clients can use [JobService.GetCustomJob][google.cloud.aiplatform.v1.JobService.GetCustomJob] or - // other methods to check whether the cancellation succeeded or whether the - // job completed despite cancellation. On successful cancellation, - // the CustomJob is not deleted; instead it becomes a job with - // a [CustomJob.error][google.cloud.aiplatform.v1.CustomJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`, and [CustomJob.state][google.cloud.aiplatform.v1.CustomJob.state] is set to - // `CANCELLED`. - rpc CancelCustomJob(CancelCustomJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/customJobs/*}:cancel" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a DataLabelingJob. - rpc CreateDataLabelingJob(CreateDataLabelingJobRequest) returns (DataLabelingJob) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/dataLabelingJobs" - body: "data_labeling_job" - }; - option (google.api.method_signature) = "parent,data_labeling_job"; - } - - // Gets a DataLabelingJob. - rpc GetDataLabelingJob(GetDataLabelingJobRequest) returns (DataLabelingJob) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/dataLabelingJobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists DataLabelingJobs in a Location. - rpc ListDataLabelingJobs(ListDataLabelingJobsRequest) returns (ListDataLabelingJobsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/dataLabelingJobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a DataLabelingJob. - rpc DeleteDataLabelingJob(DeleteDataLabelingJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/dataLabelingJobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Cancels a DataLabelingJob. Success of cancellation is not guaranteed. - rpc CancelDataLabelingJob(CancelDataLabelingJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/dataLabelingJobs/*}:cancel" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a HyperparameterTuningJob - rpc CreateHyperparameterTuningJob(CreateHyperparameterTuningJobRequest) returns (HyperparameterTuningJob) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/hyperparameterTuningJobs" - body: "hyperparameter_tuning_job" - }; - option (google.api.method_signature) = "parent,hyperparameter_tuning_job"; - } - - // Gets a HyperparameterTuningJob - rpc GetHyperparameterTuningJob(GetHyperparameterTuningJobRequest) returns (HyperparameterTuningJob) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists HyperparameterTuningJobs in a Location. - rpc ListHyperparameterTuningJobs(ListHyperparameterTuningJobsRequest) returns (ListHyperparameterTuningJobsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/hyperparameterTuningJobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a HyperparameterTuningJob. - rpc DeleteHyperparameterTuningJob(DeleteHyperparameterTuningJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Cancels a HyperparameterTuningJob. - // Starts asynchronous cancellation on the HyperparameterTuningJob. The server - // makes a best effort to cancel the job, but success is not - // guaranteed. Clients can use [JobService.GetHyperparameterTuningJob][google.cloud.aiplatform.v1.JobService.GetHyperparameterTuningJob] or - // other methods to check whether the cancellation succeeded or whether the - // job completed despite cancellation. On successful cancellation, - // the HyperparameterTuningJob is not deleted; instead it becomes a job with - // a [HyperparameterTuningJob.error][google.cloud.aiplatform.v1.HyperparameterTuningJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] - // of 1, corresponding to `Code.CANCELLED`, and - // [HyperparameterTuningJob.state][google.cloud.aiplatform.v1.HyperparameterTuningJob.state] is set to `CANCELLED`. - rpc CancelHyperparameterTuningJob(CancelHyperparameterTuningJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}:cancel" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a BatchPredictionJob. A BatchPredictionJob once created will - // right away be attempted to start. - rpc CreateBatchPredictionJob(CreateBatchPredictionJobRequest) returns (BatchPredictionJob) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/batchPredictionJobs" - body: "batch_prediction_job" - }; - option (google.api.method_signature) = "parent,batch_prediction_job"; - } - - // Gets a BatchPredictionJob - rpc GetBatchPredictionJob(GetBatchPredictionJobRequest) returns (BatchPredictionJob) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/batchPredictionJobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists BatchPredictionJobs in a Location. - rpc ListBatchPredictionJobs(ListBatchPredictionJobsRequest) returns (ListBatchPredictionJobsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/batchPredictionJobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a BatchPredictionJob. Can only be called on jobs that already - // finished. - rpc DeleteBatchPredictionJob(DeleteBatchPredictionJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/batchPredictionJobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Cancels a BatchPredictionJob. - // - // Starts asynchronous cancellation on the BatchPredictionJob. The server - // makes the best effort to cancel the job, but success is not - // guaranteed. Clients can use [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob] or - // other methods to check whether the cancellation succeeded or whether the - // job completed despite cancellation. On a successful cancellation, - // the BatchPredictionJob is not deleted;instead its - // [BatchPredictionJob.state][google.cloud.aiplatform.v1.BatchPredictionJob.state] is set to `CANCELLED`. Any files already - // outputted by the job are not deleted. - rpc CancelBatchPredictionJob(CancelBatchPredictionJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/batchPredictionJobs/*}:cancel" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a ModelDeploymentMonitoringJob. It will run periodically on a - // configured interval. - rpc CreateModelDeploymentMonitoringJob(CreateModelDeploymentMonitoringJobRequest) returns (ModelDeploymentMonitoringJob) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/modelDeploymentMonitoringJobs" - body: "model_deployment_monitoring_job" - }; - option (google.api.method_signature) = "parent,model_deployment_monitoring_job"; - } - - // Searches Model Monitoring Statistics generated within a given time window. - rpc SearchModelDeploymentMonitoringStatsAnomalies(SearchModelDeploymentMonitoringStatsAnomaliesRequest) returns (SearchModelDeploymentMonitoringStatsAnomaliesResponse) { - option (google.api.http) = { - post: "/v1/{model_deployment_monitoring_job=projects/*/locations/*/modelDeploymentMonitoringJobs/*}:searchModelDeploymentMonitoringStatsAnomalies" - body: "*" - }; - option (google.api.method_signature) = "model_deployment_monitoring_job,deployed_model_id"; - } - - // Gets a ModelDeploymentMonitoringJob. - rpc GetModelDeploymentMonitoringJob(GetModelDeploymentMonitoringJobRequest) returns (ModelDeploymentMonitoringJob) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists ModelDeploymentMonitoringJobs in a Location. - rpc ListModelDeploymentMonitoringJobs(ListModelDeploymentMonitoringJobsRequest) returns (ListModelDeploymentMonitoringJobsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/modelDeploymentMonitoringJobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates a ModelDeploymentMonitoringJob. - rpc UpdateModelDeploymentMonitoringJob(UpdateModelDeploymentMonitoringJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{model_deployment_monitoring_job.name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}" - body: "model_deployment_monitoring_job" - }; - option (google.api.method_signature) = "model_deployment_monitoring_job,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "ModelDeploymentMonitoringJob" - metadata_type: "UpdateModelDeploymentMonitoringJobOperationMetadata" - }; - } - - // Deletes a ModelDeploymentMonitoringJob. - rpc DeleteModelDeploymentMonitoringJob(DeleteModelDeploymentMonitoringJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Pauses a ModelDeploymentMonitoringJob. If the job is running, the server - // makes a best effort to cancel the job. Will mark - // [ModelDeploymentMonitoringJob.state][google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.state] to 'PAUSED'. - rpc PauseModelDeploymentMonitoringJob(PauseModelDeploymentMonitoringJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}:pause" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Resumes a paused ModelDeploymentMonitoringJob. It will start to run from - // next scheduled time. A deleted ModelDeploymentMonitoringJob can't be - // resumed. - rpc ResumeModelDeploymentMonitoringJob(ResumeModelDeploymentMonitoringJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}:resume" - body: "*" - }; - option (google.api.method_signature) = "name"; - } -} - -// Request message for [JobService.CreateCustomJob][google.cloud.aiplatform.v1.JobService.CreateCustomJob]. -message CreateCustomJobRequest { - // Required. The resource name of the Location to create the CustomJob in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The CustomJob to create. - CustomJob custom_job = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [JobService.GetCustomJob][google.cloud.aiplatform.v1.JobService.GetCustomJob]. -message GetCustomJobRequest { - // Required. The name of the CustomJob resource. - // Format: - // `projects/{project}/locations/{location}/customJobs/{custom_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/CustomJob" - } - ]; -} - -// Request message for [JobService.ListCustomJobs][google.cloud.aiplatform.v1.JobService.ListCustomJobs]. -message ListCustomJobsRequest { - // Required. The resource name of the Location to list the CustomJobs from. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The standard list filter. - // - // Supported fields: - // - // * `display_name` supports = and !=. - // - // * `state` supports = and !=. - // - // Some examples of using the filter are: - // - // * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - // - // * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - // - // * `NOT display_name="my_job"` - // - // * `state="JOB_STATE_FAILED"` - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListCustomJobsResponse.next_page_token][google.cloud.aiplatform.v1.ListCustomJobsResponse.next_page_token] of the previous - // [JobService.ListCustomJobs][google.cloud.aiplatform.v1.JobService.ListCustomJobs] call. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for [JobService.ListCustomJobs][google.cloud.aiplatform.v1.JobService.ListCustomJobs] -message ListCustomJobsResponse { - // List of CustomJobs in the requested page. - repeated CustomJob custom_jobs = 1; - - // A token to retrieve the next page of results. - // Pass to [ListCustomJobsRequest.page_token][google.cloud.aiplatform.v1.ListCustomJobsRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [JobService.DeleteCustomJob][google.cloud.aiplatform.v1.JobService.DeleteCustomJob]. -message DeleteCustomJobRequest { - // Required. The name of the CustomJob resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/customJobs/{custom_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/CustomJob" - } - ]; -} - -// Request message for [JobService.CancelCustomJob][google.cloud.aiplatform.v1.JobService.CancelCustomJob]. -message CancelCustomJobRequest { - // Required. The name of the CustomJob to cancel. - // Format: - // `projects/{project}/locations/{location}/customJobs/{custom_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/CustomJob" - } - ]; -} - -// Request message for [JobService.CreateDataLabelingJob][google.cloud.aiplatform.v1.JobService.CreateDataLabelingJob]. -message CreateDataLabelingJobRequest { - // Required. The parent of the DataLabelingJob. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The DataLabelingJob to create. - DataLabelingJob data_labeling_job = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [JobService.GetDataLabelingJob][google.cloud.aiplatform.v1.JobService.GetDataLabelingJob]. -message GetDataLabelingJobRequest { - // Required. The name of the DataLabelingJob. - // Format: - // `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/DataLabelingJob" - } - ]; -} - -// Request message for [JobService.ListDataLabelingJobs][google.cloud.aiplatform.v1.JobService.ListDataLabelingJobs]. -message ListDataLabelingJobsRequest { - // Required. The parent of the DataLabelingJob. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The standard list filter. - // - // Supported fields: - // - // * `display_name` supports = and !=. - // - // * `state` supports = and !=. - // - // Some examples of using the filter are: - // - // * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - // - // * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - // - // * `NOT display_name="my_job"` - // - // * `state="JOB_STATE_FAILED"` - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - string page_token = 4; - - // Mask specifying which fields to read. FieldMask represents a set of - // symbolic field paths. For example, the mask can be `paths: "name"`. The - // "name" here is a field in DataLabelingJob. - // If this field is not set, all fields of the DataLabelingJob are returned. - google.protobuf.FieldMask read_mask = 5; - - // A comma-separated list of fields to order by, sorted in ascending order by - // default. - // Use `desc` after a field name for descending. - string order_by = 6; -} - -// Response message for [JobService.ListDataLabelingJobs][google.cloud.aiplatform.v1.JobService.ListDataLabelingJobs]. -message ListDataLabelingJobsResponse { - // A list of DataLabelingJobs that matches the specified filter in the - // request. - repeated DataLabelingJob data_labeling_jobs = 1; - - // The standard List next-page token. - string next_page_token = 2; -} - -// Request message for [JobService.DeleteDataLabelingJob][google.cloud.aiplatform.v1.JobService.DeleteDataLabelingJob]. -message DeleteDataLabelingJobRequest { - // Required. The name of the DataLabelingJob to be deleted. - // Format: - // `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/DataLabelingJob" - } - ]; -} - -// Request message for [JobService.CancelDataLabelingJob][google.cloud.aiplatform.v1.JobService.CancelDataLabelingJob]. -message CancelDataLabelingJobRequest { - // Required. The name of the DataLabelingJob. - // Format: - // `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/DataLabelingJob" - } - ]; -} - -// Request message for [JobService.CreateHyperparameterTuningJob][google.cloud.aiplatform.v1.JobService.CreateHyperparameterTuningJob]. -message CreateHyperparameterTuningJobRequest { - // Required. The resource name of the Location to create the HyperparameterTuningJob in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The HyperparameterTuningJob to create. - HyperparameterTuningJob hyperparameter_tuning_job = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [JobService.GetHyperparameterTuningJob][google.cloud.aiplatform.v1.JobService.GetHyperparameterTuningJob]. -message GetHyperparameterTuningJobRequest { - // Required. The name of the HyperparameterTuningJob resource. - // Format: - // `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/HyperparameterTuningJob" - } - ]; -} - -// Request message for [JobService.ListHyperparameterTuningJobs][google.cloud.aiplatform.v1.JobService.ListHyperparameterTuningJobs]. -message ListHyperparameterTuningJobsRequest { - // Required. The resource name of the Location to list the HyperparameterTuningJobs - // from. Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The standard list filter. - // - // Supported fields: - // - // * `display_name` supports = and !=. - // - // * `state` supports = and !=. - // - // Some examples of using the filter are: - // - // * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - // - // * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - // - // * `NOT display_name="my_job"` - // - // * `state="JOB_STATE_FAILED"` - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListHyperparameterTuningJobsResponse.next_page_token][google.cloud.aiplatform.v1.ListHyperparameterTuningJobsResponse.next_page_token] of the previous - // [JobService.ListHyperparameterTuningJobs][google.cloud.aiplatform.v1.JobService.ListHyperparameterTuningJobs] call. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for [JobService.ListHyperparameterTuningJobs][google.cloud.aiplatform.v1.JobService.ListHyperparameterTuningJobs] -message ListHyperparameterTuningJobsResponse { - // List of HyperparameterTuningJobs in the requested page. - // [HyperparameterTuningJob.trials][google.cloud.aiplatform.v1.HyperparameterTuningJob.trials] of the jobs will be not be returned. - repeated HyperparameterTuningJob hyperparameter_tuning_jobs = 1; - - // A token to retrieve the next page of results. - // Pass to [ListHyperparameterTuningJobsRequest.page_token][google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest.page_token] to obtain that - // page. - string next_page_token = 2; -} - -// Request message for [JobService.DeleteHyperparameterTuningJob][google.cloud.aiplatform.v1.JobService.DeleteHyperparameterTuningJob]. -message DeleteHyperparameterTuningJobRequest { - // Required. The name of the HyperparameterTuningJob resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/HyperparameterTuningJob" - } - ]; -} - -// Request message for [JobService.CancelHyperparameterTuningJob][google.cloud.aiplatform.v1.JobService.CancelHyperparameterTuningJob]. -message CancelHyperparameterTuningJobRequest { - // Required. The name of the HyperparameterTuningJob to cancel. - // Format: - // `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/HyperparameterTuningJob" - } - ]; -} - -// Request message for [JobService.CreateBatchPredictionJob][google.cloud.aiplatform.v1.JobService.CreateBatchPredictionJob]. -message CreateBatchPredictionJobRequest { - // Required. The resource name of the Location to create the BatchPredictionJob in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The BatchPredictionJob to create. - BatchPredictionJob batch_prediction_job = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob]. -message GetBatchPredictionJobRequest { - // Required. The name of the BatchPredictionJob resource. - // Format: - // `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/BatchPredictionJob" - } - ]; -} - -// Request message for [JobService.ListBatchPredictionJobs][google.cloud.aiplatform.v1.JobService.ListBatchPredictionJobs]. -message ListBatchPredictionJobsRequest { - // Required. The resource name of the Location to list the BatchPredictionJobs - // from. Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The standard list filter. - // - // Supported fields: - // - // * `display_name` supports = and !=. - // - // * `state` supports = and !=. - // - // * `model_display_name` supports = and != - // - // Some examples of using the filter are: - // - // * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - // - // * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - // - // * `NOT display_name="my_job"` - // - // * `state="JOB_STATE_FAILED"` - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListBatchPredictionJobsResponse.next_page_token][google.cloud.aiplatform.v1.ListBatchPredictionJobsResponse.next_page_token] of the previous - // [JobService.ListBatchPredictionJobs][google.cloud.aiplatform.v1.JobService.ListBatchPredictionJobs] call. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for [JobService.ListBatchPredictionJobs][google.cloud.aiplatform.v1.JobService.ListBatchPredictionJobs] -message ListBatchPredictionJobsResponse { - // List of BatchPredictionJobs in the requested page. - repeated BatchPredictionJob batch_prediction_jobs = 1; - - // A token to retrieve the next page of results. - // Pass to [ListBatchPredictionJobsRequest.page_token][google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest.page_token] to obtain that - // page. - string next_page_token = 2; -} - -// Request message for [JobService.DeleteBatchPredictionJob][google.cloud.aiplatform.v1.JobService.DeleteBatchPredictionJob]. -message DeleteBatchPredictionJobRequest { - // Required. The name of the BatchPredictionJob resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/BatchPredictionJob" - } - ]; -} - -// Request message for [JobService.CancelBatchPredictionJob][google.cloud.aiplatform.v1.JobService.CancelBatchPredictionJob]. -message CancelBatchPredictionJobRequest { - // Required. The name of the BatchPredictionJob to cancel. - // Format: - // `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/BatchPredictionJob" - } - ]; -} - -// Request message for -// [JobService.CreateModelDeploymentMonitoringJob][google.cloud.aiplatform.v1.JobService.CreateModelDeploymentMonitoringJob]. -message CreateModelDeploymentMonitoringJobRequest { - // Required. The parent of the ModelDeploymentMonitoringJob. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The ModelDeploymentMonitoringJob to create - ModelDeploymentMonitoringJob model_deployment_monitoring_job = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [JobService.SearchModelDeploymentMonitoringStatsAnomalies][google.cloud.aiplatform.v1.JobService.SearchModelDeploymentMonitoringStatsAnomalies]. -message SearchModelDeploymentMonitoringStatsAnomaliesRequest { - // Stats requested for specific objective. - message StatsAnomaliesObjective { - ModelDeploymentMonitoringObjectiveType type = 1; - - // If set, all attribution scores between - // [SearchModelDeploymentMonitoringStatsAnomaliesRequest.start_time][google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest.start_time] and - // [SearchModelDeploymentMonitoringStatsAnomaliesRequest.end_time][google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest.end_time] are - // fetched, and page token doesn't take affect in this case. - // Only used to retrieve attribution score for the top Features which has - // the highest attribution score in the latest monitoring run. - int32 top_feature_count = 4; - } - - // Required. ModelDeploymentMonitoring Job resource name. - // Format: - // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - string model_deployment_monitoring_job = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" - } - ]; - - // Required. The DeployedModel ID of the - // [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. - string deployed_model_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // The feature display name. If specified, only return the stats belonging to - // this feature. Format: - // [ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name][google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name], - // example: "user_destination". - string feature_display_name = 3; - - // Required. Objectives of the stats to retrieve. - repeated StatsAnomaliesObjective objectives = 4 [(google.api.field_behavior) = REQUIRED]; - - // The standard list page size. - int32 page_size = 5; - - // A page token received from a previous - // [JobService.SearchModelDeploymentMonitoringStatsAnomalies][google.cloud.aiplatform.v1.JobService.SearchModelDeploymentMonitoringStatsAnomalies] - // call. - string page_token = 6; - - // The earliest timestamp of stats being generated. - // If not set, indicates fetching stats till the earliest possible one. - google.protobuf.Timestamp start_time = 7; - - // The latest timestamp of stats being generated. - // If not set, indicates feching stats till the latest possible one. - google.protobuf.Timestamp end_time = 8; -} - -// Response message for -// [JobService.SearchModelDeploymentMonitoringStatsAnomalies][google.cloud.aiplatform.v1.JobService.SearchModelDeploymentMonitoringStatsAnomalies]. -message SearchModelDeploymentMonitoringStatsAnomaliesResponse { - // Stats retrieved for requested objectives. - // There are at most 1000 - // [ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.prediction_stats][google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.prediction_stats] - // in the response. - repeated ModelMonitoringStatsAnomalies monitoring_stats = 1; - - // The page token that can be used by the next - // [JobService.SearchModelDeploymentMonitoringStatsAnomalies][google.cloud.aiplatform.v1.JobService.SearchModelDeploymentMonitoringStatsAnomalies] - // call. - string next_page_token = 2; -} - -// Request message for -// [JobService.GetModelDeploymentMonitoringJob][google.cloud.aiplatform.v1.JobService.GetModelDeploymentMonitoringJob]. -message GetModelDeploymentMonitoringJobRequest { - // Required. The resource name of the ModelDeploymentMonitoringJob. - // Format: - // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" - } - ]; -} - -// Request message for -// [JobService.ListModelDeploymentMonitoringJobs][google.cloud.aiplatform.v1.JobService.ListModelDeploymentMonitoringJobs]. -message ListModelDeploymentMonitoringJobsRequest { - // Required. The parent of the ModelDeploymentMonitoringJob. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The standard list filter. - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - string page_token = 4; - - // Mask specifying which fields to read - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for -// [JobService.ListModelDeploymentMonitoringJobs][google.cloud.aiplatform.v1.JobService.ListModelDeploymentMonitoringJobs]. -message ListModelDeploymentMonitoringJobsResponse { - // A list of ModelDeploymentMonitoringJobs that matches the specified filter - // in the request. - repeated ModelDeploymentMonitoringJob model_deployment_monitoring_jobs = 1; - - // The standard List next-page token. - string next_page_token = 2; -} - -// Request message for -// [JobService.UpdateModelDeploymentMonitoringJob][google.cloud.aiplatform.v1.JobService.UpdateModelDeploymentMonitoringJob]. -message UpdateModelDeploymentMonitoringJobRequest { - // Required. The model monitoring configuration which replaces the resource on the - // server. - ModelDeploymentMonitoringJob model_deployment_monitoring_job = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The update mask is used to specify the fields to be overwritten in the - // ModelDeploymentMonitoringJob resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then only the non-empty fields present in the - // request will be overwritten. Set the update_mask to `*` to override all - // fields. - // For the objective config, the user can either provide the update mask for - // model_deployment_monitoring_objective_configs or any combination of its - // nested fields, such as: - // model_deployment_monitoring_objective_configs.objective_config.training_dataset. - // - // Updatable fields: - // - // * `display_name` - // * `model_deployment_monitoring_schedule_config` - // * `model_monitoring_alert_config` - // * `logging_sampling_strategy` - // * `labels` - // * `log_ttl` - // * `enable_monitoring_pipeline_logs` - // . and - // * `model_deployment_monitoring_objective_configs` - // . or - // * `model_deployment_monitoring_objective_configs.objective_config.training_dataset` - // * `model_deployment_monitoring_objective_configs.objective_config.training_prediction_skew_detection_config` - // * `model_deployment_monitoring_objective_configs.objective_config.prediction_drift_detection_config` - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [JobService.DeleteModelDeploymentMonitoringJob][google.cloud.aiplatform.v1.JobService.DeleteModelDeploymentMonitoringJob]. -message DeleteModelDeploymentMonitoringJobRequest { - // Required. The resource name of the model monitoring job to delete. - // Format: - // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" - } - ]; -} - -// Request message for -// [JobService.PauseModelDeploymentMonitoringJob][google.cloud.aiplatform.v1.JobService.PauseModelDeploymentMonitoringJob]. -message PauseModelDeploymentMonitoringJobRequest { - // Required. The resource name of the ModelDeploymentMonitoringJob to pause. - // Format: - // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" - } - ]; -} - -// Request message for -// [JobService.ResumeModelDeploymentMonitoringJob][google.cloud.aiplatform.v1.JobService.ResumeModelDeploymentMonitoringJob]. -message ResumeModelDeploymentMonitoringJobRequest { - // Required. The resource name of the ModelDeploymentMonitoringJob to resume. - // Format: - // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" - } - ]; -} - -// Runtime operation information for -// [JobService.UpdateModelDeploymentMonitoringJob][google.cloud.aiplatform.v1.JobService.UpdateModelDeploymentMonitoringJob]. -message UpdateModelDeploymentMonitoringJobOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/job_state.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/job_state.proto deleted file mode 100644 index 45b101c0..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/job_state.proto +++ /dev/null @@ -1,66 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "JobStateProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Describes the state of a job. -enum JobState { - // The job state is unspecified. - JOB_STATE_UNSPECIFIED = 0; - - // The job has been just created or resumed and processing has not yet begun. - JOB_STATE_QUEUED = 1; - - // The service is preparing to run the job. - JOB_STATE_PENDING = 2; - - // The job is in progress. - JOB_STATE_RUNNING = 3; - - // The job completed successfully. - JOB_STATE_SUCCEEDED = 4; - - // The job failed. - JOB_STATE_FAILED = 5; - - // The job is being cancelled. From this state the job may only go to - // either `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`. - JOB_STATE_CANCELLING = 6; - - // The job has been cancelled. - JOB_STATE_CANCELLED = 7; - - // The job has been stopped, and can be resumed. - JOB_STATE_PAUSED = 8; - - // The job has expired. - JOB_STATE_EXPIRED = 9; - - // The job is being updated. The job is only able to be updated at RUNNING - // state; if the update operation succeeds, job goes back to RUNNING state; if - // the update operation fails, the job goes back to RUNNING state with error - // messages written to [ModelDeploymentMonitoringJob.partial_errors][] field - // if it is a ModelDeploymentMonitoringJob. - JOB_STATE_UPDATING = 10; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/lineage_subgraph.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/lineage_subgraph.proto deleted file mode 100644 index 7ad020b6..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/lineage_subgraph.proto +++ /dev/null @@ -1,42 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/cloud/aiplatform/v1/artifact.proto"; -import "google/cloud/aiplatform/v1/event.proto"; -import "google/cloud/aiplatform/v1/execution.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "LineageSubgraphProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A subgraph of the overall lineage graph. Event edges connect Artifact and -// Execution nodes. -message LineageSubgraph { - // The Artifact nodes in the subgraph. - repeated Artifact artifacts = 1; - - // The Execution nodes in the subgraph. - repeated Execution executions = 2; - - // The Event edges between Artifacts and Executions in the subgraph. - repeated Event events = 3; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/machine_resources.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/machine_resources.proto deleted file mode 100644 index 9bcf37c1..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/machine_resources.proto +++ /dev/null @@ -1,204 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/cloud/aiplatform/v1/accelerator_type.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "MachineResourcesProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Specification of a single machine. -message MachineSpec { - // Immutable. The type of the machine. - // - // See the [list of machine types supported for - // prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types) - // - // See the [list of machine types supported for custom - // training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types). - // - // For [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] this field is optional, and the default - // value is `n1-standard-2`. For [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob] or as part of - // [WorkerPoolSpec][google.cloud.aiplatform.v1.WorkerPoolSpec] this field is required. - string machine_type = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. The type of accelerator(s) that may be attached to the machine as per - // [accelerator_count][google.cloud.aiplatform.v1.MachineSpec.accelerator_count]. - AcceleratorType accelerator_type = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // The number of accelerators to attach to the machine. - int32 accelerator_count = 3; -} - -// A description of resources that are dedicated to a DeployedModel, and -// that need a higher degree of manual configuration. -message DedicatedResources { - // Required. Immutable. The specification of a single machine used by the prediction. - MachineSpec machine_spec = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Required. Immutable. The minimum number of machine replicas this DeployedModel will be always - // deployed on. This value must be greater than or equal to 1. - // - // If traffic against the DeployedModel increases, it may dynamically be - // deployed onto more replicas, and as traffic decreases, some of these extra - // replicas may be freed. - int32 min_replica_count = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Immutable. The maximum number of replicas this DeployedModel may be deployed on when - // the traffic against it increases. If the requested value is too large, - // the deployment will error, but if deployment succeeds then the ability - // to scale the model to that many replicas is guaranteed (barring service - // outages). If traffic against the DeployedModel increases beyond what its - // replicas at maximum may handle, a portion of the traffic will be dropped. - // If this value is not provided, will use [min_replica_count][google.cloud.aiplatform.v1.DedicatedResources.min_replica_count] as the - // default value. - // - // The value of this field impacts the charge against Vertex CPU and GPU - // quotas. Specifically, you will be charged for (max_replica_count * - // number of cores in the selected machine type) and (max_replica_count * - // number of GPUs per replica in the selected machine type). - int32 max_replica_count = 3 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. The metric specifications that overrides a resource - // utilization metric (CPU utilization, accelerator's duty cycle, and so on) - // target value (default to 60 if not set). At most one entry is allowed per - // metric. - // - // If [machine_spec.accelerator_count][google.cloud.aiplatform.v1.MachineSpec.accelerator_count] is - // above 0, the autoscaling will be based on both CPU utilization and - // accelerator's duty cycle metrics and scale up when either metrics exceeds - // its target value while scale down if both metrics are under their target - // value. The default target value is 60 for both metrics. - // - // If [machine_spec.accelerator_count][google.cloud.aiplatform.v1.MachineSpec.accelerator_count] is - // 0, the autoscaling will be based on CPU utilization metric only with - // default target value 60 if not explicitly set. - // - // For example, in the case of Online Prediction, if you want to override - // target CPU utilization to 80, you should set - // [autoscaling_metric_specs.metric_name][google.cloud.aiplatform.v1.AutoscalingMetricSpec.metric_name] - // to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and - // [autoscaling_metric_specs.target][google.cloud.aiplatform.v1.AutoscalingMetricSpec.target] to `80`. - repeated AutoscalingMetricSpec autoscaling_metric_specs = 4 [(google.api.field_behavior) = IMMUTABLE]; -} - -// A description of resources that to large degree are decided by Vertex AI, -// and require only a modest additional configuration. -// Each Model supporting these resources documents its specific guidelines. -message AutomaticResources { - // Immutable. The minimum number of replicas this DeployedModel will be always deployed - // on. If traffic against it increases, it may dynamically be deployed onto - // more replicas up to [max_replica_count][google.cloud.aiplatform.v1.AutomaticResources.max_replica_count], and as traffic decreases, some - // of these extra replicas may be freed. - // If the requested value is too large, the deployment will error. - int32 min_replica_count = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. The maximum number of replicas this DeployedModel may be deployed on when - // the traffic against it increases. If the requested value is too large, - // the deployment will error, but if deployment succeeds then the ability - // to scale the model to that many replicas is guaranteed (barring service - // outages). If traffic against the DeployedModel increases beyond what its - // replicas at maximum may handle, a portion of the traffic will be dropped. - // If this value is not provided, a no upper bound for scaling under heavy - // traffic will be assume, though Vertex AI may be unable to scale beyond - // certain replica number. - int32 max_replica_count = 2 [(google.api.field_behavior) = IMMUTABLE]; -} - -// A description of resources that are used for performing batch operations, are -// dedicated to a Model, and need manual configuration. -message BatchDedicatedResources { - // Required. Immutable. The specification of a single machine. - MachineSpec machine_spec = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Immutable. The number of machine replicas used at the start of the batch operation. - // If not set, Vertex AI decides starting number, not greater than - // [max_replica_count][google.cloud.aiplatform.v1.BatchDedicatedResources.max_replica_count] - int32 starting_replica_count = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. The maximum number of machine replicas the batch operation may be scaled - // to. The default value is 10. - int32 max_replica_count = 3 [(google.api.field_behavior) = IMMUTABLE]; -} - -// Statistics information about resource consumption. -message ResourcesConsumed { - // Output only. The number of replica hours used. Note that many replicas may run in - // parallel, and additionally any given work may be queued for some time. - // Therefore this value is not strictly related to wall time. - double replica_hours = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Represents the spec of disk options. -message DiskSpec { - // Type of the boot disk (default is "pd-ssd"). - // Valid values: "pd-ssd" (Persistent Disk Solid State Drive) or - // "pd-standard" (Persistent Disk Hard Disk Drive). - string boot_disk_type = 1; - - // Size in GB of the boot disk (default is 100GB). - int32 boot_disk_size_gb = 2; -} - -// Represents a mount configuration for Network File System (NFS) to mount. -message NfsMount { - // Required. IP address of the NFS server. - string server = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Source path exported from NFS server. - // Has to start with '/', and combined with the ip address, it indicates - // the source mount path in the form of `server:path` - string path = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Destination mount path. The NFS will be mounted for the user under - // /mnt/nfs/ - string mount_point = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The metric specification that defines the target resource utilization -// (CPU utilization, accelerator's duty cycle, and so on) for calculating the -// desired replica count. -message AutoscalingMetricSpec { - // Required. The resource metric name. - // Supported metrics: - // - // * For Online Prediction: - // * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle` - // * `aiplatform.googleapis.com/prediction/online/cpu/utilization` - string metric_name = 1 [(google.api.field_behavior) = REQUIRED]; - - // The target resource utilization in percentage (1% - 100%) for the given - // metric; once the real usage deviates from the target by a certain - // percentage, the machine replicas change. The default value is 60 - // (representing 60%) if not provided. - int32 target = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto deleted file mode 100644 index 54002126..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto +++ /dev/null @@ -1,39 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ManualBatchTuningParametersProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Manual batch tuning parameters. -message ManualBatchTuningParameters { - // Immutable. The number of the records (e.g. instances) of the operation given in - // each batch to a machine replica. Machine type, and size of a single - // record should be considered when setting this parameter, higher value - // speeds up the batch operation's execution, but too high value will result - // in a whole batch not fitting in a machine's memory, and the whole - // operation will fail. - // The default value is 4. - int32 batch_size = 1 [(google.api.field_behavior) = IMMUTABLE]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_schema.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_schema.proto deleted file mode 100644 index b00a1552..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_schema.proto +++ /dev/null @@ -1,79 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "MetadataSchemaProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Instance of a general MetadataSchema. -message MetadataSchema { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/MetadataSchema" - pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}" - }; - - // Describes the type of the MetadataSchema. - enum MetadataSchemaType { - // Unspecified type for the MetadataSchema. - METADATA_SCHEMA_TYPE_UNSPECIFIED = 0; - - // A type indicating that the MetadataSchema will be used by Artifacts. - ARTIFACT_TYPE = 1; - - // A typee indicating that the MetadataSchema will be used by Executions. - EXECUTION_TYPE = 2; - - // A state indicating that the MetadataSchema will be used by Contexts. - CONTEXT_TYPE = 3; - } - - // Output only. The resource name of the MetadataSchema. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The version of the MetadataSchema. The version's format must match - // the following regular expression: `^[0-9]+[.][0-9]+[.][0-9]+$`, which would - // allow to order/compare different versions. Example: 1.0.0, 1.0.1, etc. - string schema_version = 2; - - // Required. The raw YAML string representation of the MetadataSchema. The combination - // of [MetadataSchema.version] and the schema name given by `title` in - // [MetadataSchema.schema] must be unique within a MetadataStore. - // - // The schema is defined as an OpenAPI 3.0.2 - // [MetadataSchema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject) - string schema = 3 [(google.api.field_behavior) = REQUIRED]; - - // The type of the MetadataSchema. This is a property that identifies which - // metadata types will use the MetadataSchema. - MetadataSchemaType schema_type = 4; - - // Output only. Timestamp when this MetadataSchema was created. - google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Description of the Metadata Schema - string description = 6; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_service.proto deleted file mode 100644 index c601d46a..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_service.proto +++ /dev/null @@ -1,1257 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/artifact.proto"; -import "google/cloud/aiplatform/v1/context.proto"; -import "google/cloud/aiplatform/v1/event.proto"; -import "google/cloud/aiplatform/v1/execution.proto"; -import "google/cloud/aiplatform/v1/lineage_subgraph.proto"; -import "google/cloud/aiplatform/v1/metadata_schema.proto"; -import "google/cloud/aiplatform/v1/metadata_store.proto"; -import "google/cloud/aiplatform/v1/operation.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "MetadataServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Service for reading and writing metadata entries. -service MetadataService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Initializes a MetadataStore, including allocation of resources. - rpc CreateMetadataStore(CreateMetadataStoreRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/metadataStores" - body: "metadata_store" - }; - option (google.api.method_signature) = "parent,metadata_store,metadata_store_id"; - option (google.longrunning.operation_info) = { - response_type: "MetadataStore" - metadata_type: "CreateMetadataStoreOperationMetadata" - }; - } - - // Retrieves a specific MetadataStore. - rpc GetMetadataStore(GetMetadataStoreRequest) returns (MetadataStore) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/metadataStores/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists MetadataStores for a Location. - rpc ListMetadataStores(ListMetadataStoresRequest) returns (ListMetadataStoresResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/metadataStores" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a single MetadataStore and all its child resources (Artifacts, - // Executions, and Contexts). - rpc DeleteMetadataStore(DeleteMetadataStoreRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/metadataStores/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteMetadataStoreOperationMetadata" - }; - } - - // Creates an Artifact associated with a MetadataStore. - rpc CreateArtifact(CreateArtifactRequest) returns (Artifact) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/metadataStores/*}/artifacts" - body: "artifact" - }; - option (google.api.method_signature) = "parent,artifact,artifact_id"; - } - - // Retrieves a specific Artifact. - rpc GetArtifact(GetArtifactRequest) returns (Artifact) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Artifacts in the MetadataStore. - rpc ListArtifacts(ListArtifactsRequest) returns (ListArtifactsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/metadataStores/*}/artifacts" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates a stored Artifact. - rpc UpdateArtifact(UpdateArtifactRequest) returns (Artifact) { - option (google.api.http) = { - patch: "/v1/{artifact.name=projects/*/locations/*/metadataStores/*/artifacts/*}" - body: "artifact" - }; - option (google.api.method_signature) = "artifact,update_mask"; - } - - // Deletes an Artifact. - rpc DeleteArtifact(DeleteArtifactRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Purges Artifacts. - rpc PurgeArtifacts(PurgeArtifactsRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/metadataStores/*}/artifacts:purge" - body: "*" - }; - option (google.api.method_signature) = "parent"; - option (google.longrunning.operation_info) = { - response_type: "PurgeArtifactsResponse" - metadata_type: "PurgeArtifactsMetadata" - }; - } - - // Creates a Context associated with a MetadataStore. - rpc CreateContext(CreateContextRequest) returns (Context) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/metadataStores/*}/contexts" - body: "context" - }; - option (google.api.method_signature) = "parent,context,context_id"; - } - - // Retrieves a specific Context. - rpc GetContext(GetContextRequest) returns (Context) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Contexts on the MetadataStore. - rpc ListContexts(ListContextsRequest) returns (ListContextsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/metadataStores/*}/contexts" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates a stored Context. - rpc UpdateContext(UpdateContextRequest) returns (Context) { - option (google.api.http) = { - patch: "/v1/{context.name=projects/*/locations/*/metadataStores/*/contexts/*}" - body: "context" - }; - option (google.api.method_signature) = "context,update_mask"; - } - - // Deletes a stored Context. - rpc DeleteContext(DeleteContextRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Purges Contexts. - rpc PurgeContexts(PurgeContextsRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/metadataStores/*}/contexts:purge" - body: "*" - }; - option (google.api.method_signature) = "parent"; - option (google.longrunning.operation_info) = { - response_type: "PurgeContextsResponse" - metadata_type: "PurgeContextsMetadata" - }; - } - - // Adds a set of Artifacts and Executions to a Context. If any of the - // Artifacts or Executions have already been added to a Context, they are - // simply skipped. - rpc AddContextArtifactsAndExecutions(AddContextArtifactsAndExecutionsRequest) returns (AddContextArtifactsAndExecutionsResponse) { - option (google.api.http) = { - post: "/v1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:addContextArtifactsAndExecutions" - body: "*" - }; - option (google.api.method_signature) = "context,artifacts,executions"; - } - - // Adds a set of Contexts as children to a parent Context. If any of the - // child Contexts have already been added to the parent Context, they are - // simply skipped. If this call would create a cycle or cause any Context to - // have more than 10 parents, the request will fail with an INVALID_ARGUMENT - // error. - rpc AddContextChildren(AddContextChildrenRequest) returns (AddContextChildrenResponse) { - option (google.api.http) = { - post: "/v1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:addContextChildren" - body: "*" - }; - option (google.api.method_signature) = "context,child_contexts"; - } - - // Retrieves Artifacts and Executions within the specified Context, connected - // by Event edges and returned as a LineageSubgraph. - rpc QueryContextLineageSubgraph(QueryContextLineageSubgraphRequest) returns (LineageSubgraph) { - option (google.api.http) = { - get: "/v1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:queryContextLineageSubgraph" - }; - option (google.api.method_signature) = "context"; - } - - // Creates an Execution associated with a MetadataStore. - rpc CreateExecution(CreateExecutionRequest) returns (Execution) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/metadataStores/*}/executions" - body: "execution" - }; - option (google.api.method_signature) = "parent,execution,execution_id"; - } - - // Retrieves a specific Execution. - rpc GetExecution(GetExecutionRequest) returns (Execution) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/metadataStores/*/executions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Executions in the MetadataStore. - rpc ListExecutions(ListExecutionsRequest) returns (ListExecutionsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/metadataStores/*}/executions" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates a stored Execution. - rpc UpdateExecution(UpdateExecutionRequest) returns (Execution) { - option (google.api.http) = { - patch: "/v1/{execution.name=projects/*/locations/*/metadataStores/*/executions/*}" - body: "execution" - }; - option (google.api.method_signature) = "execution,update_mask"; - } - - // Deletes an Execution. - rpc DeleteExecution(DeleteExecutionRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/metadataStores/*/executions/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Purges Executions. - rpc PurgeExecutions(PurgeExecutionsRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/metadataStores/*}/executions:purge" - body: "*" - }; - option (google.api.method_signature) = "parent"; - option (google.longrunning.operation_info) = { - response_type: "PurgeExecutionsResponse" - metadata_type: "PurgeExecutionsMetadata" - }; - } - - // Adds Events to the specified Execution. An Event indicates whether an - // Artifact was used as an input or output for an Execution. If an Event - // already exists between the Execution and the Artifact, the Event is - // skipped. - rpc AddExecutionEvents(AddExecutionEventsRequest) returns (AddExecutionEventsResponse) { - option (google.api.http) = { - post: "/v1/{execution=projects/*/locations/*/metadataStores/*/executions/*}:addExecutionEvents" - body: "*" - }; - option (google.api.method_signature) = "execution,events"; - } - - // Obtains the set of input and output Artifacts for this Execution, in the - // form of LineageSubgraph that also contains the Execution and connecting - // Events. - rpc QueryExecutionInputsAndOutputs(QueryExecutionInputsAndOutputsRequest) returns (LineageSubgraph) { - option (google.api.http) = { - get: "/v1/{execution=projects/*/locations/*/metadataStores/*/executions/*}:queryExecutionInputsAndOutputs" - }; - option (google.api.method_signature) = "execution"; - } - - // Creates a MetadataSchema. - rpc CreateMetadataSchema(CreateMetadataSchemaRequest) returns (MetadataSchema) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/metadataStores/*}/metadataSchemas" - body: "metadata_schema" - }; - option (google.api.method_signature) = "parent,metadata_schema,metadata_schema_id"; - } - - // Retrieves a specific MetadataSchema. - rpc GetMetadataSchema(GetMetadataSchemaRequest) returns (MetadataSchema) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/metadataStores/*/metadataSchemas/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists MetadataSchemas. - rpc ListMetadataSchemas(ListMetadataSchemasRequest) returns (ListMetadataSchemasResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/metadataStores/*}/metadataSchemas" - }; - option (google.api.method_signature) = "parent"; - } - - // Retrieves lineage of an Artifact represented through Artifacts and - // Executions connected by Event edges and returned as a LineageSubgraph. - rpc QueryArtifactLineageSubgraph(QueryArtifactLineageSubgraphRequest) returns (LineageSubgraph) { - option (google.api.http) = { - get: "/v1/{artifact=projects/*/locations/*/metadataStores/*/artifacts/*}:queryArtifactLineageSubgraph" - }; - option (google.api.method_signature) = "artifact"; - } -} - -// Request message for [MetadataService.CreateMetadataStore][google.cloud.aiplatform.v1.MetadataService.CreateMetadataStore]. -message CreateMetadataStoreRequest { - // Required. The resource name of the Location where the MetadataStore should - // be created. - // Format: `projects/{project}/locations/{location}/` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The MetadataStore to create. - MetadataStore metadata_store = 2 [(google.api.field_behavior) = REQUIRED]; - - // The {metadatastore} portion of the resource name with the format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - // If not provided, the MetadataStore's ID will be a UUID generated by the - // service. - // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. - // Must be unique across all MetadataStores in the parent Location. - // (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED - // if the caller can't view the preexisting MetadataStore.) - string metadata_store_id = 3; -} - -// Details of operations that perform [MetadataService.CreateMetadataStore][google.cloud.aiplatform.v1.MetadataService.CreateMetadataStore]. -message CreateMetadataStoreOperationMetadata { - // Operation metadata for creating a MetadataStore. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [MetadataService.GetMetadataStore][google.cloud.aiplatform.v1.MetadataService.GetMetadataStore]. -message GetMetadataStoreRequest { - // Required. The resource name of the MetadataStore to retrieve. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/MetadataStore" - } - ]; -} - -// Request message for [MetadataService.ListMetadataStores][google.cloud.aiplatform.v1.MetadataService.ListMetadataStores]. -message ListMetadataStoresRequest { - // Required. The Location whose MetadataStores should be listed. - // Format: - // `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The maximum number of Metadata Stores to return. The service may return - // fewer. - // Must be in range 1-1000, inclusive. Defaults to 100. - int32 page_size = 2; - - // A page token, received from a previous - // [MetadataService.ListMetadataStores][google.cloud.aiplatform.v1.MetadataService.ListMetadataStores] call. Provide this to retrieve the - // subsequent page. - // - // When paginating, all other provided parameters must match the call that - // provided the page token. (Otherwise the request will fail with - // INVALID_ARGUMENT error.) - string page_token = 3; -} - -// Response message for [MetadataService.ListMetadataStores][google.cloud.aiplatform.v1.MetadataService.ListMetadataStores]. -message ListMetadataStoresResponse { - // The MetadataStores found for the Location. - repeated MetadataStore metadata_stores = 1; - - // A token, which can be sent as - // [ListMetadataStoresRequest.page_token][google.cloud.aiplatform.v1.ListMetadataStoresRequest.page_token] to retrieve the next - // page. If this field is not populated, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [MetadataService.DeleteMetadataStore][google.cloud.aiplatform.v1.MetadataService.DeleteMetadataStore]. -message DeleteMetadataStoreRequest { - // Required. The resource name of the MetadataStore to delete. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/MetadataStore" - } - ]; - - // Deprecated: Field is no longer supported. - bool force = 2 [deprecated = true]; -} - -// Details of operations that perform [MetadataService.DeleteMetadataStore][google.cloud.aiplatform.v1.MetadataService.DeleteMetadataStore]. -message DeleteMetadataStoreOperationMetadata { - // Operation metadata for deleting a MetadataStore. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [MetadataService.CreateArtifact][google.cloud.aiplatform.v1.MetadataService.CreateArtifact]. -message CreateArtifactRequest { - // Required. The resource name of the MetadataStore where the Artifact should - // be created. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/MetadataStore" - } - ]; - - // Required. The Artifact to create. - Artifact artifact = 2 [(google.api.field_behavior) = REQUIRED]; - - // The {artifact} portion of the resource name with the format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - // If not provided, the Artifact's ID will be a UUID generated by the service. - // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. - // Must be unique across all Artifacts in the parent MetadataStore. (Otherwise - // the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the - // caller can't view the preexisting Artifact.) - string artifact_id = 3; -} - -// Request message for [MetadataService.GetArtifact][google.cloud.aiplatform.v1.MetadataService.GetArtifact]. -message GetArtifactRequest { - // Required. The resource name of the Artifact to retrieve. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Artifact" - } - ]; -} - -// Request message for [MetadataService.ListArtifacts][google.cloud.aiplatform.v1.MetadataService.ListArtifacts]. -message ListArtifactsRequest { - // Required. The MetadataStore whose Artifacts should be listed. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Artifact" - } - ]; - - // The maximum number of Artifacts to return. The service may return fewer. - // Must be in range 1-1000, inclusive. Defaults to 100. - int32 page_size = 2; - - // A page token, received from a previous [MetadataService.ListArtifacts][google.cloud.aiplatform.v1.MetadataService.ListArtifacts] - // call. Provide this to retrieve the subsequent page. - // - // When paginating, all other provided parameters must match the call that - // provided the page token. (Otherwise the request will fail with - // INVALID_ARGUMENT error.) - string page_token = 3; - - // Filter specifying the boolean condition for the Artifacts to satisfy in - // order to be part of the result set. - // The syntax to define filter query is based on https://google.aip.dev/160. - // The supported set of filters include the following: - // - // * **Attribute filtering**: - // For example: `display_name = "test"`. - // Supported fields include: `name`, `display_name`, `uri`, `state`, - // `schema_title`, `create_time`, and `update_time`. - // Time fields, such as `create_time` and `update_time`, require values - // specified in RFC-3339 format. - // For example: `create_time = "2020-11-19T11:30:00-04:00"` - // * **Metadata field**: - // To filter on metadata fields use traversal operation as follows: - // `metadata..`. - // For example: `metadata.field_1.number_value = 10.0` - // * **Context based filtering**: - // To filter Artifacts based on the contexts to which they belong, use the - // function operator with the full resource name - // `in_context()`. - // For example: - // `in_context("projects//locations//metadataStores//contexts/")` - // - // Each of the above supported filter types can be combined together using - // logical operators (`AND` & `OR`). - // - // For example: `display_name = "test" AND metadata.field1.bool_value = true`. - string filter = 4; -} - -// Response message for [MetadataService.ListArtifacts][google.cloud.aiplatform.v1.MetadataService.ListArtifacts]. -message ListArtifactsResponse { - // The Artifacts retrieved from the MetadataStore. - repeated Artifact artifacts = 1; - - // A token, which can be sent as [ListArtifactsRequest.page_token][google.cloud.aiplatform.v1.ListArtifactsRequest.page_token] - // to retrieve the next page. - // If this field is not populated, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [MetadataService.UpdateArtifact][google.cloud.aiplatform.v1.MetadataService.UpdateArtifact]. -message UpdateArtifactRequest { - // Required. The Artifact containing updates. - // The Artifact's [Artifact.name][google.cloud.aiplatform.v1.Artifact.name] field is used to identify the Artifact to - // be updated. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - Artifact artifact = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A FieldMask indicating which fields should be updated. - // Functionality of this field is not yet supported. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; - - // If set to true, and the [Artifact][google.cloud.aiplatform.v1.Artifact] is not found, a new [Artifact][google.cloud.aiplatform.v1.Artifact] is - // created. - bool allow_missing = 3; -} - -// Request message for [MetadataService.DeleteArtifact][google.cloud.aiplatform.v1.MetadataService.DeleteArtifact]. -message DeleteArtifactRequest { - // Required. The resource name of the Artifact to delete. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Artifact" - } - ]; - - // Optional. The etag of the Artifact to delete. - // If this is provided, it must match the server's etag. Otherwise, the - // request will fail with a FAILED_PRECONDITION. - string etag = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for [MetadataService.PurgeArtifacts][google.cloud.aiplatform.v1.MetadataService.PurgeArtifacts]. -message PurgeArtifactsRequest { - // Required. The metadata store to purge Artifacts from. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Artifact" - } - ]; - - // Required. A required filter matching the Artifacts to be purged. - // E.g., `update_time <= 2020-11-19T11:30:00-04:00`. - string filter = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Flag to indicate to actually perform the purge. - // If `force` is set to false, the method will return a sample of - // Artifact names that would be deleted. - bool force = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for [MetadataService.PurgeArtifacts][google.cloud.aiplatform.v1.MetadataService.PurgeArtifacts]. -message PurgeArtifactsResponse { - // The number of Artifacts that this request deleted (or, if `force` is false, - // the number of Artifacts that will be deleted). This can be an estimate. - int64 purge_count = 1; - - // A sample of the Artifact names that will be deleted. - // Only populated if `force` is set to false. The maximum number of samples is - // 100 (it is possible to return fewer). - repeated string purge_sample = 2 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Artifact" - }]; -} - -// Details of operations that perform [MetadataService.PurgeArtifacts][google.cloud.aiplatform.v1.MetadataService.PurgeArtifacts]. -message PurgeArtifactsMetadata { - // Operation metadata for purging Artifacts. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [MetadataService.CreateContext][google.cloud.aiplatform.v1.MetadataService.CreateContext]. -message CreateContextRequest { - // Required. The resource name of the MetadataStore where the Context should be - // created. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/MetadataStore" - } - ]; - - // Required. The Context to create. - Context context = 2 [(google.api.field_behavior) = REQUIRED]; - - // The {context} portion of the resource name with the format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`. - // If not provided, the Context's ID will be a UUID generated by the service. - // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. - // Must be unique across all Contexts in the parent MetadataStore. (Otherwise - // the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the - // caller can't view the preexisting Context.) - string context_id = 3; -} - -// Request message for [MetadataService.GetContext][google.cloud.aiplatform.v1.MetadataService.GetContext]. -message GetContextRequest { - // Required. The resource name of the Context to retrieve. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - } - ]; -} - -// Request message for [MetadataService.ListContexts][google.cloud.aiplatform.v1.MetadataService.ListContexts] -message ListContextsRequest { - // Required. The MetadataStore whose Contexts should be listed. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Context" - } - ]; - - // The maximum number of Contexts to return. The service may return fewer. - // Must be in range 1-1000, inclusive. Defaults to 100. - int32 page_size = 2; - - // A page token, received from a previous [MetadataService.ListContexts][google.cloud.aiplatform.v1.MetadataService.ListContexts] - // call. Provide this to retrieve the subsequent page. - // - // When paginating, all other provided parameters must match the call that - // provided the page token. (Otherwise the request will fail with - // INVALID_ARGUMENT error.) - string page_token = 3; - - // Filter specifying the boolean condition for the Contexts to satisfy in - // order to be part of the result set. - // The syntax to define filter query is based on https://google.aip.dev/160. - // Following are the supported set of filters: - // - // * **Attribute filtering**: - // For example: `display_name = "test"`. - // Supported fields include: `name`, `display_name`, `schema_title`, - // `create_time`, and `update_time`. - // Time fields, such as `create_time` and `update_time`, require values - // specified in RFC-3339 format. - // For example: `create_time = "2020-11-19T11:30:00-04:00"`. - // * **Metadata field**: - // To filter on metadata fields use traversal operation as follows: - // `metadata..`. - // For example: `metadata.field_1.number_value = 10.0`. - // * **Parent Child filtering**: - // To filter Contexts based on parent-child relationship use the HAS - // operator as follows: - // - // ``` - // parent_contexts: - // "projects//locations//metadataStores//contexts/" - // child_contexts: - // "projects//locations//metadataStores//contexts/" - // ``` - // - // Each of the above supported filters can be combined together using - // logical operators (`AND` & `OR`). - // - // For example: `display_name = "test" AND metadata.field1.bool_value = true`. - string filter = 4; -} - -// Response message for [MetadataService.ListContexts][google.cloud.aiplatform.v1.MetadataService.ListContexts]. -message ListContextsResponse { - // The Contexts retrieved from the MetadataStore. - repeated Context contexts = 1; - - // A token, which can be sent as [ListContextsRequest.page_token][google.cloud.aiplatform.v1.ListContextsRequest.page_token] - // to retrieve the next page. - // If this field is not populated, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [MetadataService.UpdateContext][google.cloud.aiplatform.v1.MetadataService.UpdateContext]. -message UpdateContextRequest { - // Required. The Context containing updates. - // The Context's [Context.name][google.cloud.aiplatform.v1.Context.name] field is used to identify the Context to be - // updated. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - Context context = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A FieldMask indicating which fields should be updated. - // Functionality of this field is not yet supported. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; - - // If set to true, and the [Context][google.cloud.aiplatform.v1.Context] is not found, a new [Context][google.cloud.aiplatform.v1.Context] is - // created. - bool allow_missing = 3; -} - -// Request message for [MetadataService.DeleteContext][google.cloud.aiplatform.v1.MetadataService.DeleteContext]. -message DeleteContextRequest { - // Required. The resource name of the Context to delete. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - } - ]; - - // The force deletion semantics is still undefined. - // Users should not use this field. - bool force = 2; - - // Optional. The etag of the Context to delete. - // If this is provided, it must match the server's etag. Otherwise, the - // request will fail with a FAILED_PRECONDITION. - string etag = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for [MetadataService.PurgeContexts][google.cloud.aiplatform.v1.MetadataService.PurgeContexts]. -message PurgeContextsRequest { - // Required. The metadata store to purge Contexts from. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Context" - } - ]; - - // Required. A required filter matching the Contexts to be purged. - // E.g., `update_time <= 2020-11-19T11:30:00-04:00`. - string filter = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Flag to indicate to actually perform the purge. - // If `force` is set to false, the method will return a sample of - // Context names that would be deleted. - bool force = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for [MetadataService.PurgeContexts][google.cloud.aiplatform.v1.MetadataService.PurgeContexts]. -message PurgeContextsResponse { - // The number of Contexts that this request deleted (or, if `force` is false, - // the number of Contexts that will be deleted). This can be an estimate. - int64 purge_count = 1; - - // A sample of the Context names that will be deleted. - // Only populated if `force` is set to false. The maximum number of samples is - // 100 (it is possible to return fewer). - repeated string purge_sample = 2 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - }]; -} - -// Details of operations that perform [MetadataService.PurgeContexts][google.cloud.aiplatform.v1.MetadataService.PurgeContexts]. -message PurgeContextsMetadata { - // Operation metadata for purging Contexts. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [MetadataService.AddContextArtifactsAndExecutions][google.cloud.aiplatform.v1.MetadataService.AddContextArtifactsAndExecutions]. -message AddContextArtifactsAndExecutionsRequest { - // Required. The resource name of the Context that the Artifacts and Executions - // belong to. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - string context = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - } - ]; - - // The resource names of the Artifacts to attribute to the Context. - // - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - repeated string artifacts = 2 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Artifact" - }]; - - // The resource names of the Executions to associate with the - // Context. - // - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - repeated string executions = 3 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Execution" - }]; -} - -// Response message for [MetadataService.AddContextArtifactsAndExecutions][google.cloud.aiplatform.v1.MetadataService.AddContextArtifactsAndExecutions]. -message AddContextArtifactsAndExecutionsResponse { - -} - -// Request message for [MetadataService.AddContextChildren][google.cloud.aiplatform.v1.MetadataService.AddContextChildren]. -message AddContextChildrenRequest { - // Required. The resource name of the parent Context. - // - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - string context = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - } - ]; - - // The resource names of the child Contexts. - repeated string child_contexts = 2 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - }]; -} - -// Response message for [MetadataService.AddContextChildren][google.cloud.aiplatform.v1.MetadataService.AddContextChildren]. -message AddContextChildrenResponse { - -} - -// Request message for [MetadataService.QueryContextLineageSubgraph][google.cloud.aiplatform.v1.MetadataService.QueryContextLineageSubgraph]. -message QueryContextLineageSubgraphRequest { - // Required. The resource name of the Context whose Artifacts and Executions - // should be retrieved as a LineageSubgraph. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - // - // The request may error with FAILED_PRECONDITION if the number of Artifacts, - // the number of Executions, or the number of Events that would be returned - // for the Context exceeds 1000. - string context = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - } - ]; -} - -// Request message for [MetadataService.CreateExecution][google.cloud.aiplatform.v1.MetadataService.CreateExecution]. -message CreateExecutionRequest { - // Required. The resource name of the MetadataStore where the Execution should - // be created. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/MetadataStore" - } - ]; - - // Required. The Execution to create. - Execution execution = 2 [(google.api.field_behavior) = REQUIRED]; - - // The {execution} portion of the resource name with the format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - // If not provided, the Execution's ID will be a UUID generated by the - // service. - // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. - // Must be unique across all Executions in the parent MetadataStore. - // (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED - // if the caller can't view the preexisting Execution.) - string execution_id = 3; -} - -// Request message for [MetadataService.GetExecution][google.cloud.aiplatform.v1.MetadataService.GetExecution]. -message GetExecutionRequest { - // Required. The resource name of the Execution to retrieve. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Execution" - } - ]; -} - -// Request message for [MetadataService.ListExecutions][google.cloud.aiplatform.v1.MetadataService.ListExecutions]. -message ListExecutionsRequest { - // Required. The MetadataStore whose Executions should be listed. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Execution" - } - ]; - - // The maximum number of Executions to return. The service may return fewer. - // Must be in range 1-1000, inclusive. Defaults to 100. - int32 page_size = 2; - - // A page token, received from a previous [MetadataService.ListExecutions][google.cloud.aiplatform.v1.MetadataService.ListExecutions] - // call. Provide this to retrieve the subsequent page. - // - // When paginating, all other provided parameters must match the call that - // provided the page token. (Otherwise the request will fail with an - // INVALID_ARGUMENT error.) - string page_token = 3; - - // Filter specifying the boolean condition for the Executions to satisfy in - // order to be part of the result set. - // The syntax to define filter query is based on https://google.aip.dev/160. - // Following are the supported set of filters: - // - // * **Attribute filtering**: - // For example: `display_name = "test"`. - // Supported fields include: `name`, `display_name`, `state`, - // `schema_title`, `create_time`, and `update_time`. - // Time fields, such as `create_time` and `update_time`, require values - // specified in RFC-3339 format. - // For example: `create_time = "2020-11-19T11:30:00-04:00"`. - // * **Metadata field**: - // To filter on metadata fields use traversal operation as follows: - // `metadata..` - // For example: `metadata.field_1.number_value = 10.0` - // * **Context based filtering**: - // To filter Executions based on the contexts to which they belong use - // the function operator with the full resource name: - // `in_context()`. - // For example: - // `in_context("projects//locations//metadataStores//contexts/")` - // - // Each of the above supported filters can be combined together using - // logical operators (`AND` & `OR`). - // For example: `display_name = "test" AND metadata.field1.bool_value = true`. - string filter = 4; -} - -// Response message for [MetadataService.ListExecutions][google.cloud.aiplatform.v1.MetadataService.ListExecutions]. -message ListExecutionsResponse { - // The Executions retrieved from the MetadataStore. - repeated Execution executions = 1; - - // A token, which can be sent as [ListExecutionsRequest.page_token][google.cloud.aiplatform.v1.ListExecutionsRequest.page_token] - // to retrieve the next page. - // If this field is not populated, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [MetadataService.UpdateExecution][google.cloud.aiplatform.v1.MetadataService.UpdateExecution]. -message UpdateExecutionRequest { - // Required. The Execution containing updates. - // The Execution's [Execution.name][google.cloud.aiplatform.v1.Execution.name] field is used to identify the Execution - // to be updated. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - Execution execution = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A FieldMask indicating which fields should be updated. - // Functionality of this field is not yet supported. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; - - // If set to true, and the [Execution][google.cloud.aiplatform.v1.Execution] is not found, a new [Execution][google.cloud.aiplatform.v1.Execution] - // is created. - bool allow_missing = 3; -} - -// Request message for [MetadataService.DeleteExecution][google.cloud.aiplatform.v1.MetadataService.DeleteExecution]. -message DeleteExecutionRequest { - // Required. The resource name of the Execution to delete. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Execution" - } - ]; - - // Optional. The etag of the Execution to delete. - // If this is provided, it must match the server's etag. Otherwise, the - // request will fail with a FAILED_PRECONDITION. - string etag = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for [MetadataService.PurgeExecutions][google.cloud.aiplatform.v1.MetadataService.PurgeExecutions]. -message PurgeExecutionsRequest { - // Required. The metadata store to purge Executions from. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Execution" - } - ]; - - // Required. A required filter matching the Executions to be purged. - // E.g., `update_time <= 2020-11-19T11:30:00-04:00`. - string filter = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Flag to indicate to actually perform the purge. - // If `force` is set to false, the method will return a sample of - // Execution names that would be deleted. - bool force = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for [MetadataService.PurgeExecutions][google.cloud.aiplatform.v1.MetadataService.PurgeExecutions]. -message PurgeExecutionsResponse { - // The number of Executions that this request deleted (or, if `force` is - // false, the number of Executions that will be deleted). This can be an - // estimate. - int64 purge_count = 1; - - // A sample of the Execution names that will be deleted. - // Only populated if `force` is set to false. The maximum number of samples is - // 100 (it is possible to return fewer). - repeated string purge_sample = 2 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Execution" - }]; -} - -// Details of operations that perform [MetadataService.PurgeExecutions][google.cloud.aiplatform.v1.MetadataService.PurgeExecutions]. -message PurgeExecutionsMetadata { - // Operation metadata for purging Executions. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [MetadataService.AddExecutionEvents][google.cloud.aiplatform.v1.MetadataService.AddExecutionEvents]. -message AddExecutionEventsRequest { - // Required. The resource name of the Execution that the Events connect - // Artifacts with. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - string execution = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Execution" - } - ]; - - // The Events to create and add. - repeated Event events = 2; -} - -// Response message for [MetadataService.AddExecutionEvents][google.cloud.aiplatform.v1.MetadataService.AddExecutionEvents]. -message AddExecutionEventsResponse { - -} - -// Request message for [MetadataService.QueryExecutionInputsAndOutputs][google.cloud.aiplatform.v1.MetadataService.QueryExecutionInputsAndOutputs]. -message QueryExecutionInputsAndOutputsRequest { - // Required. The resource name of the Execution whose input and output Artifacts should - // be retrieved as a LineageSubgraph. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - string execution = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Execution" - } - ]; -} - -// Request message for [MetadataService.CreateMetadataSchema][google.cloud.aiplatform.v1.MetadataService.CreateMetadataSchema]. -message CreateMetadataSchemaRequest { - // Required. The resource name of the MetadataStore where the MetadataSchema should - // be created. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/MetadataStore" - } - ]; - - // Required. The MetadataSchema to create. - MetadataSchema metadata_schema = 2 [(google.api.field_behavior) = REQUIRED]; - - // The {metadata_schema} portion of the resource name with the format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` - // If not provided, the MetadataStore's ID will be a UUID generated by the - // service. - // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. - // Must be unique across all MetadataSchemas in the parent Location. - // (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED - // if the caller can't view the preexisting MetadataSchema.) - string metadata_schema_id = 3; -} - -// Request message for [MetadataService.GetMetadataSchema][google.cloud.aiplatform.v1.MetadataService.GetMetadataSchema]. -message GetMetadataSchemaRequest { - // Required. The resource name of the MetadataSchema to retrieve. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/MetadataSchema" - } - ]; -} - -// Request message for [MetadataService.ListMetadataSchemas][google.cloud.aiplatform.v1.MetadataService.ListMetadataSchemas]. -message ListMetadataSchemasRequest { - // Required. The MetadataStore whose MetadataSchemas should be listed. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/MetadataSchema" - } - ]; - - // The maximum number of MetadataSchemas to return. The service may return - // fewer. - // Must be in range 1-1000, inclusive. Defaults to 100. - int32 page_size = 2; - - // A page token, received from a previous - // [MetadataService.ListMetadataSchemas][google.cloud.aiplatform.v1.MetadataService.ListMetadataSchemas] call. Provide this to retrieve the - // next page. - // - // When paginating, all other provided parameters must match the call that - // provided the page token. (Otherwise the request will fail with - // INVALID_ARGUMENT error.) - string page_token = 3; - - // A query to filter available MetadataSchemas for matching results. - string filter = 4; -} - -// Response message for [MetadataService.ListMetadataSchemas][google.cloud.aiplatform.v1.MetadataService.ListMetadataSchemas]. -message ListMetadataSchemasResponse { - // The MetadataSchemas found for the MetadataStore. - repeated MetadataSchema metadata_schemas = 1; - - // A token, which can be sent as - // [ListMetadataSchemasRequest.page_token][google.cloud.aiplatform.v1.ListMetadataSchemasRequest.page_token] to retrieve the next - // page. If this field is not populated, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [MetadataService.QueryArtifactLineageSubgraph][google.cloud.aiplatform.v1.MetadataService.QueryArtifactLineageSubgraph]. -message QueryArtifactLineageSubgraphRequest { - // Required. The resource name of the Artifact whose Lineage needs to be retrieved as a - // LineageSubgraph. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - // - // The request may error with FAILED_PRECONDITION if the number of Artifacts, - // the number of Executions, or the number of Events that would be returned - // for the Context exceeds 1000. - string artifact = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Artifact" - } - ]; - - // Specifies the size of the lineage graph in terms of number of hops from the - // specified artifact. - // Negative Value: INVALID_ARGUMENT error is returned - // 0: Only input artifact is returned. - // No value: Transitive closure is performed to return the complete graph. - int32 max_hops = 2; - - // Filter specifying the boolean condition for the Artifacts to satisfy in - // order to be part of the Lineage Subgraph. - // The syntax to define filter query is based on https://google.aip.dev/160. - // The supported set of filters include the following: - // - // * **Attribute filtering**: - // For example: `display_name = "test"` - // Supported fields include: `name`, `display_name`, `uri`, `state`, - // `schema_title`, `create_time`, and `update_time`. - // Time fields, such as `create_time` and `update_time`, require values - // specified in RFC-3339 format. - // For example: `create_time = "2020-11-19T11:30:00-04:00"` - // * **Metadata field**: - // To filter on metadata fields use traversal operation as follows: - // `metadata..`. - // For example: `metadata.field_1.number_value = 10.0` - // - // Each of the above supported filter types can be combined together using - // logical operators (`AND` & `OR`). - // - // For example: `display_name = "test" AND metadata.field1.bool_value = true`. - string filter = 3; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_store.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_store.proto deleted file mode 100644 index 31e7fd2c..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/metadata_store.proto +++ /dev/null @@ -1,65 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/encryption_spec.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "MetadataProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Instance of a metadata store. Contains a set of metadata that can be -// queried. -message MetadataStore { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/MetadataStore" - pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}" - }; - - // Represents state information for a MetadataStore. - message MetadataStoreState { - // The disk utilization of the MetadataStore in bytes. - int64 disk_utilization_bytes = 1; - } - - // Output only. The resource name of the MetadataStore instance. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this MetadataStore was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this MetadataStore was last updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Customer-managed encryption key spec for a Metadata Store. If set, this - // Metadata Store and all sub-resources of this Metadata Store are secured - // using this key. - EncryptionSpec encryption_spec = 5; - - // Description of the MetadataStore. - string description = 6; - - // Output only. State information of the MetadataStore. - MetadataStoreState state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/migratable_resource.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/migratable_resource.proto deleted file mode 100644 index 3306029a..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/migratable_resource.proto +++ /dev/null @@ -1,150 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "MigratableResourceProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; -option (google.api.resource_definition) = { - type: "ml.googleapis.com/Version" - pattern: "projects/{project}/models/{model}/versions/{version}" -}; -option (google.api.resource_definition) = { - type: "automl.googleapis.com/Model" - pattern: "projects/{project}/locations/{location}/models/{model}" -}; -option (google.api.resource_definition) = { - type: "automl.googleapis.com/Dataset" - pattern: "projects/{project}/locations/{location}/datasets/{dataset}" -}; -option (google.api.resource_definition) = { - type: "datalabeling.googleapis.com/Dataset" - pattern: "projects/{project}/datasets/{dataset}" -}; -option (google.api.resource_definition) = { - type: "datalabeling.googleapis.com/AnnotatedDataset" - pattern: "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}" -}; - -// Represents one resource that exists in automl.googleapis.com, -// datalabeling.googleapis.com or ml.googleapis.com. -message MigratableResource { - // Represents one model Version in ml.googleapis.com. - message MlEngineModelVersion { - // The ml.googleapis.com endpoint that this model Version currently lives - // in. - // Example values: - // - // * ml.googleapis.com - // * us-centrall-ml.googleapis.com - // * europe-west4-ml.googleapis.com - // * asia-east1-ml.googleapis.com - string endpoint = 1; - - // Full resource name of ml engine model Version. - // Format: `projects/{project}/models/{model}/versions/{version}`. - string version = 2 [(google.api.resource_reference) = { - type: "ml.googleapis.com/Version" - }]; - } - - // Represents one Model in automl.googleapis.com. - message AutomlModel { - // Full resource name of automl Model. - // Format: - // `projects/{project}/locations/{location}/models/{model}`. - string model = 1 [(google.api.resource_reference) = { - type: "automl.googleapis.com/Model" - }]; - - // The Model's display name in automl.googleapis.com. - string model_display_name = 3; - } - - // Represents one Dataset in automl.googleapis.com. - message AutomlDataset { - // Full resource name of automl Dataset. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}`. - string dataset = 1 [(google.api.resource_reference) = { - type: "automl.googleapis.com/Dataset" - }]; - - // The Dataset's display name in automl.googleapis.com. - string dataset_display_name = 4; - } - - // Represents one Dataset in datalabeling.googleapis.com. - message DataLabelingDataset { - // Represents one AnnotatedDataset in datalabeling.googleapis.com. - message DataLabelingAnnotatedDataset { - // Full resource name of data labeling AnnotatedDataset. - // Format: - // `projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}`. - string annotated_dataset = 1 [(google.api.resource_reference) = { - type: "datalabeling.googleapis.com/AnnotatedDataset" - }]; - - // The AnnotatedDataset's display name in datalabeling.googleapis.com. - string annotated_dataset_display_name = 3; - } - - // Full resource name of data labeling Dataset. - // Format: - // `projects/{project}/datasets/{dataset}`. - string dataset = 1 [(google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Dataset" - }]; - - // The Dataset's display name in datalabeling.googleapis.com. - string dataset_display_name = 4; - - // The migratable AnnotatedDataset in datalabeling.googleapis.com belongs to - // the data labeling Dataset. - repeated DataLabelingAnnotatedDataset data_labeling_annotated_datasets = 3; - } - - oneof resource { - // Output only. Represents one Version in ml.googleapis.com. - MlEngineModelVersion ml_engine_model_version = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents one Model in automl.googleapis.com. - AutomlModel automl_model = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents one Dataset in automl.googleapis.com. - AutomlDataset automl_dataset = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents one Dataset in datalabeling.googleapis.com. - DataLabelingDataset data_labeling_dataset = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. Timestamp when the last migration attempt on this MigratableResource - // started. Will not be set if there's no migration attempt on this - // MigratableResource. - google.protobuf.Timestamp last_migrate_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this MigratableResource was last updated. - google.protobuf.Timestamp last_update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/migration_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/migration_service.proto deleted file mode 100644 index bcacf30a..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/migration_service.proto +++ /dev/null @@ -1,314 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/migratable_resource.proto"; -import "google/cloud/aiplatform/v1/operation.proto"; -import "google/longrunning/operations.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "MigrationServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A service that migrates resources from automl.googleapis.com, -// datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. -service MigrationService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Searches all of the resources in automl.googleapis.com, - // datalabeling.googleapis.com and ml.googleapis.com that can be migrated to - // Vertex AI's given location. - rpc SearchMigratableResources(SearchMigratableResourcesRequest) returns (SearchMigratableResourcesResponse) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/migratableResources:search" - body: "*" - }; - option (google.api.method_signature) = "parent"; - } - - // Batch migrates resources from ml.googleapis.com, automl.googleapis.com, - // and datalabeling.googleapis.com to Vertex AI. - rpc BatchMigrateResources(BatchMigrateResourcesRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/migratableResources:batchMigrate" - body: "*" - }; - option (google.api.method_signature) = "parent,migrate_resource_requests"; - option (google.longrunning.operation_info) = { - response_type: "BatchMigrateResourcesResponse" - metadata_type: "BatchMigrateResourcesOperationMetadata" - }; - } -} - -// Request message for [MigrationService.SearchMigratableResources][google.cloud.aiplatform.v1.MigrationService.SearchMigratableResources]. -message SearchMigratableResourcesRequest { - // Required. The location that the migratable resources should be searched from. - // It's the Vertex AI location that the resources can be migrated to, not - // the resources' original location. - // Format: - // `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The standard page size. - // The default and maximum value is 100. - int32 page_size = 2; - - // The standard page token. - string page_token = 3; - - // A filter for your search. You can use the following types of filters: - // - // * Resource type filters. The following strings filter for a specific type - // of [MigratableResource][google.cloud.aiplatform.v1.MigratableResource]: - // * `ml_engine_model_version:*` - // * `automl_model:*` - // * `automl_dataset:*` - // * `data_labeling_dataset:*` - // * "Migrated or not" filters. The following strings filter for resources - // that either have or have not already been migrated: - // * `last_migrate_time:*` filters for migrated resources. - // * `NOT last_migrate_time:*` filters for not yet migrated resources. - string filter = 4; -} - -// Response message for [MigrationService.SearchMigratableResources][google.cloud.aiplatform.v1.MigrationService.SearchMigratableResources]. -message SearchMigratableResourcesResponse { - // All migratable resources that can be migrated to the - // location specified in the request. - repeated MigratableResource migratable_resources = 1; - - // The standard next-page token. - // The migratable_resources may not fill page_size in - // SearchMigratableResourcesRequest even when there are subsequent pages. - string next_page_token = 2; -} - -// Request message for [MigrationService.BatchMigrateResources][google.cloud.aiplatform.v1.MigrationService.BatchMigrateResources]. -message BatchMigrateResourcesRequest { - // Required. The location of the migrated resource will live in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The request messages specifying the resources to migrate. - // They must be in the same location as the destination. - // Up to 50 resources can be migrated in one batch. - repeated MigrateResourceRequest migrate_resource_requests = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Config of migrating one resource from automl.googleapis.com, -// datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. -message MigrateResourceRequest { - // Config for migrating version in ml.googleapis.com to Vertex AI's Model. - message MigrateMlEngineModelVersionConfig { - // Required. The ml.googleapis.com endpoint that this model version should be migrated - // from. - // Example values: - // - // * ml.googleapis.com - // - // * us-centrall-ml.googleapis.com - // - // * europe-west4-ml.googleapis.com - // - // * asia-east1-ml.googleapis.com - string endpoint = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Full resource name of ml engine model version. - // Format: `projects/{project}/models/{model}/versions/{version}`. - string model_version = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "ml.googleapis.com/Version" - } - ]; - - // Required. Display name of the model in Vertex AI. - // System will pick a display name if unspecified. - string model_display_name = 3 [(google.api.field_behavior) = REQUIRED]; - } - - // Config for migrating Model in automl.googleapis.com to Vertex AI's Model. - message MigrateAutomlModelConfig { - // Required. Full resource name of automl Model. - // Format: - // `projects/{project}/locations/{location}/models/{model}`. - string model = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "automl.googleapis.com/Model" - } - ]; - - // Optional. Display name of the model in Vertex AI. - // System will pick a display name if unspecified. - string model_display_name = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Config for migrating Dataset in automl.googleapis.com to Vertex AI's - // Dataset. - message MigrateAutomlDatasetConfig { - // Required. Full resource name of automl Dataset. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}`. - string dataset = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "automl.googleapis.com/Dataset" - } - ]; - - // Required. Display name of the Dataset in Vertex AI. - // System will pick a display name if unspecified. - string dataset_display_name = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Config for migrating Dataset in datalabeling.googleapis.com to Vertex - // AI's Dataset. - message MigrateDataLabelingDatasetConfig { - // Config for migrating AnnotatedDataset in datalabeling.googleapis.com to - // Vertex AI's SavedQuery. - message MigrateDataLabelingAnnotatedDatasetConfig { - // Required. Full resource name of data labeling AnnotatedDataset. - // Format: - // `projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}`. - string annotated_dataset = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/AnnotatedDataset" - } - ]; - } - - // Required. Full resource name of data labeling Dataset. - // Format: - // `projects/{project}/datasets/{dataset}`. - string dataset = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Dataset" - } - ]; - - // Optional. Display name of the Dataset in Vertex AI. - // System will pick a display name if unspecified. - string dataset_display_name = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Configs for migrating AnnotatedDataset in datalabeling.googleapis.com to - // Vertex AI's SavedQuery. The specified AnnotatedDatasets have to belong - // to the datalabeling Dataset. - repeated MigrateDataLabelingAnnotatedDatasetConfig migrate_data_labeling_annotated_dataset_configs = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - oneof request { - // Config for migrating Version in ml.googleapis.com to Vertex AI's Model. - MigrateMlEngineModelVersionConfig migrate_ml_engine_model_version_config = 1; - - // Config for migrating Model in automl.googleapis.com to Vertex AI's - // Model. - MigrateAutomlModelConfig migrate_automl_model_config = 2; - - // Config for migrating Dataset in automl.googleapis.com to Vertex AI's - // Dataset. - MigrateAutomlDatasetConfig migrate_automl_dataset_config = 3; - - // Config for migrating Dataset in datalabeling.googleapis.com to - // Vertex AI's Dataset. - MigrateDataLabelingDatasetConfig migrate_data_labeling_dataset_config = 4; - } -} - -// Response message for [MigrationService.BatchMigrateResources][google.cloud.aiplatform.v1.MigrationService.BatchMigrateResources]. -message BatchMigrateResourcesResponse { - // Successfully migrated resources. - repeated MigrateResourceResponse migrate_resource_responses = 1; -} - -// Describes a successfully migrated resource. -message MigrateResourceResponse { - // After migration, the resource name in Vertex AI. - oneof migrated_resource { - // Migrated Dataset's resource name. - string dataset = 1 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - }]; - - // Migrated Model's resource name. - string model = 2 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - }]; - } - - // Before migration, the identifier in ml.googleapis.com, - // automl.googleapis.com or datalabeling.googleapis.com. - MigratableResource migratable_resource = 3; -} - -// Runtime operation information for [MigrationService.BatchMigrateResources][google.cloud.aiplatform.v1.MigrationService.BatchMigrateResources]. -message BatchMigrateResourcesOperationMetadata { - // Represents a partial result in batch migration operation for one - // [MigrateResourceRequest][google.cloud.aiplatform.v1.MigrateResourceRequest]. - message PartialResult { - // If the resource's migration is ongoing, none of the result will be set. - // If the resource's migration is finished, either error or one of the - // migrated resource name will be filled. - oneof result { - // The error result of the migration request in case of failure. - google.rpc.Status error = 2; - - // Migrated model resource name. - string model = 3 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - }]; - - // Migrated dataset resource name. - string dataset = 4 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - }]; - } - - // It's the same as the value in - // [MigrateResourceRequest.migrate_resource_requests][]. - MigrateResourceRequest request = 1; - } - - // The common part of the operation metadata. - GenericOperationMetadata generic_metadata = 1; - - // Partial results that reflect the latest migration operation progress. - repeated PartialResult partial_results = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model.proto deleted file mode 100644 index 32e617dd..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model.proto +++ /dev/null @@ -1,559 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/deployed_model_ref.proto"; -import "google/cloud/aiplatform/v1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1/env_var.proto"; -import "google/cloud/aiplatform/v1/explanation.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ModelProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A trained machine learning Model. -message Model { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Model" - pattern: "projects/{project}/locations/{location}/models/{model}" - }; - - // Represents export format supported by the Model. - // All formats export to Google Cloud Storage. - message ExportFormat { - // The Model content that can be exported. - enum ExportableContent { - // Should not be used. - EXPORTABLE_CONTENT_UNSPECIFIED = 0; - - // Model artifact and any of its supported files. Will be exported to the - // location specified by the `artifactDestination` field of the - // [ExportModelRequest.output_config][google.cloud.aiplatform.v1.ExportModelRequest.output_config] object. - ARTIFACT = 1; - - // The container image that is to be used when deploying this Model. Will - // be exported to the location specified by the `imageDestination` field - // of the [ExportModelRequest.output_config][google.cloud.aiplatform.v1.ExportModelRequest.output_config] object. - IMAGE = 2; - } - - // Output only. The ID of the export format. - // The possible format IDs are: - // - // * `tflite` - // Used for Android mobile devices. - // - // * `edgetpu-tflite` - // Used for [Edge TPU](https://cloud.google.com/edge-tpu/) devices. - // - // * `tf-saved-model` - // A tensorflow model in SavedModel format. - // - // * `tf-js` - // A [TensorFlow.js](https://www.tensorflow.org/js) model that can be used - // in the browser and in Node.js using JavaScript. - // - // * `core-ml` - // Used for iOS mobile devices. - // - // * `custom-trained` - // A Model that was uploaded or trained by custom code. - string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The content of this Model that may be exported. - repeated ExportableContent exportable_contents = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Identifies a type of Model's prediction resources. - enum DeploymentResourcesType { - // Should not be used. - DEPLOYMENT_RESOURCES_TYPE_UNSPECIFIED = 0; - - // Resources that are dedicated to the [DeployedModel][google.cloud.aiplatform.v1.DeployedModel], and that need a - // higher degree of manual configuration. - DEDICATED_RESOURCES = 1; - - // Resources that to large degree are decided by Vertex AI, and require - // only a modest additional configuration. - AUTOMATIC_RESOURCES = 2; - } - - // The resource name of the Model. - string name = 1; - - // Required. The display name of the Model. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // The description of the Model. - string description = 3; - - // The schemata that describe formats of the Model's predictions and - // explanations as given and returned via - // [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict] and [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain]. - PredictSchemata predict_schemata = 4; - - // Immutable. Points to a YAML file stored on Google Cloud Storage describing additional - // information about the Model, that is specific to it. Unset if the Model - // does not have any additional information. - // The schema is defined as an OpenAPI 3.0.2 [Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - // AutoML Models always have this field populated by Vertex AI, if no - // additional metadata is needed, this field is set to an empty string. - // Note: The URI given on output will be immutable and probably different, - // including the URI scheme, than the one given on input. The output URI will - // point to a location where the user only has a read access. - string metadata_schema_uri = 5 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. An additional information about the Model; the schema of the metadata can - // be found in [metadata_schema][google.cloud.aiplatform.v1.Model.metadata_schema_uri]. - // Unset if the Model does not have any additional information. - google.protobuf.Value metadata = 6 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. The formats in which this Model may be exported. If empty, this Model is - // not available for export. - repeated ExportFormat supported_export_formats = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The resource name of the TrainingPipeline that uploaded this Model, if - // any. - string training_pipeline = 7 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TrainingPipeline" - } - ]; - - // Input only. The specification of the container that is to be used when deploying - // this Model. The specification is ingested upon - // [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel], and all binaries it contains are copied - // and stored internally by Vertex AI. - // Not present for AutoML Models. - ModelContainerSpec container_spec = 9 [(google.api.field_behavior) = INPUT_ONLY]; - - // Immutable. The path to the directory containing the Model artifact and any of its - // supporting files. - // Not present for AutoML Models. - string artifact_uri = 26 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. When this Model is deployed, its prediction resources are described by the - // `prediction_resources` field of the [Endpoint.deployed_models][google.cloud.aiplatform.v1.Endpoint.deployed_models] object. - // Because not all Models support all resource configuration types, the - // configuration types this Model supports are listed here. If no - // configuration types are listed, the Model cannot be deployed to an - // [Endpoint][google.cloud.aiplatform.v1.Endpoint] and does not support - // online predictions ([PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict] or - // [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain]). Such a Model can serve predictions by - // using a [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob], if it has at least one entry each in - // [supported_input_storage_formats][google.cloud.aiplatform.v1.Model.supported_input_storage_formats] and - // [supported_output_storage_formats][google.cloud.aiplatform.v1.Model.supported_output_storage_formats]. - repeated DeploymentResourcesType supported_deployment_resources_types = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The formats this Model supports in - // [BatchPredictionJob.input_config][google.cloud.aiplatform.v1.BatchPredictionJob.input_config]. If - // [PredictSchemata.instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri] exists, the instances - // should be given as per that schema. - // - // The possible formats are: - // - // * `jsonl` - // The JSON Lines format, where each instance is a single line. Uses - // [GcsSource][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig.gcs_source]. - // - // * `csv` - // The CSV format, where each instance is a single comma-separated line. - // The first line in the file is the header, containing comma-separated field - // names. Uses [GcsSource][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig.gcs_source]. - // - // * `tf-record` - // The TFRecord format, where each instance is a single record in tfrecord - // syntax. Uses [GcsSource][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig.gcs_source]. - // - // * `tf-record-gzip` - // Similar to `tf-record`, but the file is gzipped. Uses - // [GcsSource][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig.gcs_source]. - // - // * `bigquery` - // Each instance is a single row in BigQuery. Uses - // [BigQuerySource][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig.bigquery_source]. - // - // * `file-list` - // Each line of the file is the location of an instance to process, uses - // `gcs_source` field of the - // [InputConfig][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig] object. - // - // - // If this Model doesn't support any of these formats it means it cannot be - // used with a [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob]. However, if it has - // [supported_deployment_resources_types][google.cloud.aiplatform.v1.Model.supported_deployment_resources_types], it could serve online - // predictions by using [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict] or - // [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain]. - repeated string supported_input_storage_formats = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The formats this Model supports in - // [BatchPredictionJob.output_config][google.cloud.aiplatform.v1.BatchPredictionJob.output_config]. If both - // [PredictSchemata.instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri] and - // [PredictSchemata.prediction_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.prediction_schema_uri] exist, the predictions - // are returned together with their instances. In other words, the - // prediction has the original instance data first, followed - // by the actual prediction content (as per the schema). - // - // The possible formats are: - // - // * `jsonl` - // The JSON Lines format, where each prediction is a single line. Uses - // [GcsDestination][google.cloud.aiplatform.v1.BatchPredictionJob.OutputConfig.gcs_destination]. - // - // * `csv` - // The CSV format, where each prediction is a single comma-separated line. - // The first line in the file is the header, containing comma-separated field - // names. Uses - // [GcsDestination][google.cloud.aiplatform.v1.BatchPredictionJob.OutputConfig.gcs_destination]. - // - // * `bigquery` - // Each prediction is a single row in a BigQuery table, uses - // [BigQueryDestination][google.cloud.aiplatform.v1.BatchPredictionJob.OutputConfig.bigquery_destination] - // . - // - // - // If this Model doesn't support any of these formats it means it cannot be - // used with a [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob]. However, if it has - // [supported_deployment_resources_types][google.cloud.aiplatform.v1.Model.supported_deployment_resources_types], it could serve online - // predictions by using [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict] or - // [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain]. - repeated string supported_output_storage_formats = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Model was uploaded into Vertex AI. - google.protobuf.Timestamp create_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Model was most recently updated. - google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The pointers to DeployedModels created from this Model. Note that - // Model could have been deployed to Endpoints in different Locations. - repeated DeployedModelRef deployed_models = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The default explanation specification for this Model. - // - // The Model can be used for [requesting - // explanation][PredictionService.Explain] after being - // [deployed][google.cloud.aiplatform.v1.EndpointService.DeployModel] if it is populated. - // The Model can be used for [batch - // explanation][BatchPredictionJob.generate_explanation] if it is populated. - // - // All fields of the explanation_spec can be overridden by - // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] of - // [DeployModelRequest.deployed_model][google.cloud.aiplatform.v1.DeployModelRequest.deployed_model], or - // [explanation_spec][google.cloud.aiplatform.v1.BatchPredictionJob.explanation_spec] of - // [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob]. - // - // If the default explanation specification is not set for this Model, this - // Model can still be used for [requesting - // explanation][PredictionService.Explain] by setting - // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] of - // [DeployModelRequest.deployed_model][google.cloud.aiplatform.v1.DeployModelRequest.deployed_model] and for [batch - // explanation][BatchPredictionJob.generate_explanation] by setting - // [explanation_spec][google.cloud.aiplatform.v1.BatchPredictionJob.explanation_spec] of - // [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob]. - ExplanationSpec explanation_spec = 23; - - // Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 16; - - // The labels with user-defined metadata to organize your Models. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 17; - - // Customer-managed encryption key spec for a Model. If set, this - // Model and all sub-resources of this Model will be secured by this key. - EncryptionSpec encryption_spec = 24; -} - -// Contains the schemata used in Model's predictions and explanations via -// [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict], [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain] and -// [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob]. -message PredictSchemata { - // Immutable. Points to a YAML file stored on Google Cloud Storage describing the format - // of a single instance, which are used in [PredictRequest.instances][google.cloud.aiplatform.v1.PredictRequest.instances], - // [ExplainRequest.instances][google.cloud.aiplatform.v1.ExplainRequest.instances] and - // [BatchPredictionJob.input_config][google.cloud.aiplatform.v1.BatchPredictionJob.input_config]. - // The schema is defined as an OpenAPI 3.0.2 [Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - // AutoML Models always have this field populated by Vertex AI. - // Note: The URI given on output will be immutable and probably different, - // including the URI scheme, than the one given on input. The output URI will - // point to a location where the user only has a read access. - string instance_schema_uri = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. Points to a YAML file stored on Google Cloud Storage describing the - // parameters of prediction and explanation via - // [PredictRequest.parameters][google.cloud.aiplatform.v1.PredictRequest.parameters], [ExplainRequest.parameters][google.cloud.aiplatform.v1.ExplainRequest.parameters] and - // [BatchPredictionJob.model_parameters][google.cloud.aiplatform.v1.BatchPredictionJob.model_parameters]. - // The schema is defined as an OpenAPI 3.0.2 [Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - // AutoML Models always have this field populated by Vertex AI, if no - // parameters are supported, then it is set to an empty string. - // Note: The URI given on output will be immutable and probably different, - // including the URI scheme, than the one given on input. The output URI will - // point to a location where the user only has a read access. - string parameters_schema_uri = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. Points to a YAML file stored on Google Cloud Storage describing the format - // of a single prediction produced by this Model, which are returned via - // [PredictResponse.predictions][google.cloud.aiplatform.v1.PredictResponse.predictions], [ExplainResponse.explanations][google.cloud.aiplatform.v1.ExplainResponse.explanations], and - // [BatchPredictionJob.output_config][google.cloud.aiplatform.v1.BatchPredictionJob.output_config]. - // The schema is defined as an OpenAPI 3.0.2 [Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - // AutoML Models always have this field populated by Vertex AI. - // Note: The URI given on output will be immutable and probably different, - // including the URI scheme, than the one given on input. The output URI will - // point to a location where the user only has a read access. - string prediction_schema_uri = 3 [(google.api.field_behavior) = IMMUTABLE]; -} - -// Specification of a container for serving predictions. Some fields in this -// message correspond to fields in the [Kubernetes Container v1 core -// specification](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). -message ModelContainerSpec { - // Required. Immutable. URI of the Docker image to be used as the custom container for serving - // predictions. This URI must identify an image in Artifact Registry or - // Container Registry. Learn more about the [container publishing - // requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#publishing), - // including permissions requirements for the Vertex AI Service Agent. - // - // The container image is ingested upon [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel], stored - // internally, and this original path is afterwards not used. - // - // To learn about the requirements for the Docker image itself, see - // [Custom container - // requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#). - // - // You can use the URI to one of Vertex AI's [pre-built container images for - // prediction](https://cloud.google.com/vertex-ai/docs/predictions/pre-built-containers) - // in this field. - string image_uri = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Immutable. Specifies the command that runs when the container starts. This overrides - // the container's - // [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint). - // Specify this field as an array of executable and arguments, similar to a - // Docker `ENTRYPOINT`'s "exec" form, not its "shell" form. - // - // If you do not specify this field, then the container's `ENTRYPOINT` runs, - // in conjunction with the [args][google.cloud.aiplatform.v1.ModelContainerSpec.args] field or the - // container's [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd), - // if either exists. If this field is not specified and the container does not - // have an `ENTRYPOINT`, then refer to the Docker documentation about [how - // `CMD` and `ENTRYPOINT` - // interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). - // - // If you specify this field, then you can also specify the `args` field to - // provide additional arguments for this command. However, if you specify this - // field, then the container's `CMD` is ignored. See the - // [Kubernetes documentation about how the - // `command` and `args` fields interact with a container's `ENTRYPOINT` and - // `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). - // - // In this field, you can reference [environment variables set by Vertex - // AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) - // and environment variables set in the [env][google.cloud.aiplatform.v1.ModelContainerSpec.env] field. - // You cannot reference environment variables set in the Docker image. In - // order for environment variables to be expanded, reference them by using the - // following syntax: - // $(VARIABLE_NAME) - // Note that this differs from Bash variable expansion, which does not use - // parentheses. If a variable cannot be resolved, the reference in the input - // string is used unchanged. To avoid variable expansion, you can escape this - // syntax with `$$`; for example: - // $$(VARIABLE_NAME) - // This field corresponds to the `command` field of the Kubernetes Containers - // [v1 core - // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). - repeated string command = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. Specifies arguments for the command that runs when the container starts. - // This overrides the container's - // [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd). Specify - // this field as an array of executable and arguments, similar to a Docker - // `CMD`'s "default parameters" form. - // - // If you don't specify this field but do specify the - // [command][google.cloud.aiplatform.v1.ModelContainerSpec.command] field, then the command from the - // `command` field runs without any additional arguments. See the - // [Kubernetes documentation about how the - // `command` and `args` fields interact with a container's `ENTRYPOINT` and - // `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). - // - // If you don't specify this field and don't specify the `command` field, - // then the container's - // [`ENTRYPOINT`](https://docs.docker.com/engine/reference/builder/#cmd) and - // `CMD` determine what runs based on their default behavior. See the Docker - // documentation about [how `CMD` and `ENTRYPOINT` - // interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). - // - // In this field, you can reference [environment variables - // set by Vertex - // AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) - // and environment variables set in the [env][google.cloud.aiplatform.v1.ModelContainerSpec.env] field. - // You cannot reference environment variables set in the Docker image. In - // order for environment variables to be expanded, reference them by using the - // following syntax: - // $(VARIABLE_NAME) - // Note that this differs from Bash variable expansion, which does not use - // parentheses. If a variable cannot be resolved, the reference in the input - // string is used unchanged. To avoid variable expansion, you can escape this - // syntax with `$$`; for example: - // $$(VARIABLE_NAME) - // This field corresponds to the `args` field of the Kubernetes Containers - // [v1 core - // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). - repeated string args = 3 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. List of environment variables to set in the container. After the container - // starts running, code running in the container can read these environment - // variables. - // - // Additionally, the [command][google.cloud.aiplatform.v1.ModelContainerSpec.command] and - // [args][google.cloud.aiplatform.v1.ModelContainerSpec.args] fields can reference these variables. Later - // entries in this list can also reference earlier entries. For example, the - // following example sets the variable `VAR_2` to have the value `foo bar`: - // - // ```json - // [ - // { - // "name": "VAR_1", - // "value": "foo" - // }, - // { - // "name": "VAR_2", - // "value": "$(VAR_1) bar" - // } - // ] - // ``` - // - // If you switch the order of the variables in the example, then the expansion - // does not occur. - // - // This field corresponds to the `env` field of the Kubernetes Containers - // [v1 core - // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). - repeated EnvVar env = 4 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. List of ports to expose from the container. Vertex AI sends any - // prediction requests that it receives to the first port on this list. Vertex - // AI also sends - // [liveness and health - // checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#liveness) - // to this port. - // - // If you do not specify this field, it defaults to following value: - // - // ```json - // [ - // { - // "containerPort": 8080 - // } - // ] - // ``` - // - // Vertex AI does not use ports other than the first one listed. This field - // corresponds to the `ports` field of the Kubernetes Containers - // [v1 core - // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). - repeated Port ports = 5 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. HTTP path on the container to send prediction requests to. Vertex AI - // forwards requests sent using - // [projects.locations.endpoints.predict][google.cloud.aiplatform.v1.PredictionService.Predict] to this - // path on the container's IP address and port. Vertex AI then returns the - // container's response in the API response. - // - // For example, if you set this field to `/foo`, then when Vertex AI - // receives a prediction request, it forwards the request body in a POST - // request to the `/foo` path on the port of your container specified by the - // first value of this `ModelContainerSpec`'s - // [ports][google.cloud.aiplatform.v1.ModelContainerSpec.ports] field. - // - // If you don't specify this field, it defaults to the following value when - // you [deploy this Model to an Endpoint][google.cloud.aiplatform.v1.EndpointService.DeployModel]: - // /v1/endpoints/ENDPOINT/deployedModels/DEPLOYED_MODEL:predict - // The placeholders in this value are replaced as follows: - // - // * ENDPOINT: The last segment (following `endpoints/`)of the - // Endpoint.name][] field of the Endpoint where this Model has been - // deployed. (Vertex AI makes this value available to your container code - // as the [`AIP_ENDPOINT_ID` environment - // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) - // - // * DEPLOYED_MODEL: [DeployedModel.id][google.cloud.aiplatform.v1.DeployedModel.id] of the `DeployedModel`. - // (Vertex AI makes this value available to your container code - // as the [`AIP_DEPLOYED_MODEL_ID` environment - // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) - string predict_route = 6 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. HTTP path on the container to send health checks to. Vertex AI - // intermittently sends GET requests to this path on the container's IP - // address and port to check that the container is healthy. Read more about - // [health - // checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#health). - // - // For example, if you set this field to `/bar`, then Vertex AI - // intermittently sends a GET request to the `/bar` path on the port of your - // container specified by the first value of this `ModelContainerSpec`'s - // [ports][google.cloud.aiplatform.v1.ModelContainerSpec.ports] field. - // - // If you don't specify this field, it defaults to the following value when - // you [deploy this Model to an Endpoint][google.cloud.aiplatform.v1.EndpointService.DeployModel]: - // /v1/endpoints/ENDPOINT/deployedModels/DEPLOYED_MODEL:predict - // The placeholders in this value are replaced as follows: - // - // * ENDPOINT: The last segment (following `endpoints/`)of the - // Endpoint.name][] field of the Endpoint where this Model has been - // deployed. (Vertex AI makes this value available to your container code - // as the [`AIP_ENDPOINT_ID` environment - // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) - // - // * DEPLOYED_MODEL: [DeployedModel.id][google.cloud.aiplatform.v1.DeployedModel.id] of the `DeployedModel`. - // (Vertex AI makes this value available to your container code as the - // [`AIP_DEPLOYED_MODEL_ID` environment - // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) - string health_route = 7 [(google.api.field_behavior) = IMMUTABLE]; -} - -// Represents a network port in a container. -message Port { - // The number of the port to expose on the pod's IP address. - // Must be a valid port number, between 1 and 65535 inclusive. - int32 container_port = 3; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto deleted file mode 100644 index 822e5926..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto +++ /dev/null @@ -1,300 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1/feature_monitoring_stats.proto"; -import "google/cloud/aiplatform/v1/io.proto"; -import "google/cloud/aiplatform/v1/job_state.proto"; -import "google/cloud/aiplatform/v1/model_monitoring.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ModelDeploymentMonitoringJobProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// The Model Monitoring Objective types. -enum ModelDeploymentMonitoringObjectiveType { - // Default value, should not be set. - MODEL_DEPLOYMENT_MONITORING_OBJECTIVE_TYPE_UNSPECIFIED = 0; - - // Raw feature values' stats to detect skew between Training-Prediction - // datasets. - RAW_FEATURE_SKEW = 1; - - // Raw feature values' stats to detect drift between Serving-Prediction - // datasets. - RAW_FEATURE_DRIFT = 2; - - // Feature attribution scores to detect skew between Training-Prediction - // datasets. - FEATURE_ATTRIBUTION_SKEW = 3; - - // Feature attribution scores to detect skew between Prediction datasets - // collected within different time windows. - FEATURE_ATTRIBUTION_DRIFT = 4; -} - -// Represents a job that runs periodically to monitor the deployed models in an -// endpoint. It will analyze the logged training & prediction data to detect any -// abnormal behaviors. -message ModelDeploymentMonitoringJob { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" - pattern: "projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}" - }; - - // All metadata of most recent monitoring pipelines. - message LatestMonitoringPipelineMetadata { - // The time that most recent monitoring pipelines that is related to this - // run. - google.protobuf.Timestamp run_time = 1; - - // The status of the most recent monitoring pipeline. - google.rpc.Status status = 2; - } - - // The state to Specify the monitoring pipeline. - enum MonitoringScheduleState { - // Unspecified state. - MONITORING_SCHEDULE_STATE_UNSPECIFIED = 0; - - // The pipeline is picked up and wait to run. - PENDING = 1; - - // The pipeline is offline and will be scheduled for next run. - OFFLINE = 2; - - // The pipeline is running. - RUNNING = 3; - } - - // Output only. Resource name of a ModelDeploymentMonitoringJob. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The user-defined name of the ModelDeploymentMonitoringJob. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - // Display name of a ModelDeploymentMonitoringJob. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Endpoint resource name. - // Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` - string endpoint = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Endpoint" - } - ]; - - // Output only. The detailed state of the monitoring job. - // When the job is still creating, the state will be 'PENDING'. - // Once the job is successfully created, the state will be 'RUNNING'. - // Pause the job, the state will be 'PAUSED'. - // Resume the job, the state will return to 'RUNNING'. - JobState state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Schedule state when the monitoring job is in Running state. - MonitoringScheduleState schedule_state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Latest triggered monitoring pipeline metadata. - LatestMonitoringPipelineMetadata latest_monitoring_pipeline_metadata = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The config for monitoring objectives. This is a per DeployedModel config. - // Each DeployedModel needs to be configured separately. - repeated ModelDeploymentMonitoringObjectiveConfig model_deployment_monitoring_objective_configs = 6 [(google.api.field_behavior) = REQUIRED]; - - // Required. Schedule config for running the monitoring job. - ModelDeploymentMonitoringScheduleConfig model_deployment_monitoring_schedule_config = 7 [(google.api.field_behavior) = REQUIRED]; - - // Required. Sample Strategy for logging. - SamplingStrategy logging_sampling_strategy = 8 [(google.api.field_behavior) = REQUIRED]; - - // Alert config for model monitoring. - ModelMonitoringAlertConfig model_monitoring_alert_config = 15; - - // YAML schema file uri describing the format of a single instance, - // which are given to format this Endpoint's prediction (and explanation). - // If not set, we will generate predict schema from collected predict - // requests. - string predict_instance_schema_uri = 9; - - // Sample Predict instance, same format as [PredictRequest.instances][google.cloud.aiplatform.v1.PredictRequest.instances], - // this can be set as a replacement of - // [ModelDeploymentMonitoringJob.predict_instance_schema_uri][google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.predict_instance_schema_uri]. If not set, - // we will generate predict schema from collected predict requests. - google.protobuf.Value sample_predict_instance = 19; - - // YAML schema file uri describing the format of a single instance that you - // want Tensorflow Data Validation (TFDV) to analyze. - // - // If this field is empty, all the feature data types are inferred from - // [predict_instance_schema_uri][google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.predict_instance_schema_uri], - // meaning that TFDV will use the data in the exact format(data type) as - // prediction request/response. - // If there are any data type differences between predict instance and TFDV - // instance, this field can be used to override the schema. - // For models trained with Vertex AI, this field must be set as all the - // fields in predict instance formatted as string. - string analysis_instance_schema_uri = 16; - - // Output only. The created bigquery tables for the job under customer project. Customer - // could do their own query & analysis. There could be 4 log tables in - // maximum: - // 1. Training data logging predict request/response - // 2. Serving data logging predict request/response - repeated ModelDeploymentMonitoringBigQueryTable bigquery_tables = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The TTL of BigQuery tables in user projects which stores logs. - // A day is the basic unit of the TTL and we take the ceil of TTL/86400(a - // day). e.g. { second: 3600} indicates ttl = 1 day. - google.protobuf.Duration log_ttl = 17; - - // The labels with user-defined metadata to organize your - // ModelDeploymentMonitoringJob. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 11; - - // Output only. Timestamp when this ModelDeploymentMonitoringJob was created. - google.protobuf.Timestamp create_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this ModelDeploymentMonitoringJob was updated most recently. - google.protobuf.Timestamp update_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this monitoring pipeline will be scheduled to run for the - // next round. - google.protobuf.Timestamp next_schedule_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Stats anomalies base folder path. - GcsDestination stats_anomalies_base_directory = 20; - - // Customer-managed encryption key spec for a ModelDeploymentMonitoringJob. If - // set, this ModelDeploymentMonitoringJob and all sub-resources of this - // ModelDeploymentMonitoringJob will be secured by this key. - EncryptionSpec encryption_spec = 21; - - // If true, the scheduled monitoring pipeline logs are sent to - // Google Cloud Logging, including pipeline status and anomalies detected. - // Please note the logs incur cost, which are subject to [Cloud Logging - // pricing](https://cloud.google.com/logging#pricing). - bool enable_monitoring_pipeline_logs = 22; - - // Output only. Only populated when the job's state is `JOB_STATE_FAILED` or - // `JOB_STATE_CANCELLED`. - google.rpc.Status error = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// ModelDeploymentMonitoringBigQueryTable specifies the BigQuery table name -// as well as some information of the logs stored in this table. -message ModelDeploymentMonitoringBigQueryTable { - // Indicates where does the log come from. - enum LogSource { - // Unspecified source. - LOG_SOURCE_UNSPECIFIED = 0; - - // Logs coming from Training dataset. - TRAINING = 1; - - // Logs coming from Serving traffic. - SERVING = 2; - } - - // Indicates what type of traffic does the log belong to. - enum LogType { - // Unspecified type. - LOG_TYPE_UNSPECIFIED = 0; - - // Predict logs. - PREDICT = 1; - - // Explain logs. - EXPLAIN = 2; - } - - // The source of log. - LogSource log_source = 1; - - // The type of log. - LogType log_type = 2; - - // The created BigQuery table to store logs. Customer could do their own query - // & analysis. Format: - // `bq://.model_deployment_monitoring_._` - string bigquery_table_path = 3; -} - -// ModelDeploymentMonitoringObjectiveConfig contains the pair of -// deployed_model_id to ModelMonitoringObjectiveConfig. -message ModelDeploymentMonitoringObjectiveConfig { - // The DeployedModel ID of the objective config. - string deployed_model_id = 1; - - // The objective config of for the modelmonitoring job of this deployed model. - ModelMonitoringObjectiveConfig objective_config = 2; -} - -// The config for scheduling monitoring job. -message ModelDeploymentMonitoringScheduleConfig { - // Required. The model monitoring job scheduling interval. It will be rounded up to next - // full hour. This defines how often the monitoring jobs are triggered. - google.protobuf.Duration monitor_interval = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Statistics and anomalies generated by Model Monitoring. -message ModelMonitoringStatsAnomalies { - // Historical Stats (and Anomalies) for a specific Feature. - message FeatureHistoricStatsAnomalies { - // Display Name of the Feature. - string feature_display_name = 1; - - // Threshold for anomaly detection. - ThresholdConfig threshold = 3; - - // Stats calculated for the Training Dataset. - FeatureStatsAnomaly training_stats = 4; - - // A list of historical stats generated by different time window's - // Prediction Dataset. - repeated FeatureStatsAnomaly prediction_stats = 5; - } - - // Model Monitoring Objective those stats and anomalies belonging to. - ModelDeploymentMonitoringObjectiveType objective = 1; - - // Deployed Model ID. - string deployed_model_id = 2; - - // Number of anomalies within all stats. - int32 anomaly_count = 3; - - // A list of historical Stats and Anomalies generated for all Features. - repeated FeatureHistoricStatsAnomalies feature_stats = 4; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_evaluation.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_evaluation.proto deleted file mode 100644 index 5fc333e6..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_evaluation.proto +++ /dev/null @@ -1,116 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/explanation.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ModelEvaluationProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A collection of metrics calculated by comparing Model's predictions on all of -// the test data against annotations from the test data. -message ModelEvaluation { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/ModelEvaluation" - pattern: "projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}" - }; - - message ModelEvaluationExplanationSpec { - // Explanation type. - // - // For AutoML Image Classification models, possible values are: - // - // * `image-integrated-gradients` - // * `image-xrai` - string explanation_type = 1; - - // Explanation spec details. - ExplanationSpec explanation_spec = 2; - } - - // Output only. The resource name of the ModelEvaluation. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The display name of the ModelEvaluation. - string display_name = 10; - - // Points to a YAML file stored on Google Cloud Storage describing the - // [metrics][google.cloud.aiplatform.v1.ModelEvaluation.metrics] of this ModelEvaluation. The schema is - // defined as an OpenAPI 3.0.2 [Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - string metrics_schema_uri = 2; - - // Evaluation metrics of the Model. The schema of the metrics is stored in - // [metrics_schema_uri][google.cloud.aiplatform.v1.ModelEvaluation.metrics_schema_uri] - google.protobuf.Value metrics = 3; - - // Output only. Timestamp when this ModelEvaluation was created. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // All possible [dimensions][ModelEvaluationSlice.slice.dimension] of - // ModelEvaluationSlices. The dimensions can be used as the filter of the - // [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices] request, in the form of - // `slice.dimension = `. - repeated string slice_dimensions = 5; - - // Points to a YAML file stored on Google Cloud Storage describing - // [EvaluatedDataItemView.data_item_payload][] and - // [EvaluatedAnnotation.data_item_payload][]. The schema is defined as an - // OpenAPI 3.0.2 [Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - // - // This field is not populated if there are neither EvaluatedDataItemViews nor - // EvaluatedAnnotations under this ModelEvaluation. - string data_item_schema_uri = 6; - - // Points to a YAML file stored on Google Cloud Storage describing - // [EvaluatedDataItemView.predictions][], - // [EvaluatedDataItemView.ground_truths][], - // [EvaluatedAnnotation.predictions][], and - // [EvaluatedAnnotation.ground_truths][]. The schema is defined as an - // OpenAPI 3.0.2 [Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - // - // This field is not populated if there are neither EvaluatedDataItemViews nor - // EvaluatedAnnotations under this ModelEvaluation. - string annotation_schema_uri = 7; - - // Aggregated explanation metrics for the Model's prediction output over the - // data this ModelEvaluation uses. This field is populated only if the Model - // is evaluated with explanations, and only for AutoML tabular Models. - // - ModelExplanation model_explanation = 8; - - // Describes the values of [ExplanationSpec][google.cloud.aiplatform.v1.ExplanationSpec] that are used for explaining - // the predicted values on the evaluated data. - repeated ModelEvaluationExplanationSpec explanation_specs = 9; - - // The metadata of the ModelEvaluation. - // For the ModelEvaluation uploaded from Managed Pipeline, metadata contains a - // structured value with keys of "pipeline_job_id", "evaluation_dataset_type", - // "evaluation_dataset_path". - google.protobuf.Value metadata = 11; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto deleted file mode 100644 index f28b0135..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto +++ /dev/null @@ -1,71 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ModelEvaluationSliceProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A collection of metrics calculated by comparing Model's predictions on a -// slice of the test data against ground truth annotations. -message ModelEvaluationSlice { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/ModelEvaluationSlice" - pattern: "projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}" - }; - - // Definition of a slice. - message Slice { - // Output only. The dimension of the slice. - // Well-known dimensions are: - // * `annotationSpec`: This slice is on the test data that has either - // ground truth or prediction with [AnnotationSpec.display_name][google.cloud.aiplatform.v1.AnnotationSpec.display_name] - // equals to [value][google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.value]. - string dimension = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The value of the dimension in this slice. - string value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. The resource name of the ModelEvaluationSlice. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The slice of the test data that is used to evaluate the Model. - Slice slice = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Points to a YAML file stored on Google Cloud Storage describing the - // [metrics][google.cloud.aiplatform.v1.ModelEvaluationSlice.metrics] of this ModelEvaluationSlice. The - // schema is defined as an OpenAPI 3.0.2 [Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - string metrics_schema_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Sliced evaluation metrics of the Model. The schema of the metrics is stored - // in [metrics_schema_uri][google.cloud.aiplatform.v1.ModelEvaluationSlice.metrics_schema_uri] - google.protobuf.Value metrics = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this ModelEvaluationSlice was created. - google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_monitoring.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_monitoring.proto deleted file mode 100644 index 0daff79d..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_monitoring.proto +++ /dev/null @@ -1,202 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/io.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ModelMonitoringProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Next ID: 8 -message ModelMonitoringObjectiveConfig { - // Training Dataset information. - message TrainingDataset { - oneof data_source { - // The resource name of the Dataset used to train this Model. - string dataset = 3 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - }]; - - // The Google Cloud Storage uri of the unmanaged Dataset used to train - // this Model. - GcsSource gcs_source = 4; - - // The BigQuery table of the unmanaged Dataset used to train this - // Model. - BigQuerySource bigquery_source = 5; - } - - // Data format of the dataset, only applicable if the input is from - // Google Cloud Storage. - // The possible formats are: - // - // "tf-record" - // The source file is a TFRecord file. - // - // "csv" - // The source file is a CSV file. - string data_format = 2; - - // The target field name the model is to predict. - // This field will be excluded when doing Predict and (or) Explain for the - // training data. - string target_field = 6; - - // Strategy to sample data from Training Dataset. - // If not set, we process the whole dataset. - SamplingStrategy logging_sampling_strategy = 7; - } - - // The config for Training & Prediction data skew detection. It specifies the - // training dataset sources and the skew detection parameters. - message TrainingPredictionSkewDetectionConfig { - // Key is the feature name and value is the threshold. If a feature needs to - // be monitored for skew, a value threshold must be configured for that - // feature. The threshold here is against feature distribution distance - // between the training and prediction feature. - map skew_thresholds = 1; - - // Key is the feature name and value is the threshold. The threshold here is - // against attribution score distance between the training and prediction - // feature. - map attribution_score_skew_thresholds = 2; - } - - // The config for Prediction data drift detection. - message PredictionDriftDetectionConfig { - // Key is the feature name and value is the threshold. If a feature needs to - // be monitored for drift, a value threshold must be configured for that - // feature. The threshold here is against feature distribution distance - // between different time windws. - map drift_thresholds = 1; - - // Key is the feature name and value is the threshold. The threshold here is - // against attribution score distance between different time windows. - map attribution_score_drift_thresholds = 2; - } - - // The config for integrating with Vertex Explainable AI. Only applicable if - // the Model has explanation_spec populated. - message ExplanationConfig { - // Output from [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob] for Model Monitoring baseline dataset, - // which can be used to generate baseline attribution scores. - message ExplanationBaseline { - // The storage format of the predictions generated BatchPrediction job. - enum PredictionFormat { - // Should not be set. - PREDICTION_FORMAT_UNSPECIFIED = 0; - - // Predictions are in JSONL files. - JSONL = 2; - - // Predictions are in BigQuery. - BIGQUERY = 3; - } - - // The configuration specifying of BatchExplain job output. This can be - // used to generate the baseline of feature attribution scores. - oneof destination { - // Cloud Storage location for BatchExplain output. - GcsDestination gcs = 2; - - // BigQuery location for BatchExplain output. - BigQueryDestination bigquery = 3; - } - - // The storage format of the predictions generated BatchPrediction job. - PredictionFormat prediction_format = 1; - } - - // If want to analyze the Vertex Explainable AI feature attribute scores or - // not. If set to true, Vertex AI will log the feature attributions from - // explain response and do the skew/drift detection for them. - bool enable_feature_attributes = 1; - - // Predictions generated by the BatchPredictionJob using baseline dataset. - ExplanationBaseline explanation_baseline = 2; - } - - // Training dataset for models. This field has to be set only if - // TrainingPredictionSkewDetectionConfig is specified. - TrainingDataset training_dataset = 1; - - // The config for skew between training data and prediction data. - TrainingPredictionSkewDetectionConfig training_prediction_skew_detection_config = 2; - - // The config for drift of prediction data. - PredictionDriftDetectionConfig prediction_drift_detection_config = 3; - - // The config for integrating with Vertex Explainable AI. - ExplanationConfig explanation_config = 5; -} - -// Next ID: 3 -message ModelMonitoringAlertConfig { - // The config for email alert. - message EmailAlertConfig { - // The email addresses to send the alert. - repeated string user_emails = 1; - } - - oneof alert { - // Email alert config. - EmailAlertConfig email_alert_config = 1; - } - - // Dump the anomalies to Cloud Logging. The anomalies will be put to json - // payload encoded from proto - // [google.cloud.aiplatform.logging.ModelMonitoringAnomaliesLogEntry][]. - // This can be further sinked to Pub/Sub or any other services supported - // by Cloud Logging. - bool enable_logging = 2; -} - -// The config for feature monitoring threshold. -// Next ID: 3 -message ThresholdConfig { - oneof threshold { - // Specify a threshold value that can trigger the alert. - // If this threshold config is for feature distribution distance: - // 1. For categorical feature, the distribution distance is calculated by - // L-inifinity norm. - // 2. For numerical feature, the distribution distance is calculated by - // Jensen–Shannon divergence. - // Each feature must have a non-zero threshold if they need to be monitored. - // Otherwise no alert will be triggered for that feature. - double value = 1; - } -} - -// Sampling Strategy for logging, can be for both training and prediction -// dataset. -// Next ID: 2 -message SamplingStrategy { - // Requests are randomly selected. - message RandomSampleConfig { - // Sample rate (0, 1] - double sample_rate = 1; - } - - // Random sample config. Will support more sampling strategies later. - RandomSampleConfig random_sample_config = 1; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_service.proto deleted file mode 100644 index 726d3ec2..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_service.proto +++ /dev/null @@ -1,480 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/io.proto"; -import "google/cloud/aiplatform/v1/model.proto"; -import "google/cloud/aiplatform/v1/model_evaluation.proto"; -import "google/cloud/aiplatform/v1/model_evaluation_slice.proto"; -import "google/cloud/aiplatform/v1/operation.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ModelServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A service for managing Vertex AI's machine learning Models. -service ModelService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Uploads a Model artifact into Vertex AI. - rpc UploadModel(UploadModelRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/models:upload" - body: "*" - }; - option (google.api.method_signature) = "parent,model"; - option (google.longrunning.operation_info) = { - response_type: "UploadModelResponse" - metadata_type: "UploadModelOperationMetadata" - }; - } - - // Gets a Model. - rpc GetModel(GetModelRequest) returns (Model) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/models/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Models in a Location. - rpc ListModels(ListModelsRequest) returns (ListModelsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/models" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates a Model. - rpc UpdateModel(UpdateModelRequest) returns (Model) { - option (google.api.http) = { - patch: "/v1/{model.name=projects/*/locations/*/models/*}" - body: "model" - }; - option (google.api.method_signature) = "model,update_mask"; - } - - // Deletes a Model. - // - // A model cannot be deleted if any [Endpoint][google.cloud.aiplatform.v1.Endpoint] resource has a - // [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] based on the model in its - // [deployed_models][google.cloud.aiplatform.v1.Endpoint.deployed_models] field. - rpc DeleteModel(DeleteModelRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/models/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Exports a trained, exportable Model to a location specified by the - // user. A Model is considered to be exportable if it has at least one - // [supported export format][google.cloud.aiplatform.v1.Model.supported_export_formats]. - rpc ExportModel(ExportModelRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/models/*}:export" - body: "*" - }; - option (google.api.method_signature) = "name,output_config"; - option (google.longrunning.operation_info) = { - response_type: "ExportModelResponse" - metadata_type: "ExportModelOperationMetadata" - }; - } - - // Imports an externally generated ModelEvaluation. - rpc ImportModelEvaluation(ImportModelEvaluationRequest) returns (ModelEvaluation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/models/*}/evaluations:import" - body: "*" - }; - option (google.api.method_signature) = "parent,model_evaluation"; - } - - // Gets a ModelEvaluation. - rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/models/*/evaluations/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists ModelEvaluations in a Model. - rpc ListModelEvaluations(ListModelEvaluationsRequest) returns (ListModelEvaluationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/models/*}/evaluations" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets a ModelEvaluationSlice. - rpc GetModelEvaluationSlice(GetModelEvaluationSliceRequest) returns (ModelEvaluationSlice) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/models/*/evaluations/*/slices/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists ModelEvaluationSlices in a ModelEvaluation. - rpc ListModelEvaluationSlices(ListModelEvaluationSlicesRequest) returns (ListModelEvaluationSlicesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/models/*/evaluations/*}/slices" - }; - option (google.api.method_signature) = "parent"; - } -} - -// Request message for [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel]. -message UploadModelRequest { - // Required. The resource name of the Location into which to upload the Model. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The Model to create. - Model model = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Details of [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel] operation. -message UploadModelOperationMetadata { - // The common part of the operation metadata. - GenericOperationMetadata generic_metadata = 1; -} - -// Response message of [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel] operation. -message UploadModelResponse { - // The name of the uploaded Model resource. - // Format: `projects/{project}/locations/{location}/models/{model}` - string model = 1 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - }]; -} - -// Request message for [ModelService.GetModel][google.cloud.aiplatform.v1.ModelService.GetModel]. -message GetModelRequest { - // Required. The name of the Model resource. - // Format: `projects/{project}/locations/{location}/models/{model}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; -} - -// Request message for [ModelService.ListModels][google.cloud.aiplatform.v1.ModelService.ListModels]. -message ListModelsRequest { - // Required. The resource name of the Location to list the Models from. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // An expression for filtering the results of the request. For field names - // both snake_case and camelCase are supported. - // - // * `model` supports = and !=. `model` represents the Model ID, - // i.e. the last segment of the Model's [resource name][google.cloud.aiplatform.v1.Model.name]. - // * `display_name` supports = and != - // * `labels` supports general map functions that is: - // * `labels.key=value` - key:value equality - // * `labels.key:* or labels:key - key existence - // * A key including a space must be quoted. `labels."a key"`. - // - // Some examples: - // * `model=1234` - // * `displayName="myDisplayName"` - // * `labels.myKey="myValue"` - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListModelsResponse.next_page_token][google.cloud.aiplatform.v1.ListModelsResponse.next_page_token] of the previous - // [ModelService.ListModels][google.cloud.aiplatform.v1.ModelService.ListModels] call. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; - - // A comma-separated list of fields to order by, sorted in ascending order. - // Use "desc" after a field name for descending. - // Supported fields: - // * `display_name` - // * `create_time` - // * `update_time` - // - // Example: `display_name, create_time desc`. - string order_by = 6; -} - -// Response message for [ModelService.ListModels][google.cloud.aiplatform.v1.ModelService.ListModels] -message ListModelsResponse { - // List of Models in the requested page. - repeated Model models = 1; - - // A token to retrieve next page of results. - // Pass to [ListModelsRequest.page_token][google.cloud.aiplatform.v1.ListModelsRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [ModelService.UpdateModel][google.cloud.aiplatform.v1.ModelService.UpdateModel]. -message UpdateModelRequest { - // Required. The Model which replaces the resource on the server. - // When Model Versioning is enabled, the model.name will be used to determine - // whether to update the model or model version. - // 1. model.name with the @ value, e.g. models/123@1, refers to a version - // specific update. - // 2. model.name without the @ value, e.g. models/123, refers to a model - // update. - // 3. model.name with @-, e.g. models/123@-, refers to a model update. - // 4. Supported model fields: display_name, description; supported - // version-specific fields: version_description. Labels are supported in both - // scenarios. Both the model labels and the version labels are merged when a - // model is returned. When updating labels, if the request is for - // model-specific update, model label gets updated. Otherwise, version labels - // get updated. - // 5. A model name or model version name fields update mismatch will cause a - // precondition error. - // 6. One request cannot update both the model and the version fields. You - // must update them separately. - Model model = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The update mask applies to the resource. - // For the `FieldMask` definition, see [google.protobuf.FieldMask][google.protobuf.FieldMask]. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [ModelService.DeleteModel][google.cloud.aiplatform.v1.ModelService.DeleteModel]. -message DeleteModelRequest { - // Required. The name of the Model resource to be deleted. - // Format: `projects/{project}/locations/{location}/models/{model}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; -} - -// Request message for [ModelService.ExportModel][google.cloud.aiplatform.v1.ModelService.ExportModel]. -message ExportModelRequest { - // Output configuration for the Model export. - message OutputConfig { - // The ID of the format in which the Model must be exported. Each Model - // lists the [export formats it supports][google.cloud.aiplatform.v1.Model.supported_export_formats]. - // If no value is provided here, then the first from the list of the Model's - // supported formats is used by default. - string export_format_id = 1; - - // The Cloud Storage location where the Model artifact is to be - // written to. Under the directory given as the destination a new one with - // name "`model-export--`", - // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, - // will be created. Inside, the Model and any of its supporting files - // will be written. - // This field should only be set when the `exportableContent` field of the - // [Model.supported_export_formats] object contains `ARTIFACT`. - GcsDestination artifact_destination = 3; - - // The Google Container Registry or Artifact Registry uri where the - // Model container image will be copied to. - // This field should only be set when the `exportableContent` field of the - // [Model.supported_export_formats] object contains `IMAGE`. - ContainerRegistryDestination image_destination = 4; - } - - // Required. The resource name of the Model to export. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - - // Required. The desired output location and configuration. - OutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Details of [ModelService.ExportModel][google.cloud.aiplatform.v1.ModelService.ExportModel] operation. -message ExportModelOperationMetadata { - // Further describes the output of the ExportModel. Supplements - // [ExportModelRequest.OutputConfig][google.cloud.aiplatform.v1.ExportModelRequest.OutputConfig]. - message OutputInfo { - // Output only. If the Model artifact is being exported to Google Cloud Storage this is - // the full path of the directory created, into which the Model files are - // being written to. - string artifact_output_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If the Model image is being exported to Google Container Registry or - // Artifact Registry this is the full path of the image created. - string image_output_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // The common part of the operation metadata. - GenericOperationMetadata generic_metadata = 1; - - // Output only. Information further describing the output of this Model export. - OutputInfo output_info = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Response message of [ModelService.ExportModel][google.cloud.aiplatform.v1.ModelService.ExportModel] operation. -message ExportModelResponse { - -} - -// Request message for [ModelService.ImportModelEvaluation][google.cloud.aiplatform.v1.ModelService.ImportModelEvaluation] -message ImportModelEvaluationRequest { - // Required. The name of the parent model resource. - // Format: `projects/{project}/locations/{location}/models/{model}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - - // Required. Model evaluation resource to be imported. - ModelEvaluation model_evaluation = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [ModelService.GetModelEvaluation][google.cloud.aiplatform.v1.ModelService.GetModelEvaluation]. -message GetModelEvaluationRequest { - // Required. The name of the ModelEvaluation resource. - // Format: - // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelEvaluation" - } - ]; -} - -// Request message for [ModelService.ListModelEvaluations][google.cloud.aiplatform.v1.ModelService.ListModelEvaluations]. -message ListModelEvaluationsRequest { - // Required. The resource name of the Model to list the ModelEvaluations from. - // Format: `projects/{project}/locations/{location}/models/{model}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - - // The standard list filter. - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListModelEvaluationsResponse.next_page_token][google.cloud.aiplatform.v1.ListModelEvaluationsResponse.next_page_token] of the previous - // [ModelService.ListModelEvaluations][google.cloud.aiplatform.v1.ModelService.ListModelEvaluations] call. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for [ModelService.ListModelEvaluations][google.cloud.aiplatform.v1.ModelService.ListModelEvaluations]. -message ListModelEvaluationsResponse { - // List of ModelEvaluations in the requested page. - repeated ModelEvaluation model_evaluations = 1; - - // A token to retrieve next page of results. - // Pass to [ListModelEvaluationsRequest.page_token][google.cloud.aiplatform.v1.ListModelEvaluationsRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [ModelService.GetModelEvaluationSlice][google.cloud.aiplatform.v1.ModelService.GetModelEvaluationSlice]. -message GetModelEvaluationSliceRequest { - // Required. The name of the ModelEvaluationSlice resource. - // Format: - // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelEvaluationSlice" - } - ]; -} - -// Request message for [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices]. -message ListModelEvaluationSlicesRequest { - // Required. The resource name of the ModelEvaluation to list the ModelEvaluationSlices - // from. Format: - // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelEvaluation" - } - ]; - - // The standard list filter. - // - // * `slice.dimension` - for =. - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListModelEvaluationSlicesResponse.next_page_token][google.cloud.aiplatform.v1.ListModelEvaluationSlicesResponse.next_page_token] of the previous - // [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices] call. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices]. -message ListModelEvaluationSlicesResponse { - // List of ModelEvaluations in the requested page. - repeated ModelEvaluationSlice model_evaluation_slices = 1; - - // A token to retrieve next page of results. - // Pass to [ListModelEvaluationSlicesRequest.page_token][google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest.page_token] to obtain that - // page. - string next_page_token = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/operation.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/operation.proto deleted file mode 100644 index da7c5dcc..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/operation.proto +++ /dev/null @@ -1,52 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "OperationProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Generic Metadata shared by all operations. -message GenericOperationMetadata { - // Output only. Partial failures encountered. - // E.g. single files that couldn't be read. - // This field should never exceed 20 entries. - // Status details field will contain standard GCP error details. - repeated google.rpc.Status partial_failures = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the operation was created. - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the operation was updated for the last time. - // If the operation has finished (successfully or not), this is the finish - // time. - google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Details of operations that perform deletes of any entities. -message DeleteOperationMetadata { - // The common part of the operation metadata. - GenericOperationMetadata generic_metadata = 1; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_job.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_job.proto deleted file mode 100644 index 21f92926..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_job.proto +++ /dev/null @@ -1,319 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/artifact.proto"; -import "google/cloud/aiplatform/v1/context.proto"; -import "google/cloud/aiplatform/v1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1/execution.proto"; -import "google/cloud/aiplatform/v1/pipeline_state.proto"; -import "google/cloud/aiplatform/v1/value.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "Pipeline"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; -option (google.api.resource_definition) = { - type: "compute.googleapis.com/Network" - pattern: "projects/{project}/global/networks/{network}" -}; - -// An instance of a machine learning PipelineJob. -message PipelineJob { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/PipelineJob" - pattern: "projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}" - }; - - // The runtime config of a PipelineJob. - message RuntimeConfig { - // Deprecated. Use [RuntimeConfig.parameter_values][google.cloud.aiplatform.v1.PipelineJob.RuntimeConfig.parameter_values] instead. The runtime - // parameters of the PipelineJob. The parameters will be passed into - // [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_spec] to replace the placeholders at runtime. - // This field is used by pipelines built using - // `PipelineJob.pipeline_spec.schema_version` 2.0.0 or lower, such as - // pipelines built using Kubeflow Pipelines SDK 1.8 or lower. - map parameters = 1 [deprecated = true]; - - // Required. A path in a Cloud Storage bucket, which will be treated as the root - // output directory of the pipeline. It is used by the system to - // generate the paths of output artifacts. The artifact paths are generated - // with a sub-path pattern `{job_id}/{task_id}/{output_key}` under the - // specified output directory. The service account specified in this - // pipeline must have the `storage.objects.get` and `storage.objects.create` - // permissions for this bucket. - string gcs_output_directory = 2 [(google.api.field_behavior) = REQUIRED]; - - // The runtime parameters of the PipelineJob. The parameters will be - // passed into [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_spec] to replace the placeholders - // at runtime. This field is used by pipelines built using - // `PipelineJob.pipeline_spec.schema_version` 2.1.0, such as pipelines built - // using Kubeflow Pipelines SDK 1.9 or higher and the v2 DSL. - map parameter_values = 3; - } - - // Output only. The resource name of the PipelineJob. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The display name of the Pipeline. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - string display_name = 2; - - // Output only. Pipeline creation time. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Pipeline start time. - google.protobuf.Timestamp start_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Pipeline end time. - google.protobuf.Timestamp end_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this PipelineJob was most recently updated. - google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The spec of the pipeline. - google.protobuf.Struct pipeline_spec = 7; - - // Output only. The detailed state of the job. - PipelineState state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The details of pipeline run. Not available in the list view. - PipelineJobDetail job_detail = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The error that occurred during pipeline execution. - // Only populated when the pipeline's state is FAILED or CANCELLED. - google.rpc.Status error = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize PipelineJob. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 11; - - // Runtime config of the pipeline. - RuntimeConfig runtime_config = 12; - - // Customer-managed encryption key spec for a pipelineJob. If set, this - // PipelineJob and all of its sub-resources will be secured by this key. - EncryptionSpec encryption_spec = 16; - - // The service account that the pipeline workload runs as. - // If not specified, the Compute Engine default service account in the project - // will be used. - // See - // https://cloud.google.com/compute/docs/access/service-accounts#default_service_account - // - // Users starting the pipeline must have the `iam.serviceAccounts.actAs` - // permission on this service account. - string service_account = 17; - - // The full name of the Compute Engine - // [network](/compute/docs/networks-and-firewalls#networks) to which the - // Pipeline Job's workload should be peered. For example, - // `projects/12345/global/networks/myVPC`. - // [Format](/compute/docs/reference/rest/v1/networks/insert) - // is of the form `projects/{project}/global/networks/{network}`. - // Where {project} is a project number, as in `12345`, and {network} is a - // network name. - // - // Private services access must already be configured for the network. - // Pipeline job will apply the network configuration to the GCP resources - // being launched, if applied, such as Vertex AI - // Training or Dataflow job. If left unspecified, the workload is not peered - // with any network. - string network = 18 [(google.api.resource_reference) = { - type: "compute.googleapis.com/Network" - }]; -} - -// The runtime detail of PipelineJob. -message PipelineJobDetail { - // Output only. The context of the pipeline. - Context pipeline_context = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The context of the current pipeline run. - Context pipeline_run_context = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The runtime details of the tasks under the pipeline. - repeated PipelineTaskDetail task_details = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The runtime detail of a task execution. -message PipelineTaskDetail { - // A single record of the task status. - message PipelineTaskStatus { - // Output only. Update time of this status. - google.protobuf.Timestamp update_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The state of the task. - State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The error that occurred during the state. May be set when the state is - // any of the non-final state (PENDING/RUNNING/CANCELLING) or FAILED state. - // If the state is FAILED, the error here is final and not going to be - // retried. - // If the state is a non-final state, the error indicates a system-error - // being retried. - google.rpc.Status error = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // A list of artifact metadata. - message ArtifactList { - // Output only. A list of artifact metadata. - repeated Artifact artifacts = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Specifies state of TaskExecution - enum State { - // Unspecified. - STATE_UNSPECIFIED = 0; - - // Specifies pending state for the task. - PENDING = 1; - - // Specifies task is being executed. - RUNNING = 2; - - // Specifies task completed successfully. - SUCCEEDED = 3; - - // Specifies Task cancel is in pending state. - CANCEL_PENDING = 4; - - // Specifies task is being cancelled. - CANCELLING = 5; - - // Specifies task was cancelled. - CANCELLED = 6; - - // Specifies task failed. - FAILED = 7; - - // Specifies task was skipped due to cache hit. - SKIPPED = 8; - - // Specifies that the task was not triggered because the task's trigger - // policy is not satisfied. The trigger policy is specified in the - // `condition` field of [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_spec]. - NOT_TRIGGERED = 9; - } - - // Output only. The system generated ID of the task. - int64 task_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The id of the parent task if the task is within a component scope. - // Empty if the task is at the root level. - int64 parent_task_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The user specified name of the task that is defined in - // [PipelineJob.spec][]. - string task_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Task create time. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Task start time. - google.protobuf.Timestamp start_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Task end time. - google.protobuf.Timestamp end_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The detailed execution info. - PipelineTaskExecutorDetail executor_detail = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. State of the task. - State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The execution metadata of the task. - Execution execution = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The error that occurred during task execution. - // Only populated when the task's state is FAILED or CANCELLED. - google.rpc.Status error = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A list of task status. This field keeps a record of task status evolving - // over time. - repeated PipelineTaskStatus pipeline_task_status = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The runtime input artifacts of the task. - map inputs = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The runtime output artifacts of the task. - map outputs = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The runtime detail of a pipeline executor. -message PipelineTaskExecutorDetail { - // The detail of a container execution. It contains the job names of the - // lifecycle of a container execution. - message ContainerDetail { - // Output only. The name of the [CustomJob][google.cloud.aiplatform.v1.CustomJob] for the main container execution. - string main_job = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/CustomJob" - } - ]; - - // Output only. The name of the [CustomJob][google.cloud.aiplatform.v1.CustomJob] for the pre-caching-check container - // execution. This job will be available if the - // [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_spec] specifies the `pre_caching_check` hook in - // the lifecycle events. - string pre_caching_check_job = 2 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/CustomJob" - } - ]; - } - - // The detailed info for a custom job executor. - message CustomJobDetail { - option deprecated = true; - - // Output only. The name of the [CustomJob][google.cloud.aiplatform.v1.CustomJob]. - string job = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/CustomJob" - } - ]; - } - - oneof details { - // Output only. The detailed info for a container executor. - ContainerDetail container_detail = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The detailed info for a custom job executor. - CustomJobDetail custom_job_detail = 2 [ - deprecated = true, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - } -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_service.proto deleted file mode 100644 index d749ecc8..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_service.proto +++ /dev/null @@ -1,403 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/pipeline_job.proto"; -import "google/cloud/aiplatform/v1/training_pipeline.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "PipelineServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A service for creating and managing Vertex AI's pipelines. This includes both -// `TrainingPipeline` resources (used for AutoML and custom training) and -// `PipelineJob` resources (used for Vertex AI Pipelines). -service PipelineService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a TrainingPipeline. A created TrainingPipeline right away will be - // attempted to be run. - rpc CreateTrainingPipeline(CreateTrainingPipelineRequest) returns (TrainingPipeline) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/trainingPipelines" - body: "training_pipeline" - }; - option (google.api.method_signature) = "parent,training_pipeline"; - } - - // Gets a TrainingPipeline. - rpc GetTrainingPipeline(GetTrainingPipelineRequest) returns (TrainingPipeline) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/trainingPipelines/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists TrainingPipelines in a Location. - rpc ListTrainingPipelines(ListTrainingPipelinesRequest) returns (ListTrainingPipelinesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/trainingPipelines" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a TrainingPipeline. - rpc DeleteTrainingPipeline(DeleteTrainingPipelineRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/trainingPipelines/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Cancels a TrainingPipeline. - // Starts asynchronous cancellation on the TrainingPipeline. The server - // makes a best effort to cancel the pipeline, but success is not - // guaranteed. Clients can use [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline] or - // other methods to check whether the cancellation succeeded or whether the - // pipeline completed despite cancellation. On successful cancellation, - // the TrainingPipeline is not deleted; instead it becomes a pipeline with - // a [TrainingPipeline.error][google.cloud.aiplatform.v1.TrainingPipeline.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`, and [TrainingPipeline.state][google.cloud.aiplatform.v1.TrainingPipeline.state] is set to - // `CANCELLED`. - rpc CancelTrainingPipeline(CancelTrainingPipelineRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/trainingPipelines/*}:cancel" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a PipelineJob. A PipelineJob will run immediately when created. - rpc CreatePipelineJob(CreatePipelineJobRequest) returns (PipelineJob) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/pipelineJobs" - body: "pipeline_job" - }; - option (google.api.method_signature) = "parent,pipeline_job,pipeline_job_id"; - } - - // Gets a PipelineJob. - rpc GetPipelineJob(GetPipelineJobRequest) returns (PipelineJob) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/pipelineJobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists PipelineJobs in a Location. - rpc ListPipelineJobs(ListPipelineJobsRequest) returns (ListPipelineJobsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/pipelineJobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a PipelineJob. - rpc DeletePipelineJob(DeletePipelineJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/pipelineJobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Cancels a PipelineJob. - // Starts asynchronous cancellation on the PipelineJob. The server - // makes a best effort to cancel the pipeline, but success is not - // guaranteed. Clients can use [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1.PipelineService.GetPipelineJob] or - // other methods to check whether the cancellation succeeded or whether the - // pipeline completed despite cancellation. On successful cancellation, - // the PipelineJob is not deleted; instead it becomes a pipeline with - // a [PipelineJob.error][google.cloud.aiplatform.v1.PipelineJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`, and [PipelineJob.state][google.cloud.aiplatform.v1.PipelineJob.state] is set to - // `CANCELLED`. - rpc CancelPipelineJob(CancelPipelineJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/pipelineJobs/*}:cancel" - body: "*" - }; - option (google.api.method_signature) = "name"; - } -} - -// Request message for [PipelineService.CreateTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.CreateTrainingPipeline]. -message CreateTrainingPipelineRequest { - // Required. The resource name of the Location to create the TrainingPipeline in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The TrainingPipeline to create. - TrainingPipeline training_pipeline = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline]. -message GetTrainingPipelineRequest { - // Required. The name of the TrainingPipeline resource. - // Format: - // `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TrainingPipeline" - } - ]; -} - -// Request message for [PipelineService.ListTrainingPipelines][google.cloud.aiplatform.v1.PipelineService.ListTrainingPipelines]. -message ListTrainingPipelinesRequest { - // Required. The resource name of the Location to list the TrainingPipelines from. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The standard list filter. - // Supported fields: - // - // * `display_name` supports = and !=. - // - // * `state` supports = and !=. - // - // Some examples of using the filter are: - // - // * `state="PIPELINE_STATE_SUCCEEDED" AND display_name="my_pipeline"` - // - // * `state="PIPELINE_STATE_RUNNING" OR display_name="my_pipeline"` - // - // * `NOT display_name="my_pipeline"` - // - // * `state="PIPELINE_STATE_FAILED"` - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListTrainingPipelinesResponse.next_page_token][google.cloud.aiplatform.v1.ListTrainingPipelinesResponse.next_page_token] of the previous - // [PipelineService.ListTrainingPipelines][google.cloud.aiplatform.v1.PipelineService.ListTrainingPipelines] call. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for [PipelineService.ListTrainingPipelines][google.cloud.aiplatform.v1.PipelineService.ListTrainingPipelines] -message ListTrainingPipelinesResponse { - // List of TrainingPipelines in the requested page. - repeated TrainingPipeline training_pipelines = 1; - - // A token to retrieve the next page of results. - // Pass to [ListTrainingPipelinesRequest.page_token][google.cloud.aiplatform.v1.ListTrainingPipelinesRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [PipelineService.DeleteTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.DeleteTrainingPipeline]. -message DeleteTrainingPipelineRequest { - // Required. The name of the TrainingPipeline resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TrainingPipeline" - } - ]; -} - -// Request message for [PipelineService.CancelTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.CancelTrainingPipeline]. -message CancelTrainingPipelineRequest { - // Required. The name of the TrainingPipeline to cancel. - // Format: - // `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TrainingPipeline" - } - ]; -} - -// Request message for [PipelineService.CreatePipelineJob][google.cloud.aiplatform.v1.PipelineService.CreatePipelineJob]. -message CreatePipelineJobRequest { - // Required. The resource name of the Location to create the PipelineJob in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The PipelineJob to create. - PipelineJob pipeline_job = 2 [(google.api.field_behavior) = REQUIRED]; - - // The ID to use for the PipelineJob, which will become the final component of - // the PipelineJob name. If not provided, an ID will be automatically - // generated. - // - // This value should be less than 128 characters, and valid characters - // are /[a-z][0-9]-/. - string pipeline_job_id = 3; -} - -// Request message for [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1.PipelineService.GetPipelineJob]. -message GetPipelineJobRequest { - // Required. The name of the PipelineJob resource. - // Format: - // `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/PipelineJob" - } - ]; -} - -// Request message for [PipelineService.ListPipelineJobs][google.cloud.aiplatform.v1.PipelineService.ListPipelineJobs]. -message ListPipelineJobsRequest { - // Required. The resource name of the Location to list the PipelineJobs from. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Lists the PipelineJobs that match the filter expression. The following - // fields are supported: - // - // * `pipeline_name`: Supports `=` and `!=` comparisons. - // * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. - // * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. - // for example, can check if pipeline's display_name contains *step* by doing - // display_name:\"*step*\" - // * `state`: Supports `=` and `!=` comparisons. - // * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - // Values must be in RFC 3339 format. - // * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - // Values must be in RFC 3339 format. - // * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - // Values must be in RFC 3339 format. - // * `labels`: Supports key-value equality and key presence. - // * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. - // * `template_metadata.version_name`: Supports `=`, `!=` comparisons, and `:` - // wildcard. - // - // Filter expressions can be combined together using logical operators - // (`AND` & `OR`). - // For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. - // - // The syntax to define filter expression is based on - // https://google.aip.dev/160. - // - // Examples: - // - // * `create_time>"2021-05-18T00:00:00Z" OR - // update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated - // after 2020-05-18 00:00:00 UTC. - // * `labels.env = "prod"` - // PipelineJobs with label "env" set to "prod". - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListPipelineJobsResponse.next_page_token][google.cloud.aiplatform.v1.ListPipelineJobsResponse.next_page_token] of the previous - // [PipelineService.ListPipelineJobs][google.cloud.aiplatform.v1.PipelineService.ListPipelineJobs] call. - string page_token = 4; - - // A comma-separated list of fields to order by. The default sort order is in - // ascending order. Use "desc" after a field name for descending. You can have - // multiple order_by fields provided e.g. "create_time desc, end_time", - // "end_time, start_time, update_time" For example, using "create_time desc, - // end_time" will order results by create time in descending order, and if - // there are multiple jobs having the same create time, order them by the end - // time in ascending order. if order_by is not specified, it will order by - // default order is create time in descending order. Supported fields: - // * `create_time` - // * `update_time` - // * `end_time` - // * `start_time` - string order_by = 6; -} - -// Response message for [PipelineService.ListPipelineJobs][google.cloud.aiplatform.v1.PipelineService.ListPipelineJobs] -message ListPipelineJobsResponse { - // List of PipelineJobs in the requested page. - repeated PipelineJob pipeline_jobs = 1; - - // A token to retrieve the next page of results. - // Pass to [ListPipelineJobsRequest.page_token][google.cloud.aiplatform.v1.ListPipelineJobsRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [PipelineService.DeletePipelineJob][google.cloud.aiplatform.v1.PipelineService.DeletePipelineJob]. -message DeletePipelineJobRequest { - // Required. The name of the PipelineJob resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/PipelineJob" - } - ]; -} - -// Request message for [PipelineService.CancelPipelineJob][google.cloud.aiplatform.v1.PipelineService.CancelPipelineJob]. -message CancelPipelineJobRequest { - // Required. The name of the PipelineJob to cancel. - // Format: - // `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/PipelineJob" - } - ]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_state.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_state.proto deleted file mode 100644 index a06ae8ab..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_state.proto +++ /dev/null @@ -1,58 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "PipelineStateProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Describes the state of a pipeline. -enum PipelineState { - // The pipeline state is unspecified. - PIPELINE_STATE_UNSPECIFIED = 0; - - // The pipeline has been created or resumed, and processing has not yet - // begun. - PIPELINE_STATE_QUEUED = 1; - - // The service is preparing to run the pipeline. - PIPELINE_STATE_PENDING = 2; - - // The pipeline is in progress. - PIPELINE_STATE_RUNNING = 3; - - // The pipeline completed successfully. - PIPELINE_STATE_SUCCEEDED = 4; - - // The pipeline failed. - PIPELINE_STATE_FAILED = 5; - - // The pipeline is being cancelled. From this state, the pipeline may only go - // to either PIPELINE_STATE_SUCCEEDED, PIPELINE_STATE_FAILED or - // PIPELINE_STATE_CANCELLED. - PIPELINE_STATE_CANCELLING = 6; - - // The pipeline has been cancelled. - PIPELINE_STATE_CANCELLED = 7; - - // The pipeline has been stopped, and can be resumed. - PIPELINE_STATE_PAUSED = 8; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/prediction_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/prediction_service.proto deleted file mode 100644 index e2ba4349..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/prediction_service.proto +++ /dev/null @@ -1,227 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/httpbody.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/explanation.proto"; -import "google/protobuf/struct.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "PredictionServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A service for online predictions and explanations. -service PredictionService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Perform an online prediction. - rpc Predict(PredictRequest) returns (PredictResponse) { - option (google.api.http) = { - post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:predict" - body: "*" - }; - option (google.api.method_signature) = "endpoint,instances,parameters"; - } - - // Perform an online prediction with an arbitrary HTTP payload. - // - // The response includes the following HTTP headers: - // - // * `X-Vertex-AI-Endpoint-Id`: ID of the [Endpoint][google.cloud.aiplatform.v1.Endpoint] that served this - // prediction. - // - // * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] - // that served this prediction. - rpc RawPredict(RawPredictRequest) returns (google.api.HttpBody) { - option (google.api.http) = { - post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:rawPredict" - body: "*" - }; - option (google.api.method_signature) = "endpoint,http_body"; - } - - // Perform an online explanation. - // - // If [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id] is specified, - // the corresponding DeployModel must have - // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] - // populated. If [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id] - // is not specified, all DeployedModels must have - // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] - // populated. Only deployed AutoML tabular Models have - // explanation_spec. - rpc Explain(ExplainRequest) returns (ExplainResponse) { - option (google.api.http) = { - post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:explain" - body: "*" - }; - option (google.api.method_signature) = "endpoint,instances,parameters,deployed_model_id"; - } -} - -// Request message for [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict]. -message PredictRequest { - // Required. The name of the Endpoint requested to serve the prediction. - // Format: - // `projects/{project}/locations/{location}/endpoints/{endpoint}` - string endpoint = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Endpoint" - } - ]; - - // Required. The instances that are the input to the prediction call. - // A DeployedModel may have an upper limit on the number of instances it - // supports per request, and when it is exceeded the prediction call errors - // in case of AutoML Models, or, in case of customer created Models, the - // behaviour is as documented by that Model. - // The schema of any single instance may be specified via Endpoint's - // DeployedModels' [Model's][google.cloud.aiplatform.v1.DeployedModel.model] - // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] - // [instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri]. - repeated google.protobuf.Value instances = 2 [(google.api.field_behavior) = REQUIRED]; - - // The parameters that govern the prediction. The schema of the parameters may - // be specified via Endpoint's DeployedModels' [Model's ][google.cloud.aiplatform.v1.DeployedModel.model] - // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] - // [parameters_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.parameters_schema_uri]. - google.protobuf.Value parameters = 3; -} - -// Response message for [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict]. -message PredictResponse { - // The predictions that are the output of the predictions call. - // The schema of any single prediction may be specified via Endpoint's - // DeployedModels' [Model's ][google.cloud.aiplatform.v1.DeployedModel.model] - // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] - // [prediction_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.prediction_schema_uri]. - repeated google.protobuf.Value predictions = 1; - - // ID of the Endpoint's DeployedModel that served this prediction. - string deployed_model_id = 2; - - // Output only. The resource name of the Model which is deployed as the DeployedModel that - // this prediction hits. - string model = 3 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - - // Output only. The [display name][google.cloud.aiplatform.v1.Model.display_name] of the Model which is deployed as - // the DeployedModel that this prediction hits. - string model_display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request message for [PredictionService.RawPredict][google.cloud.aiplatform.v1.PredictionService.RawPredict]. -message RawPredictRequest { - // Required. The name of the Endpoint requested to serve the prediction. - // Format: - // `projects/{project}/locations/{location}/endpoints/{endpoint}` - string endpoint = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Endpoint" - } - ]; - - // The prediction input. Supports HTTP headers and arbitrary data payload. - // - // A [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] may have an upper limit on the number of instances it - // supports per request. When this limit it is exceeded for an AutoML model, - // the [RawPredict][google.cloud.aiplatform.v1.PredictionService.RawPredict] method returns an error. - // When this limit is exceeded for a custom-trained model, the behavior varies - // depending on the model. - // - // You can specify the schema for each instance in the - // [predict_schemata.instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri] - // field when you create a [Model][google.cloud.aiplatform.v1.Model]. This schema applies when you deploy the - // `Model` as a `DeployedModel` to an [Endpoint][google.cloud.aiplatform.v1.Endpoint] and use the `RawPredict` - // method. - google.api.HttpBody http_body = 2; -} - -// Request message for [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain]. -message ExplainRequest { - // Required. The name of the Endpoint requested to serve the explanation. - // Format: - // `projects/{project}/locations/{location}/endpoints/{endpoint}` - string endpoint = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Endpoint" - } - ]; - - // Required. The instances that are the input to the explanation call. - // A DeployedModel may have an upper limit on the number of instances it - // supports per request, and when it is exceeded the explanation call errors - // in case of AutoML Models, or, in case of customer created Models, the - // behaviour is as documented by that Model. - // The schema of any single instance may be specified via Endpoint's - // DeployedModels' [Model's][google.cloud.aiplatform.v1.DeployedModel.model] - // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] - // [instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri]. - repeated google.protobuf.Value instances = 2 [(google.api.field_behavior) = REQUIRED]; - - // The parameters that govern the prediction. The schema of the parameters may - // be specified via Endpoint's DeployedModels' [Model's ][google.cloud.aiplatform.v1.DeployedModel.model] - // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata] - // [parameters_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.parameters_schema_uri]. - google.protobuf.Value parameters = 4; - - // If specified, overrides the - // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] of the DeployedModel. - // Can be used for explaining prediction results with different - // configurations, such as: - // - Explaining top-5 predictions results as opposed to top-1; - // - Increasing path count or step count of the attribution methods to reduce - // approximate errors; - // - Using different baselines for explaining the prediction results. - ExplanationSpecOverride explanation_spec_override = 5; - - // If specified, this ExplainRequest will be served by the chosen - // DeployedModel, overriding [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split]. - string deployed_model_id = 3; -} - -// Response message for [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain]. -message ExplainResponse { - // The explanations of the Model's [PredictResponse.predictions][google.cloud.aiplatform.v1.PredictResponse.predictions]. - // - // It has the same number of elements as [instances][google.cloud.aiplatform.v1.ExplainRequest.instances] - // to be explained. - repeated Explanation explanations = 1; - - // ID of the Endpoint's DeployedModel that served this explanation. - string deployed_model_id = 2; - - // The predictions that are the output of the predictions call. - // Same as [PredictResponse.predictions][google.cloud.aiplatform.v1.PredictResponse.predictions]. - repeated google.protobuf.Value predictions = 3; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto deleted file mode 100644 index 75222795..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.instance; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Instance"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/instance;instance"; -option java_multiple_files = true; -option java_outer_classname = "ImageClassificationPredictionInstanceProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.instance"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Instance"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Instance"; - -// Prediction input format for Image Classification. -message ImageClassificationPredictionInstance { - // The image bytes or Cloud Storage URI to make the prediction on. - string content = 1; - - // The MIME type of the content of the image. Only the images in below listed - // MIME types are supported. - // - image/jpeg - // - image/gif - // - image/png - // - image/webp - // - image/bmp - // - image/tiff - // - image/vnd.microsoft.icon - string mime_type = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto deleted file mode 100644 index 5e531733..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.instance; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Instance"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/instance;instance"; -option java_multiple_files = true; -option java_outer_classname = "ImageObjectDetectionPredictionInstanceProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.instance"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Instance"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Instance"; - -// Prediction input format for Image Object Detection. -message ImageObjectDetectionPredictionInstance { - // The image bytes or Cloud Storage URI to make the prediction on. - string content = 1; - - // The MIME type of the content of the image. Only the images in below listed - // MIME types are supported. - // - image/jpeg - // - image/gif - // - image/png - // - image/webp - // - image/bmp - // - image/tiff - // - image/vnd.microsoft.icon - string mime_type = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto deleted file mode 100644 index b4682c03..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.instance; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Instance"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/instance;instance"; -option java_multiple_files = true; -option java_outer_classname = "ImageSegmentationPredictionInstanceProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.instance"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Instance"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Instance"; - -// Prediction input format for Image Segmentation. -message ImageSegmentationPredictionInstance { - // The image bytes to make the predictions on. - string content = 1; - - // The MIME type of the content of the image. Only the images in below listed - // MIME types are supported. - // - image/jpeg - // - image/png - string mime_type = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto deleted file mode 100644 index cfd43170..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.instance; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Instance"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/instance;instance"; -option java_multiple_files = true; -option java_outer_classname = "TextClassificationPredictionInstanceProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.instance"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Instance"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Instance"; - -// Prediction input format for Text Classification. -message TextClassificationPredictionInstance { - // The text snippet to make the predictions on. - string content = 1; - - // The MIME type of the text snippet. The supported MIME types are listed - // below. - // - text/plain - string mime_type = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto deleted file mode 100644 index 697ee119..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.instance; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Instance"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/instance;instance"; -option java_multiple_files = true; -option java_outer_classname = "TextExtractionPredictionInstanceProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.instance"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Instance"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Instance"; - -// Prediction input format for Text Extraction. -message TextExtractionPredictionInstance { - // The text snippet to make the predictions on. - string content = 1; - - // The MIME type of the text snippet. The supported MIME types are listed - // below. - // - text/plain - string mime_type = 2; - - // This field is only used for batch prediction. If a key is provided, the - // batch prediction result will by mapped to this key. If omitted, then the - // batch prediction result will contain the entire input instance. Vertex AI - // will not check if keys in the request are duplicates, so it is up to the - // caller to ensure the keys are unique. - string key = 3; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto deleted file mode 100644 index a06c7c2f..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.instance; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Instance"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/instance;instance"; -option java_multiple_files = true; -option java_outer_classname = "TextSentimentPredictionInstanceProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.instance"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Instance"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Instance"; - -// Prediction input format for Text Sentiment. -message TextSentimentPredictionInstance { - // The text snippet to make the predictions on. - string content = 1; - - // The MIME type of the text snippet. The supported MIME types are listed - // below. - // - text/plain - string mime_type = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto deleted file mode 100644 index 9ab477e2..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.instance; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Instance"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/instance;instance"; -option java_multiple_files = true; -option java_outer_classname = "VideoActionRecognitionPredictionInstanceProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.instance"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Instance"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Instance"; - -// Prediction input format for Video Action Recognition. -message VideoActionRecognitionPredictionInstance { - // The Google Cloud Storage location of the video on which to perform the - // prediction. - string content = 1; - - // The MIME type of the content of the video. Only the following are - // supported: video/mp4 video/avi video/quicktime - string mime_type = 2; - - // The beginning, inclusive, of the video's time segment on which to perform - // the prediction. Expressed as a number of seconds as measured from the - // start of the video, with "s" appended at the end. Fractions are allowed, - // up to a microsecond precision. - string time_segment_start = 3; - - // The end, exclusive, of the video's time segment on which to perform - // the prediction. Expressed as a number of seconds as measured from the - // start of the video, with "s" appended at the end. Fractions are allowed, - // up to a microsecond precision, and "inf" or "Infinity" is allowed, which - // means the end of the video. - string time_segment_end = 4; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto deleted file mode 100644 index 68cb3cb3..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.instance; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Instance"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/instance;instance"; -option java_multiple_files = true; -option java_outer_classname = "VideoClassificationPredictionInstanceProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.instance"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Instance"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Instance"; - -// Prediction input format for Video Classification. -message VideoClassificationPredictionInstance { - // The Google Cloud Storage location of the video on which to perform the - // prediction. - string content = 1; - - // The MIME type of the content of the video. Only the following are - // supported: video/mp4 video/avi video/quicktime - string mime_type = 2; - - // The beginning, inclusive, of the video's time segment on which to perform - // the prediction. Expressed as a number of seconds as measured from the - // start of the video, with "s" appended at the end. Fractions are allowed, - // up to a microsecond precision. - string time_segment_start = 3; - - // The end, exclusive, of the video's time segment on which to perform - // the prediction. Expressed as a number of seconds as measured from the - // start of the video, with "s" appended at the end. Fractions are allowed, - // up to a microsecond precision, and "inf" or "Infinity" is allowed, which - // means the end of the video. - string time_segment_end = 4; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto deleted file mode 100644 index 34adc840..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.instance; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Instance"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/instance;instance"; -option java_multiple_files = true; -option java_outer_classname = "VideoObjectTrackingPredictionInstanceProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.instance"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Instance"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Instance"; - -// Prediction input format for Video Object Tracking. -message VideoObjectTrackingPredictionInstance { - // The Google Cloud Storage location of the video on which to perform the - // prediction. - string content = 1; - - // The MIME type of the content of the video. Only the following are - // supported: video/mp4 video/avi video/quicktime - string mime_type = 2; - - // The beginning, inclusive, of the video's time segment on which to perform - // the prediction. Expressed as a number of seconds as measured from the - // start of the video, with "s" appended at the end. Fractions are allowed, - // up to a microsecond precision. - string time_segment_start = 3; - - // The end, exclusive, of the video's time segment on which to perform - // the prediction. Expressed as a number of seconds as measured from the - // start of the video, with "s" appended at the end. Fractions are allowed, - // up to a microsecond precision, and "inf" or "Infinity" is allowed, which - // means the end of the video. - string time_segment_end = 4; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto deleted file mode 100644 index b3cb7e20..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.params; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Params"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/params;params"; -option java_multiple_files = true; -option java_outer_classname = "ImageClassificationPredictionParamsProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.params"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Params"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Params"; - -// Prediction model parameters for Image Classification. -message ImageClassificationPredictionParams { - // The Model only returns predictions with at least this confidence score. - // Default value is 0.0 - float confidence_threshold = 1; - - // The Model only returns up to that many top, by confidence score, - // predictions per instance. If this number is very high, the Model may return - // fewer predictions. Default value is 10. - int32 max_predictions = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto deleted file mode 100644 index 34130f7c..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.params; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Params"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/params;params"; -option java_multiple_files = true; -option java_outer_classname = "ImageObjectDetectionPredictionParamsProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.params"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Params"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Params"; - -// Prediction model parameters for Image Object Detection. -message ImageObjectDetectionPredictionParams { - // The Model only returns predictions with at least this confidence score. - // Default value is 0.0 - float confidence_threshold = 1; - - // The Model only returns up to that many top, by confidence score, - // predictions per instance. Note that number of returned predictions is also - // limited by metadata's predictionsLimit. Default value is 10. - int32 max_predictions = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto deleted file mode 100644 index 50e06ee8..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.params; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Params"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/params;params"; -option java_multiple_files = true; -option java_outer_classname = "ImageSegmentationPredictionParamsProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.params"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Params"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Params"; - -// Prediction model parameters for Image Segmentation. -message ImageSegmentationPredictionParams { - // When the model predicts category of pixels of the image, it will only - // provide predictions for pixels that it is at least this much confident - // about. All other pixels will be classified as background. Default value is - // 0.5. - float confidence_threshold = 1; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto deleted file mode 100644 index aa640722..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.params; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Params"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/params;params"; -option java_multiple_files = true; -option java_outer_classname = "VideoActionRecognitionPredictionParamsProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.params"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Params"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Params"; - -// Prediction model parameters for Video Action Recognition. -message VideoActionRecognitionPredictionParams { - // The Model only returns predictions with at least this confidence score. - // Default value is 0.0 - float confidence_threshold = 1; - - // The model only returns up to that many top, by confidence score, - // predictions per frame of the video. If this number is very high, the - // Model may return fewer predictions per frame. Default value is 50. - int32 max_predictions = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto deleted file mode 100644 index ec062072..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.params; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Params"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/params;params"; -option java_multiple_files = true; -option java_outer_classname = "VideoClassificationPredictionParamsProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.params"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Params"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Params"; - -// Prediction model parameters for Video Classification. -message VideoClassificationPredictionParams { - // The Model only returns predictions with at least this confidence score. - // Default value is 0.0 - float confidence_threshold = 1; - - // The Model only returns up to that many top, by confidence score, - // predictions per instance. If this number is very high, the Model may return - // fewer predictions. Default value is 10,000. - int32 max_predictions = 2; - - // Set to true to request segment-level classification. Vertex AI returns - // labels and their confidence scores for the entire time segment of the - // video that user specified in the input instance. - // Default value is true - bool segment_classification = 3; - - // Set to true to request shot-level classification. Vertex AI determines - // the boundaries for each camera shot in the entire time segment of the - // video that user specified in the input instance. Vertex AI then - // returns labels and their confidence scores for each detected shot, along - // with the start and end time of the shot. - // WARNING: Model evaluation is not done for this classification type, - // the quality of it depends on the training data, but there are no metrics - // provided to describe that quality. - // Default value is false - bool shot_classification = 4; - - // Set to true to request classification for a video at one-second intervals. - // Vertex AI returns labels and their confidence scores for each second of - // the entire time segment of the video that user specified in the input - // WARNING: Model evaluation is not done for this classification type, the - // quality of it depends on the training data, but there are no metrics - // provided to describe that quality. Default value is false - bool one_sec_interval_classification = 5; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto deleted file mode 100644 index 579dc4d4..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.params; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Params"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/params;params"; -option java_multiple_files = true; -option java_outer_classname = "VideoObjectTrackingPredictionParamsProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.params"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Params"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Params"; - -// Prediction model parameters for Video Object Tracking. -message VideoObjectTrackingPredictionParams { - // The Model only returns predictions with at least this confidence score. - // Default value is 0.0 - float confidence_threshold = 1; - - // The model only returns up to that many top, by confidence score, - // predictions per frame of the video. If this number is very high, the - // Model may return fewer predictions per frame. Default value is 50. - int32 max_predictions = 2; - - // Only bounding boxes with shortest edge at least that long as a relative - // value of video frame size are returned. Default value is 0.0. - float min_bounding_box_size = 3; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto deleted file mode 100644 index b8e396ab..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.prediction; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "ClassificationPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; - -// Prediction output format for Image and Text Classification. -message ClassificationPredictionResult { - // The resource IDs of the AnnotationSpecs that had been identified. - repeated int64 ids = 1; - - // The display names of the AnnotationSpecs that had been identified, order - // matches the IDs. - repeated string display_names = 2; - - // The Model's confidences in correctness of the predicted IDs, higher value - // means higher confidence. Order matches the Ids. - repeated float confidences = 3; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto deleted file mode 100644 index 50d76ecc..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.prediction; - -import "google/protobuf/struct.proto"; -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "ImageObjectDetectionPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; - -// Prediction output format for Image Object Detection. -message ImageObjectDetectionPredictionResult { - // The resource IDs of the AnnotationSpecs that had been identified, ordered - // by the confidence score descendingly. - repeated int64 ids = 1; - - // The display names of the AnnotationSpecs that had been identified, order - // matches the IDs. - repeated string display_names = 2; - - // The Model's confidences in correctness of the predicted IDs, higher value - // means higher confidence. Order matches the Ids. - repeated float confidences = 3; - - // Bounding boxes, i.e. the rectangles over the image, that pinpoint - // the found AnnotationSpecs. Given in order that matches the IDs. Each - // bounding box is an array of 4 numbers `xMin`, `xMax`, `yMin`, and - // `yMax`, which represent the extremal coordinates of the box. They are - // relative to the image size, and the point 0,0 is in the top left - // of the image. - repeated google.protobuf.ListValue bboxes = 4; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto deleted file mode 100644 index f245f1e1..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.prediction; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "ImageSegmentationPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; - -// Prediction output format for Image Segmentation. -message ImageSegmentationPredictionResult { - // A PNG image where each pixel in the mask represents the category in which - // the pixel in the original image was predicted to belong to. The size of - // this image will be the same as the original image. The mapping between the - // AnntoationSpec and the color can be found in model's metadata. The model - // will choose the most likely category and if none of the categories reach - // the confidence threshold, the pixel will be marked as background. - string category_mask = 1; - - // A one channel image which is encoded as an 8bit lossless PNG. The size of - // the image will be the same as the original image. For a specific pixel, - // darker color means less confidence in correctness of the cateogry in the - // categoryMask for the corresponding pixel. Black means no confidence and - // white means complete confidence. - string confidence_mask = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto deleted file mode 100644 index 25cd6672..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.prediction; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "TabularClassificationPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; - -// Prediction output format for Tabular Classification. -message TabularClassificationPredictionResult { - // The name of the classes being classified, contains all possible values of - // the target column. - repeated string classes = 1; - - // The model's confidence in each class being correct, higher - // value means higher confidence. The N-th score corresponds to - // the N-th class in classes. - repeated float scores = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto deleted file mode 100644 index a26c3cb2..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.prediction; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "TabularRegressionPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; - -// Prediction output format for Tabular Regression. -message TabularRegressionPredictionResult { - // The regression value. - float value = 1; - - // The lower bound of the prediction interval. - float lower_bound = 2; - - // The upper bound of the prediction interval. - float upper_bound = 3; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto deleted file mode 100644 index 00ca7694..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.prediction; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "TextExtractionPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; - -// Prediction output format for Text Extraction. -message TextExtractionPredictionResult { - // The resource IDs of the AnnotationSpecs that had been identified, - // ordered by the confidence score descendingly. - repeated int64 ids = 1; - - // The display names of the AnnotationSpecs that had been identified, - // order matches the IDs. - repeated string display_names = 2; - - // The start offsets, inclusive, of the text segment in which the - // AnnotationSpec has been identified. Expressed as a zero-based number - // of characters as measured from the start of the text snippet. - repeated int64 text_segment_start_offsets = 3; - - // The end offsets, inclusive, of the text segment in which the - // AnnotationSpec has been identified. Expressed as a zero-based number - // of characters as measured from the start of the text snippet. - repeated int64 text_segment_end_offsets = 4; - - // The Model's confidences in correctness of the predicted IDs, higher - // value means higher confidence. Order matches the Ids. - repeated float confidences = 5; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto deleted file mode 100644 index 09d24248..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.prediction; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "TextSentimentPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; - -// Prediction output format for Text Sentiment -message TextSentimentPredictionResult { - // The integer sentiment labels between 0 (inclusive) and sentimentMax label - // (inclusive), while 0 maps to the least positive sentiment and - // sentimentMax maps to the most positive one. The higher the score is, the - // more positive the sentiment in the text snippet is. Note: sentimentMax is - // an integer value between 1 (inclusive) and 10 (inclusive). - int32 sentiment = 1; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto deleted file mode 100644 index 6cd59711..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.prediction; - -import "google/protobuf/duration.proto"; -import "google/protobuf/wrappers.proto"; -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "VideoActionRecognitionPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; - -// Prediction output format for Video Action Recognition. -message VideoActionRecognitionPredictionResult { - // The resource ID of the AnnotationSpec that had been identified. - string id = 1; - - // The display name of the AnnotationSpec that had been identified. - string display_name = 2; - - // The beginning, inclusive, of the video's time segment in which the - // AnnotationSpec has been identified. Expressed as a number of seconds as - // measured from the start of the video, with fractions up to a microsecond - // precision, and with "s" appended at the end. - google.protobuf.Duration time_segment_start = 4; - - // The end, exclusive, of the video's time segment in which the - // AnnotationSpec has been identified. Expressed as a number of seconds as - // measured from the start of the video, with fractions up to a microsecond - // precision, and with "s" appended at the end. - google.protobuf.Duration time_segment_end = 5; - - // The Model's confidence in correction of this prediction, higher - // value means higher confidence. - google.protobuf.FloatValue confidence = 6; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto deleted file mode 100644 index 5d33c5ae..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.prediction; - -import "google/protobuf/duration.proto"; -import "google/protobuf/wrappers.proto"; -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "VideoClassificationPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; - -// Prediction output format for Video Classification. -message VideoClassificationPredictionResult { - // The resource ID of the AnnotationSpec that had been identified. - string id = 1; - - // The display name of the AnnotationSpec that had been identified. - string display_name = 2; - - // The type of the prediction. The requested types can be configured - // via parameters. This will be one of - // - segment-classification - // - shot-classification - // - one-sec-interval-classification - string type = 3; - - // The beginning, inclusive, of the video's time segment in which the - // AnnotationSpec has been identified. Expressed as a number of seconds as - // measured from the start of the video, with fractions up to a microsecond - // precision, and with "s" appended at the end. Note that for - // 'segment-classification' prediction type, this equals the original - // 'timeSegmentStart' from the input instance, for other types it is the - // start of a shot or a 1 second interval respectively. - google.protobuf.Duration time_segment_start = 4; - - // The end, exclusive, of the video's time segment in which the - // AnnotationSpec has been identified. Expressed as a number of seconds as - // measured from the start of the video, with fractions up to a microsecond - // precision, and with "s" appended at the end. Note that for - // 'segment-classification' prediction type, this equals the original - // 'timeSegmentEnd' from the input instance, for other types it is the end - // of a shot or a 1 second interval respectively. - google.protobuf.Duration time_segment_end = 5; - - // The Model's confidence in correction of this prediction, higher - // value means higher confidence. - google.protobuf.FloatValue confidence = 6; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto deleted file mode 100644 index 20ecbb1a..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.predict.prediction; - -import "google/protobuf/duration.proto"; -import "google/protobuf/wrappers.proto"; -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "VideoObjectTrackingPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::Predict::Prediction"; - -// Prediction output format for Video Object Tracking. -message VideoObjectTrackingPredictionResult { - // The fields `xMin`, `xMax`, `yMin`, and `yMax` refer to a bounding box, - // i.e. the rectangle over the video frame pinpointing the found - // AnnotationSpec. The coordinates are relative to the frame size, and the - // point 0,0 is in the top left of the frame. - message Frame { - // A time (frame) of a video in which the object has been detected. - // Expressed as a number of seconds as measured from the - // start of the video, with fractions up to a microsecond precision, and - // with "s" appended at the end. - google.protobuf.Duration time_offset = 1; - - // The leftmost coordinate of the bounding box. - google.protobuf.FloatValue x_min = 2; - - // The rightmost coordinate of the bounding box. - google.protobuf.FloatValue x_max = 3; - - // The topmost coordinate of the bounding box. - google.protobuf.FloatValue y_min = 4; - - // The bottommost coordinate of the bounding box. - google.protobuf.FloatValue y_max = 5; - } - - // The resource ID of the AnnotationSpec that had been identified. - string id = 1; - - // The display name of the AnnotationSpec that had been identified. - string display_name = 2; - - // The beginning, inclusive, of the video's time segment in which the - // object instance has been detected. Expressed as a number of seconds as - // measured from the start of the video, with fractions up to a microsecond - // precision, and with "s" appended at the end. - google.protobuf.Duration time_segment_start = 3; - - // The end, inclusive, of the video's time segment in which the - // object instance has been detected. Expressed as a number of seconds as - // measured from the start of the video, with fractions up to a microsecond - // precision, and with "s" appended at the end. - google.protobuf.Duration time_segment_end = 4; - - // The Model's confidence in correction of this prediction, higher - // value means higher confidence. - google.protobuf.FloatValue confidence = 5; - - // All of the frames of the video in which a single object instance has been - // detected. The bounding boxes in the frames identify the same object. - repeated Frame frames = 6; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto deleted file mode 100644 index f51227cf..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLImageClassificationProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Image Classification Model. -message AutoMlImageClassification { - // The input parameters of this TrainingJob. - AutoMlImageClassificationInputs inputs = 1; - - // The metadata information. - AutoMlImageClassificationMetadata metadata = 2; -} - -message AutoMlImageClassificationInputs { - enum ModelType { - // Should not be set. - MODEL_TYPE_UNSPECIFIED = 0; - - // A Model best tailored to be used within Google Cloud, and which cannot - // be exported. - // Default. - CLOUD = 1; - - // A model that, in addition to being available within Google - // Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow - // or Core ML model and used on a mobile or edge device afterwards. - // Expected to have low latency, but may have lower prediction - // quality than other mobile models. - MOBILE_TF_LOW_LATENCY_1 = 2; - - // A model that, in addition to being available within Google - // Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow - // or Core ML model and used on a mobile or edge device with afterwards. - MOBILE_TF_VERSATILE_1 = 3; - - // A model that, in addition to being available within Google - // Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow - // or Core ML model and used on a mobile or edge device afterwards. - // Expected to have a higher latency, but should also have a higher - // prediction quality than other mobile models. - MOBILE_TF_HIGH_ACCURACY_1 = 4; - } - - ModelType model_type = 1; - - // The ID of the `base` model. If it is specified, the new model will be - // trained based on the `base` model. Otherwise, the new model will be - // trained from scratch. The `base` model must be in the same - // Project and Location as the new Model to train, and have the same - // modelType. - string base_model_id = 2; - - // The training budget of creating this model, expressed in milli node - // hours i.e. 1,000 value in this field means 1 node hour. The actual - // metadata.costMilliNodeHours will be equal or less than this value. - // If further model training ceases to provide any improvements, it will - // stop without using the full budget and the metadata.successfulStopReason - // will be `model-converged`. - // Note, node_hour = actual_hour * number_of_nodes_involved. - // For modelType `cloud`(default), the budget must be between 8,000 - // and 800,000 milli node hours, inclusive. The default value is 192,000 - // which represents one day in wall time, considering 8 nodes are used. - // For model types `mobile-tf-low-latency-1`, `mobile-tf-versatile-1`, - // `mobile-tf-high-accuracy-1`, the training budget must be between - // 1,000 and 100,000 milli node hours, inclusive. - // The default value is 24,000 which represents one day in wall time on a - // single node that is used. - int64 budget_milli_node_hours = 3; - - // Use the entire training budget. This disables the early stopping feature. - // When false the early stopping feature is enabled, which means that - // AutoML Image Classification might stop training before the entire - // training budget has been used. - bool disable_early_stopping = 4; - - // If false, a single-label (multi-class) Model will be trained (i.e. - // assuming that for each image just up to one annotation may be - // applicable). If true, a multi-label Model will be trained (i.e. - // assuming that for each image multiple annotations may be applicable). - bool multi_label = 5; -} - -message AutoMlImageClassificationMetadata { - enum SuccessfulStopReason { - // Should not be set. - SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0; - - // The inputs.budgetMilliNodeHours had been reached. - BUDGET_REACHED = 1; - - // Further training of the Model ceased to increase its quality, since it - // already has converged. - MODEL_CONVERGED = 2; - } - - // The actual training cost of creating this model, expressed in - // milli node hours, i.e. 1,000 value in this field means 1 node hour. - // Guaranteed to not exceed inputs.budgetMilliNodeHours. - int64 cost_milli_node_hours = 1; - - // For successful job completions, this is the reason why the job has - // finished. - SuccessfulStopReason successful_stop_reason = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto deleted file mode 100644 index 62e7ae2c..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLImageObjectDetectionProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Image Object Detection Model. -message AutoMlImageObjectDetection { - // The input parameters of this TrainingJob. - AutoMlImageObjectDetectionInputs inputs = 1; - - // The metadata information - AutoMlImageObjectDetectionMetadata metadata = 2; -} - -message AutoMlImageObjectDetectionInputs { - enum ModelType { - // Should not be set. - MODEL_TYPE_UNSPECIFIED = 0; - - // A model best tailored to be used within Google Cloud, and which cannot - // be exported. Expected to have a higher latency, but should also have a - // higher prediction quality than other cloud models. - CLOUD_HIGH_ACCURACY_1 = 1; - - // A model best tailored to be used within Google Cloud, and which cannot - // be exported. Expected to have a low latency, but may have lower - // prediction quality than other cloud models. - CLOUD_LOW_LATENCY_1 = 2; - - // A model that, in addition to being available within Google - // Cloud can also be exported (see ModelService.ExportModel) and - // used on a mobile or edge device with TensorFlow afterwards. - // Expected to have low latency, but may have lower prediction - // quality than other mobile models. - MOBILE_TF_LOW_LATENCY_1 = 3; - - // A model that, in addition to being available within Google - // Cloud can also be exported (see ModelService.ExportModel) and - // used on a mobile or edge device with TensorFlow afterwards. - MOBILE_TF_VERSATILE_1 = 4; - - // A model that, in addition to being available within Google - // Cloud, can also be exported (see ModelService.ExportModel) and - // used on a mobile or edge device with TensorFlow afterwards. - // Expected to have a higher latency, but should also have a higher - // prediction quality than other mobile models. - MOBILE_TF_HIGH_ACCURACY_1 = 5; - } - - ModelType model_type = 1; - - // The training budget of creating this model, expressed in milli node - // hours i.e. 1,000 value in this field means 1 node hour. The actual - // metadata.costMilliNodeHours will be equal or less than this value. - // If further model training ceases to provide any improvements, it will - // stop without using the full budget and the metadata.successfulStopReason - // will be `model-converged`. - // Note, node_hour = actual_hour * number_of_nodes_involved. - // For modelType `cloud`(default), the budget must be between 20,000 - // and 900,000 milli node hours, inclusive. The default value is 216,000 - // which represents one day in wall time, considering 9 nodes are used. - // For model types `mobile-tf-low-latency-1`, `mobile-tf-versatile-1`, - // `mobile-tf-high-accuracy-1` - // the training budget must be between 1,000 and 100,000 milli node hours, - // inclusive. The default value is 24,000 which represents one day in - // wall time on a single node that is used. - int64 budget_milli_node_hours = 2; - - // Use the entire training budget. This disables the early stopping feature. - // When false the early stopping feature is enabled, which means that AutoML - // Image Object Detection might stop training before the entire training - // budget has been used. - bool disable_early_stopping = 3; -} - -message AutoMlImageObjectDetectionMetadata { - enum SuccessfulStopReason { - // Should not be set. - SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0; - - // The inputs.budgetMilliNodeHours had been reached. - BUDGET_REACHED = 1; - - // Further training of the Model ceased to increase its quality, since it - // already has converged. - MODEL_CONVERGED = 2; - } - - // The actual training cost of creating this model, expressed in - // milli node hours, i.e. 1,000 value in this field means 1 node hour. - // Guaranteed to not exceed inputs.budgetMilliNodeHours. - int64 cost_milli_node_hours = 1; - - // For successful job completions, this is the reason why the job has - // finished. - SuccessfulStopReason successful_stop_reason = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto deleted file mode 100644 index 00af43c1..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLImageSegmentationProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Image Segmentation Model. -message AutoMlImageSegmentation { - // The input parameters of this TrainingJob. - AutoMlImageSegmentationInputs inputs = 1; - - // The metadata information. - AutoMlImageSegmentationMetadata metadata = 2; -} - -message AutoMlImageSegmentationInputs { - enum ModelType { - // Should not be set. - MODEL_TYPE_UNSPECIFIED = 0; - - // A model to be used via prediction calls to uCAIP API. Expected - // to have a higher latency, but should also have a higher prediction - // quality than other models. - CLOUD_HIGH_ACCURACY_1 = 1; - - // A model to be used via prediction calls to uCAIP API. Expected - // to have a lower latency but relatively lower prediction quality. - CLOUD_LOW_ACCURACY_1 = 2; - - // A model that, in addition to being available within Google - // Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow - // model and used on a mobile or edge device afterwards. - // Expected to have low latency, but may have lower prediction - // quality than other mobile models. - MOBILE_TF_LOW_LATENCY_1 = 3; - } - - ModelType model_type = 1; - - // The training budget of creating this model, expressed in milli node - // hours i.e. 1,000 value in this field means 1 node hour. The actual - // metadata.costMilliNodeHours will be equal or less than this value. - // If further model training ceases to provide any improvements, it will - // stop without using the full budget and the metadata.successfulStopReason - // will be `model-converged`. - // Note, node_hour = actual_hour * number_of_nodes_involved. Or - // actaul_wall_clock_hours = train_budget_milli_node_hours / - // (number_of_nodes_involved * 1000) - // For modelType `cloud-high-accuracy-1`(default), the budget must be between - // 20,000 and 2,000,000 milli node hours, inclusive. The default value is - // 192,000 which represents one day in wall time - // (1000 milli * 24 hours * 8 nodes). - int64 budget_milli_node_hours = 2; - - // The ID of the `base` model. If it is specified, the new model will be - // trained based on the `base` model. Otherwise, the new model will be - // trained from scratch. The `base` model must be in the same - // Project and Location as the new Model to train, and have the same - // modelType. - string base_model_id = 3; -} - -message AutoMlImageSegmentationMetadata { - enum SuccessfulStopReason { - // Should not be set. - SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0; - - // The inputs.budgetMilliNodeHours had been reached. - BUDGET_REACHED = 1; - - // Further training of the Model ceased to increase its quality, since it - // already has converged. - MODEL_CONVERGED = 2; - } - - // The actual training cost of creating this model, expressed in - // milli node hours, i.e. 1,000 value in this field means 1 node hour. - // Guaranteed to not exceed inputs.budgetMilliNodeHours. - int64 cost_milli_node_hours = 1; - - // For successful job completions, this is the reason why the job has - // finished. - SuccessfulStopReason successful_stop_reason = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto deleted file mode 100644 index 0c4ee2d6..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.trainingjob.definition; - -import "google/api/field_behavior.proto"; -import "google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto"; -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLTablesProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Tables Model. -message AutoMlTables { - // The input parameters of this TrainingJob. - AutoMlTablesInputs inputs = 1; - - // The metadata information. - AutoMlTablesMetadata metadata = 2; -} - -message AutoMlTablesInputs { - message Transformation { - // Training pipeline will infer the proper transformation based on the - // statistic of dataset. - message AutoTransformation { - string column_name = 1; - } - - // Training pipeline will perform following transformation functions. - // * The value converted to float32. - // * The z_score of the value. - // * log(value+1) when the value is greater than or equal to 0. Otherwise, - // this transformation is not applied and the value is considered a - // missing value. - // * z_score of log(value+1) when the value is greater than or equal to 0. - // Otherwise, this transformation is not applied and the value is - // considered a missing value. - // * A boolean value that indicates whether the value is valid. - message NumericTransformation { - string column_name = 1; - - // If invalid values is allowed, the training pipeline will create a - // boolean feature that indicated whether the value is valid. - // Otherwise, the training pipeline will discard the input row from - // trainining data. - bool invalid_values_allowed = 2; - } - - // Training pipeline will perform following transformation functions. - // * The categorical string as is--no change to case, punctuation, - // spelling, - // tense, and so on. - // * Convert the category name to a dictionary lookup index and generate an - // embedding for each index. - // * Categories that appear less than 5 times in the training dataset are - // treated as the "unknown" category. The "unknown" category gets its own - // special lookup index and resulting embedding. - message CategoricalTransformation { - string column_name = 1; - } - - // Training pipeline will perform following transformation functions. - // * Apply the transformation functions for Numerical columns. - // * Determine the year, month, day,and weekday. Treat each value from the - // * timestamp as a Categorical column. - // * Invalid numerical values (for example, values that fall outside of a - // typical timestamp range, or are extreme values) receive no special - // treatment and are not removed. - message TimestampTransformation { - string column_name = 1; - - // The format in which that time field is expressed. The time_format must - // either be one of: - // * `unix-seconds` - // * `unix-milliseconds` - // * `unix-microseconds` - // * `unix-nanoseconds` - // (for respectively number of seconds, milliseconds, microseconds and - // nanoseconds since start of the Unix epoch); - // or be written in `strftime` syntax. If time_format is not set, then the - // default format is RFC 3339 `date-time` format, where - // `time-offset` = `"Z"` (e.g. 1985-04-12T23:20:50.52Z) - string time_format = 2; - - // If invalid values is allowed, the training pipeline will create a - // boolean feature that indicated whether the value is valid. - // Otherwise, the training pipeline will discard the input row from - // trainining data. - bool invalid_values_allowed = 3; - } - - // Training pipeline will perform following transformation functions. - // * The text as is--no change to case, punctuation, spelling, tense, and - // so - // on. - // * Tokenize text to words. Convert each words to a dictionary lookup - // index - // and generate an embedding for each index. Combine the embedding of all - // elements into a single embedding using the mean. - // * Tokenization is based on unicode script boundaries. - // * Missing values get their own lookup index and resulting embedding. - // * Stop-words receive no special treatment and are not removed. - message TextTransformation { - string column_name = 1; - } - - // Treats the column as numerical array and performs following - // transformation functions. - // * All transformations for Numerical types applied to the average of the - // all elements. - // * The average of empty arrays is treated as zero. - message NumericArrayTransformation { - string column_name = 1; - - // If invalid values is allowed, the training pipeline will create a - // boolean feature that indicated whether the value is valid. - // Otherwise, the training pipeline will discard the input row from - // trainining data. - bool invalid_values_allowed = 2; - } - - // Treats the column as categorical array and performs following - // transformation functions. - // * For each element in the array, convert the category name to a - // dictionary - // lookup index and generate an embedding for each index. - // Combine the embedding of all elements into a single embedding using - // the mean. - // * Empty arrays treated as an embedding of zeroes. - message CategoricalArrayTransformation { - string column_name = 1; - } - - // Treats the column as text array and performs following transformation - // functions. - // * Concatenate all text values in the array into a single text value - // using - // a space (" ") as a delimiter, and then treat the result as a single - // text value. Apply the transformations for Text columns. - // * Empty arrays treated as an empty text. - message TextArrayTransformation { - string column_name = 1; - } - - // The transformation that the training pipeline will apply to the input - // columns. - oneof transformation_detail { - AutoTransformation auto = 1; - - NumericTransformation numeric = 2; - - CategoricalTransformation categorical = 3; - - TimestampTransformation timestamp = 4; - - TextTransformation text = 5; - - NumericArrayTransformation repeated_numeric = 6; - - CategoricalArrayTransformation repeated_categorical = 7; - - TextArrayTransformation repeated_text = 8; - } - } - - // Additional optimization objective configuration. Required for - // `maximize-precision-at-recall` and `maximize-recall-at-precision`, - // otherwise unused. - oneof additional_optimization_objective_config { - // Required when optimization_objective is "maximize-precision-at-recall". - // Must be between 0 and 1, inclusive. - float optimization_objective_recall_value = 5; - - // Required when optimization_objective is "maximize-recall-at-precision". - // Must be between 0 and 1, inclusive. - float optimization_objective_precision_value = 6; - } - - // The type of prediction the Model is to produce. - // "classification" - Predict one out of multiple target values is - // picked for each row. - // "regression" - Predict a value based on its relation to other values. - // This type is available only to columns that contain - // semantically numeric values, i.e. integers or floating - // point number, even if stored as e.g. strings. - string prediction_type = 1; - - // The column name of the target column that the model is to predict. - string target_column = 2; - - // Each transformation will apply transform function to given input column. - // And the result will be used for training. - // When creating transformation for BigQuery Struct column, the column should - // be flattened using "." as the delimiter. - repeated Transformation transformations = 3; - - // Objective function the model is optimizing towards. The training process - // creates a model that maximizes/minimizes the value of the objective - // function over the validation set. - // - // The supported optimization objectives depend on the prediction type. - // If the field is not set, a default objective function is used. - // - // classification (binary): - // "maximize-au-roc" (default) - Maximize the area under the receiver - // operating characteristic (ROC) curve. - // "minimize-log-loss" - Minimize log loss. - // "maximize-au-prc" - Maximize the area under the precision-recall curve. - // "maximize-precision-at-recall" - Maximize precision for a specified - // recall value. - // "maximize-recall-at-precision" - Maximize recall for a specified - // precision value. - // - // classification (multi-class): - // "minimize-log-loss" (default) - Minimize log loss. - // - // regression: - // "minimize-rmse" (default) - Minimize root-mean-squared error (RMSE). - // "minimize-mae" - Minimize mean-absolute error (MAE). - // "minimize-rmsle" - Minimize root-mean-squared log error (RMSLE). - string optimization_objective = 4; - - // Required. The train budget of creating this model, expressed in milli node - // hours i.e. 1,000 value in this field means 1 node hour. - // - // The training cost of the model will not exceed this budget. The final cost - // will be attempted to be close to the budget, though may end up being (even) - // noticeably smaller - at the backend's discretion. This especially may - // happen when further model training ceases to provide any improvements. - // - // If the budget is set to a value known to be insufficient to train a - // model for the given dataset, the training won't be attempted and - // will error. - // - // The train budget must be between 1,000 and 72,000 milli node hours, - // inclusive. - int64 train_budget_milli_node_hours = 7; - - // Use the entire training budget. This disables the early stopping feature. - // By default, the early stopping feature is enabled, which means that AutoML - // Tables might stop training before the entire training budget has been used. - bool disable_early_stopping = 8; - - // Column name that should be used as the weight column. - // Higher values in this column give more importance to the row - // during model training. The column must have numeric values between 0 and - // 10000 inclusively; 0 means the row is ignored for training. If weight - // column field is not set, then all rows are assumed to have equal weight - // of 1. - string weight_column_name = 9; - - // Configuration for exporting test set predictions to a BigQuery table. If - // this configuration is absent, then the export is not performed. - ExportEvaluatedDataItemsConfig export_evaluated_data_items_config = 10; - - // Additional experiment flags for the Tables training pipeline. - repeated string additional_experiments = 11; -} - -// Model metadata specific to AutoML Tables. -message AutoMlTablesMetadata { - // Output only. The actual training cost of the model, expressed in milli - // node hours, i.e. 1,000 value in this field means 1 node hour. Guaranteed - // to not exceed the train budget. - int64 train_cost_milli_node_hours = 1; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto deleted file mode 100644 index 8723af0e..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLTextClassificationProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Text Classification Model. -message AutoMlTextClassification { - // The input parameters of this TrainingJob. - AutoMlTextClassificationInputs inputs = 1; -} - -message AutoMlTextClassificationInputs { - bool multi_label = 1; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto deleted file mode 100644 index db33c3f5..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLTextExtractionProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Text Extraction Model. -message AutoMlTextExtraction { - // The input parameters of this TrainingJob. - AutoMlTextExtractionInputs inputs = 1; -} - -message AutoMlTextExtractionInputs { - -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto deleted file mode 100644 index 153a57fe..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLTextSentimentProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Text Sentiment Model. -message AutoMlTextSentiment { - // The input parameters of this TrainingJob. - AutoMlTextSentimentInputs inputs = 1; -} - -message AutoMlTextSentimentInputs { - // A sentiment is expressed as an integer ordinal, where higher value - // means a more positive sentiment. The range of sentiments that will be used - // is between 0 and sentimentMax (inclusive on both ends), and all the values - // in the range must be represented in the dataset before a model can be - // created. - // Only the Annotations with this sentimentMax will be used for training. - // sentimentMax value must be between 1 and 10 (inclusive). - int32 sentiment_max = 1; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto deleted file mode 100644 index 86f723b7..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLVideoActionRecognitionProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Video Action Recognition -// Model. -message AutoMlVideoActionRecognition { - // The input parameters of this TrainingJob. - AutoMlVideoActionRecognitionInputs inputs = 1; -} - -message AutoMlVideoActionRecognitionInputs { - enum ModelType { - // Should not be set. - MODEL_TYPE_UNSPECIFIED = 0; - - // A model best tailored to be used within Google Cloud, and which c annot - // be exported. Default. - CLOUD = 1; - - // A model that, in addition to being available within Google Cloud, can - // also be exported (see ModelService.ExportModel) as a TensorFlow or - // TensorFlow Lite model and used on a mobile or edge device afterwards. - MOBILE_VERSATILE_1 = 2; - - // A model that, in addition to being available within Google Cloud, can - // also be exported (see ModelService.ExportModel) to a Jetson device - // afterwards. - MOBILE_JETSON_VERSATILE_1 = 3; - - // A model that, in addition to being available within Google Cloud, can - // also be exported (see ModelService.ExportModel) as a TensorFlow or - // TensorFlow Lite model and used on a Coral device afterwards. - MOBILE_CORAL_VERSATILE_1 = 4; - } - - ModelType model_type = 1; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto deleted file mode 100644 index ff0d78f0..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLVideoClassificationProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Video Classification Model. -message AutoMlVideoClassification { - // The input parameters of this TrainingJob. - AutoMlVideoClassificationInputs inputs = 1; -} - -message AutoMlVideoClassificationInputs { - enum ModelType { - // Should not be set. - MODEL_TYPE_UNSPECIFIED = 0; - - // A model best tailored to be used within Google Cloud, and which cannot - // be exported. Default. - CLOUD = 1; - - // A model that, in addition to being available within Google Cloud, can - // also be exported (see ModelService.ExportModel) as a TensorFlow or - // TensorFlow Lite model and used on a mobile or edge device afterwards. - MOBILE_VERSATILE_1 = 2; - - // A model that, in addition to being available within Google Cloud, can - // also be exported (see ModelService.ExportModel) to a Jetson device - // afterwards. - MOBILE_JETSON_VERSATILE_1 = 3; - } - - ModelType model_type = 1; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto deleted file mode 100644 index 52cba9f3..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLVideoObjectTrackingProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Video ObjectTracking Model. -message AutoMlVideoObjectTracking { - // The input parameters of this TrainingJob. - AutoMlVideoObjectTrackingInputs inputs = 1; -} - -message AutoMlVideoObjectTrackingInputs { - enum ModelType { - // Should not be set. - MODEL_TYPE_UNSPECIFIED = 0; - - // A model best tailored to be used within Google Cloud, and which c annot - // be exported. Default. - CLOUD = 1; - - // A model that, in addition to being available within Google Cloud, can - // also be exported (see ModelService.ExportModel) as a TensorFlow or - // TensorFlow Lite model and used on a mobile or edge device afterwards. - MOBILE_VERSATILE_1 = 2; - - // A versatile model that is meant to be exported (see - // ModelService.ExportModel) and used on a Google Coral device. - MOBILE_CORAL_VERSATILE_1 = 3; - - // A model that trades off quality for low latency, to be exported (see - // ModelService.ExportModel) and used on a Google Coral device. - MOBILE_CORAL_LOW_LATENCY_1 = 4; - - // A versatile model that is meant to be exported (see - // ModelService.ExportModel) and used on an NVIDIA Jetson device. - MOBILE_JETSON_VERSATILE_1 = 5; - - // A model that trades off quality for low latency, to be exported (see - // ModelService.ExportModel) and used on an NVIDIA Jetson device. - MOBILE_JETSON_LOW_LATENCY_1 = 6; - } - - ModelType model_type = 1; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto deleted file mode 100644 index ac0d3235..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "ExportEvaluatedDataItemsConfigProto"; -option java_package = "com.google.cloud.aiplatform.v1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1::Schema::TrainingJob::Definition"; - -// Configuration for exporting test set predictions to a BigQuery table. -message ExportEvaluatedDataItemsConfig { - // URI of desired destination BigQuery table. Expected format: - // bq://::
include:samples/generated/v1beta1/dataset_service.get_dataset.jsinclude:samples/generated/v1beta1/dataset_service.update_dataset.jsinclude:samples/generated/v1beta1/dataset_service.get_annotation_spec.jsinclude:samples/generated/v1beta1/dataset_service.create_dataset.jsinclude:samples/generated/v1beta1/dataset_service.create_dataset.jsinclude:samples/generated/v1beta1/dataset_service.delete_dataset.jsinclude:samples/generated/v1beta1/dataset_service.delete_dataset.jsinclude:samples/generated/v1beta1/dataset_service.import_data.jsinclude:samples/generated/v1beta1/dataset_service.import_data.jsinclude:samples/generated/v1beta1/dataset_service.export_data.jsinclude:samples/generated/v1beta1/dataset_service.export_data.jsinclude:samples/generated/v1beta1/dataset_service.list_datasets.jsinclude:samples/generated/v1beta1/dataset_service.list_data_items.jsinclude:samples/generated/v1beta1/dataset_service.list_annotations.jsinclude:samples/generated/v1beta1/endpoint_service.get_endpoint.jsinclude:samples/generated/v1beta1/endpoint_service.update_endpoint.jsinclude:samples/generated/v1beta1/endpoint_service.create_endpoint.jsinclude:samples/generated/v1beta1/endpoint_service.create_endpoint.jsinclude:samples/generated/v1beta1/endpoint_service.delete_endpoint.jsinclude:samples/generated/v1beta1/endpoint_service.delete_endpoint.jsinclude:samples/generated/v1beta1/endpoint_service.deploy_model.jsinclude:samples/generated/v1beta1/endpoint_service.deploy_model.jsinclude:samples/generated/v1beta1/endpoint_service.undeploy_model.jsinclude:samples/generated/v1beta1/endpoint_service.undeploy_model.jsinclude:samples/generated/v1beta1/endpoint_service.list_endpoints.jsinclude:samples/generated/v1beta1/featurestore_online_serving_service.read_feature_values.jsinclude:samples/generated/v1beta1/featurestore_online_serving_service.streaming_read_feature_values.jsinclude:samples/generated/v1beta1/featurestore_service.get_featurestore.jsinclude:samples/generated/v1beta1/featurestore_service.get_entity_type.jsinclude:samples/generated/v1beta1/featurestore_service.update_entity_type.jsinclude:samples/generated/v1beta1/featurestore_service.get_feature.jsinclude:samples/generated/v1beta1/featurestore_service.update_feature.jsinclude:samples/generated/v1beta1/featurestore_service.create_featurestore.jsinclude:samples/generated/v1beta1/featurestore_service.create_featurestore.jsinclude:samples/generated/v1beta1/featurestore_service.update_featurestore.jsinclude:samples/generated/v1beta1/featurestore_service.update_featurestore.jsinclude:samples/generated/v1beta1/featurestore_service.delete_featurestore.jsinclude:samples/generated/v1beta1/featurestore_service.delete_featurestore.jsinclude:samples/generated/v1beta1/featurestore_service.create_entity_type.jsinclude:samples/generated/v1beta1/featurestore_service.create_entity_type.jsinclude:samples/generated/v1beta1/featurestore_service.delete_entity_type.jsinclude:samples/generated/v1beta1/featurestore_service.delete_entity_type.jsinclude:samples/generated/v1beta1/featurestore_service.create_feature.jsinclude:samples/generated/v1beta1/featurestore_service.create_feature.jsinclude:samples/generated/v1beta1/featurestore_service.batch_create_features.jsinclude:samples/generated/v1beta1/featurestore_service.batch_create_features.jsinclude:samples/generated/v1beta1/featurestore_service.delete_feature.jsinclude:samples/generated/v1beta1/featurestore_service.delete_feature.jsinclude:samples/generated/v1beta1/featurestore_service.import_feature_values.jsinclude:samples/generated/v1beta1/featurestore_service.import_feature_values.jsinclude:samples/generated/v1beta1/featurestore_service.batch_read_feature_values.jsinclude:samples/generated/v1beta1/featurestore_service.batch_read_feature_values.jsinclude:samples/generated/v1beta1/featurestore_service.export_feature_values.jsinclude:samples/generated/v1beta1/featurestore_service.export_feature_values.jsinclude:samples/generated/v1beta1/featurestore_service.list_featurestores.jsinclude:samples/generated/v1beta1/featurestore_service.list_entity_types.jsinclude:samples/generated/v1beta1/featurestore_service.list_features.jsinclude:samples/generated/v1beta1/featurestore_service.search_features.jsinclude:samples/generated/v1beta1/index_endpoint_service.get_index_endpoint.jsinclude:samples/generated/v1beta1/index_endpoint_service.update_index_endpoint.jsinclude:samples/generated/v1beta1/index_endpoint_service.create_index_endpoint.jsinclude:samples/generated/v1beta1/index_endpoint_service.create_index_endpoint.jsinclude:samples/generated/v1beta1/index_endpoint_service.delete_index_endpoint.jsinclude:samples/generated/v1beta1/index_endpoint_service.delete_index_endpoint.jsinclude:samples/generated/v1beta1/index_endpoint_service.deploy_index.jsinclude:samples/generated/v1beta1/index_endpoint_service.deploy_index.jsinclude:samples/generated/v1beta1/index_endpoint_service.undeploy_index.jsinclude:samples/generated/v1beta1/index_endpoint_service.undeploy_index.jsinclude:samples/generated/v1beta1/index_endpoint_service.mutate_deployed_index.jsinclude:samples/generated/v1beta1/index_endpoint_service.mutate_deployed_index.jsinclude:samples/generated/v1beta1/index_endpoint_service.list_index_endpoints.jsinclude:samples/generated/v1beta1/index_service.get_index.jsinclude:samples/generated/v1beta1/index_service.create_index.jsinclude:samples/generated/v1beta1/index_service.create_index.jsinclude:samples/generated/v1beta1/index_service.update_index.jsinclude:samples/generated/v1beta1/index_service.update_index.jsinclude:samples/generated/v1beta1/index_service.delete_index.jsinclude:samples/generated/v1beta1/index_service.delete_index.jsinclude:samples/generated/v1beta1/index_service.list_indexes.jsinclude:samples/generated/v1beta1/job_service.create_custom_job.jsinclude:samples/generated/v1beta1/job_service.get_custom_job.jsinclude:samples/generated/v1beta1/job_service.cancel_custom_job.jsinclude:samples/generated/v1beta1/job_service.create_data_labeling_job.jsinclude:samples/generated/v1beta1/job_service.get_data_labeling_job.jsinclude:samples/generated/v1beta1/job_service.cancel_data_labeling_job.jsinclude:samples/generated/v1beta1/job_service.create_hyperparameter_tuning_job.jsinclude:samples/generated/v1beta1/job_service.get_hyperparameter_tuning_job.jsinclude:samples/generated/v1beta1/job_service.cancel_hyperparameter_tuning_job.jsinclude:samples/generated/v1beta1/job_service.create_batch_prediction_job.jsinclude:samples/generated/v1beta1/job_service.get_batch_prediction_job.jsinclude:samples/generated/v1beta1/job_service.cancel_batch_prediction_job.jsinclude:samples/generated/v1beta1/job_service.create_model_deployment_monitoring_job.jsinclude:samples/generated/v1beta1/job_service.get_model_deployment_monitoring_job.jsinclude:samples/generated/v1beta1/job_service.pause_model_deployment_monitoring_job.jsinclude:samples/generated/v1beta1/job_service.resume_model_deployment_monitoring_job.jsinclude:samples/generated/v1beta1/job_service.delete_custom_job.jsinclude:samples/generated/v1beta1/job_service.delete_custom_job.jsinclude:samples/generated/v1beta1/job_service.delete_data_labeling_job.jsinclude:samples/generated/v1beta1/job_service.delete_data_labeling_job.jsinclude:samples/generated/v1beta1/job_service.delete_hyperparameter_tuning_job.jsinclude:samples/generated/v1beta1/job_service.delete_hyperparameter_tuning_job.jsinclude:samples/generated/v1beta1/job_service.delete_batch_prediction_job.jsinclude:samples/generated/v1beta1/job_service.delete_batch_prediction_job.jsinclude:samples/generated/v1beta1/job_service.update_model_deployment_monitoring_job.jsinclude:samples/generated/v1beta1/job_service.update_model_deployment_monitoring_job.jsinclude:samples/generated/v1beta1/job_service.delete_model_deployment_monitoring_job.jsinclude:samples/generated/v1beta1/job_service.delete_model_deployment_monitoring_job.jsinclude:samples/generated/v1beta1/job_service.list_custom_jobs.jsinclude:samples/generated/v1beta1/job_service.list_data_labeling_jobs.jsinclude:samples/generated/v1beta1/job_service.list_hyperparameter_tuning_jobs.jsinclude:samples/generated/v1beta1/job_service.list_batch_prediction_jobs.jsinclude:samples/generated/v1beta1/job_service.search_model_deployment_monitoring_stats_anomalies.jsinclude:samples/generated/v1beta1/job_service.list_model_deployment_monitoring_jobs.jsinclude:samples/generated/v1beta1/metadata_service.get_metadata_store.jsinclude:samples/generated/v1beta1/metadata_service.create_artifact.jsinclude:samples/generated/v1beta1/metadata_service.get_artifact.jsinclude:samples/generated/v1beta1/metadata_service.update_artifact.jsinclude:samples/generated/v1beta1/metadata_service.create_context.jsinclude:samples/generated/v1beta1/metadata_service.get_context.jsinclude:samples/generated/v1beta1/metadata_service.update_context.jsinclude:samples/generated/v1beta1/metadata_service.add_context_artifacts_and_executions.jsinclude:samples/generated/v1beta1/metadata_service.add_context_children.jsinclude:samples/generated/v1beta1/metadata_service.query_context_lineage_subgraph.jsinclude:samples/generated/v1beta1/metadata_service.create_execution.jsinclude:samples/generated/v1beta1/metadata_service.get_execution.jsinclude:samples/generated/v1beta1/metadata_service.update_execution.jsinclude:samples/generated/v1beta1/metadata_service.add_execution_events.jsinclude:samples/generated/v1beta1/metadata_service.query_execution_inputs_and_outputs.jsinclude:samples/generated/v1beta1/metadata_service.create_metadata_schema.jsinclude:samples/generated/v1beta1/metadata_service.get_metadata_schema.jsinclude:samples/generated/v1beta1/metadata_service.query_artifact_lineage_subgraph.jsinclude:samples/generated/v1beta1/metadata_service.create_metadata_store.jsinclude:samples/generated/v1beta1/metadata_service.create_metadata_store.jsinclude:samples/generated/v1beta1/metadata_service.delete_metadata_store.jsinclude:samples/generated/v1beta1/metadata_service.delete_metadata_store.jsinclude:samples/generated/v1beta1/metadata_service.delete_artifact.jsinclude:samples/generated/v1beta1/metadata_service.delete_artifact.jsinclude:samples/generated/v1beta1/metadata_service.purge_artifacts.jsinclude:samples/generated/v1beta1/metadata_service.purge_artifacts.jsinclude:samples/generated/v1beta1/metadata_service.delete_context.jsinclude:samples/generated/v1beta1/metadata_service.delete_context.jsinclude:samples/generated/v1beta1/metadata_service.purge_contexts.jsinclude:samples/generated/v1beta1/metadata_service.purge_contexts.jsinclude:samples/generated/v1beta1/metadata_service.delete_execution.jsinclude:samples/generated/v1beta1/metadata_service.delete_execution.jsinclude:samples/generated/v1beta1/metadata_service.purge_executions.jsinclude:samples/generated/v1beta1/metadata_service.purge_executions.jsinclude:samples/generated/v1beta1/metadata_service.list_metadata_stores.jsinclude:samples/generated/v1beta1/metadata_service.list_artifacts.jsinclude:samples/generated/v1beta1/metadata_service.list_contexts.jsinclude:samples/generated/v1beta1/metadata_service.list_executions.jsinclude:samples/generated/v1beta1/metadata_service.list_metadata_schemas.jsinclude:samples/generated/v1beta1/migration_service.batch_migrate_resources.jsinclude:samples/generated/v1beta1/migration_service.batch_migrate_resources.jsinclude:samples/generated/v1beta1/migration_service.search_migratable_resources.jsinclude:samples/generated/v1beta1/model_service.get_model.jsinclude:samples/generated/v1beta1/model_service.update_model.jsinclude:samples/generated/v1beta1/model_service.merge_version_aliases.jsinclude:samples/generated/v1beta1/model_service.import_model_evaluation.jsinclude:samples/generated/v1beta1/model_service.get_model_evaluation.jsinclude:samples/generated/v1beta1/model_service.get_model_evaluation_slice.jsinclude:samples/generated/v1beta1/model_service.upload_model.jsinclude:samples/generated/v1beta1/model_service.upload_model.jsinclude:samples/generated/v1beta1/model_service.update_explanation_dataset.jsinclude:samples/generated/v1beta1/model_service.update_explanation_dataset.jsinclude:samples/generated/v1beta1/model_service.delete_model.jsinclude:samples/generated/v1beta1/model_service.delete_model.jsinclude:samples/generated/v1beta1/model_service.delete_model_version.jsinclude:samples/generated/v1beta1/model_service.delete_model_version.jsinclude:samples/generated/v1beta1/model_service.export_model.jsinclude:samples/generated/v1beta1/model_service.export_model.jsinclude:samples/generated/v1beta1/model_service.list_models.jsinclude:samples/generated/v1beta1/model_service.list_model_versions.jsinclude:samples/generated/v1beta1/model_service.list_model_evaluations.jsinclude:samples/generated/v1beta1/model_service.list_model_evaluation_slices.jsinclude:samples/generated/v1beta1/pipeline_service.create_training_pipeline.jsinclude:samples/generated/v1beta1/pipeline_service.get_training_pipeline.jsinclude:samples/generated/v1beta1/pipeline_service.cancel_training_pipeline.jsinclude:samples/generated/v1beta1/pipeline_service.create_pipeline_job.jsinclude:samples/generated/v1beta1/pipeline_service.get_pipeline_job.jsinclude:samples/generated/v1beta1/pipeline_service.cancel_pipeline_job.jsinclude:samples/generated/v1beta1/pipeline_service.delete_training_pipeline.jsinclude:samples/generated/v1beta1/pipeline_service.delete_training_pipeline.jsinclude:samples/generated/v1beta1/pipeline_service.delete_pipeline_job.jsinclude:samples/generated/v1beta1/pipeline_service.delete_pipeline_job.jsinclude:samples/generated/v1beta1/pipeline_service.list_training_pipelines.jsinclude:samples/generated/v1beta1/pipeline_service.list_pipeline_jobs.jsinclude:samples/generated/v1beta1/prediction_service.predict.jsinclude:samples/generated/v1beta1/prediction_service.raw_predict.jsinclude:samples/generated/v1beta1/prediction_service.explain.jsinclude:samples/generated/v1beta1/specialist_pool_service.get_specialist_pool.jsinclude:samples/generated/v1beta1/specialist_pool_service.create_specialist_pool.jsinclude:samples/generated/v1beta1/specialist_pool_service.create_specialist_pool.jsinclude:samples/generated/v1beta1/specialist_pool_service.delete_specialist_pool.jsinclude:samples/generated/v1beta1/specialist_pool_service.delete_specialist_pool.jsinclude:samples/generated/v1beta1/specialist_pool_service.update_specialist_pool.jsinclude:samples/generated/v1beta1/specialist_pool_service.update_specialist_pool.jsinclude:samples/generated/v1beta1/specialist_pool_service.list_specialist_pools.jsinclude:samples/generated/v1beta1/tensorboard_service.get_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.get_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_runs.jsinclude:samples/generated/v1beta1/tensorboard_service.get_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.get_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.batch_read_tensorboard_time_series_data.jsinclude:samples/generated/v1beta1/tensorboard_service.read_tensorboard_time_series_data.jsinclude:samples/generated/v1beta1/tensorboard_service.write_tensorboard_experiment_data.jsinclude:samples/generated/v1beta1/tensorboard_service.write_tensorboard_run_data.jsinclude:samples/generated/v1beta1/tensorboard_service.read_tensorboard_blob_data.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.list_tensorboards.jsinclude:samples/generated/v1beta1/tensorboard_service.list_tensorboard_experiments.jsinclude:samples/generated/v1beta1/tensorboard_service.list_tensorboard_runs.jsinclude:samples/generated/v1beta1/tensorboard_service.list_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.jsinclude:samples/generated/v1beta1/vizier_service.create_study.jsinclude:samples/generated/v1beta1/vizier_service.get_study.jsinclude:samples/generated/v1beta1/vizier_service.delete_study.jsinclude:samples/generated/v1beta1/vizier_service.lookup_study.jsinclude:samples/generated/v1beta1/vizier_service.create_trial.jsinclude:samples/generated/v1beta1/vizier_service.get_trial.jsinclude:samples/generated/v1beta1/vizier_service.add_trial_measurement.jsinclude:samples/generated/v1beta1/vizier_service.complete_trial.jsinclude:samples/generated/v1beta1/vizier_service.delete_trial.jsinclude:samples/generated/v1beta1/vizier_service.stop_trial.jsinclude:samples/generated/v1beta1/vizier_service.list_optimal_trials.jsinclude:samples/generated/v1beta1/vizier_service.suggest_trials.jsinclude:samples/generated/v1beta1/vizier_service.suggest_trials.jsinclude:samples/generated/v1beta1/vizier_service.check_trial_early_stopping_state.jsinclude:samples/generated/v1beta1/vizier_service.check_trial_early_stopping_state.jsinclude:samples/generated/v1beta1/vizier_service.list_studies.jsinclude:samples/generated/v1beta1/vizier_service.list_trials.js
- // - // If not specified, then results are exported to the following auto-created - // BigQuery table: - // :export_evaluated_examples__.evaluated_examples - string destination_bigquery_uri = 1; - - // If true and an export destination is specified, then the contents of the - // destination are overwritten. Otherwise, if the export destination already - // exists, then the export operation fails. - bool override_existing_table = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/specialist_pool.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/specialist_pool.proto deleted file mode 100644 index 0e620e6a..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/specialist_pool.proto +++ /dev/null @@ -1,62 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "SpecialistPoolProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// SpecialistPool represents customers' own workforce to work on their data -// labeling jobs. It includes a group of specialist managers and workers. -// Managers are responsible for managing the workers in this pool as well as -// customers' data labeling jobs associated with this pool. Customers create -// specialist pool as well as start data labeling jobs on Cloud, managers and -// workers handle the jobs using CrowdCompute console. -message SpecialistPool { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/SpecialistPool" - pattern: "projects/{project}/locations/{location}/specialistPools/{specialist_pool}" - }; - - // Required. The resource name of the SpecialistPool. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The user-defined name of the SpecialistPool. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - // This field should be unique on project-level. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The number of managers in this SpecialistPool. - int32 specialist_managers_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The email addresses of the managers in the SpecialistPool. - repeated string specialist_manager_emails = 4; - - // Output only. The resource name of the pending data labeling jobs. - repeated string pending_data_labeling_jobs = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The email addresses of workers in the SpecialistPool. - repeated string specialist_worker_emails = 7; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/specialist_pool_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/specialist_pool_service.proto deleted file mode 100644 index c45cc767..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/specialist_pool_service.proto +++ /dev/null @@ -1,210 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/operation.proto"; -import "google/cloud/aiplatform/v1/specialist_pool.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "SpecialistPoolServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A service for creating and managing Customer SpecialistPools. -// When customers start Data Labeling jobs, they can reuse/create Specialist -// Pools to bring their own Specialists to label the data. -// Customers can add/remove Managers for the Specialist Pool on Cloud console, -// then Managers will get email notifications to manage Specialists and tasks on -// CrowdCompute console. -service SpecialistPoolService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a SpecialistPool. - rpc CreateSpecialistPool(CreateSpecialistPoolRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/specialistPools" - body: "specialist_pool" - }; - option (google.api.method_signature) = "parent,specialist_pool"; - option (google.longrunning.operation_info) = { - response_type: "SpecialistPool" - metadata_type: "CreateSpecialistPoolOperationMetadata" - }; - } - - // Gets a SpecialistPool. - rpc GetSpecialistPool(GetSpecialistPoolRequest) returns (SpecialistPool) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/specialistPools/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists SpecialistPools in a Location. - rpc ListSpecialistPools(ListSpecialistPoolsRequest) returns (ListSpecialistPoolsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/specialistPools" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a SpecialistPool as well as all Specialists in the pool. - rpc DeleteSpecialistPool(DeleteSpecialistPoolRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/specialistPools/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Updates a SpecialistPool. - rpc UpdateSpecialistPool(UpdateSpecialistPoolRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{specialist_pool.name=projects/*/locations/*/specialistPools/*}" - body: "specialist_pool" - }; - option (google.api.method_signature) = "specialist_pool,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "SpecialistPool" - metadata_type: "UpdateSpecialistPoolOperationMetadata" - }; - } -} - -// Request message for [SpecialistPoolService.CreateSpecialistPool][google.cloud.aiplatform.v1.SpecialistPoolService.CreateSpecialistPool]. -message CreateSpecialistPoolRequest { - // Required. The parent Project name for the new SpecialistPool. - // The form is `projects/{project}/locations/{location}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The SpecialistPool to create. - SpecialistPool specialist_pool = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Runtime operation information for -// [SpecialistPoolService.CreateSpecialistPool][google.cloud.aiplatform.v1.SpecialistPoolService.CreateSpecialistPool]. -message CreateSpecialistPoolOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [SpecialistPoolService.GetSpecialistPool][google.cloud.aiplatform.v1.SpecialistPoolService.GetSpecialistPool]. -message GetSpecialistPoolRequest { - // Required. The name of the SpecialistPool resource. - // The form is - // `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/SpecialistPool" - } - ]; -} - -// Request message for [SpecialistPoolService.ListSpecialistPools][google.cloud.aiplatform.v1.SpecialistPoolService.ListSpecialistPools]. -message ListSpecialistPoolsRequest { - // Required. The name of the SpecialistPool's parent resource. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The standard list page size. - int32 page_size = 2; - - // The standard list page token. - // Typically obtained by [ListSpecialistPoolsResponse.next_page_token][google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.next_page_token] of - // the previous [SpecialistPoolService.ListSpecialistPools][google.cloud.aiplatform.v1.SpecialistPoolService.ListSpecialistPools] call. Return - // first page if empty. - string page_token = 3; - - // Mask specifying which fields to read. FieldMask represents a set of - google.protobuf.FieldMask read_mask = 4; -} - -// Response message for [SpecialistPoolService.ListSpecialistPools][google.cloud.aiplatform.v1.SpecialistPoolService.ListSpecialistPools]. -message ListSpecialistPoolsResponse { - // A list of SpecialistPools that matches the specified filter in the request. - repeated SpecialistPool specialist_pools = 1; - - // The standard List next-page token. - string next_page_token = 2; -} - -// Request message for [SpecialistPoolService.DeleteSpecialistPool][google.cloud.aiplatform.v1.SpecialistPoolService.DeleteSpecialistPool]. -message DeleteSpecialistPoolRequest { - // Required. The resource name of the SpecialistPool to delete. Format: - // `projects/{project}/locations/{location}/specialistPools/{specialist_pool}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/SpecialistPool" - } - ]; - - // If set to true, any specialist managers in this SpecialistPool will also be - // deleted. (Otherwise, the request will only work if the SpecialistPool has - // no specialist managers.) - bool force = 2; -} - -// Request message for [SpecialistPoolService.UpdateSpecialistPool][google.cloud.aiplatform.v1.SpecialistPoolService.UpdateSpecialistPool]. -message UpdateSpecialistPoolRequest { - // Required. The SpecialistPool which replaces the resource on the server. - SpecialistPool specialist_pool = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The update mask applies to the resource. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Runtime operation metadata for -// [SpecialistPoolService.UpdateSpecialistPool][google.cloud.aiplatform.v1.SpecialistPoolService.UpdateSpecialistPool]. -message UpdateSpecialistPoolOperationMetadata { - // Output only. The name of the SpecialistPool to which the specialists are being added. - // Format: - // `projects/{project_id}/locations/{location_id}/specialistPools/{specialist_pool}` - string specialist_pool = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/SpecialistPool" - } - ]; - - // The operation generic information. - GenericOperationMetadata generic_metadata = 2; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/study.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/study.proto deleted file mode 100644 index 96b3c8ff..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/study.proto +++ /dev/null @@ -1,559 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "StudyProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A message representing a Study. -message Study { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Study" - pattern: "projects/{project}/locations/{location}/studies/{study}" - }; - - // Describes the Study state. - enum State { - // The study state is unspecified. - STATE_UNSPECIFIED = 0; - - // The study is active. - ACTIVE = 1; - - // The study is stopped due to an internal error. - INACTIVE = 2; - - // The study is done when the service exhausts the parameter search space - // or max_trial_count is reached. - COMPLETED = 3; - } - - // Output only. The name of a study. The study's globally unique identifier. - // Format: `projects/{project}/locations/{location}/studies/{study}` - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Describes the Study, default value is empty string. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Configuration of the Study. - StudySpec study_spec = 3 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The detailed state of a Study. - State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time at which the study was created. - google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A human readable reason why the Study is inactive. - // This should be empty if a study is ACTIVE or COMPLETED. - string inactive_reason = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A message representing a Trial. A Trial contains a unique set of Parameters -// that has been or will be evaluated, along with the objective metrics got by -// running the Trial. -message Trial { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Trial" - pattern: "projects/{project}/locations/{location}/studies/{study}/trials/{trial}" - }; - - // A message representing a parameter to be tuned. - message Parameter { - // Output only. The ID of the parameter. The parameter should be defined in - // [StudySpec's Parameters][google.cloud.aiplatform.v1.StudySpec.parameters]. - string parameter_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The value of the parameter. - // `number_value` will be set if a parameter defined in StudySpec is - // in type 'INTEGER', 'DOUBLE' or 'DISCRETE'. - // `string_value` will be set if a parameter defined in StudySpec is - // in type 'CATEGORICAL'. - google.protobuf.Value value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Describes a Trial state. - enum State { - // The Trial state is unspecified. - STATE_UNSPECIFIED = 0; - - // Indicates that a specific Trial has been requested, but it has not yet - // been suggested by the service. - REQUESTED = 1; - - // Indicates that the Trial has been suggested. - ACTIVE = 2; - - // Indicates that the Trial should stop according to the service. - STOPPING = 3; - - // Indicates that the Trial is completed successfully. - SUCCEEDED = 4; - - // Indicates that the Trial should not be attempted again. - // The service will set a Trial to INFEASIBLE when it's done but missing - // the final_measurement. - INFEASIBLE = 5; - } - - // Output only. Resource name of the Trial assigned by the service. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The identifier of the Trial assigned by the service. - string id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The detailed state of the Trial. - State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The parameters of the Trial. - repeated Parameter parameters = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The final measurement containing the objective value. - Measurement final_measurement = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A list of measurements that are strictly lexicographically - // ordered by their induced tuples (steps, elapsed_duration). - // These are used for early stopping computations. - repeated Measurement measurements = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the Trial was started. - google.protobuf.Timestamp start_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the Trial's status changed to `SUCCEEDED` or `INFEASIBLE`. - google.protobuf.Timestamp end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The identifier of the client that originally requested this Trial. - // Each client is identified by a unique client_id. When a client - // asks for a suggestion, Vertex AI Vizier will assign it a Trial. The client - // should evaluate the Trial, complete it, and report back to Vertex AI - // Vizier. If suggestion is asked again by same client_id before the Trial is - // completed, the same Trial will be returned. Multiple clients with - // different client_ids can ask for suggestions simultaneously, each of them - // will get their own Trial. - string client_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A human readable string describing why the Trial is - // infeasible. This is set only if Trial state is `INFEASIBLE`. - string infeasible_reason = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The CustomJob name linked to the Trial. - // It's set for a HyperparameterTuningJob's Trial. - string custom_job = 11 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/CustomJob" - } - ]; - - // Output only. URIs for accessing [interactive - // shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) - // (one URI for each training node). Only available if this trial is part of - // a [HyperparameterTuningJob][google.cloud.aiplatform.v1.HyperparameterTuningJob] and the job's - // [trial_job_spec.enable_web_access][google.cloud.aiplatform.v1.CustomJobSpec.enable_web_access] field - // is `true`. - // - // The keys are names of each node used for the trial; for example, - // `workerpool0-0` for the primary node, `workerpool1-0` for the first node in - // the second worker pool, and `workerpool1-1` for the second node in the - // second worker pool. - // - // The values are the URIs for each node's interactive shell. - map web_access_uris = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Represents specification of a Study. -message StudySpec { - // Represents a metric to optimize. - message MetricSpec { - // The available types of optimization goals. - enum GoalType { - // Goal Type will default to maximize. - GOAL_TYPE_UNSPECIFIED = 0; - - // Maximize the goal metric. - MAXIMIZE = 1; - - // Minimize the goal metric. - MINIMIZE = 2; - } - - // Required. The ID of the metric. Must not contain whitespaces and must be unique - // amongst all MetricSpecs. - string metric_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The optimization goal of the metric. - GoalType goal = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Represents a single parameter to optimize. - message ParameterSpec { - // Value specification for a parameter in `DOUBLE` type. - message DoubleValueSpec { - // Required. Inclusive minimum value of the parameter. - double min_value = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Inclusive maximum value of the parameter. - double max_value = 2 [(google.api.field_behavior) = REQUIRED]; - - // A default value for a `DOUBLE` parameter that is assumed to be a - // relatively good starting point. Unset value signals that there is no - // offered starting point. - // - // Currently only supported by the Vertex AI Vizier service. Not supported - // by HyperparamterTuningJob or TrainingPipeline. - optional double default_value = 4; - } - - // Value specification for a parameter in `INTEGER` type. - message IntegerValueSpec { - // Required. Inclusive minimum value of the parameter. - int64 min_value = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Inclusive maximum value of the parameter. - int64 max_value = 2 [(google.api.field_behavior) = REQUIRED]; - - // A default value for an `INTEGER` parameter that is assumed to be a - // relatively good starting point. Unset value signals that there is no - // offered starting point. - // - // Currently only supported by the Vertex AI Vizier service. Not supported - // by HyperparamterTuningJob or TrainingPipeline. - optional int64 default_value = 4; - } - - // Value specification for a parameter in `CATEGORICAL` type. - message CategoricalValueSpec { - // Required. The list of possible categories. - repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; - - // A default value for a `CATEGORICAL` parameter that is assumed to be a - // relatively good starting point. Unset value signals that there is no - // offered starting point. - // - // Currently only supported by the Vizier service. Not supported by - // HyperparamterTuningJob or TrainingPipeline. - optional string default_value = 3; - } - - // Value specification for a parameter in `DISCRETE` type. - message DiscreteValueSpec { - // Required. A list of possible values. - // The list should be in increasing order and at least 1e-10 apart. - // For instance, this parameter might have possible settings of 1.5, 2.5, - // and 4.0. This list should not contain more than 1,000 values. - repeated double values = 1 [(google.api.field_behavior) = REQUIRED]; - - // A default value for a `DISCRETE` parameter that is assumed to be a - // relatively good starting point. Unset value signals that there is no - // offered starting point. It automatically rounds to the - // nearest feasible discrete point. - // - // Currently only supported by the Vizier service. Not supported by - // HyperparamterTuningJob or TrainingPipeline. - optional double default_value = 3; - } - - // Represents a parameter spec with condition from its parent parameter. - message ConditionalParameterSpec { - // Represents the spec to match discrete values from parent parameter. - message DiscreteValueCondition { - // Required. Matches values of the parent parameter of 'DISCRETE' type. - // All values must exist in `discrete_value_spec` of parent parameter. - // - // The Epsilon of the value matching is 1e-10. - repeated double values = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Represents the spec to match integer values from parent parameter. - message IntValueCondition { - // Required. Matches values of the parent parameter of 'INTEGER' type. - // All values must lie in `integer_value_spec` of parent parameter. - repeated int64 values = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Represents the spec to match categorical values from parent parameter. - message CategoricalValueCondition { - // Required. Matches values of the parent parameter of 'CATEGORICAL' type. - // All values must exist in `categorical_value_spec` of parent - // parameter. - repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // A set of parameter values from the parent ParameterSpec's feasible - // space. - oneof parent_value_condition { - // The spec for matching values from a parent parameter of - // `DISCRETE` type. - DiscreteValueCondition parent_discrete_values = 2; - - // The spec for matching values from a parent parameter of `INTEGER` - // type. - IntValueCondition parent_int_values = 3; - - // The spec for matching values from a parent parameter of - // `CATEGORICAL` type. - CategoricalValueCondition parent_categorical_values = 4; - } - - // Required. The spec for a conditional parameter. - ParameterSpec parameter_spec = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // The type of scaling that should be applied to this parameter. - enum ScaleType { - // By default, no scaling is applied. - SCALE_TYPE_UNSPECIFIED = 0; - - // Scales the feasible space to (0, 1) linearly. - UNIT_LINEAR_SCALE = 1; - - // Scales the feasible space logarithmically to (0, 1). The entire - // feasible space must be strictly positive. - UNIT_LOG_SCALE = 2; - - // Scales the feasible space "reverse" logarithmically to (0, 1). The - // result is that values close to the top of the feasible space are spread - // out more than points near the bottom. The entire feasible space must be - // strictly positive. - UNIT_REVERSE_LOG_SCALE = 3; - } - - oneof parameter_value_spec { - // The value spec for a 'DOUBLE' parameter. - DoubleValueSpec double_value_spec = 2; - - // The value spec for an 'INTEGER' parameter. - IntegerValueSpec integer_value_spec = 3; - - // The value spec for a 'CATEGORICAL' parameter. - CategoricalValueSpec categorical_value_spec = 4; - - // The value spec for a 'DISCRETE' parameter. - DiscreteValueSpec discrete_value_spec = 5; - } - - // Required. The ID of the parameter. Must not contain whitespaces and must be unique - // amongst all ParameterSpecs. - string parameter_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // How the parameter should be scaled. - // Leave unset for `CATEGORICAL` parameters. - ScaleType scale_type = 6; - - // A conditional parameter node is active if the parameter's value matches - // the conditional node's parent_value_condition. - // - // If two items in conditional_parameter_specs have the same name, they - // must have disjoint parent_value_condition. - repeated ConditionalParameterSpec conditional_parameter_specs = 10; - } - - // The decay curve automated stopping rule builds a Gaussian Process - // Regressor to predict the final objective value of a Trial based on the - // already completed Trials and the intermediate measurements of the current - // Trial. Early stopping is requested for the current Trial if there is very - // low probability to exceed the optimal value found so far. - message DecayCurveAutomatedStoppingSpec { - // True if [Measurement.elapsed_duration][google.cloud.aiplatform.v1.Measurement.elapsed_duration] is used as the x-axis of each - // Trials Decay Curve. Otherwise, [Measurement.step_count][google.cloud.aiplatform.v1.Measurement.step_count] will be used - // as the x-axis. - bool use_elapsed_duration = 1; - } - - // The median automated stopping rule stops a pending Trial if the Trial's - // best objective_value is strictly below the median 'performance' of all - // completed Trials reported up to the Trial's last measurement. - // Currently, 'performance' refers to the running average of the objective - // values reported by the Trial in each measurement. - message MedianAutomatedStoppingSpec { - // True if median automated stopping rule applies on - // [Measurement.elapsed_duration][google.cloud.aiplatform.v1.Measurement.elapsed_duration]. It means that elapsed_duration - // field of latest measurement of current Trial is used to compute median - // objective value for each completed Trials. - bool use_elapsed_duration = 1; - } - - // Configuration for ConvexAutomatedStoppingSpec. - // When there are enough completed trials (configured by - // min_measurement_count), for pending trials with enough measurements and - // steps, the policy first computes an overestimate of the objective value at - // max_num_steps according to the slope of the incomplete objective value - // curve. No prediction can be made if the curve is completely flat. If the - // overestimation is worse than the best objective value of the completed - // trials, this pending trial will be early-stopped, but a last measurement - // will be added to the pending trial with max_num_steps and predicted - // objective value from the autoregression model. - message ConvexAutomatedStoppingSpec { - // Steps used in predicting the final objective for early stopped trials. In - // general, it's set to be the same as the defined steps in training / - // tuning. If not defined, it will learn it from the completed trials. When - // use_steps is false, this field is set to the maximum elapsed seconds. - int64 max_step_count = 1; - - // Minimum number of steps for a trial to complete. Trials which do not have - // a measurement with step_count > min_step_count won't be considered for - // early stopping. It's ok to set it to 0, and a trial can be early stopped - // at any stage. By default, min_step_count is set to be one-tenth of the - // max_step_count. - // When use_elapsed_duration is true, this field is set to the minimum - // elapsed seconds. - int64 min_step_count = 2; - - // The minimal number of measurements in a Trial. Early-stopping checks - // will not trigger if less than min_measurement_count+1 completed trials or - // pending trials with less than min_measurement_count measurements. If not - // defined, the default value is 5. - int64 min_measurement_count = 3; - - // The hyper-parameter name used in the tuning job that stands for learning - // rate. Leave it blank if learning rate is not in a parameter in tuning. - // The learning_rate is used to estimate the objective value of the ongoing - // trial. - string learning_rate_parameter_name = 4; - - // This bool determines whether or not the rule is applied based on - // elapsed_secs or steps. If use_elapsed_duration==false, the early stopping - // decision is made according to the predicted objective values according to - // the target steps. If use_elapsed_duration==true, elapsed_secs is used - // instead of steps. Also, in this case, the parameters max_num_steps and - // min_num_steps are overloaded to contain max_elapsed_seconds and - // min_elapsed_seconds. - bool use_elapsed_duration = 5; - } - - // The available search algorithms for the Study. - enum Algorithm { - // The default algorithm used by Vertex AI for [hyperparameter - // tuning](https://cloud.google.com/vertex-ai/docs/training/hyperparameter-tuning-overview) - // and [Vertex AI Vizier](https://cloud.google.com/vertex-ai/docs/vizier). - ALGORITHM_UNSPECIFIED = 0; - - // Simple grid search within the feasible space. To use grid search, - // all parameters must be `INTEGER`, `CATEGORICAL`, or `DISCRETE`. - GRID_SEARCH = 2; - - // Simple random search within the feasible space. - RANDOM_SEARCH = 3; - } - - // Describes the noise level of the repeated observations. - // - // "Noisy" means that the repeated observations with the same Trial parameters - // may lead to different metric evaluations. - enum ObservationNoise { - // The default noise level chosen by Vertex AI. - OBSERVATION_NOISE_UNSPECIFIED = 0; - - // Vertex AI assumes that the objective function is (nearly) - // perfectly reproducible, and will never repeat the same Trial - // parameters. - LOW = 1; - - // Vertex AI will estimate the amount of noise in metric - // evaluations, it may repeat the same Trial parameters more than once. - HIGH = 2; - } - - // This indicates which measurement to use if/when the service automatically - // selects the final measurement from previously reported intermediate - // measurements. Choose this based on two considerations: - // A) Do you expect your measurements to monotonically improve? - // If so, choose LAST_MEASUREMENT. On the other hand, if you're in a - // situation where your system can "over-train" and you expect the - // performance to get better for a while but then start declining, - // choose BEST_MEASUREMENT. - // B) Are your measurements significantly noisy and/or irreproducible? - // If so, BEST_MEASUREMENT will tend to be over-optimistic, and it - // may be better to choose LAST_MEASUREMENT. - // If both or neither of (A) and (B) apply, it doesn't matter which - // selection type is chosen. - enum MeasurementSelectionType { - // Will be treated as LAST_MEASUREMENT. - MEASUREMENT_SELECTION_TYPE_UNSPECIFIED = 0; - - // Use the last measurement reported. - LAST_MEASUREMENT = 1; - - // Use the best measurement reported. - BEST_MEASUREMENT = 2; - } - - oneof automated_stopping_spec { - // The automated early stopping spec using decay curve rule. - DecayCurveAutomatedStoppingSpec decay_curve_stopping_spec = 4; - - // The automated early stopping spec using median rule. - MedianAutomatedStoppingSpec median_automated_stopping_spec = 5; - - // The automated early stopping spec using convex stopping rule. - ConvexAutomatedStoppingSpec convex_automated_stopping_spec = 9; - } - - // Required. Metric specs for the Study. - repeated MetricSpec metrics = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The set of parameters to tune. - repeated ParameterSpec parameters = 2 [(google.api.field_behavior) = REQUIRED]; - - // The search algorithm specified for the Study. - Algorithm algorithm = 3; - - // The observation noise level of the study. - // Currently only supported by the Vertex AI Vizier service. Not supported by - // HyperparamterTuningJob or TrainingPipeline. - ObservationNoise observation_noise = 6; - - // Describe which measurement selection type will be used - MeasurementSelectionType measurement_selection_type = 7; -} - -// A message representing a Measurement of a Trial. A Measurement contains -// the Metrics got by executing a Trial using suggested hyperparameter -// values. -message Measurement { - // A message representing a metric in the measurement. - message Metric { - // Output only. The ID of the Metric. The Metric should be defined in - // [StudySpec's Metrics][google.cloud.aiplatform.v1.StudySpec.metrics]. - string metric_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The value for this metric. - double value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. Time that the Trial has been running at the point of this Measurement. - google.protobuf.Duration elapsed_duration = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of steps the machine learning model has been trained for. - // Must be non-negative. - int64 step_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A list of metrics got by evaluating the objective functions using suggested - // Parameter values. - repeated Metric metrics = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard.proto deleted file mode 100644 index 84a245d9..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard.proto +++ /dev/null @@ -1,86 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/encryption_spec.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "TensorboardProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Tensorboard is a physical database that stores users' training metrics. -// A default Tensorboard is provided in each region of a GCP project. -// If needed users can also create extra Tensorboards in their projects. -message Tensorboard { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Tensorboard" - pattern: "projects/{project}/locations/{location}/tensorboards/{tensorboard}" - }; - - // Output only. Name of the Tensorboard. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. User provided name of this Tensorboard. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Description of this Tensorboard. - string description = 3; - - // Customer-managed encryption key spec for a Tensorboard. If set, this - // Tensorboard and all sub-resources of this Tensorboard will be secured by - // this key. - EncryptionSpec encryption_spec = 11; - - // Output only. Consumer project Cloud Storage path prefix used to store blob data, which - // can either be a bucket or directory. Does not end with a '/'. - string blob_storage_path_prefix = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of Runs stored in this Tensorboard. - int32 run_count = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Tensorboard was created. - google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Tensorboard was last updated. - google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize your Tensorboards. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one Tensorboard - // (System labels are excluded). - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. - map labels = 8; - - // Used to perform a consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 9; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_data.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_data.proto deleted file mode 100644 index c65db694..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_data.proto +++ /dev/null @@ -1,101 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/cloud/aiplatform/v1/tensorboard_time_series.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "TensorboardDataProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// All the data stored in a TensorboardTimeSeries. -message TimeSeriesData { - // Required. The ID of the TensorboardTimeSeries, which will become the final component - // of the TensorboardTimeSeries' resource name - string tensorboard_time_series_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Immutable. The value type of this time series. All the values in this time series data - // must match this value type. - TensorboardTimeSeries.ValueType value_type = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Required. Data points in this time series. - repeated TimeSeriesDataPoint values = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// A TensorboardTimeSeries data point. -message TimeSeriesDataPoint { - // Value of this time series data point. - oneof value { - // A scalar value. - Scalar scalar = 3; - - // A tensor value. - TensorboardTensor tensor = 4; - - // A blob sequence value. - TensorboardBlobSequence blobs = 5; - } - - // Wall clock timestamp when this data point is generated by the end user. - google.protobuf.Timestamp wall_time = 1; - - // Step index of this data point within the run. - int64 step = 2; -} - -// One point viewable on a scalar metric plot. -message Scalar { - // Value of the point at this step / timestamp. - double value = 1; -} - -// One point viewable on a tensor metric plot. -message TensorboardTensor { - // Required. Serialized form of - // https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/tensor.proto - bytes value = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Version number of TensorProto used to serialize [value][google.cloud.aiplatform.v1.TensorboardTensor.value]. - int32 version_number = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// One point viewable on a blob metric plot, but mostly just a wrapper message -// to work around repeated fields can't be used directly within `oneof` fields. -message TensorboardBlobSequence { - // List of blobs contained within the sequence. - repeated TensorboardBlob values = 1; -} - -// One blob (e.g, image, graph) viewable on a blob metric plot. -message TensorboardBlob { - // Output only. A URI safe key uniquely identifying a blob. Can be used to locate the blob - // stored in the Cloud Storage bucket of the consumer project. - string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The bytes of the blob is not present unless it's returned by the - // ReadTensorboardBlobData endpoint. - bytes data = 2 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto deleted file mode 100644 index 9d7fe120..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto +++ /dev/null @@ -1,78 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "TensorboardExperimentProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A TensorboardExperiment is a group of TensorboardRuns, that are typically the -// results of a training job run, in a Tensorboard. -message TensorboardExperiment { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/TensorboardExperiment" - pattern: "projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}" - }; - - // Output only. Name of the TensorboardExperiment. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User provided name of this TensorboardExperiment. - string display_name = 2; - - // Description of this TensorboardExperiment. - string description = 3; - - // Output only. Timestamp when this TensorboardExperiment was created. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this TensorboardExperiment was last updated. - google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize your Datasets. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one Dataset (System - // labels are excluded). - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. Following system labels exist for each Dataset: - // * "aiplatform.googleapis.com/dataset_metadata_schema": - // - output only, its value is the - // [metadata_schema's][metadata_schema_uri] title. - map labels = 6; - - // Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 7; - - // Immutable. Source of the TensorboardExperiment. Example: a custom training job. - string source = 8 [(google.api.field_behavior) = IMMUTABLE]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_run.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_run.proto deleted file mode 100644 index 0f7b5eff..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_run.proto +++ /dev/null @@ -1,81 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "TensorboardRunProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// TensorboardRun maps to a specific execution of a training job with a given -// set of hyperparameter values, model definition, dataset, etc -message TensorboardRun { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/TensorboardRun" - pattern: "projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}" - }; - - // Output only. Name of the TensorboardRun. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. User provided name of this TensorboardRun. - // This value must be unique among all TensorboardRuns - // belonging to the same parent TensorboardExperiment. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Description of this TensorboardRun. - string description = 3; - - // Output only. Timestamp when this TensorboardRun was created. - google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this TensorboardRun was last updated. - google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize your TensorboardRuns. - // - // This field will be used to filter and visualize Runs in the Tensorboard UI. - // For example, a Vertex AI training job can set a label - // aiplatform.googleapis.com/training_job_id=xxxxx to all the runs created - // within that job. An end user can set a label experiment_id=xxxxx for all - // the runs produced in a Jupyter notebook. These runs can be grouped by a - // label value and visualized together in the Tensorboard UI. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one TensorboardRun - // (System labels are excluded). - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. - map labels = 8; - - // Used to perform a consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 9; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_service.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_service.proto deleted file mode 100644 index ed81dd1f..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_service.proto +++ /dev/null @@ -1,1006 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/operation.proto"; -import "google/cloud/aiplatform/v1/tensorboard.proto"; -import "google/cloud/aiplatform/v1/tensorboard_data.proto"; -import "google/cloud/aiplatform/v1/tensorboard_experiment.proto"; -import "google/cloud/aiplatform/v1/tensorboard_run.proto"; -import "google/cloud/aiplatform/v1/tensorboard_time_series.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "TensorboardServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// TensorboardService -service TensorboardService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/cloud-platform.read-only"; - - // Creates a Tensorboard. - rpc CreateTensorboard(CreateTensorboardRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/tensorboards" - body: "tensorboard" - }; - option (google.api.method_signature) = "parent,tensorboard"; - option (google.longrunning.operation_info) = { - response_type: "Tensorboard" - metadata_type: "CreateTensorboardOperationMetadata" - }; - } - - // Gets a Tensorboard. - rpc GetTensorboard(GetTensorboardRequest) returns (Tensorboard) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/tensorboards/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a Tensorboard. - rpc UpdateTensorboard(UpdateTensorboardRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{tensorboard.name=projects/*/locations/*/tensorboards/*}" - body: "tensorboard" - }; - option (google.api.method_signature) = "tensorboard,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Tensorboard" - metadata_type: "UpdateTensorboardOperationMetadata" - }; - } - - // Lists Tensorboards in a Location. - rpc ListTensorboards(ListTensorboardsRequest) returns (ListTensorboardsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/tensorboards" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a Tensorboard. - rpc DeleteTensorboard(DeleteTensorboardRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/tensorboards/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Creates a TensorboardExperiment. - rpc CreateTensorboardExperiment(CreateTensorboardExperimentRequest) returns (TensorboardExperiment) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/tensorboards/*}/experiments" - body: "tensorboard_experiment" - }; - option (google.api.method_signature) = "parent,tensorboard_experiment,tensorboard_experiment_id"; - } - - // Gets a TensorboardExperiment. - rpc GetTensorboardExperiment(GetTensorboardExperimentRequest) returns (TensorboardExperiment) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a TensorboardExperiment. - rpc UpdateTensorboardExperiment(UpdateTensorboardExperimentRequest) returns (TensorboardExperiment) { - option (google.api.http) = { - patch: "/v1/{tensorboard_experiment.name=projects/*/locations/*/tensorboards/*/experiments/*}" - body: "tensorboard_experiment" - }; - option (google.api.method_signature) = "tensorboard_experiment,update_mask"; - } - - // Lists TensorboardExperiments in a Location. - rpc ListTensorboardExperiments(ListTensorboardExperimentsRequest) returns (ListTensorboardExperimentsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/tensorboards/*}/experiments" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a TensorboardExperiment. - rpc DeleteTensorboardExperiment(DeleteTensorboardExperimentRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Creates a TensorboardRun. - rpc CreateTensorboardRun(CreateTensorboardRunRequest) returns (TensorboardRun) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs" - body: "tensorboard_run" - }; - option (google.api.method_signature) = "parent,tensorboard_run,tensorboard_run_id"; - } - - // Batch create TensorboardRuns. - rpc BatchCreateTensorboardRuns(BatchCreateTensorboardRunsRequest) returns (BatchCreateTensorboardRunsResponse) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs:batchCreate" - body: "*" - }; - option (google.api.method_signature) = "parent,requests"; - } - - // Gets a TensorboardRun. - rpc GetTensorboardRun(GetTensorboardRunRequest) returns (TensorboardRun) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a TensorboardRun. - rpc UpdateTensorboardRun(UpdateTensorboardRunRequest) returns (TensorboardRun) { - option (google.api.http) = { - patch: "/v1/{tensorboard_run.name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}" - body: "tensorboard_run" - }; - option (google.api.method_signature) = "tensorboard_run,update_mask"; - } - - // Lists TensorboardRuns in a Location. - rpc ListTensorboardRuns(ListTensorboardRunsRequest) returns (ListTensorboardRunsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a TensorboardRun. - rpc DeleteTensorboardRun(DeleteTensorboardRunRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Batch create TensorboardTimeSeries that belong to a TensorboardExperiment. - rpc BatchCreateTensorboardTimeSeries(BatchCreateTensorboardTimeSeriesRequest) returns (BatchCreateTensorboardTimeSeriesResponse) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs/*/timeSeries:batchCreate" - body: "*" - }; - option (google.api.method_signature) = "parent,requests"; - } - - // Creates a TensorboardTimeSeries. - rpc CreateTensorboardTimeSeries(CreateTensorboardTimeSeriesRequest) returns (TensorboardTimeSeries) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/timeSeries" - body: "tensorboard_time_series" - }; - option (google.api.method_signature) = "parent,tensorboard_time_series"; - } - - // Gets a TensorboardTimeSeries. - rpc GetTensorboardTimeSeries(GetTensorboardTimeSeriesRequest) returns (TensorboardTimeSeries) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a TensorboardTimeSeries. - rpc UpdateTensorboardTimeSeries(UpdateTensorboardTimeSeriesRequest) returns (TensorboardTimeSeries) { - option (google.api.http) = { - patch: "/v1/{tensorboard_time_series.name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}" - body: "tensorboard_time_series" - }; - option (google.api.method_signature) = "tensorboard_time_series,update_mask"; - } - - // Lists TensorboardTimeSeries in a Location. - rpc ListTensorboardTimeSeries(ListTensorboardTimeSeriesRequest) returns (ListTensorboardTimeSeriesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/timeSeries" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a TensorboardTimeSeries. - rpc DeleteTensorboardTimeSeries(DeleteTensorboardTimeSeriesRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Reads multiple TensorboardTimeSeries' data. The data point number limit is - // 1000 for scalars, 100 for tensors and blob references. If the number of - // data points stored is less than the limit, all data will be returned. - // Otherwise, that limit number of data points will be randomly selected from - // this time series and returned. - rpc BatchReadTensorboardTimeSeriesData(BatchReadTensorboardTimeSeriesDataRequest) returns (BatchReadTensorboardTimeSeriesDataResponse) { - option (google.api.http) = { - get: "/v1/{tensorboard=projects/*/locations/*/tensorboards/*}/experiments/*/runs/*/timeSeries:batchRead" - }; - option (google.api.method_signature) = "tensorboard"; - } - - // Reads a TensorboardTimeSeries' data. By default, if the number of data - // points stored is less than 1000, all data will be returned. Otherwise, 1000 - // data points will be randomly selected from this time series and returned. - // This value can be changed by changing max_data_points, which can't be - // greater than 10k. - rpc ReadTensorboardTimeSeriesData(ReadTensorboardTimeSeriesDataRequest) returns (ReadTensorboardTimeSeriesDataResponse) { - option (google.api.http) = { - get: "/v1/{tensorboard_time_series=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}:read" - }; - option (google.api.method_signature) = "tensorboard_time_series"; - } - - // Gets bytes of TensorboardBlobs. - // This is to allow reading blob data stored in consumer project's Cloud - // Storage bucket without users having to obtain Cloud Storage access - // permission. - rpc ReadTensorboardBlobData(ReadTensorboardBlobDataRequest) returns (stream ReadTensorboardBlobDataResponse) { - option (google.api.http) = { - get: "/v1/{time_series=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}:readBlobData" - }; - option (google.api.method_signature) = "time_series"; - } - - // Write time series data points of multiple TensorboardTimeSeries in multiple - // TensorboardRun's. If any data fail to be ingested, an error will be - // returned. - rpc WriteTensorboardExperimentData(WriteTensorboardExperimentDataRequest) returns (WriteTensorboardExperimentDataResponse) { - option (google.api.http) = { - post: "/v1/{tensorboard_experiment=projects/*/locations/*/tensorboards/*/experiments/*}:write" - body: "*" - }; - option (google.api.method_signature) = "tensorboard_experiment,write_run_data_requests"; - } - - // Write time series data points into multiple TensorboardTimeSeries under - // a TensorboardRun. If any data fail to be ingested, an error will be - // returned. - rpc WriteTensorboardRunData(WriteTensorboardRunDataRequest) returns (WriteTensorboardRunDataResponse) { - option (google.api.http) = { - post: "/v1/{tensorboard_run=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}:write" - body: "*" - }; - option (google.api.method_signature) = "tensorboard_run,time_series_data"; - } - - // Exports a TensorboardTimeSeries' data. Data is returned in paginated - // responses. - rpc ExportTensorboardTimeSeriesData(ExportTensorboardTimeSeriesDataRequest) returns (ExportTensorboardTimeSeriesDataResponse) { - option (google.api.http) = { - post: "/v1/{tensorboard_time_series=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}:exportTensorboardTimeSeries" - body: "*" - }; - option (google.api.method_signature) = "tensorboard_time_series"; - } -} - -// Request message for [TensorboardService.CreateTensorboard][google.cloud.aiplatform.v1.TensorboardService.CreateTensorboard]. -message CreateTensorboardRequest { - // Required. The resource name of the Location to create the Tensorboard in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Tensorboard" - } - ]; - - // Required. The Tensorboard to create. - Tensorboard tensorboard = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [TensorboardService.GetTensorboard][google.cloud.aiplatform.v1.TensorboardService.GetTensorboard]. -message GetTensorboardRequest { - // Required. The name of the Tensorboard resource. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Tensorboard" - } - ]; -} - -// Request message for [TensorboardService.ListTensorboards][google.cloud.aiplatform.v1.TensorboardService.ListTensorboards]. -message ListTensorboardsRequest { - // Required. The resource name of the Location to list Tensorboards. - // Format: - // `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Tensorboard" - } - ]; - - // Lists the Tensorboards that match the filter expression. - string filter = 2; - - // The maximum number of Tensorboards to return. The service may return - // fewer than this value. If unspecified, at most 100 Tensorboards will be - // returned. The maximum value is 100; values above 100 will be coerced to - // 100. - int32 page_size = 3; - - // A page token, received from a previous - // [TensorboardService.ListTensorboards][google.cloud.aiplatform.v1.TensorboardService.ListTensorboards] call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [TensorboardService.ListTensorboards][google.cloud.aiplatform.v1.TensorboardService.ListTensorboards] must - // match the call that provided the page token. - string page_token = 4; - - // Field to use to sort the list. - string order_by = 5; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 6; -} - -// Response message for [TensorboardService.ListTensorboards][google.cloud.aiplatform.v1.TensorboardService.ListTensorboards]. -message ListTensorboardsResponse { - // The Tensorboards mathching the request. - repeated Tensorboard tensorboards = 1; - - // A token, which can be sent as [ListTensorboardsRequest.page_token][google.cloud.aiplatform.v1.ListTensorboardsRequest.page_token] - // to retrieve the next page. If this field is omitted, there are no - // subsequent pages. - string next_page_token = 2; -} - -// Request message for [TensorboardService.UpdateTensorboard][google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboard]. -message UpdateTensorboardRequest { - // Required. Field mask is used to specify the fields to be overwritten in the - // Tensorboard resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then all fields will be overwritten if new - // values are specified. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Tensorboard's `name` field is used to identify the - // Tensorboard to be updated. Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - Tensorboard tensorboard = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [TensorboardService.DeleteTensorboard][google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboard]. -message DeleteTensorboardRequest { - // Required. The name of the Tensorboard to be deleted. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Tensorboard" - } - ]; -} - -// Request message for [TensorboardService.CreateTensorboardExperiment][google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardExperiment]. -message CreateTensorboardExperimentRequest { - // Required. The resource name of the Tensorboard to create the TensorboardExperiment - // in. Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardExperiment" - } - ]; - - // The TensorboardExperiment to create. - TensorboardExperiment tensorboard_experiment = 2; - - // Required. The ID to use for the Tensorboard experiment, which will become the final - // component of the Tensorboard experiment's resource name. - // - // This value should be 1-128 characters, and valid characters - // are /[a-z][0-9]-/. - string tensorboard_experiment_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [TensorboardService.GetTensorboardExperiment][google.cloud.aiplatform.v1.TensorboardService.GetTensorboardExperiment]. -message GetTensorboardExperimentRequest { - // Required. The name of the TensorboardExperiment resource. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardExperiment" - } - ]; -} - -// Request message for [TensorboardService.ListTensorboardExperiments][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments]. -message ListTensorboardExperimentsRequest { - // Required. The resource name of the Tensorboard to list TensorboardExperiments. - // Format: - // 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/TensorboardExperiment" - } - ]; - - // Lists the TensorboardExperiments that match the filter expression. - string filter = 2; - - // The maximum number of TensorboardExperiments to return. The service may - // return fewer than this value. If unspecified, at most 50 - // TensorboardExperiments will be returned. The maximum value is 1000; values - // above 1000 will be coerced to 1000. - int32 page_size = 3; - - // A page token, received from a previous - // [TensorboardService.ListTensorboardExperiments][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments] call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [TensorboardService.ListTensorboardExperiments][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments] must - // match the call that provided the page token. - string page_token = 4; - - // Field to use to sort the list. - string order_by = 5; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 6; -} - -// Response message for [TensorboardService.ListTensorboardExperiments][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments]. -message ListTensorboardExperimentsResponse { - // The TensorboardExperiments mathching the request. - repeated TensorboardExperiment tensorboard_experiments = 1; - - // A token, which can be sent as - // [ListTensorboardExperimentsRequest.page_token][google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest.page_token] to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [TensorboardService.UpdateTensorboardExperiment][google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardExperiment]. -message UpdateTensorboardExperimentRequest { - // Required. Field mask is used to specify the fields to be overwritten in the - // TensorboardExperiment resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then all fields will be overwritten if new - // values are specified. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The TensorboardExperiment's `name` field is used to identify the - // TensorboardExperiment to be updated. Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - TensorboardExperiment tensorboard_experiment = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [TensorboardService.DeleteTensorboardExperiment][google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardExperiment]. -message DeleteTensorboardExperimentRequest { - // Required. The name of the TensorboardExperiment to be deleted. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardExperiment" - } - ]; -} - -// Request message for [TensorboardService.BatchCreateTensorboardRuns][google.cloud.aiplatform.v1.TensorboardService.BatchCreateTensorboardRuns]. -message BatchCreateTensorboardRunsRequest { - // Required. The resource name of the TensorboardExperiment to create the - // TensorboardRuns in. Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - // The parent field in the CreateTensorboardRunRequest messages must match - // this field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardExperiment" - } - ]; - - // Required. The request message specifying the TensorboardRuns to create. - // A maximum of 1000 TensorboardRuns can be created in a batch. - repeated CreateTensorboardRunRequest requests = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [TensorboardService.BatchCreateTensorboardRuns][google.cloud.aiplatform.v1.TensorboardService.BatchCreateTensorboardRuns]. -message BatchCreateTensorboardRunsResponse { - // The created TensorboardRuns. - repeated TensorboardRun tensorboard_runs = 1; -} - -// Request message for [TensorboardService.CreateTensorboardRun][google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardRun]. -message CreateTensorboardRunRequest { - // Required. The resource name of the TensorboardExperiment to create the TensorboardRun - // in. Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardRun" - } - ]; - - // Required. The TensorboardRun to create. - TensorboardRun tensorboard_run = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID to use for the Tensorboard run, which will become the final - // component of the Tensorboard run's resource name. - // - // This value should be 1-128 characters, and valid characters - // are /[a-z][0-9]-/. - string tensorboard_run_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [TensorboardService.GetTensorboardRun][google.cloud.aiplatform.v1.TensorboardService.GetTensorboardRun]. -message GetTensorboardRunRequest { - // Required. The name of the TensorboardRun resource. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardRun" - } - ]; -} - -// Request message for [TensorboardService.ReadTensorboardBlobData][google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardBlobData]. -message ReadTensorboardBlobDataRequest { - // Required. The resource name of the TensorboardTimeSeries to list Blobs. - // Format: - // 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - string time_series = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardTimeSeries" - } - ]; - - // IDs of the blobs to read. - repeated string blob_ids = 2; -} - -// Response message for [TensorboardService.ReadTensorboardBlobData][google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardBlobData]. -message ReadTensorboardBlobDataResponse { - // Blob messages containing blob bytes. - repeated TensorboardBlob blobs = 1; -} - -// Request message for [TensorboardService.ListTensorboardRuns][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns]. -message ListTensorboardRunsRequest { - // Required. The resource name of the TensorboardExperiment to list TensorboardRuns. - // Format: - // 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/TensorboardRun" - } - ]; - - // Lists the TensorboardRuns that match the filter expression. - string filter = 2; - - // The maximum number of TensorboardRuns to return. The service may return - // fewer than this value. If unspecified, at most 50 TensorboardRuns will be - // returned. The maximum value is 1000; values above 1000 will be coerced to - // 1000. - int32 page_size = 3; - - // A page token, received from a previous - // [TensorboardService.ListTensorboardRuns][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns] call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [TensorboardService.ListTensorboardRuns][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns] must - // match the call that provided the page token. - string page_token = 4; - - // Field to use to sort the list. - string order_by = 5; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 6; -} - -// Response message for [TensorboardService.ListTensorboardRuns][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns]. -message ListTensorboardRunsResponse { - // The TensorboardRuns mathching the request. - repeated TensorboardRun tensorboard_runs = 1; - - // A token, which can be sent as [ListTensorboardRunsRequest.page_token][google.cloud.aiplatform.v1.ListTensorboardRunsRequest.page_token] to - // retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [TensorboardService.UpdateTensorboardRun][google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardRun]. -message UpdateTensorboardRunRequest { - // Required. Field mask is used to specify the fields to be overwritten in the - // TensorboardRun resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then all fields will be overwritten if new - // values are specified. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The TensorboardRun's `name` field is used to identify the TensorboardRun to - // be updated. Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - TensorboardRun tensorboard_run = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [TensorboardService.DeleteTensorboardRun][google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardRun]. -message DeleteTensorboardRunRequest { - // Required. The name of the TensorboardRun to be deleted. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardRun" - } - ]; -} - -// Request message for [TensorboardService.BatchCreateTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.BatchCreateTensorboardTimeSeries]. -message BatchCreateTensorboardTimeSeriesRequest { - // Required. The resource name of the TensorboardExperiment to create the - // TensorboardTimeSeries in. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - // The TensorboardRuns referenced by the parent fields in the - // CreateTensorboardTimeSeriesRequest messages must be sub resources of this - // TensorboardExperiment. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardExperiment" - } - ]; - - // Required. The request message specifying the TensorboardTimeSeries to create. - // A maximum of 1000 TensorboardTimeSeries can be created in a batch. - repeated CreateTensorboardTimeSeriesRequest requests = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [TensorboardService.BatchCreateTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.BatchCreateTensorboardTimeSeries]. -message BatchCreateTensorboardTimeSeriesResponse { - // The created TensorboardTimeSeries. - repeated TensorboardTimeSeries tensorboard_time_series = 1; -} - -// Request message for [TensorboardService.CreateTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardTimeSeries]. -message CreateTensorboardTimeSeriesRequest { - // Required. The resource name of the TensorboardRun to create the - // TensorboardTimeSeries in. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardTimeSeries" - } - ]; - - // Optional. The user specified unique ID to use for the TensorboardTimeSeries, which - // will become the final component of the TensorboardTimeSeries's resource - // name. - // This value should match "[a-z0-9][a-z0-9-]{0, 127}" - string tensorboard_time_series_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The TensorboardTimeSeries to create. - TensorboardTimeSeries tensorboard_time_series = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [TensorboardService.GetTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.GetTensorboardTimeSeries]. -message GetTensorboardTimeSeriesRequest { - // Required. The name of the TensorboardTimeSeries resource. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardTimeSeries" - } - ]; -} - -// Request message for [TensorboardService.ListTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries]. -message ListTensorboardTimeSeriesRequest { - // Required. The resource name of the TensorboardRun to list TensorboardTimeSeries. - // Format: - // 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/TensorboardTimeSeries" - } - ]; - - // Lists the TensorboardTimeSeries that match the filter expression. - string filter = 2; - - // The maximum number of TensorboardTimeSeries to return. The service may - // return fewer than this value. If unspecified, at most 50 - // TensorboardTimeSeries will be returned. The maximum value is 1000; values - // above 1000 will be coerced to 1000. - int32 page_size = 3; - - // A page token, received from a previous - // [TensorboardService.ListTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries] call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [TensorboardService.ListTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries] must - // match the call that provided the page token. - string page_token = 4; - - // Field to use to sort the list. - string order_by = 5; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 6; -} - -// Response message for [TensorboardService.ListTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries]. -message ListTensorboardTimeSeriesResponse { - // The TensorboardTimeSeries mathching the request. - repeated TensorboardTimeSeries tensorboard_time_series = 1; - - // A token, which can be sent as - // [ListTensorboardTimeSeriesRequest.page_token][google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest.page_token] to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [TensorboardService.UpdateTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardTimeSeries]. -message UpdateTensorboardTimeSeriesRequest { - // Required. Field mask is used to specify the fields to be overwritten in the - // TensorboardTimeSeries resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then all fields will be overwritten if new - // values are specified. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The TensorboardTimeSeries' `name` field is used to identify the - // TensorboardTimeSeries to be updated. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - TensorboardTimeSeries tensorboard_time_series = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [TensorboardService.DeleteTensorboardTimeSeries][google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardTimeSeries]. -message DeleteTensorboardTimeSeriesRequest { - // Required. The name of the TensorboardTimeSeries to be deleted. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardTimeSeries" - } - ]; -} - -// Request message for -// [TensorboardService.BatchReadTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.BatchReadTensorboardTimeSeriesData]. -message BatchReadTensorboardTimeSeriesDataRequest { - // Required. The resource name of the Tensorboard containing TensorboardTimeSeries to - // read data from. Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}`. - // The TensorboardTimeSeries referenced by [time_series][google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest.time_series] must be sub - // resources of this Tensorboard. - string tensorboard = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Tensorboard" - } - ]; - - // Required. The resource names of the TensorboardTimeSeries to read data from. Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - repeated string time_series = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardTimeSeries" - } - ]; -} - -// Response message for -// [TensorboardService.BatchReadTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.BatchReadTensorboardTimeSeriesData]. -message BatchReadTensorboardTimeSeriesDataResponse { - // The returned time series data. - repeated TimeSeriesData time_series_data = 1; -} - -// Request message for [TensorboardService.ReadTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardTimeSeriesData]. -message ReadTensorboardTimeSeriesDataRequest { - // Required. The resource name of the TensorboardTimeSeries to read data from. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - string tensorboard_time_series = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardTimeSeries" - } - ]; - - // The maximum number of TensorboardTimeSeries' data to return. - // - // This value should be a positive integer. - // This value can be set to -1 to return all data. - int32 max_data_points = 2; - - // Reads the TensorboardTimeSeries' data that match the filter expression. - string filter = 3; -} - -// Response message for [TensorboardService.ReadTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardTimeSeriesData]. -message ReadTensorboardTimeSeriesDataResponse { - // The returned time series data. - TimeSeriesData time_series_data = 1; -} - -// Request message for [TensorboardService.WriteTensorboardExperimentData][google.cloud.aiplatform.v1.TensorboardService.WriteTensorboardExperimentData]. -message WriteTensorboardExperimentDataRequest { - // Required. The resource name of the TensorboardExperiment to write data to. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - string tensorboard_experiment = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardExperiment" - } - ]; - - // Required. Requests containing per-run TensorboardTimeSeries data to write. - repeated WriteTensorboardRunDataRequest write_run_data_requests = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [TensorboardService.WriteTensorboardExperimentData][google.cloud.aiplatform.v1.TensorboardService.WriteTensorboardExperimentData]. -message WriteTensorboardExperimentDataResponse { - -} - -// Request message for [TensorboardService.WriteTensorboardRunData][google.cloud.aiplatform.v1.TensorboardService.WriteTensorboardRunData]. -message WriteTensorboardRunDataRequest { - // Required. The resource name of the TensorboardRun to write data to. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - string tensorboard_run = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardRun" - } - ]; - - // Required. The TensorboardTimeSeries data to write. - // Values with in a time series are indexed by their step value. - // Repeated writes to the same step will overwrite the existing value for that - // step. - // The upper limit of data points per write request is 5000. - repeated TimeSeriesData time_series_data = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [TensorboardService.WriteTensorboardRunData][google.cloud.aiplatform.v1.TensorboardService.WriteTensorboardRunData]. -message WriteTensorboardRunDataResponse { - -} - -// Request message for [TensorboardService.ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData]. -message ExportTensorboardTimeSeriesDataRequest { - // Required. The resource name of the TensorboardTimeSeries to export data from. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - string tensorboard_time_series = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardTimeSeries" - } - ]; - - // Exports the TensorboardTimeSeries' data that match the filter expression. - string filter = 2; - - // The maximum number of data points to return per page. - // The default page_size will be 1000. Values must be between 1 and 10000. - // Values above 10000 will be coerced to 10000. - int32 page_size = 3; - - // A page token, received from a previous - // [TensorboardService.ExportTensorboardTimeSeries][] call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [TensorboardService.ExportTensorboardTimeSeries][] must - // match the call that provided the page token. - string page_token = 4; - - // Field to use to sort the TensorboardTimeSeries' data. - // By default, TensorboardTimeSeries' data will be returned in a pseudo random - // order. - string order_by = 5; -} - -// Response message for [TensorboardService.ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesData]. -message ExportTensorboardTimeSeriesDataResponse { - // The returned time series data points. - repeated TimeSeriesDataPoint time_series_data_points = 1; - - // A token, which can be sent as - // [ExportTensorboardTimeSeriesRequest.page_token][] to retrieve the next - // page. If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Details of operations that perform create Tensorboard. -message CreateTensorboardOperationMetadata { - // Operation metadata for Tensorboard. - GenericOperationMetadata generic_metadata = 1; -} - -// Details of operations that perform update Tensorboard. -message UpdateTensorboardOperationMetadata { - // Operation metadata for Tensorboard. - GenericOperationMetadata generic_metadata = 1; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto deleted file mode 100644 index eff288e5..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto +++ /dev/null @@ -1,106 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "TensorboardTimeSeriesProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// TensorboardTimeSeries maps to times series produced in training runs -message TensorboardTimeSeries { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/TensorboardTimeSeries" - pattern: "projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}" - }; - - // Describes metadata for a TensorboardTimeSeries. - message Metadata { - // Output only. Max step index of all data points within a TensorboardTimeSeries. - int64 max_step = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Max wall clock timestamp of all data points within a - // TensorboardTimeSeries. - google.protobuf.Timestamp max_wall_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The largest blob sequence length (number of blobs) of all data points in - // this time series, if its ValueType is BLOB_SEQUENCE. - int64 max_blob_sequence_length = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // An enum representing the value type of a TensorboardTimeSeries. - enum ValueType { - // The value type is unspecified. - VALUE_TYPE_UNSPECIFIED = 0; - - // Used for TensorboardTimeSeries that is a list of scalars. - // E.g. accuracy of a model over epochs/time. - SCALAR = 1; - - // Used for TensorboardTimeSeries that is a list of tensors. - // E.g. histograms of weights of layer in a model over epoch/time. - TENSOR = 2; - - // Used for TensorboardTimeSeries that is a list of blob sequences. - // E.g. set of sample images with labels over epochs/time. - BLOB_SEQUENCE = 3; - } - - // Output only. Name of the TensorboardTimeSeries. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. User provided name of this TensorboardTimeSeries. - // This value should be unique among all TensorboardTimeSeries resources - // belonging to the same TensorboardRun resource (parent resource). - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Description of this TensorboardTimeSeries. - string description = 3; - - // Required. Immutable. Type of TensorboardTimeSeries value. - ValueType value_type = 4 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Output only. Timestamp when this TensorboardTimeSeries was created. - google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this TensorboardTimeSeries was last updated. - google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Used to perform a consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 7; - - // Immutable. Name of the plugin this time series pertain to. Such as Scalar, Tensor, - // Blob - string plugin_name = 8 [(google.api.field_behavior) = IMMUTABLE]; - - // Data of the current plugin, with the size limited to 65KB. - bytes plugin_data = 9; - - // Output only. Scalar, Tensor, or Blob metadata for this TensorboardTimeSeries. - Metadata metadata = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/training_pipeline.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/training_pipeline.proto deleted file mode 100644 index 0660f82e..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/training_pipeline.proto +++ /dev/null @@ -1,388 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1/io.proto"; -import "google/cloud/aiplatform/v1/model.proto"; -import "google/cloud/aiplatform/v1/pipeline_state.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "TrainingPipelineProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// The TrainingPipeline orchestrates tasks associated with training a Model. It -// always executes the training task, and optionally may also -// export data from Vertex AI's Dataset which becomes the training input, -// [upload][google.cloud.aiplatform.v1.ModelService.UploadModel] the Model to Vertex AI, and evaluate the -// Model. -message TrainingPipeline { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/TrainingPipeline" - pattern: "projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}" - }; - - // Output only. Resource name of the TrainingPipeline. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The user-defined name of this TrainingPipeline. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Specifies Vertex AI owned input data that may be used for training the - // Model. The TrainingPipeline's [training_task_definition][google.cloud.aiplatform.v1.TrainingPipeline.training_task_definition] should make - // clear whether this config is used and if there are any special requirements - // on how it should be filled. If nothing about this config is mentioned in - // the [training_task_definition][google.cloud.aiplatform.v1.TrainingPipeline.training_task_definition], then it should be assumed that the - // TrainingPipeline does not depend on this configuration. - InputDataConfig input_data_config = 3; - - // Required. A Google Cloud Storage path to the YAML file that defines the training task - // which is responsible for producing the model artifact, and may also include - // additional auxiliary work. - // The definition files that can be used here are found in - // gs://google-cloud-aiplatform/schema/trainingjob/definition/. - // Note: The URI given on output will be immutable and probably different, - // including the URI scheme, than the one given on input. The output URI will - // point to a location where the user only has a read access. - string training_task_definition = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. The training task's parameter(s), as specified in the - // [training_task_definition][google.cloud.aiplatform.v1.TrainingPipeline.training_task_definition]'s `inputs`. - google.protobuf.Value training_task_inputs = 5 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The metadata information as specified in the [training_task_definition][google.cloud.aiplatform.v1.TrainingPipeline.training_task_definition]'s - // `metadata`. This metadata is an auxiliary runtime and final information - // about the training task. While the pipeline is running this information is - // populated only at a best effort basis. Only present if the - // pipeline's [training_task_definition][google.cloud.aiplatform.v1.TrainingPipeline.training_task_definition] contains `metadata` object. - google.protobuf.Value training_task_metadata = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Describes the Model that may be uploaded (via [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel]) - // by this TrainingPipeline. The TrainingPipeline's - // [training_task_definition][google.cloud.aiplatform.v1.TrainingPipeline.training_task_definition] should make clear whether this Model - // description should be populated, and if there are any special requirements - // regarding how it should be filled. If nothing is mentioned in the - // [training_task_definition][google.cloud.aiplatform.v1.TrainingPipeline.training_task_definition], then it should be assumed that this field - // should not be filled and the training task either uploads the Model without - // a need of this information, or that training task does not support - // uploading a Model as part of the pipeline. - // When the Pipeline's state becomes `PIPELINE_STATE_SUCCEEDED` and - // the trained Model had been uploaded into Vertex AI, then the - // model_to_upload's resource [name][google.cloud.aiplatform.v1.Model.name] is populated. The Model - // is always uploaded into the Project and Location in which this pipeline - // is. - Model model_to_upload = 7; - - // Output only. The detailed state of the pipeline. - PipelineState state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Only populated when the pipeline's state is `PIPELINE_STATE_FAILED` or - // `PIPELINE_STATE_CANCELLED`. - google.rpc.Status error = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the TrainingPipeline was created. - google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the TrainingPipeline for the first time entered the - // `PIPELINE_STATE_RUNNING` state. - google.protobuf.Timestamp start_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the TrainingPipeline entered any of the following states: - // `PIPELINE_STATE_SUCCEEDED`, `PIPELINE_STATE_FAILED`, - // `PIPELINE_STATE_CANCELLED`. - google.protobuf.Timestamp end_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the TrainingPipeline was most recently updated. - google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize TrainingPipelines. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 15; - - // Customer-managed encryption key spec for a TrainingPipeline. If set, this - // TrainingPipeline will be secured by this key. - // - // Note: Model trained by this TrainingPipeline is also secured by this key if - // [model_to_upload][google.cloud.aiplatform.v1.TrainingPipeline.encryption_spec] is not set separately. - EncryptionSpec encryption_spec = 18; -} - -// Specifies Vertex AI owned input data to be used for training, and -// possibly evaluating, the Model. -message InputDataConfig { - // The instructions how the input data should be split between the - // training, validation and test sets. - // If no split type is provided, the [fraction_split][google.cloud.aiplatform.v1.InputDataConfig.fraction_split] is used by default. - oneof split { - // Split based on fractions defining the size of each set. - FractionSplit fraction_split = 2; - - // Split based on the provided filters for each set. - FilterSplit filter_split = 3; - - // Supported only for tabular Datasets. - // - // Split based on a predefined key. - PredefinedSplit predefined_split = 4; - - // Supported only for tabular Datasets. - // - // Split based on the timestamp of the input data pieces. - TimestampSplit timestamp_split = 5; - - // Supported only for tabular Datasets. - // - // Split based on the distribution of the specified column. - StratifiedSplit stratified_split = 12; - } - - // Only applicable to Custom and Hyperparameter Tuning TrainingPipelines. - // - // The destination of the training data to be written to. - // - // Supported destination file formats: - // * For non-tabular data: "jsonl". - // * For tabular data: "csv" and "bigquery". - // - // The following Vertex AI environment variables are passed to containers - // or python modules of the training task when this field is set: - // - // * AIP_DATA_FORMAT : Exported data format. - // * AIP_TRAINING_DATA_URI : Sharded exported training data uris. - // * AIP_VALIDATION_DATA_URI : Sharded exported validation data uris. - // * AIP_TEST_DATA_URI : Sharded exported test data uris. - oneof destination { - // The Cloud Storage location where the training data is to be - // written to. In the given directory a new directory is created with - // name: - // `dataset---` - // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. - // All training input data is written into that directory. - // - // The Vertex AI environment variables representing Cloud Storage - // data URIs are represented in the Cloud Storage wildcard - // format to support sharded data. e.g.: "gs://.../training-*.jsonl" - // - // * AIP_DATA_FORMAT = "jsonl" for non-tabular data, "csv" for tabular data - // * AIP_TRAINING_DATA_URI = - // "gcs_destination/dataset--- - * region_tag:aiplatform_v1_generated_DatasetService_GetDataset_async - */ - getDataset( - request?: protos.google.cloud.aiplatform.v1.IGetDatasetRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IDataset, - protos.google.cloud.aiplatform.v1.IGetDatasetRequest|undefined, {}|undefined - ]>; - getDataset( - request: protos.google.cloud.aiplatform.v1.IGetDatasetRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IDataset, - protos.google.cloud.aiplatform.v1.IGetDatasetRequest|null|undefined, - {}|null|undefined>): void; - getDataset( - request: protos.google.cloud.aiplatform.v1.IGetDatasetRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IDataset, - protos.google.cloud.aiplatform.v1.IGetDatasetRequest|null|undefined, - {}|null|undefined>): void; - getDataset( - request?: protos.google.cloud.aiplatform.v1.IGetDatasetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IDataset, - protos.google.cloud.aiplatform.v1.IGetDatasetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IDataset, - protos.google.cloud.aiplatform.v1.IGetDatasetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IDataset, - protos.google.cloud.aiplatform.v1.IGetDatasetRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getDataset(request, options, callback); - } -/** - * Updates a Dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1.Dataset} request.dataset - * Required. The Dataset which replaces the resource on the server. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The update mask applies to the resource. - * For the `FieldMask` definition, see {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. - * Updatable fields: - * - * * `display_name` - * * `description` - * * `labels` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Dataset]{@link google.cloud.aiplatform.v1.Dataset}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_DatasetService_UpdateDataset_async - */ - updateDataset( - request?: protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IDataset, - protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest|undefined, {}|undefined - ]>; - updateDataset( - request: protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IDataset, - protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest|null|undefined, - {}|null|undefined>): void; - updateDataset( - request: protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IDataset, - protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest|null|undefined, - {}|null|undefined>): void; - updateDataset( - request?: protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IDataset, - protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IDataset, - protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IDataset, - protos.google.cloud.aiplatform.v1.IUpdateDatasetRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'dataset.name': request.dataset!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateDataset(request, options, callback); - } -/** - * Gets an AnnotationSpec. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the AnnotationSpec resource. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AnnotationSpec]{@link google.cloud.aiplatform.v1.AnnotationSpec}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_DatasetService_GetAnnotationSpec_async - */ - getAnnotationSpec( - request?: protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IAnnotationSpec, - protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest|undefined, {}|undefined - ]>; - getAnnotationSpec( - request: protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IAnnotationSpec, - protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest|null|undefined, - {}|null|undefined>): void; - getAnnotationSpec( - request: protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IAnnotationSpec, - protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest|null|undefined, - {}|null|undefined>): void; - getAnnotationSpec( - request?: protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IAnnotationSpec, - protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IAnnotationSpec, - protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IAnnotationSpec, - protos.google.cloud.aiplatform.v1.IGetAnnotationSpecRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getAnnotationSpec(request, options, callback); - } - -/** - * Creates a Dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the Dataset in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1.Dataset} request.dataset - * Required. The Dataset to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_DatasetService_CreateDataset_async - */ - createDataset( - request?: protos.google.cloud.aiplatform.v1.ICreateDatasetRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createDataset( - request: protos.google.cloud.aiplatform.v1.ICreateDatasetRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createDataset( - request: protos.google.cloud.aiplatform.v1.ICreateDatasetRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createDataset( - request?: protos.google.cloud.aiplatform.v1.ICreateDatasetRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createDataset(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createDataset()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_DatasetService_CreateDataset_async - */ - async checkCreateDatasetProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createDataset, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a Dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Dataset to delete. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_DatasetService_DeleteDataset_async - */ - deleteDataset( - request?: protos.google.cloud.aiplatform.v1.IDeleteDatasetRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteDataset( - request: protos.google.cloud.aiplatform.v1.IDeleteDatasetRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteDataset( - request: protos.google.cloud.aiplatform.v1.IDeleteDatasetRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteDataset( - request?: protos.google.cloud.aiplatform.v1.IDeleteDatasetRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteDataset(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteDataset()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_DatasetService_DeleteDataset_async - */ - async checkDeleteDatasetProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteDataset, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Imports data into a Dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Dataset resource. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param {number[]} request.importConfigs - * Required. The desired input locations. The contents of all input locations will be - * imported in one batch. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_DatasetService_ImportData_async - */ - importData( - request?: protos.google.cloud.aiplatform.v1.IImportDataRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - importData( - request: protos.google.cloud.aiplatform.v1.IImportDataRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importData( - request: protos.google.cloud.aiplatform.v1.IImportDataRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importData( - request?: protos.google.cloud.aiplatform.v1.IImportDataRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.importData(request, options, callback); - } -/** - * Check the status of the long running operation returned by `importData()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_DatasetService_ImportData_async - */ - async checkImportDataProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.importData, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Exports data from a Dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Dataset resource. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param {google.cloud.aiplatform.v1.ExportDataConfig} request.exportConfig - * Required. The desired output location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_DatasetService_ExportData_async - */ - exportData( - request?: protos.google.cloud.aiplatform.v1.IExportDataRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - exportData( - request: protos.google.cloud.aiplatform.v1.IExportDataRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportData( - request: protos.google.cloud.aiplatform.v1.IExportDataRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportData( - request?: protos.google.cloud.aiplatform.v1.IExportDataRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.exportData(request, options, callback); - } -/** - * Check the status of the long running operation returned by `exportData()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_DatasetService_ExportData_async - */ - async checkExportDataProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.exportData, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Datasets in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the Dataset's parent resource. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `display_name`: supports = and != - * * `metadata_schema_uri`: supports = and != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * * `display_name` - * * `create_time` - * * `update_time` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Dataset]{@link google.cloud.aiplatform.v1.Dataset}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDatasetsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDatasets( - request?: protos.google.cloud.aiplatform.v1.IListDatasetsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IDataset[], - protos.google.cloud.aiplatform.v1.IListDatasetsRequest|null, - protos.google.cloud.aiplatform.v1.IListDatasetsResponse - ]>; - listDatasets( - request: protos.google.cloud.aiplatform.v1.IListDatasetsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListDatasetsRequest, - protos.google.cloud.aiplatform.v1.IListDatasetsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IDataset>): void; - listDatasets( - request: protos.google.cloud.aiplatform.v1.IListDatasetsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListDatasetsRequest, - protos.google.cloud.aiplatform.v1.IListDatasetsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IDataset>): void; - listDatasets( - request?: protos.google.cloud.aiplatform.v1.IListDatasetsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListDatasetsRequest, - protos.google.cloud.aiplatform.v1.IListDatasetsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IDataset>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListDatasetsRequest, - protos.google.cloud.aiplatform.v1.IListDatasetsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IDataset>): - Promise<[ - protos.google.cloud.aiplatform.v1.IDataset[], - protos.google.cloud.aiplatform.v1.IListDatasetsRequest|null, - protos.google.cloud.aiplatform.v1.IListDatasetsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listDatasets(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the Dataset's parent resource. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `display_name`: supports = and != - * * `metadata_schema_uri`: supports = and != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * * `display_name` - * * `create_time` - * * `update_time` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Dataset]{@link google.cloud.aiplatform.v1.Dataset} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDatasetsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDatasetsStream( - request?: protos.google.cloud.aiplatform.v1.IListDatasetsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDatasets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDatasets.createStream( - this.innerApiCalls.listDatasets as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDatasets`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the Dataset's parent resource. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `display_name`: supports = and != - * * `metadata_schema_uri`: supports = and != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * * `display_name` - * * `create_time` - * * `update_time` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Dataset]{@link google.cloud.aiplatform.v1.Dataset}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_DatasetService_ListDatasets_async - */ - listDatasetsAsync( - request?: protos.google.cloud.aiplatform.v1.IListDatasetsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDatasets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDatasets.asyncIterate( - this.innerApiCalls['listDatasets'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists DataItems in a Dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Dataset to list DataItems from. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [DataItem]{@link google.cloud.aiplatform.v1.DataItem}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDataItemsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDataItems( - request?: protos.google.cloud.aiplatform.v1.IListDataItemsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IDataItem[], - protos.google.cloud.aiplatform.v1.IListDataItemsRequest|null, - protos.google.cloud.aiplatform.v1.IListDataItemsResponse - ]>; - listDataItems( - request: protos.google.cloud.aiplatform.v1.IListDataItemsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListDataItemsRequest, - protos.google.cloud.aiplatform.v1.IListDataItemsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IDataItem>): void; - listDataItems( - request: protos.google.cloud.aiplatform.v1.IListDataItemsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListDataItemsRequest, - protos.google.cloud.aiplatform.v1.IListDataItemsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IDataItem>): void; - listDataItems( - request?: protos.google.cloud.aiplatform.v1.IListDataItemsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListDataItemsRequest, - protos.google.cloud.aiplatform.v1.IListDataItemsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IDataItem>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListDataItemsRequest, - protos.google.cloud.aiplatform.v1.IListDataItemsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IDataItem>): - Promise<[ - protos.google.cloud.aiplatform.v1.IDataItem[], - protos.google.cloud.aiplatform.v1.IListDataItemsRequest|null, - protos.google.cloud.aiplatform.v1.IListDataItemsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listDataItems(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Dataset to list DataItems from. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [DataItem]{@link google.cloud.aiplatform.v1.DataItem} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDataItemsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDataItemsStream( - request?: protos.google.cloud.aiplatform.v1.IListDataItemsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDataItems']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDataItems.createStream( - this.innerApiCalls.listDataItems as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDataItems`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Dataset to list DataItems from. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [DataItem]{@link google.cloud.aiplatform.v1.DataItem}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_DatasetService_ListDataItems_async - */ - listDataItemsAsync( - request?: protos.google.cloud.aiplatform.v1.IListDataItemsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDataItems']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDataItems.asyncIterate( - this.innerApiCalls['listDataItems'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists Annotations belongs to a dataitem - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the DataItem to list Annotations from. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Annotation]{@link google.cloud.aiplatform.v1.Annotation}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listAnnotationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listAnnotations( - request?: protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IAnnotation[], - protos.google.cloud.aiplatform.v1.IListAnnotationsRequest|null, - protos.google.cloud.aiplatform.v1.IListAnnotationsResponse - ]>; - listAnnotations( - request: protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, - protos.google.cloud.aiplatform.v1.IListAnnotationsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IAnnotation>): void; - listAnnotations( - request: protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, - protos.google.cloud.aiplatform.v1.IListAnnotationsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IAnnotation>): void; - listAnnotations( - request?: protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, - protos.google.cloud.aiplatform.v1.IListAnnotationsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IAnnotation>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, - protos.google.cloud.aiplatform.v1.IListAnnotationsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IAnnotation>): - Promise<[ - protos.google.cloud.aiplatform.v1.IAnnotation[], - protos.google.cloud.aiplatform.v1.IListAnnotationsRequest|null, - protos.google.cloud.aiplatform.v1.IListAnnotationsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listAnnotations(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the DataItem to list Annotations from. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Annotation]{@link google.cloud.aiplatform.v1.Annotation} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listAnnotationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listAnnotationsStream( - request?: protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listAnnotations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAnnotations.createStream( - this.innerApiCalls.listAnnotations as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAnnotations`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the DataItem to list Annotations from. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Annotation]{@link google.cloud.aiplatform.v1.Annotation}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_DatasetService_ListAnnotations_async - */ - listAnnotationsAsync( - request?: protos.google.cloud.aiplatform.v1.IListAnnotationsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listAnnotations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAnnotations.asyncIterate( - this.innerApiCalls['listAnnotations'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.datasetServiceStub && !this._terminated) { - return this.datasetServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/dataset_service_client_config.json b/owl-bot-staging/v1/src/v1/dataset_service_client_config.json deleted file mode 100644 index 2b8e5d85..00000000 --- a/owl-bot-staging/v1/src/v1/dataset_service_client_config.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1.DatasetService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateDataset": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetDataset": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateDataset": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListDatasets": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteDataset": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ImportData": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ExportData": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListDataItems": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetAnnotationSpec": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListAnnotations": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/dataset_service_proto_list.json b/owl-bot-staging/v1/src/v1/dataset_service_proto_list.json deleted file mode 100644 index 581a7346..00000000 --- a/owl-bot-staging/v1/src/v1/dataset_service_proto_list.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1/context.proto", - "../../protos/google/cloud/aiplatform/v1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1/event.proto", - "../../protos/google/cloud/aiplatform/v1/execution.proto", - "../../protos/google/cloud/aiplatform/v1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1/feature.proto", - "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1/index.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1/io.proto", - "../../protos/google/cloud/aiplatform/v1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1/model.proto", - "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1/operation.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1/study.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1/types.proto", - "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1/value.proto", - "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1/src/v1/endpoint_service_client.ts b/owl-bot-staging/v1/src/v1/endpoint_service_client.ts deleted file mode 100644 index 4d7c1cb7..00000000 --- a/owl-bot-staging/v1/src/v1/endpoint_service_client.ts +++ /dev/null @@ -1,3161 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/endpoint_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './endpoint_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * A service for managing Vertex AI's Endpoints. - * @class - * @memberof v1 - */ -export class EndpointServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - endpointServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of EndpointServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof EndpointServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listEndpoints: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'endpoints') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const createEndpointResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.Endpoint') as gax.protobuf.Type; - const createEndpointMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.CreateEndpointOperationMetadata') as gax.protobuf.Type; - const deleteEndpointResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteEndpointMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - const deployModelResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeployModelResponse') as gax.protobuf.Type; - const deployModelMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeployModelOperationMetadata') as gax.protobuf.Type; - const undeployModelResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.UndeployModelResponse') as gax.protobuf.Type; - const undeployModelMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.UndeployModelOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createEndpoint: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createEndpointResponse.decode.bind(createEndpointResponse), - createEndpointMetadata.decode.bind(createEndpointMetadata)), - deleteEndpoint: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteEndpointResponse.decode.bind(deleteEndpointResponse), - deleteEndpointMetadata.decode.bind(deleteEndpointMetadata)), - deployModel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deployModelResponse.decode.bind(deployModelResponse), - deployModelMetadata.decode.bind(deployModelMetadata)), - undeployModel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - undeployModelResponse.decode.bind(undeployModelResponse), - undeployModelMetadata.decode.bind(undeployModelMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1.EndpointService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.endpointServiceStub) { - return this.endpointServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1.EndpointService. - this.endpointServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.EndpointService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1.EndpointService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const endpointServiceStubMethods = - ['createEndpoint', 'getEndpoint', 'listEndpoints', 'updateEndpoint', 'deleteEndpoint', 'deployModel', 'undeployModel']; - for (const methodName of endpointServiceStubMethods) { - const callPromise = this.endpointServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.endpointServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets an Endpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Endpoint resource. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Endpoint]{@link google.cloud.aiplatform.v1.Endpoint}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_EndpointService_GetEndpoint_async - */ - getEndpoint( - request?: protos.google.cloud.aiplatform.v1.IGetEndpointRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IEndpoint, - protos.google.cloud.aiplatform.v1.IGetEndpointRequest|undefined, {}|undefined - ]>; - getEndpoint( - request: protos.google.cloud.aiplatform.v1.IGetEndpointRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IEndpoint, - protos.google.cloud.aiplatform.v1.IGetEndpointRequest|null|undefined, - {}|null|undefined>): void; - getEndpoint( - request: protos.google.cloud.aiplatform.v1.IGetEndpointRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IEndpoint, - protos.google.cloud.aiplatform.v1.IGetEndpointRequest|null|undefined, - {}|null|undefined>): void; - getEndpoint( - request?: protos.google.cloud.aiplatform.v1.IGetEndpointRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IEndpoint, - protos.google.cloud.aiplatform.v1.IGetEndpointRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IEndpoint, - protos.google.cloud.aiplatform.v1.IGetEndpointRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IEndpoint, - protos.google.cloud.aiplatform.v1.IGetEndpointRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getEndpoint(request, options, callback); - } -/** - * Updates an Endpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1.Endpoint} request.endpoint - * Required. The Endpoint which replaces the resource on the server. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The update mask applies to the resource. See {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Endpoint]{@link google.cloud.aiplatform.v1.Endpoint}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_EndpointService_UpdateEndpoint_async - */ - updateEndpoint( - request?: protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IEndpoint, - protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest|undefined, {}|undefined - ]>; - updateEndpoint( - request: protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IEndpoint, - protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest|null|undefined, - {}|null|undefined>): void; - updateEndpoint( - request: protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IEndpoint, - protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest|null|undefined, - {}|null|undefined>): void; - updateEndpoint( - request?: protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IEndpoint, - protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IEndpoint, - protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IEndpoint, - protos.google.cloud.aiplatform.v1.IUpdateEndpointRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'endpoint.name': request.endpoint!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateEndpoint(request, options, callback); - } - -/** - * Creates an Endpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the Endpoint in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1.Endpoint} request.endpoint - * Required. The Endpoint to create. - * @param {string} request.endpointId - * Immutable. The ID to use for endpoint, which will become the final - * component of the endpoint resource name. - * If not provided, Vertex AI will generate a value for this ID. - * - * This value should be 1-10 characters, and valid characters are /[0-9]/. - * When using HTTP/JSON, this field is populated based on a query string - * argument, such as `?endpoint_id=12345`. This is the fallback for fields - * that are not included in either the URI or the body. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_EndpointService_CreateEndpoint_async - */ - createEndpoint( - request?: protos.google.cloud.aiplatform.v1.ICreateEndpointRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createEndpoint( - request: protos.google.cloud.aiplatform.v1.ICreateEndpointRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createEndpoint( - request: protos.google.cloud.aiplatform.v1.ICreateEndpointRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createEndpoint( - request?: protos.google.cloud.aiplatform.v1.ICreateEndpointRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createEndpoint(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createEndpoint()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_EndpointService_CreateEndpoint_async - */ - async checkCreateEndpointProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createEndpoint, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes an Endpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Endpoint resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_EndpointService_DeleteEndpoint_async - */ - deleteEndpoint( - request?: protos.google.cloud.aiplatform.v1.IDeleteEndpointRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteEndpoint( - request: protos.google.cloud.aiplatform.v1.IDeleteEndpointRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteEndpoint( - request: protos.google.cloud.aiplatform.v1.IDeleteEndpointRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteEndpoint( - request?: protos.google.cloud.aiplatform.v1.IDeleteEndpointRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteEndpoint(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteEndpoint()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_EndpointService_DeleteEndpoint_async - */ - async checkDeleteEndpointProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteEndpoint, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deploys a Model into this Endpoint, creating a DeployedModel within it. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.endpoint - * Required. The name of the Endpoint resource into which to deploy a Model. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param {google.cloud.aiplatform.v1.DeployedModel} request.deployedModel - * Required. The DeployedModel to be created within the Endpoint. Note that - * {@link google.cloud.aiplatform.v1.Endpoint.traffic_split|Endpoint.traffic_split} must be updated for the DeployedModel to start - * receiving traffic, either as part of this call, or via - * {@link google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint|EndpointService.UpdateEndpoint}. - * @param {number[]} request.trafficSplit - * A map from a DeployedModel's ID to the percentage of this Endpoint's - * traffic that should be forwarded to that DeployedModel. - * - * If this field is non-empty, then the Endpoint's - * {@link google.cloud.aiplatform.v1.Endpoint.traffic_split|traffic_split} will be overwritten with it. - * To refer to the ID of the just being deployed Model, a "0" should be used, - * and the actual ID of the new DeployedModel will be filled in its place by - * this method. The traffic percentage values must add up to 100. - * - * If this field is empty, then the Endpoint's - * {@link google.cloud.aiplatform.v1.Endpoint.traffic_split|traffic_split} is not updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_EndpointService_DeployModel_async - */ - deployModel( - request?: protos.google.cloud.aiplatform.v1.IDeployModelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deployModel( - request: protos.google.cloud.aiplatform.v1.IDeployModelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deployModel( - request: protos.google.cloud.aiplatform.v1.IDeployModelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deployModel( - request?: protos.google.cloud.aiplatform.v1.IDeployModelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'endpoint': request.endpoint || '', - }); - this.initialize(); - return this.innerApiCalls.deployModel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deployModel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_EndpointService_DeployModel_async - */ - async checkDeployModelProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deployModel, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Undeploys a Model from an Endpoint, removing a DeployedModel from it, and - * freeing all resources it's using. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.endpoint - * Required. The name of the Endpoint resource from which to undeploy a Model. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param {string} request.deployedModelId - * Required. The ID of the DeployedModel to be undeployed from the Endpoint. - * @param {number[]} request.trafficSplit - * If this field is provided, then the Endpoint's - * {@link google.cloud.aiplatform.v1.Endpoint.traffic_split|traffic_split} will be overwritten with it. If - * last DeployedModel is being undeployed from the Endpoint, the - * [Endpoint.traffic_split] will always end up empty when this call returns. - * A DeployedModel will be successfully undeployed only if it doesn't have - * any traffic assigned to it when this method executes, or if this field - * unassigns any traffic to it. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_EndpointService_UndeployModel_async - */ - undeployModel( - request?: protos.google.cloud.aiplatform.v1.IUndeployModelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - undeployModel( - request: protos.google.cloud.aiplatform.v1.IUndeployModelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - undeployModel( - request: protos.google.cloud.aiplatform.v1.IUndeployModelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - undeployModel( - request?: protos.google.cloud.aiplatform.v1.IUndeployModelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'endpoint': request.endpoint || '', - }); - this.initialize(); - return this.innerApiCalls.undeployModel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `undeployModel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_EndpointService_UndeployModel_async - */ - async checkUndeployModelProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.undeployModel, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Endpoints in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location from which to list the Endpoints. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID, - * i.e. the last segment of the Endpoint's {@link google.cloud.aiplatform.v1.Endpoint.name|resource name}. - * * `display_name` supports = and, != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `endpoint=1` - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @param {number} [request.pageSize] - * Optional. The standard list page size. - * @param {string} [request.pageToken] - * Optional. The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListEndpointsResponse.next_page_token|ListEndpointsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.EndpointService.ListEndpoints|EndpointService.ListEndpoints} call. - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * * `display_name` - * * `create_time` - * * `update_time` - * - * Example: `display_name, create_time desc`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Endpoint]{@link google.cloud.aiplatform.v1.Endpoint}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listEndpointsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listEndpoints( - request?: protos.google.cloud.aiplatform.v1.IListEndpointsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IEndpoint[], - protos.google.cloud.aiplatform.v1.IListEndpointsRequest|null, - protos.google.cloud.aiplatform.v1.IListEndpointsResponse - ]>; - listEndpoints( - request: protos.google.cloud.aiplatform.v1.IListEndpointsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListEndpointsRequest, - protos.google.cloud.aiplatform.v1.IListEndpointsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IEndpoint>): void; - listEndpoints( - request: protos.google.cloud.aiplatform.v1.IListEndpointsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListEndpointsRequest, - protos.google.cloud.aiplatform.v1.IListEndpointsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IEndpoint>): void; - listEndpoints( - request?: protos.google.cloud.aiplatform.v1.IListEndpointsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListEndpointsRequest, - protos.google.cloud.aiplatform.v1.IListEndpointsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IEndpoint>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListEndpointsRequest, - protos.google.cloud.aiplatform.v1.IListEndpointsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IEndpoint>): - Promise<[ - protos.google.cloud.aiplatform.v1.IEndpoint[], - protos.google.cloud.aiplatform.v1.IListEndpointsRequest|null, - protos.google.cloud.aiplatform.v1.IListEndpointsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listEndpoints(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location from which to list the Endpoints. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID, - * i.e. the last segment of the Endpoint's {@link google.cloud.aiplatform.v1.Endpoint.name|resource name}. - * * `display_name` supports = and, != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `endpoint=1` - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @param {number} [request.pageSize] - * Optional. The standard list page size. - * @param {string} [request.pageToken] - * Optional. The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListEndpointsResponse.next_page_token|ListEndpointsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.EndpointService.ListEndpoints|EndpointService.ListEndpoints} call. - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * * `display_name` - * * `create_time` - * * `update_time` - * - * Example: `display_name, create_time desc`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Endpoint]{@link google.cloud.aiplatform.v1.Endpoint} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listEndpointsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listEndpointsStream( - request?: protos.google.cloud.aiplatform.v1.IListEndpointsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listEndpoints']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listEndpoints.createStream( - this.innerApiCalls.listEndpoints as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listEndpoints`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location from which to list the Endpoints. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID, - * i.e. the last segment of the Endpoint's {@link google.cloud.aiplatform.v1.Endpoint.name|resource name}. - * * `display_name` supports = and, != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `endpoint=1` - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @param {number} [request.pageSize] - * Optional. The standard list page size. - * @param {string} [request.pageToken] - * Optional. The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListEndpointsResponse.next_page_token|ListEndpointsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.EndpointService.ListEndpoints|EndpointService.ListEndpoints} call. - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * * `display_name` - * * `create_time` - * * `update_time` - * - * Example: `display_name, create_time desc`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Endpoint]{@link google.cloud.aiplatform.v1.Endpoint}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_EndpointService_ListEndpoints_async - */ - listEndpointsAsync( - request?: protos.google.cloud.aiplatform.v1.IListEndpointsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listEndpoints']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listEndpoints.asyncIterate( - this.innerApiCalls['listEndpoints'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.endpointServiceStub && !this._terminated) { - return this.endpointServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/endpoint_service_client_config.json b/owl-bot-staging/v1/src/v1/endpoint_service_client_config.json deleted file mode 100644 index 0c101562..00000000 --- a/owl-bot-staging/v1/src/v1/endpoint_service_client_config.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1.EndpointService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateEndpoint": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetEndpoint": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListEndpoints": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateEndpoint": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteEndpoint": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeployModel": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UndeployModel": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/endpoint_service_proto_list.json b/owl-bot-staging/v1/src/v1/endpoint_service_proto_list.json deleted file mode 100644 index 581a7346..00000000 --- a/owl-bot-staging/v1/src/v1/endpoint_service_proto_list.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1/context.proto", - "../../protos/google/cloud/aiplatform/v1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1/event.proto", - "../../protos/google/cloud/aiplatform/v1/execution.proto", - "../../protos/google/cloud/aiplatform/v1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1/feature.proto", - "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1/index.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1/io.proto", - "../../protos/google/cloud/aiplatform/v1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1/model.proto", - "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1/operation.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1/study.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1/types.proto", - "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1/value.proto", - "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_client.ts b/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_client.ts deleted file mode 100644 index cf3b0b9c..00000000 --- a/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_client.ts +++ /dev/null @@ -1,2386 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, GoogleError} from 'google-gax'; - -import { PassThrough } from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/featurestore_online_serving_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './featurestore_online_serving_service_client_config.json'; - -const version = require('../../../package.json').version; - -/** - * A service for serving online feature values. - * @class - * @memberof v1 - */ -export class FeaturestoreOnlineServingServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - featurestoreOnlineServingServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of FeaturestoreOnlineServingServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof FeaturestoreOnlineServingServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service provide streaming responses. - // Provide descriptors for these. - this.descriptors.stream = { - streamingReadFeatureValues: new this._gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1.FeaturestoreOnlineServingService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.featurestoreOnlineServingServiceStub) { - return this.featurestoreOnlineServingServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1.FeaturestoreOnlineServingService. - this.featurestoreOnlineServingServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.FeaturestoreOnlineServingService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1.FeaturestoreOnlineServingService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const featurestoreOnlineServingServiceStubMethods = - ['readFeatureValues', 'streamingReadFeatureValues']; - for (const methodName of featurestoreOnlineServingServiceStubMethods) { - const callPromise = this.featurestoreOnlineServingServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - if (methodName in this.descriptors.stream) { - const stream = new PassThrough(); - setImmediate(() => { - stream.emit('error', new GoogleError('The client has already been closed.')); - }); - return stream; - } - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.stream[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.featurestoreOnlineServingServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Reads Feature values of a specific entity of an EntityType. For reading - * feature values of multiple entities of an EntityType, please use - * StreamingReadFeatureValues. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.entityType - * Required. The resource name of the EntityType for the entity being read. - * 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`. - * @param {string} request.entityId - * Required. ID for a specific entity. For example, - * for a machine learning model predicting user clicks on a website, an entity - * ID could be `user_123`. - * @param {google.cloud.aiplatform.v1.FeatureSelector} request.featureSelector - * Required. Selector choosing Features of the target EntityType. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ReadFeatureValuesResponse]{@link google.cloud.aiplatform.v1.ReadFeatureValuesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreOnlineServingService_ReadFeatureValues_async - */ - readFeatureValues( - request?: protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IReadFeatureValuesResponse, - protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest|undefined, {}|undefined - ]>; - readFeatureValues( - request: protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IReadFeatureValuesResponse, - protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest|null|undefined, - {}|null|undefined>): void; - readFeatureValues( - request: protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IReadFeatureValuesResponse, - protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest|null|undefined, - {}|null|undefined>): void; - readFeatureValues( - request?: protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IReadFeatureValuesResponse, - protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IReadFeatureValuesResponse, - protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IReadFeatureValuesResponse, - protos.google.cloud.aiplatform.v1.IReadFeatureValuesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'entity_type': request.entityType || '', - }); - this.initialize(); - return this.innerApiCalls.readFeatureValues(request, options, callback); - } - -/** - * Reads Feature values for multiple entities. Depending on their size, data - * for different entities may be broken - * up across multiple responses. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.entityType - * Required. The resource name of the entities' type. - * 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`. - * @param {string[]} request.entityIds - * Required. IDs of entities to read Feature values of. The maximum number of IDs is - * 100. For example, for a machine learning model predicting user clicks on a - * website, an entity ID could be `user_123`. - * @param {google.cloud.aiplatform.v1.FeatureSelector} request.featureSelector - * Required. Selector choosing Features of the target EntityType. Feature IDs will be - * deduplicated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits [ReadFeatureValuesResponse]{@link google.cloud.aiplatform.v1.ReadFeatureValuesResponse} on 'data' event. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreOnlineServingService_StreamingReadFeatureValues_async - */ - streamingReadFeatureValues( - request?: protos.google.cloud.aiplatform.v1.IStreamingReadFeatureValuesRequest, - options?: CallOptions): - gax.CancellableStream{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'entity_type': request.entityType || '', - }); - this.initialize(); - return this.innerApiCalls.streamingReadFeatureValues(request, options); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.featurestoreOnlineServingServiceStub && !this._terminated) { - return this.featurestoreOnlineServingServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_client_config.json b/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_client_config.json deleted file mode 100644 index c60b6292..00000000 --- a/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_client_config.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1.FeaturestoreOnlineServingService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ReadFeatureValues": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "StreamingReadFeatureValues": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_proto_list.json b/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_proto_list.json deleted file mode 100644 index 581a7346..00000000 --- a/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_proto_list.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1/context.proto", - "../../protos/google/cloud/aiplatform/v1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1/event.proto", - "../../protos/google/cloud/aiplatform/v1/execution.proto", - "../../protos/google/cloud/aiplatform/v1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1/feature.proto", - "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1/index.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1/io.proto", - "../../protos/google/cloud/aiplatform/v1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1/model.proto", - "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1/operation.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1/study.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1/types.proto", - "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1/value.proto", - "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1/src/v1/featurestore_service_client.ts b/owl-bot-staging/v1/src/v1/featurestore_service_client.ts deleted file mode 100644 index 60fd3c74..00000000 --- a/owl-bot-staging/v1/src/v1/featurestore_service_client.ts +++ /dev/null @@ -1,5310 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/featurestore_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './featurestore_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * The service that handles CRUD and List for resources for Featurestore. - * @class - * @memberof v1 - */ -export class FeaturestoreServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - featurestoreServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of FeaturestoreServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof FeaturestoreServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listFeaturestores: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'featurestores'), - listEntityTypes: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'entityTypes'), - listFeatures: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'features'), - searchFeatures: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'features') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const createFeaturestoreResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.Featurestore') as gax.protobuf.Type; - const createFeaturestoreMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.CreateFeaturestoreOperationMetadata') as gax.protobuf.Type; - const updateFeaturestoreResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.Featurestore') as gax.protobuf.Type; - const updateFeaturestoreMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.UpdateFeaturestoreOperationMetadata') as gax.protobuf.Type; - const deleteFeaturestoreResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteFeaturestoreMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - const createEntityTypeResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.EntityType') as gax.protobuf.Type; - const createEntityTypeMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.CreateEntityTypeOperationMetadata') as gax.protobuf.Type; - const deleteEntityTypeResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteEntityTypeMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - const createFeatureResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.Feature') as gax.protobuf.Type; - const createFeatureMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.CreateFeatureOperationMetadata') as gax.protobuf.Type; - const batchCreateFeaturesResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.BatchCreateFeaturesResponse') as gax.protobuf.Type; - const batchCreateFeaturesMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.BatchCreateFeaturesOperationMetadata') as gax.protobuf.Type; - const deleteFeatureResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteFeatureMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - const importFeatureValuesResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.ImportFeatureValuesResponse') as gax.protobuf.Type; - const importFeatureValuesMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.ImportFeatureValuesOperationMetadata') as gax.protobuf.Type; - const batchReadFeatureValuesResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.BatchReadFeatureValuesResponse') as gax.protobuf.Type; - const batchReadFeatureValuesMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.BatchReadFeatureValuesOperationMetadata') as gax.protobuf.Type; - const exportFeatureValuesResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.ExportFeatureValuesResponse') as gax.protobuf.Type; - const exportFeatureValuesMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.ExportFeatureValuesOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createFeaturestore: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createFeaturestoreResponse.decode.bind(createFeaturestoreResponse), - createFeaturestoreMetadata.decode.bind(createFeaturestoreMetadata)), - updateFeaturestore: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateFeaturestoreResponse.decode.bind(updateFeaturestoreResponse), - updateFeaturestoreMetadata.decode.bind(updateFeaturestoreMetadata)), - deleteFeaturestore: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteFeaturestoreResponse.decode.bind(deleteFeaturestoreResponse), - deleteFeaturestoreMetadata.decode.bind(deleteFeaturestoreMetadata)), - createEntityType: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createEntityTypeResponse.decode.bind(createEntityTypeResponse), - createEntityTypeMetadata.decode.bind(createEntityTypeMetadata)), - deleteEntityType: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteEntityTypeResponse.decode.bind(deleteEntityTypeResponse), - deleteEntityTypeMetadata.decode.bind(deleteEntityTypeMetadata)), - createFeature: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createFeatureResponse.decode.bind(createFeatureResponse), - createFeatureMetadata.decode.bind(createFeatureMetadata)), - batchCreateFeatures: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - batchCreateFeaturesResponse.decode.bind(batchCreateFeaturesResponse), - batchCreateFeaturesMetadata.decode.bind(batchCreateFeaturesMetadata)), - deleteFeature: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteFeatureResponse.decode.bind(deleteFeatureResponse), - deleteFeatureMetadata.decode.bind(deleteFeatureMetadata)), - importFeatureValues: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - importFeatureValuesResponse.decode.bind(importFeatureValuesResponse), - importFeatureValuesMetadata.decode.bind(importFeatureValuesMetadata)), - batchReadFeatureValues: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - batchReadFeatureValuesResponse.decode.bind(batchReadFeatureValuesResponse), - batchReadFeatureValuesMetadata.decode.bind(batchReadFeatureValuesMetadata)), - exportFeatureValues: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - exportFeatureValuesResponse.decode.bind(exportFeatureValuesResponse), - exportFeatureValuesMetadata.decode.bind(exportFeatureValuesMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1.FeaturestoreService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.featurestoreServiceStub) { - return this.featurestoreServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1.FeaturestoreService. - this.featurestoreServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.FeaturestoreService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1.FeaturestoreService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const featurestoreServiceStubMethods = - ['createFeaturestore', 'getFeaturestore', 'listFeaturestores', 'updateFeaturestore', 'deleteFeaturestore', 'createEntityType', 'getEntityType', 'listEntityTypes', 'updateEntityType', 'deleteEntityType', 'createFeature', 'batchCreateFeatures', 'getFeature', 'listFeatures', 'updateFeature', 'deleteFeature', 'importFeatureValues', 'batchReadFeatureValues', 'exportFeatureValues', 'searchFeatures']; - for (const methodName of featurestoreServiceStubMethods) { - const callPromise = this.featurestoreServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.featurestoreServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets details of a single Featurestore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Featurestore resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Featurestore]{@link google.cloud.aiplatform.v1.Featurestore}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_GetFeaturestore_async - */ - getFeaturestore( - request?: protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IFeaturestore, - protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest|undefined, {}|undefined - ]>; - getFeaturestore( - request: protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IFeaturestore, - protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest|null|undefined, - {}|null|undefined>): void; - getFeaturestore( - request: protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IFeaturestore, - protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest|null|undefined, - {}|null|undefined>): void; - getFeaturestore( - request?: protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IFeaturestore, - protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IFeaturestore, - protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IFeaturestore, - protos.google.cloud.aiplatform.v1.IGetFeaturestoreRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getFeaturestore(request, options, callback); - } -/** - * Gets details of a single EntityType. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the EntityType resource. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [EntityType]{@link google.cloud.aiplatform.v1.EntityType}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_GetEntityType_async - */ - getEntityType( - request?: protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IEntityType, - protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest|undefined, {}|undefined - ]>; - getEntityType( - request: protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IEntityType, - protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest|null|undefined, - {}|null|undefined>): void; - getEntityType( - request: protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IEntityType, - protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest|null|undefined, - {}|null|undefined>): void; - getEntityType( - request?: protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IEntityType, - protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IEntityType, - protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IEntityType, - protos.google.cloud.aiplatform.v1.IGetEntityTypeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getEntityType(request, options, callback); - } -/** - * Updates the parameters of a single EntityType. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1.EntityType} request.entityType - * Required. The EntityType's `name` field is used to identify the EntityType to be - * updated. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {google.protobuf.FieldMask} request.updateMask - * Field mask is used to specify the fields to be overwritten in the - * EntityType resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then only the non-empty fields present in the - * request will be overwritten. Set the update_mask to `*` to override all - * fields. - * - * Updatable fields: - * - * * `description` - * * `labels` - * * `monitoring_config.snapshot_analysis.disabled` - * * `monitoring_config.snapshot_analysis.monitoring_interval_days` - * * `monitoring_config.snapshot_analysis.staleness_days` - * * `monitoring_config.import_features_analysis.state` - * * `monitoring_config.import_features_analysis.anomaly_detection_baseline` - * * `monitoring_config.numerical_threshold_config.value` - * * `monitoring_config.categorical_threshold_config.value` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [EntityType]{@link google.cloud.aiplatform.v1.EntityType}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_UpdateEntityType_async - */ - updateEntityType( - request?: protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IEntityType, - protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest|undefined, {}|undefined - ]>; - updateEntityType( - request: protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IEntityType, - protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest|null|undefined, - {}|null|undefined>): void; - updateEntityType( - request: protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IEntityType, - protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest|null|undefined, - {}|null|undefined>): void; - updateEntityType( - request?: protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IEntityType, - protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IEntityType, - protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IEntityType, - protos.google.cloud.aiplatform.v1.IUpdateEntityTypeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'entity_type.name': request.entityType!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateEntityType(request, options, callback); - } -/** - * Gets details of a single Feature. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Feature resource. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Feature]{@link google.cloud.aiplatform.v1.Feature}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_GetFeature_async - */ - getFeature( - request?: protos.google.cloud.aiplatform.v1.IGetFeatureRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IFeature, - protos.google.cloud.aiplatform.v1.IGetFeatureRequest|undefined, {}|undefined - ]>; - getFeature( - request: protos.google.cloud.aiplatform.v1.IGetFeatureRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IFeature, - protos.google.cloud.aiplatform.v1.IGetFeatureRequest|null|undefined, - {}|null|undefined>): void; - getFeature( - request: protos.google.cloud.aiplatform.v1.IGetFeatureRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IFeature, - protos.google.cloud.aiplatform.v1.IGetFeatureRequest|null|undefined, - {}|null|undefined>): void; - getFeature( - request?: protos.google.cloud.aiplatform.v1.IGetFeatureRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IFeature, - protos.google.cloud.aiplatform.v1.IGetFeatureRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IFeature, - protos.google.cloud.aiplatform.v1.IGetFeatureRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IFeature, - protos.google.cloud.aiplatform.v1.IGetFeatureRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getFeature(request, options, callback); - } -/** - * Updates the parameters of a single Feature. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1.Feature} request.feature - * Required. The Feature's `name` field is used to identify the Feature to be - * updated. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` - * @param {google.protobuf.FieldMask} request.updateMask - * Field mask is used to specify the fields to be overwritten in the - * Features resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then only the non-empty fields present in the - * request will be overwritten. Set the update_mask to `*` to override all - * fields. - * - * Updatable fields: - * - * * `description` - * * `labels` - * * `disable_monitoring` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Feature]{@link google.cloud.aiplatform.v1.Feature}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_UpdateFeature_async - */ - updateFeature( - request?: protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IFeature, - protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest|undefined, {}|undefined - ]>; - updateFeature( - request: protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IFeature, - protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest|null|undefined, - {}|null|undefined>): void; - updateFeature( - request: protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IFeature, - protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest|null|undefined, - {}|null|undefined>): void; - updateFeature( - request?: protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IFeature, - protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IFeature, - protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IFeature, - protos.google.cloud.aiplatform.v1.IUpdateFeatureRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'feature.name': request.feature!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateFeature(request, options, callback); - } - -/** - * Creates a new Featurestore in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create Featurestores. - * Format: - * `projects/{project}/locations/{location}'` - * @param {google.cloud.aiplatform.v1.Featurestore} request.featurestore - * Required. The Featurestore to create. - * @param {string} request.featurestoreId - * Required. The ID to use for this Featurestore, which will become the final component - * of the Featurestore's resource name. - * - * This value may be up to 60 characters, and valid characters are - * `[a-z0-9_]`. The first character cannot be a number. - * - * The value must be unique within the project and location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_CreateFeaturestore_async - */ - createFeaturestore( - request?: protos.google.cloud.aiplatform.v1.ICreateFeaturestoreRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createFeaturestore( - request: protos.google.cloud.aiplatform.v1.ICreateFeaturestoreRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createFeaturestore( - request: protos.google.cloud.aiplatform.v1.ICreateFeaturestoreRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createFeaturestore( - request?: protos.google.cloud.aiplatform.v1.ICreateFeaturestoreRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createFeaturestore(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createFeaturestore()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_CreateFeaturestore_async - */ - async checkCreateFeaturestoreProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createFeaturestore, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the parameters of a single Featurestore. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1.Featurestore} request.featurestore - * Required. The Featurestore's `name` field is used to identify the Featurestore to be - * updated. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param {google.protobuf.FieldMask} request.updateMask - * Field mask is used to specify the fields to be overwritten in the - * Featurestore resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then only the non-empty fields present in the - * request will be overwritten. Set the update_mask to `*` to override all - * fields. - * - * Updatable fields: - * - * * `labels` - * * `online_serving_config.fixed_node_count` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_UpdateFeaturestore_async - */ - updateFeaturestore( - request?: protos.google.cloud.aiplatform.v1.IUpdateFeaturestoreRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateFeaturestore( - request: protos.google.cloud.aiplatform.v1.IUpdateFeaturestoreRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateFeaturestore( - request: protos.google.cloud.aiplatform.v1.IUpdateFeaturestoreRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateFeaturestore( - request?: protos.google.cloud.aiplatform.v1.IUpdateFeaturestoreRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'featurestore.name': request.featurestore!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateFeaturestore(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateFeaturestore()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_UpdateFeaturestore_async - */ - async checkUpdateFeaturestoreProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateFeaturestore, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single Featurestore. The Featurestore must not contain any - * EntityTypes or `force` must be set to true for the request to succeed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Featurestore to be deleted. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param {boolean} request.force - * If set to true, any EntityTypes and Features for this Featurestore will - * also be deleted. (Otherwise, the request will only work if the Featurestore - * has no EntityTypes.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_DeleteFeaturestore_async - */ - deleteFeaturestore( - request?: protos.google.cloud.aiplatform.v1.IDeleteFeaturestoreRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteFeaturestore( - request: protos.google.cloud.aiplatform.v1.IDeleteFeaturestoreRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteFeaturestore( - request: protos.google.cloud.aiplatform.v1.IDeleteFeaturestoreRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteFeaturestore( - request?: protos.google.cloud.aiplatform.v1.IDeleteFeaturestoreRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteFeaturestore(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteFeaturestore()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_DeleteFeaturestore_async - */ - async checkDeleteFeaturestoreProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteFeaturestore, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a new EntityType in a given Featurestore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Featurestore to create EntityTypes. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param {google.cloud.aiplatform.v1.EntityType} request.entityType - * The EntityType to create. - * @param {string} request.entityTypeId - * Required. The ID to use for the EntityType, which will become the final component of - * the EntityType's resource name. - * - * This value may be up to 60 characters, and valid characters are - * `[a-z0-9_]`. The first character cannot be a number. - * - * The value must be unique within a featurestore. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_CreateEntityType_async - */ - createEntityType( - request?: protos.google.cloud.aiplatform.v1.ICreateEntityTypeRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createEntityType( - request: protos.google.cloud.aiplatform.v1.ICreateEntityTypeRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createEntityType( - request: protos.google.cloud.aiplatform.v1.ICreateEntityTypeRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createEntityType( - request?: protos.google.cloud.aiplatform.v1.ICreateEntityTypeRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createEntityType(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createEntityType()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_CreateEntityType_async - */ - async checkCreateEntityTypeProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createEntityType, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single EntityType. The EntityType must not have any Features - * or `force` must be set to true for the request to succeed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the EntityType to be deleted. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {boolean} request.force - * If set to true, any Features for this EntityType will also be deleted. - * (Otherwise, the request will only work if the EntityType has no Features.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_DeleteEntityType_async - */ - deleteEntityType( - request?: protos.google.cloud.aiplatform.v1.IDeleteEntityTypeRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteEntityType( - request: protos.google.cloud.aiplatform.v1.IDeleteEntityTypeRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteEntityType( - request: protos.google.cloud.aiplatform.v1.IDeleteEntityTypeRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteEntityType( - request?: protos.google.cloud.aiplatform.v1.IDeleteEntityTypeRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteEntityType(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteEntityType()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_DeleteEntityType_async - */ - async checkDeleteEntityTypeProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteEntityType, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a new Feature in a given EntityType. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the EntityType to create a Feature. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {google.cloud.aiplatform.v1.Feature} request.feature - * Required. The Feature to create. - * @param {string} request.featureId - * Required. The ID to use for the Feature, which will become the final component of - * the Feature's resource name. - * - * This value may be up to 60 characters, and valid characters are - * `[a-z0-9_]`. The first character cannot be a number. - * - * The value must be unique within an EntityType. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_CreateFeature_async - */ - createFeature( - request?: protos.google.cloud.aiplatform.v1.ICreateFeatureRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createFeature( - request: protos.google.cloud.aiplatform.v1.ICreateFeatureRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createFeature( - request: protos.google.cloud.aiplatform.v1.ICreateFeatureRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createFeature( - request?: protos.google.cloud.aiplatform.v1.ICreateFeatureRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createFeature(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createFeature()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_CreateFeature_async - */ - async checkCreateFeatureProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createFeature, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a batch of Features in a given EntityType. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the EntityType to create the batch of Features under. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {number[]} request.requests - * Required. The request message specifying the Features to create. All Features must be - * created under the same parent EntityType. The `parent` field in each child - * request message can be omitted. If `parent` is set in a child request, then - * the value must match the `parent` value in this request message. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_BatchCreateFeatures_async - */ - batchCreateFeatures( - request?: protos.google.cloud.aiplatform.v1.IBatchCreateFeaturesRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - batchCreateFeatures( - request: protos.google.cloud.aiplatform.v1.IBatchCreateFeaturesRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchCreateFeatures( - request: protos.google.cloud.aiplatform.v1.IBatchCreateFeaturesRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchCreateFeatures( - request?: protos.google.cloud.aiplatform.v1.IBatchCreateFeaturesRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.batchCreateFeatures(request, options, callback); - } -/** - * Check the status of the long running operation returned by `batchCreateFeatures()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_BatchCreateFeatures_async - */ - async checkBatchCreateFeaturesProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.batchCreateFeatures, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single Feature. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Features to be deleted. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_DeleteFeature_async - */ - deleteFeature( - request?: protos.google.cloud.aiplatform.v1.IDeleteFeatureRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteFeature( - request: protos.google.cloud.aiplatform.v1.IDeleteFeatureRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteFeature( - request: protos.google.cloud.aiplatform.v1.IDeleteFeatureRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteFeature( - request?: protos.google.cloud.aiplatform.v1.IDeleteFeatureRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteFeature(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteFeature()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_DeleteFeature_async - */ - async checkDeleteFeatureProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteFeature, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Imports Feature values into the Featurestore from a source storage. - * - * The progress of the import is tracked by the returned operation. The - * imported features are guaranteed to be visible to subsequent read - * operations after the operation is marked as successfully done. - * - * If an import operation fails, the Feature values returned from - * reads and exports may be inconsistent. If consistency is - * required, the caller must retry the same import request again and wait till - * the new operation returned is marked as successfully done. - * - * There are also scenarios where the caller can cause inconsistency. - * - * - Source data for import contains multiple distinct Feature values for - * the same entity ID and timestamp. - * - Source is modified during an import. This includes adding, updating, or - * removing source data and/or metadata. Examples of updating metadata - * include but are not limited to changing storage location, storage class, - * or retention policy. - * - Online serving cluster is under-provisioned. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1.AvroSource} request.avroSource - * @param {google.cloud.aiplatform.v1.BigQuerySource} request.bigquerySource - * @param {google.cloud.aiplatform.v1.CsvSource} request.csvSource - * @param {string} request.featureTimeField - * Source column that holds the Feature timestamp for all Feature - * values in each entity. - * @param {google.protobuf.Timestamp} request.featureTime - * Single Feature timestamp for all entities being imported. The - * timestamp must not have higher than millisecond precision. - * @param {string} request.entityType - * Required. The resource name of the EntityType grouping the Features for which values - * are being imported. Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}` - * @param {string} request.entityIdField - * Source column that holds entity IDs. If not provided, entity IDs are - * extracted from the column named `entity_id`. - * @param {number[]} request.featureSpecs - * Required. Specifications defining which Feature values to import from the entity. The - * request fails if no feature_specs are provided, and having multiple - * feature_specs for one Feature is not allowed. - * @param {boolean} request.disableOnlineServing - * If set, data will not be imported for online serving. This - * is typically used for backfilling, where Feature generation timestamps are - * not in the timestamp range needed for online serving. - * @param {number} request.workerCount - * Specifies the number of workers that are used to write data to the - * Featurestore. Consider the online serving capacity that you require to - * achieve the desired import throughput without interfering with online - * serving. The value must be positive, and less than or equal to 100. - * If not set, defaults to using 1 worker. The low count ensures minimal - * impact on online serving performance. - * @param {boolean} request.disableIngestionAnalysis - * If true, API doesn't start ingestion analysis pipeline. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_ImportFeatureValues_async - */ - importFeatureValues( - request?: protos.google.cloud.aiplatform.v1.IImportFeatureValuesRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - importFeatureValues( - request: protos.google.cloud.aiplatform.v1.IImportFeatureValuesRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importFeatureValues( - request: protos.google.cloud.aiplatform.v1.IImportFeatureValuesRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importFeatureValues( - request?: protos.google.cloud.aiplatform.v1.IImportFeatureValuesRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'entity_type': request.entityType || '', - }); - this.initialize(); - return this.innerApiCalls.importFeatureValues(request, options, callback); - } -/** - * Check the status of the long running operation returned by `importFeatureValues()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_ImportFeatureValues_async - */ - async checkImportFeatureValuesProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.importFeatureValues, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Batch reads Feature values from a Featurestore. - * - * This API enables batch reading Feature values, where each read - * instance in the batch may read Feature values of entities from one or - * more EntityTypes. Point-in-time correctness is guaranteed for Feature - * values of each read instance as of each instance's read timestamp. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1.CsvSource} request.csvReadInstances - * Each read instance consists of exactly one read timestamp and one or more - * entity IDs identifying entities of the corresponding EntityTypes whose - * Features are requested. - * - * Each output instance contains Feature values of requested entities - * concatenated together as of the read time. - * - * An example read instance may be `foo_entity_id, bar_entity_id, - * 2020-01-01T10:00:00.123Z`. - * - * An example output instance may be `foo_entity_id, bar_entity_id, - * 2020-01-01T10:00:00.123Z, foo_entity_feature1_value, - * bar_entity_feature2_value`. - * - * Timestamp in each read instance must be millisecond-aligned. - * - * `csv_read_instances` are read instances stored in a plain-text CSV file. - * The header should be: - * [ENTITY_TYPE_ID1], [ENTITY_TYPE_ID2], ..., timestamp - * - * The columns can be in any order. - * - * Values in the timestamp column must use the RFC 3339 format, e.g. - * `2012-07-30T10:43:17.123Z`. - * @param {google.cloud.aiplatform.v1.BigQuerySource} request.bigqueryReadInstances - * Similar to csv_read_instances, but from BigQuery source. - * @param {string} request.featurestore - * Required. The resource name of the Featurestore from which to query Feature values. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param {google.cloud.aiplatform.v1.FeatureValueDestination} request.destination - * Required. Specifies output location and format. - * @param {number[]} request.passThroughFields - * When not empty, the specified fields in the *_read_instances source will be - * joined as-is in the output, in addition to those fields from the - * Featurestore Entity. - * - * For BigQuery source, the type of the pass-through values will be - * automatically inferred. For CSV source, the pass-through values will be - * passed as opaque bytes. - * @param {number[]} request.entityTypeSpecs - * Required. Specifies EntityType grouping Features to read values of and settings. - * Each EntityType referenced in - * [BatchReadFeatureValuesRequest.entity_type_specs] must have a column - * specifying entity IDs in the EntityType in - * {@link |BatchReadFeatureValuesRequest.request} . - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_BatchReadFeatureValues_async - */ - batchReadFeatureValues( - request?: protos.google.cloud.aiplatform.v1.IBatchReadFeatureValuesRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - batchReadFeatureValues( - request: protos.google.cloud.aiplatform.v1.IBatchReadFeatureValuesRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchReadFeatureValues( - request: protos.google.cloud.aiplatform.v1.IBatchReadFeatureValuesRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchReadFeatureValues( - request?: protos.google.cloud.aiplatform.v1.IBatchReadFeatureValuesRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'featurestore': request.featurestore || '', - }); - this.initialize(); - return this.innerApiCalls.batchReadFeatureValues(request, options, callback); - } -/** - * Check the status of the long running operation returned by `batchReadFeatureValues()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_BatchReadFeatureValues_async - */ - async checkBatchReadFeatureValuesProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.batchReadFeatureValues, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Exports Feature values from all the entities of a target EntityType. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1.ExportFeatureValuesRequest.SnapshotExport} request.snapshotExport - * Exports the latest Feature values of all entities of the EntityType - * within a time range. - * @param {google.cloud.aiplatform.v1.ExportFeatureValuesRequest.FullExport} request.fullExport - * Exports all historical values of all entities of the EntityType within a - * time range - * @param {string} request.entityType - * Required. The resource name of the EntityType from which to export Feature values. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {google.cloud.aiplatform.v1.FeatureValueDestination} request.destination - * Required. Specifies destination location and format. - * @param {google.cloud.aiplatform.v1.FeatureSelector} request.featureSelector - * Required. Selects Features to export values of. - * @param {number[]} request.settings - * Per-Feature export settings. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_ExportFeatureValues_async - */ - exportFeatureValues( - request?: protos.google.cloud.aiplatform.v1.IExportFeatureValuesRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - exportFeatureValues( - request: protos.google.cloud.aiplatform.v1.IExportFeatureValuesRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportFeatureValues( - request: protos.google.cloud.aiplatform.v1.IExportFeatureValuesRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportFeatureValues( - request?: protos.google.cloud.aiplatform.v1.IExportFeatureValuesRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'entity_type': request.entityType || '', - }); - this.initialize(); - return this.innerApiCalls.exportFeatureValues(request, options, callback); - } -/** - * Check the status of the long running operation returned by `exportFeatureValues()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_ExportFeatureValues_async - */ - async checkExportFeatureValuesProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.exportFeatureValues, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Featurestores in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list Featurestores. - * Format: - * `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the featurestores that match the filter expression. The following - * fields are supported: - * - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be - * in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be - * in RFC 3339 format. - * * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, - * `<=`, and `>=` comparisons. - * * `labels`: Supports key-value equality and key presence. - * - * Examples: - * - * * `create_time > "2020-01-01" OR update_time > "2020-01-01"` - * Featurestores created or updated after 2020-01-01. - * * `labels.env = "prod"` - * Featurestores with label "env" set to "prod". - * @param {number} request.pageSize - * The maximum number of Featurestores to return. The service may return fewer - * than this value. If unspecified, at most 100 Featurestores will be - * returned. The maximum value is 100; any value greater than 100 will be - * coerced to 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} must - * match the call that provided the page token. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported Fields: - * - * * `create_time` - * * `update_time` - * * `online_serving_config.fixed_node_count` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Featurestore]{@link google.cloud.aiplatform.v1.Featurestore}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listFeaturestoresAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listFeaturestores( - request?: protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IFeaturestore[], - protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest|null, - protos.google.cloud.aiplatform.v1.IListFeaturestoresResponse - ]>; - listFeaturestores( - request: protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, - protos.google.cloud.aiplatform.v1.IListFeaturestoresResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IFeaturestore>): void; - listFeaturestores( - request: protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, - protos.google.cloud.aiplatform.v1.IListFeaturestoresResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IFeaturestore>): void; - listFeaturestores( - request?: protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, - protos.google.cloud.aiplatform.v1.IListFeaturestoresResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IFeaturestore>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, - protos.google.cloud.aiplatform.v1.IListFeaturestoresResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IFeaturestore>): - Promise<[ - protos.google.cloud.aiplatform.v1.IFeaturestore[], - protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest|null, - protos.google.cloud.aiplatform.v1.IListFeaturestoresResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listFeaturestores(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list Featurestores. - * Format: - * `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the featurestores that match the filter expression. The following - * fields are supported: - * - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be - * in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be - * in RFC 3339 format. - * * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, - * `<=`, and `>=` comparisons. - * * `labels`: Supports key-value equality and key presence. - * - * Examples: - * - * * `create_time > "2020-01-01" OR update_time > "2020-01-01"` - * Featurestores created or updated after 2020-01-01. - * * `labels.env = "prod"` - * Featurestores with label "env" set to "prod". - * @param {number} request.pageSize - * The maximum number of Featurestores to return. The service may return fewer - * than this value. If unspecified, at most 100 Featurestores will be - * returned. The maximum value is 100; any value greater than 100 will be - * coerced to 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} must - * match the call that provided the page token. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported Fields: - * - * * `create_time` - * * `update_time` - * * `online_serving_config.fixed_node_count` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Featurestore]{@link google.cloud.aiplatform.v1.Featurestore} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listFeaturestoresAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listFeaturestoresStream( - request?: protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listFeaturestores']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listFeaturestores.createStream( - this.innerApiCalls.listFeaturestores as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listFeaturestores`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list Featurestores. - * Format: - * `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the featurestores that match the filter expression. The following - * fields are supported: - * - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be - * in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be - * in RFC 3339 format. - * * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, - * `<=`, and `>=` comparisons. - * * `labels`: Supports key-value equality and key presence. - * - * Examples: - * - * * `create_time > "2020-01-01" OR update_time > "2020-01-01"` - * Featurestores created or updated after 2020-01-01. - * * `labels.env = "prod"` - * Featurestores with label "env" set to "prod". - * @param {number} request.pageSize - * The maximum number of Featurestores to return. The service may return fewer - * than this value. If unspecified, at most 100 Featurestores will be - * returned. The maximum value is 100; any value greater than 100 will be - * coerced to 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} must - * match the call that provided the page token. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported Fields: - * - * * `create_time` - * * `update_time` - * * `online_serving_config.fixed_node_count` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Featurestore]{@link google.cloud.aiplatform.v1.Featurestore}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_ListFeaturestores_async - */ - listFeaturestoresAsync( - request?: protos.google.cloud.aiplatform.v1.IListFeaturestoresRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listFeaturestores']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listFeaturestores.asyncIterate( - this.innerApiCalls['listFeaturestores'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists EntityTypes in a given Featurestore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Featurestore to list EntityTypes. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param {string} request.filter - * Lists the EntityTypes that match the filter expression. The following - * filters are supported: - * - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - * Values must be in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - * Values must be in RFC 3339 format. - * * `labels`: Supports key-value equality as well as key presence. - * - * Examples: - * - * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - * or updated after 2020-01-31T15:30:00.000000Z. - * * `labels.active = yes AND labels.env = prod` --> EntityTypes having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any EntityType which has a label with 'env' as the - * key. - * @param {number} request.pageSize - * The maximum number of EntityTypes to return. The service may return fewer - * than this value. If unspecified, at most 1000 EntityTypes will be returned. - * The maximum value is 1000; any value greater than 1000 will be coerced to - * 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} must - * match the call that provided the page token. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * - * Supported fields: - * - * * `entity_type_id` - * * `create_time` - * * `update_time` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [EntityType]{@link google.cloud.aiplatform.v1.EntityType}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listEntityTypesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listEntityTypes( - request?: protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IEntityType[], - protos.google.cloud.aiplatform.v1.IListEntityTypesRequest|null, - protos.google.cloud.aiplatform.v1.IListEntityTypesResponse - ]>; - listEntityTypes( - request: protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, - protos.google.cloud.aiplatform.v1.IListEntityTypesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IEntityType>): void; - listEntityTypes( - request: protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, - protos.google.cloud.aiplatform.v1.IListEntityTypesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IEntityType>): void; - listEntityTypes( - request?: protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, - protos.google.cloud.aiplatform.v1.IListEntityTypesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IEntityType>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, - protos.google.cloud.aiplatform.v1.IListEntityTypesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IEntityType>): - Promise<[ - protos.google.cloud.aiplatform.v1.IEntityType[], - protos.google.cloud.aiplatform.v1.IListEntityTypesRequest|null, - protos.google.cloud.aiplatform.v1.IListEntityTypesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listEntityTypes(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Featurestore to list EntityTypes. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param {string} request.filter - * Lists the EntityTypes that match the filter expression. The following - * filters are supported: - * - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - * Values must be in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - * Values must be in RFC 3339 format. - * * `labels`: Supports key-value equality as well as key presence. - * - * Examples: - * - * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - * or updated after 2020-01-31T15:30:00.000000Z. - * * `labels.active = yes AND labels.env = prod` --> EntityTypes having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any EntityType which has a label with 'env' as the - * key. - * @param {number} request.pageSize - * The maximum number of EntityTypes to return. The service may return fewer - * than this value. If unspecified, at most 1000 EntityTypes will be returned. - * The maximum value is 1000; any value greater than 1000 will be coerced to - * 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} must - * match the call that provided the page token. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * - * Supported fields: - * - * * `entity_type_id` - * * `create_time` - * * `update_time` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [EntityType]{@link google.cloud.aiplatform.v1.EntityType} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listEntityTypesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listEntityTypesStream( - request?: protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listEntityTypes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listEntityTypes.createStream( - this.innerApiCalls.listEntityTypes as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listEntityTypes`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Featurestore to list EntityTypes. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param {string} request.filter - * Lists the EntityTypes that match the filter expression. The following - * filters are supported: - * - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - * Values must be in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - * Values must be in RFC 3339 format. - * * `labels`: Supports key-value equality as well as key presence. - * - * Examples: - * - * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - * or updated after 2020-01-31T15:30:00.000000Z. - * * `labels.active = yes AND labels.env = prod` --> EntityTypes having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any EntityType which has a label with 'env' as the - * key. - * @param {number} request.pageSize - * The maximum number of EntityTypes to return. The service may return fewer - * than this value. If unspecified, at most 1000 EntityTypes will be returned. - * The maximum value is 1000; any value greater than 1000 will be coerced to - * 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} must - * match the call that provided the page token. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * - * Supported fields: - * - * * `entity_type_id` - * * `create_time` - * * `update_time` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [EntityType]{@link google.cloud.aiplatform.v1.EntityType}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_ListEntityTypes_async - */ - listEntityTypesAsync( - request?: protos.google.cloud.aiplatform.v1.IListEntityTypesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listEntityTypes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listEntityTypes.asyncIterate( - this.innerApiCalls['listEntityTypes'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists Features in a given EntityType. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list Features. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {string} request.filter - * Lists the Features that match the filter expression. The following - * filters are supported: - * - * * `value_type`: Supports = and != comparisons. - * * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - * be in RFC 3339 format. - * * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - * be in RFC 3339 format. - * * `labels`: Supports key-value equality as well as key presence. - * - * Examples: - * - * * `value_type = DOUBLE` --> Features whose type is DOUBLE. - * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - * or updated after 2020-01-31T15:30:00.000000Z. - * * `labels.active = yes AND labels.env = prod` --> Features having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any Feature which has a label with 'env' as the - * key. - * @param {number} request.pageSize - * The maximum number of Features to return. The service may return fewer - * than this value. If unspecified, at most 1000 Features will be returned. - * The maximum value is 1000; any value greater than 1000 will be coerced to - * 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} must - * match the call that provided the page token. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * - * * `feature_id` - * * `value_type` - * * `create_time` - * * `update_time` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {number} request.latestStatsCount - * If set, return the most recent {@link google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count} - * of stats for each Feature in response. Valid value is [0, 10]. If number of - * stats exists < {@link google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count}, return all - * existing stats. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Feature]{@link google.cloud.aiplatform.v1.Feature}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listFeaturesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listFeatures( - request?: protos.google.cloud.aiplatform.v1.IListFeaturesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IFeature[], - protos.google.cloud.aiplatform.v1.IListFeaturesRequest|null, - protos.google.cloud.aiplatform.v1.IListFeaturesResponse - ]>; - listFeatures( - request: protos.google.cloud.aiplatform.v1.IListFeaturesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListFeaturesRequest, - protos.google.cloud.aiplatform.v1.IListFeaturesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IFeature>): void; - listFeatures( - request: protos.google.cloud.aiplatform.v1.IListFeaturesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListFeaturesRequest, - protos.google.cloud.aiplatform.v1.IListFeaturesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IFeature>): void; - listFeatures( - request?: protos.google.cloud.aiplatform.v1.IListFeaturesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListFeaturesRequest, - protos.google.cloud.aiplatform.v1.IListFeaturesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IFeature>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListFeaturesRequest, - protos.google.cloud.aiplatform.v1.IListFeaturesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IFeature>): - Promise<[ - protos.google.cloud.aiplatform.v1.IFeature[], - protos.google.cloud.aiplatform.v1.IListFeaturesRequest|null, - protos.google.cloud.aiplatform.v1.IListFeaturesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listFeatures(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list Features. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {string} request.filter - * Lists the Features that match the filter expression. The following - * filters are supported: - * - * * `value_type`: Supports = and != comparisons. - * * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - * be in RFC 3339 format. - * * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - * be in RFC 3339 format. - * * `labels`: Supports key-value equality as well as key presence. - * - * Examples: - * - * * `value_type = DOUBLE` --> Features whose type is DOUBLE. - * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - * or updated after 2020-01-31T15:30:00.000000Z. - * * `labels.active = yes AND labels.env = prod` --> Features having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any Feature which has a label with 'env' as the - * key. - * @param {number} request.pageSize - * The maximum number of Features to return. The service may return fewer - * than this value. If unspecified, at most 1000 Features will be returned. - * The maximum value is 1000; any value greater than 1000 will be coerced to - * 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} must - * match the call that provided the page token. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * - * * `feature_id` - * * `value_type` - * * `create_time` - * * `update_time` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {number} request.latestStatsCount - * If set, return the most recent {@link google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count} - * of stats for each Feature in response. Valid value is [0, 10]. If number of - * stats exists < {@link google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count}, return all - * existing stats. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Feature]{@link google.cloud.aiplatform.v1.Feature} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listFeaturesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listFeaturesStream( - request?: protos.google.cloud.aiplatform.v1.IListFeaturesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listFeatures']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listFeatures.createStream( - this.innerApiCalls.listFeatures as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listFeatures`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list Features. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {string} request.filter - * Lists the Features that match the filter expression. The following - * filters are supported: - * - * * `value_type`: Supports = and != comparisons. - * * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - * be in RFC 3339 format. - * * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - * be in RFC 3339 format. - * * `labels`: Supports key-value equality as well as key presence. - * - * Examples: - * - * * `value_type = DOUBLE` --> Features whose type is DOUBLE. - * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - * or updated after 2020-01-31T15:30:00.000000Z. - * * `labels.active = yes AND labels.env = prod` --> Features having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any Feature which has a label with 'env' as the - * key. - * @param {number} request.pageSize - * The maximum number of Features to return. The service may return fewer - * than this value. If unspecified, at most 1000 Features will be returned. - * The maximum value is 1000; any value greater than 1000 will be coerced to - * 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} must - * match the call that provided the page token. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * - * * `feature_id` - * * `value_type` - * * `create_time` - * * `update_time` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {number} request.latestStatsCount - * If set, return the most recent {@link google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count} - * of stats for each Feature in response. Valid value is [0, 10]. If number of - * stats exists < {@link google.cloud.aiplatform.v1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count}, return all - * existing stats. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Feature]{@link google.cloud.aiplatform.v1.Feature}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_ListFeatures_async - */ - listFeaturesAsync( - request?: protos.google.cloud.aiplatform.v1.IListFeaturesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listFeatures']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listFeatures.asyncIterate( - this.innerApiCalls['listFeatures'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Searches Features matching a query in a given project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.location - * Required. The resource name of the Location to search Features. - * Format: - * `projects/{project}/locations/{location}` - * @param {string} request.query - * Query string that is a conjunction of field-restricted queries and/or - * field-restricted filters. Field-restricted queries and filters can be - * combined using `AND` to form a conjunction. - * - * A field query is in the form FIELD:QUERY. This implicitly checks if QUERY - * exists as a substring within Feature's FIELD. The QUERY - * and the FIELD are converted to a sequence of words (i.e. tokens) for - * comparison. This is done by: - * - * * Removing leading/trailing whitespace and tokenizing the search value. - * Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore - * `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated - * as a wildcard that matches characters within a token. - * * Ignoring case. - * * Prepending an asterisk to the first and appending an asterisk to the - * last token in QUERY. - * - * A QUERY must be either a singular token or a phrase. A phrase is one or - * multiple words enclosed in double quotation marks ("). With phrases, the - * order of the words is important. Words in the phrase must be matching in - * order and consecutively. - * - * Supported FIELDs for field-restricted queries: - * - * * `feature_id` - * * `description` - * * `entity_type_id` - * - * Examples: - * - * * `feature_id: foo` --> Matches a Feature with ID containing the substring - * `foo` (eg. `foo`, `foofeature`, `barfoo`). - * * `feature_id: foo*feature` --> Matches a Feature with ID containing the - * substring `foo*feature` (eg. `foobarfeature`). - * * `feature_id: foo AND description: bar` --> Matches a Feature with ID - * containing the substring `foo` and description containing the substring - * `bar`. - * - * - * Besides field queries, the following exact-match filters are - * supported. The exact-match filters do not support wildcards. Unlike - * field-restricted queries, exact-match filters are case-sensitive. - * - * * `feature_id`: Supports = comparisons. - * * `description`: Supports = comparisons. Multi-token filters should be - * enclosed in quotes. - * * `entity_type_id`: Supports = comparisons. - * * `value_type`: Supports = and != comparisons. - * * `labels`: Supports key-value equality as well as key presence. - * * `featurestore_id`: Supports = comparisons. - * - * Examples: - * * `description = "foo bar"` --> Any Feature with description exactly equal - * to `foo bar` - * * `value_type = DOUBLE` --> Features whose type is DOUBLE. - * * `labels.active = yes AND labels.env = prod` --> Features having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any Feature which has a label with `env` as the - * key. - * @param {number} request.pageSize - * The maximum number of Features to return. The service may return fewer - * than this value. If unspecified, at most 100 Features will be returned. - * The maximum value is 100; any value greater than 100 will be coerced to - * 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures}, except `page_size`, must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Feature]{@link google.cloud.aiplatform.v1.Feature}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `searchFeaturesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - searchFeatures( - request?: protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IFeature[], - protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest|null, - protos.google.cloud.aiplatform.v1.ISearchFeaturesResponse - ]>; - searchFeatures( - request: protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, - protos.google.cloud.aiplatform.v1.ISearchFeaturesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IFeature>): void; - searchFeatures( - request: protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, - protos.google.cloud.aiplatform.v1.ISearchFeaturesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IFeature>): void; - searchFeatures( - request?: protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, - protos.google.cloud.aiplatform.v1.ISearchFeaturesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IFeature>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, - protos.google.cloud.aiplatform.v1.ISearchFeaturesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IFeature>): - Promise<[ - protos.google.cloud.aiplatform.v1.IFeature[], - protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest|null, - protos.google.cloud.aiplatform.v1.ISearchFeaturesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'location': request.location || '', - }); - this.initialize(); - return this.innerApiCalls.searchFeatures(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.location - * Required. The resource name of the Location to search Features. - * Format: - * `projects/{project}/locations/{location}` - * @param {string} request.query - * Query string that is a conjunction of field-restricted queries and/or - * field-restricted filters. Field-restricted queries and filters can be - * combined using `AND` to form a conjunction. - * - * A field query is in the form FIELD:QUERY. This implicitly checks if QUERY - * exists as a substring within Feature's FIELD. The QUERY - * and the FIELD are converted to a sequence of words (i.e. tokens) for - * comparison. This is done by: - * - * * Removing leading/trailing whitespace and tokenizing the search value. - * Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore - * `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated - * as a wildcard that matches characters within a token. - * * Ignoring case. - * * Prepending an asterisk to the first and appending an asterisk to the - * last token in QUERY. - * - * A QUERY must be either a singular token or a phrase. A phrase is one or - * multiple words enclosed in double quotation marks ("). With phrases, the - * order of the words is important. Words in the phrase must be matching in - * order and consecutively. - * - * Supported FIELDs for field-restricted queries: - * - * * `feature_id` - * * `description` - * * `entity_type_id` - * - * Examples: - * - * * `feature_id: foo` --> Matches a Feature with ID containing the substring - * `foo` (eg. `foo`, `foofeature`, `barfoo`). - * * `feature_id: foo*feature` --> Matches a Feature with ID containing the - * substring `foo*feature` (eg. `foobarfeature`). - * * `feature_id: foo AND description: bar` --> Matches a Feature with ID - * containing the substring `foo` and description containing the substring - * `bar`. - * - * - * Besides field queries, the following exact-match filters are - * supported. The exact-match filters do not support wildcards. Unlike - * field-restricted queries, exact-match filters are case-sensitive. - * - * * `feature_id`: Supports = comparisons. - * * `description`: Supports = comparisons. Multi-token filters should be - * enclosed in quotes. - * * `entity_type_id`: Supports = comparisons. - * * `value_type`: Supports = and != comparisons. - * * `labels`: Supports key-value equality as well as key presence. - * * `featurestore_id`: Supports = comparisons. - * - * Examples: - * * `description = "foo bar"` --> Any Feature with description exactly equal - * to `foo bar` - * * `value_type = DOUBLE` --> Features whose type is DOUBLE. - * * `labels.active = yes AND labels.env = prod` --> Features having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any Feature which has a label with `env` as the - * key. - * @param {number} request.pageSize - * The maximum number of Features to return. The service may return fewer - * than this value. If unspecified, at most 100 Features will be returned. - * The maximum value is 100; any value greater than 100 will be coerced to - * 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures}, except `page_size`, must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Feature]{@link google.cloud.aiplatform.v1.Feature} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `searchFeaturesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - searchFeaturesStream( - request?: protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'location': request.location || '', - }); - const defaultCallSettings = this._defaults['searchFeatures']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchFeatures.createStream( - this.innerApiCalls.searchFeatures as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `searchFeatures`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.location - * Required. The resource name of the Location to search Features. - * Format: - * `projects/{project}/locations/{location}` - * @param {string} request.query - * Query string that is a conjunction of field-restricted queries and/or - * field-restricted filters. Field-restricted queries and filters can be - * combined using `AND` to form a conjunction. - * - * A field query is in the form FIELD:QUERY. This implicitly checks if QUERY - * exists as a substring within Feature's FIELD. The QUERY - * and the FIELD are converted to a sequence of words (i.e. tokens) for - * comparison. This is done by: - * - * * Removing leading/trailing whitespace and tokenizing the search value. - * Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore - * `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated - * as a wildcard that matches characters within a token. - * * Ignoring case. - * * Prepending an asterisk to the first and appending an asterisk to the - * last token in QUERY. - * - * A QUERY must be either a singular token or a phrase. A phrase is one or - * multiple words enclosed in double quotation marks ("). With phrases, the - * order of the words is important. Words in the phrase must be matching in - * order and consecutively. - * - * Supported FIELDs for field-restricted queries: - * - * * `feature_id` - * * `description` - * * `entity_type_id` - * - * Examples: - * - * * `feature_id: foo` --> Matches a Feature with ID containing the substring - * `foo` (eg. `foo`, `foofeature`, `barfoo`). - * * `feature_id: foo*feature` --> Matches a Feature with ID containing the - * substring `foo*feature` (eg. `foobarfeature`). - * * `feature_id: foo AND description: bar` --> Matches a Feature with ID - * containing the substring `foo` and description containing the substring - * `bar`. - * - * - * Besides field queries, the following exact-match filters are - * supported. The exact-match filters do not support wildcards. Unlike - * field-restricted queries, exact-match filters are case-sensitive. - * - * * `feature_id`: Supports = comparisons. - * * `description`: Supports = comparisons. Multi-token filters should be - * enclosed in quotes. - * * `entity_type_id`: Supports = comparisons. - * * `value_type`: Supports = and != comparisons. - * * `labels`: Supports key-value equality as well as key presence. - * * `featurestore_id`: Supports = comparisons. - * - * Examples: - * * `description = "foo bar"` --> Any Feature with description exactly equal - * to `foo bar` - * * `value_type = DOUBLE` --> Features whose type is DOUBLE. - * * `labels.active = yes AND labels.env = prod` --> Features having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any Feature which has a label with `env` as the - * key. - * @param {number} request.pageSize - * The maximum number of Features to return. The service may return fewer - * than this value. If unspecified, at most 100 Features will be returned. - * The maximum value is 100; any value greater than 100 will be coerced to - * 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures}, except `page_size`, must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Feature]{@link google.cloud.aiplatform.v1.Feature}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_FeaturestoreService_SearchFeatures_async - */ - searchFeaturesAsync( - request?: protos.google.cloud.aiplatform.v1.ISearchFeaturesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'location': request.location || '', - }); - const defaultCallSettings = this._defaults['searchFeatures']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchFeatures.asyncIterate( - this.innerApiCalls['searchFeatures'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.featurestoreServiceStub && !this._terminated) { - return this.featurestoreServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/featurestore_service_client_config.json b/owl-bot-staging/v1/src/v1/featurestore_service_client_config.json deleted file mode 100644 index c7fd6ba0..00000000 --- a/owl-bot-staging/v1/src/v1/featurestore_service_client_config.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1.FeaturestoreService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateFeaturestore": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetFeaturestore": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListFeaturestores": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateFeaturestore": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteFeaturestore": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateEntityType": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetEntityType": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListEntityTypes": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateEntityType": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteEntityType": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateFeature": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchCreateFeatures": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetFeature": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListFeatures": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateFeature": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteFeature": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ImportFeatureValues": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchReadFeatureValues": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ExportFeatureValues": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SearchFeatures": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/featurestore_service_proto_list.json b/owl-bot-staging/v1/src/v1/featurestore_service_proto_list.json deleted file mode 100644 index 581a7346..00000000 --- a/owl-bot-staging/v1/src/v1/featurestore_service_proto_list.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1/context.proto", - "../../protos/google/cloud/aiplatform/v1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1/event.proto", - "../../protos/google/cloud/aiplatform/v1/execution.proto", - "../../protos/google/cloud/aiplatform/v1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1/feature.proto", - "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1/index.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1/io.proto", - "../../protos/google/cloud/aiplatform/v1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1/model.proto", - "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1/operation.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1/study.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1/types.proto", - "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1/value.proto", - "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1/src/v1/gapic_metadata.json b/owl-bot-staging/v1/src/v1/gapic_metadata.json deleted file mode 100644 index 8c7e4346..00000000 --- a/owl-bot-staging/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,2199 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.aiplatform.v1", - "libraryPackage": "@google-cloud/aiplatform", - "services": { - "DatasetService": { - "clients": { - "grpc": { - "libraryClient": "DatasetServiceClient", - "rpcs": { - "GetDataset": { - "methods": [ - "getDataset" - ] - }, - "UpdateDataset": { - "methods": [ - "updateDataset" - ] - }, - "GetAnnotationSpec": { - "methods": [ - "getAnnotationSpec" - ] - }, - "CreateDataset": { - "methods": [ - "createDataset" - ] - }, - "DeleteDataset": { - "methods": [ - "deleteDataset" - ] - }, - "ImportData": { - "methods": [ - "importData" - ] - }, - "ExportData": { - "methods": [ - "exportData" - ] - }, - "ListDatasets": { - "methods": [ - "listDatasets", - "listDatasetsStream", - "listDatasetsAsync" - ] - }, - "ListDataItems": { - "methods": [ - "listDataItems", - "listDataItemsStream", - "listDataItemsAsync" - ] - }, - "ListAnnotations": { - "methods": [ - "listAnnotations", - "listAnnotationsStream", - "listAnnotationsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "DatasetServiceClient", - "rpcs": { - "GetDataset": { - "methods": [ - "getDataset" - ] - }, - "UpdateDataset": { - "methods": [ - "updateDataset" - ] - }, - "GetAnnotationSpec": { - "methods": [ - "getAnnotationSpec" - ] - }, - "CreateDataset": { - "methods": [ - "createDataset" - ] - }, - "DeleteDataset": { - "methods": [ - "deleteDataset" - ] - }, - "ImportData": { - "methods": [ - "importData" - ] - }, - "ExportData": { - "methods": [ - "exportData" - ] - }, - "ListDatasets": { - "methods": [ - "listDatasets", - "listDatasetsStream", - "listDatasetsAsync" - ] - }, - "ListDataItems": { - "methods": [ - "listDataItems", - "listDataItemsStream", - "listDataItemsAsync" - ] - }, - "ListAnnotations": { - "methods": [ - "listAnnotations", - "listAnnotationsStream", - "listAnnotationsAsync" - ] - } - } - } - } - }, - "EndpointService": { - "clients": { - "grpc": { - "libraryClient": "EndpointServiceClient", - "rpcs": { - "GetEndpoint": { - "methods": [ - "getEndpoint" - ] - }, - "UpdateEndpoint": { - "methods": [ - "updateEndpoint" - ] - }, - "CreateEndpoint": { - "methods": [ - "createEndpoint" - ] - }, - "DeleteEndpoint": { - "methods": [ - "deleteEndpoint" - ] - }, - "DeployModel": { - "methods": [ - "deployModel" - ] - }, - "UndeployModel": { - "methods": [ - "undeployModel" - ] - }, - "ListEndpoints": { - "methods": [ - "listEndpoints", - "listEndpointsStream", - "listEndpointsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "EndpointServiceClient", - "rpcs": { - "GetEndpoint": { - "methods": [ - "getEndpoint" - ] - }, - "UpdateEndpoint": { - "methods": [ - "updateEndpoint" - ] - }, - "CreateEndpoint": { - "methods": [ - "createEndpoint" - ] - }, - "DeleteEndpoint": { - "methods": [ - "deleteEndpoint" - ] - }, - "DeployModel": { - "methods": [ - "deployModel" - ] - }, - "UndeployModel": { - "methods": [ - "undeployModel" - ] - }, - "ListEndpoints": { - "methods": [ - "listEndpoints", - "listEndpointsStream", - "listEndpointsAsync" - ] - } - } - } - } - }, - "FeaturestoreOnlineServingService": { - "clients": { - "grpc": { - "libraryClient": "FeaturestoreOnlineServingServiceClient", - "rpcs": { - "ReadFeatureValues": { - "methods": [ - "readFeatureValues" - ] - }, - "StreamingReadFeatureValues": { - "methods": [ - "streamingReadFeatureValues" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "FeaturestoreOnlineServingServiceClient", - "rpcs": { - "ReadFeatureValues": { - "methods": [ - "readFeatureValues" - ] - } - } - } - } - }, - "FeaturestoreService": { - "clients": { - "grpc": { - "libraryClient": "FeaturestoreServiceClient", - "rpcs": { - "GetFeaturestore": { - "methods": [ - "getFeaturestore" - ] - }, - "GetEntityType": { - "methods": [ - "getEntityType" - ] - }, - "UpdateEntityType": { - "methods": [ - "updateEntityType" - ] - }, - "GetFeature": { - "methods": [ - "getFeature" - ] - }, - "UpdateFeature": { - "methods": [ - "updateFeature" - ] - }, - "CreateFeaturestore": { - "methods": [ - "createFeaturestore" - ] - }, - "UpdateFeaturestore": { - "methods": [ - "updateFeaturestore" - ] - }, - "DeleteFeaturestore": { - "methods": [ - "deleteFeaturestore" - ] - }, - "CreateEntityType": { - "methods": [ - "createEntityType" - ] - }, - "DeleteEntityType": { - "methods": [ - "deleteEntityType" - ] - }, - "CreateFeature": { - "methods": [ - "createFeature" - ] - }, - "BatchCreateFeatures": { - "methods": [ - "batchCreateFeatures" - ] - }, - "DeleteFeature": { - "methods": [ - "deleteFeature" - ] - }, - "ImportFeatureValues": { - "methods": [ - "importFeatureValues" - ] - }, - "BatchReadFeatureValues": { - "methods": [ - "batchReadFeatureValues" - ] - }, - "ExportFeatureValues": { - "methods": [ - "exportFeatureValues" - ] - }, - "ListFeaturestores": { - "methods": [ - "listFeaturestores", - "listFeaturestoresStream", - "listFeaturestoresAsync" - ] - }, - "ListEntityTypes": { - "methods": [ - "listEntityTypes", - "listEntityTypesStream", - "listEntityTypesAsync" - ] - }, - "ListFeatures": { - "methods": [ - "listFeatures", - "listFeaturesStream", - "listFeaturesAsync" - ] - }, - "SearchFeatures": { - "methods": [ - "searchFeatures", - "searchFeaturesStream", - "searchFeaturesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "FeaturestoreServiceClient", - "rpcs": { - "GetFeaturestore": { - "methods": [ - "getFeaturestore" - ] - }, - "GetEntityType": { - "methods": [ - "getEntityType" - ] - }, - "UpdateEntityType": { - "methods": [ - "updateEntityType" - ] - }, - "GetFeature": { - "methods": [ - "getFeature" - ] - }, - "UpdateFeature": { - "methods": [ - "updateFeature" - ] - }, - "CreateFeaturestore": { - "methods": [ - "createFeaturestore" - ] - }, - "UpdateFeaturestore": { - "methods": [ - "updateFeaturestore" - ] - }, - "DeleteFeaturestore": { - "methods": [ - "deleteFeaturestore" - ] - }, - "CreateEntityType": { - "methods": [ - "createEntityType" - ] - }, - "DeleteEntityType": { - "methods": [ - "deleteEntityType" - ] - }, - "CreateFeature": { - "methods": [ - "createFeature" - ] - }, - "BatchCreateFeatures": { - "methods": [ - "batchCreateFeatures" - ] - }, - "DeleteFeature": { - "methods": [ - "deleteFeature" - ] - }, - "ImportFeatureValues": { - "methods": [ - "importFeatureValues" - ] - }, - "BatchReadFeatureValues": { - "methods": [ - "batchReadFeatureValues" - ] - }, - "ExportFeatureValues": { - "methods": [ - "exportFeatureValues" - ] - }, - "ListFeaturestores": { - "methods": [ - "listFeaturestores", - "listFeaturestoresStream", - "listFeaturestoresAsync" - ] - }, - "ListEntityTypes": { - "methods": [ - "listEntityTypes", - "listEntityTypesStream", - "listEntityTypesAsync" - ] - }, - "ListFeatures": { - "methods": [ - "listFeatures", - "listFeaturesStream", - "listFeaturesAsync" - ] - }, - "SearchFeatures": { - "methods": [ - "searchFeatures", - "searchFeaturesStream", - "searchFeaturesAsync" - ] - } - } - } - } - }, - "IndexEndpointService": { - "clients": { - "grpc": { - "libraryClient": "IndexEndpointServiceClient", - "rpcs": { - "GetIndexEndpoint": { - "methods": [ - "getIndexEndpoint" - ] - }, - "UpdateIndexEndpoint": { - "methods": [ - "updateIndexEndpoint" - ] - }, - "CreateIndexEndpoint": { - "methods": [ - "createIndexEndpoint" - ] - }, - "DeleteIndexEndpoint": { - "methods": [ - "deleteIndexEndpoint" - ] - }, - "DeployIndex": { - "methods": [ - "deployIndex" - ] - }, - "UndeployIndex": { - "methods": [ - "undeployIndex" - ] - }, - "MutateDeployedIndex": { - "methods": [ - "mutateDeployedIndex" - ] - }, - "ListIndexEndpoints": { - "methods": [ - "listIndexEndpoints", - "listIndexEndpointsStream", - "listIndexEndpointsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "IndexEndpointServiceClient", - "rpcs": { - "GetIndexEndpoint": { - "methods": [ - "getIndexEndpoint" - ] - }, - "UpdateIndexEndpoint": { - "methods": [ - "updateIndexEndpoint" - ] - }, - "CreateIndexEndpoint": { - "methods": [ - "createIndexEndpoint" - ] - }, - "DeleteIndexEndpoint": { - "methods": [ - "deleteIndexEndpoint" - ] - }, - "DeployIndex": { - "methods": [ - "deployIndex" - ] - }, - "UndeployIndex": { - "methods": [ - "undeployIndex" - ] - }, - "MutateDeployedIndex": { - "methods": [ - "mutateDeployedIndex" - ] - }, - "ListIndexEndpoints": { - "methods": [ - "listIndexEndpoints", - "listIndexEndpointsStream", - "listIndexEndpointsAsync" - ] - } - } - } - } - }, - "IndexService": { - "clients": { - "grpc": { - "libraryClient": "IndexServiceClient", - "rpcs": { - "GetIndex": { - "methods": [ - "getIndex" - ] - }, - "CreateIndex": { - "methods": [ - "createIndex" - ] - }, - "UpdateIndex": { - "methods": [ - "updateIndex" - ] - }, - "DeleteIndex": { - "methods": [ - "deleteIndex" - ] - }, - "ListIndexes": { - "methods": [ - "listIndexes", - "listIndexesStream", - "listIndexesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "IndexServiceClient", - "rpcs": { - "GetIndex": { - "methods": [ - "getIndex" - ] - }, - "CreateIndex": { - "methods": [ - "createIndex" - ] - }, - "UpdateIndex": { - "methods": [ - "updateIndex" - ] - }, - "DeleteIndex": { - "methods": [ - "deleteIndex" - ] - }, - "ListIndexes": { - "methods": [ - "listIndexes", - "listIndexesStream", - "listIndexesAsync" - ] - } - } - } - } - }, - "JobService": { - "clients": { - "grpc": { - "libraryClient": "JobServiceClient", - "rpcs": { - "CreateCustomJob": { - "methods": [ - "createCustomJob" - ] - }, - "GetCustomJob": { - "methods": [ - "getCustomJob" - ] - }, - "CancelCustomJob": { - "methods": [ - "cancelCustomJob" - ] - }, - "CreateDataLabelingJob": { - "methods": [ - "createDataLabelingJob" - ] - }, - "GetDataLabelingJob": { - "methods": [ - "getDataLabelingJob" - ] - }, - "CancelDataLabelingJob": { - "methods": [ - "cancelDataLabelingJob" - ] - }, - "CreateHyperparameterTuningJob": { - "methods": [ - "createHyperparameterTuningJob" - ] - }, - "GetHyperparameterTuningJob": { - "methods": [ - "getHyperparameterTuningJob" - ] - }, - "CancelHyperparameterTuningJob": { - "methods": [ - "cancelHyperparameterTuningJob" - ] - }, - "CreateBatchPredictionJob": { - "methods": [ - "createBatchPredictionJob" - ] - }, - "GetBatchPredictionJob": { - "methods": [ - "getBatchPredictionJob" - ] - }, - "CancelBatchPredictionJob": { - "methods": [ - "cancelBatchPredictionJob" - ] - }, - "CreateModelDeploymentMonitoringJob": { - "methods": [ - "createModelDeploymentMonitoringJob" - ] - }, - "GetModelDeploymentMonitoringJob": { - "methods": [ - "getModelDeploymentMonitoringJob" - ] - }, - "PauseModelDeploymentMonitoringJob": { - "methods": [ - "pauseModelDeploymentMonitoringJob" - ] - }, - "ResumeModelDeploymentMonitoringJob": { - "methods": [ - "resumeModelDeploymentMonitoringJob" - ] - }, - "DeleteCustomJob": { - "methods": [ - "deleteCustomJob" - ] - }, - "DeleteDataLabelingJob": { - "methods": [ - "deleteDataLabelingJob" - ] - }, - "DeleteHyperparameterTuningJob": { - "methods": [ - "deleteHyperparameterTuningJob" - ] - }, - "DeleteBatchPredictionJob": { - "methods": [ - "deleteBatchPredictionJob" - ] - }, - "UpdateModelDeploymentMonitoringJob": { - "methods": [ - "updateModelDeploymentMonitoringJob" - ] - }, - "DeleteModelDeploymentMonitoringJob": { - "methods": [ - "deleteModelDeploymentMonitoringJob" - ] - }, - "ListCustomJobs": { - "methods": [ - "listCustomJobs", - "listCustomJobsStream", - "listCustomJobsAsync" - ] - }, - "ListDataLabelingJobs": { - "methods": [ - "listDataLabelingJobs", - "listDataLabelingJobsStream", - "listDataLabelingJobsAsync" - ] - }, - "ListHyperparameterTuningJobs": { - "methods": [ - "listHyperparameterTuningJobs", - "listHyperparameterTuningJobsStream", - "listHyperparameterTuningJobsAsync" - ] - }, - "ListBatchPredictionJobs": { - "methods": [ - "listBatchPredictionJobs", - "listBatchPredictionJobsStream", - "listBatchPredictionJobsAsync" - ] - }, - "SearchModelDeploymentMonitoringStatsAnomalies": { - "methods": [ - "searchModelDeploymentMonitoringStatsAnomalies", - "searchModelDeploymentMonitoringStatsAnomaliesStream", - "searchModelDeploymentMonitoringStatsAnomaliesAsync" - ] - }, - "ListModelDeploymentMonitoringJobs": { - "methods": [ - "listModelDeploymentMonitoringJobs", - "listModelDeploymentMonitoringJobsStream", - "listModelDeploymentMonitoringJobsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "JobServiceClient", - "rpcs": { - "CreateCustomJob": { - "methods": [ - "createCustomJob" - ] - }, - "GetCustomJob": { - "methods": [ - "getCustomJob" - ] - }, - "CancelCustomJob": { - "methods": [ - "cancelCustomJob" - ] - }, - "CreateDataLabelingJob": { - "methods": [ - "createDataLabelingJob" - ] - }, - "GetDataLabelingJob": { - "methods": [ - "getDataLabelingJob" - ] - }, - "CancelDataLabelingJob": { - "methods": [ - "cancelDataLabelingJob" - ] - }, - "CreateHyperparameterTuningJob": { - "methods": [ - "createHyperparameterTuningJob" - ] - }, - "GetHyperparameterTuningJob": { - "methods": [ - "getHyperparameterTuningJob" - ] - }, - "CancelHyperparameterTuningJob": { - "methods": [ - "cancelHyperparameterTuningJob" - ] - }, - "CreateBatchPredictionJob": { - "methods": [ - "createBatchPredictionJob" - ] - }, - "GetBatchPredictionJob": { - "methods": [ - "getBatchPredictionJob" - ] - }, - "CancelBatchPredictionJob": { - "methods": [ - "cancelBatchPredictionJob" - ] - }, - "CreateModelDeploymentMonitoringJob": { - "methods": [ - "createModelDeploymentMonitoringJob" - ] - }, - "GetModelDeploymentMonitoringJob": { - "methods": [ - "getModelDeploymentMonitoringJob" - ] - }, - "PauseModelDeploymentMonitoringJob": { - "methods": [ - "pauseModelDeploymentMonitoringJob" - ] - }, - "ResumeModelDeploymentMonitoringJob": { - "methods": [ - "resumeModelDeploymentMonitoringJob" - ] - }, - "DeleteCustomJob": { - "methods": [ - "deleteCustomJob" - ] - }, - "DeleteDataLabelingJob": { - "methods": [ - "deleteDataLabelingJob" - ] - }, - "DeleteHyperparameterTuningJob": { - "methods": [ - "deleteHyperparameterTuningJob" - ] - }, - "DeleteBatchPredictionJob": { - "methods": [ - "deleteBatchPredictionJob" - ] - }, - "UpdateModelDeploymentMonitoringJob": { - "methods": [ - "updateModelDeploymentMonitoringJob" - ] - }, - "DeleteModelDeploymentMonitoringJob": { - "methods": [ - "deleteModelDeploymentMonitoringJob" - ] - }, - "ListCustomJobs": { - "methods": [ - "listCustomJobs", - "listCustomJobsStream", - "listCustomJobsAsync" - ] - }, - "ListDataLabelingJobs": { - "methods": [ - "listDataLabelingJobs", - "listDataLabelingJobsStream", - "listDataLabelingJobsAsync" - ] - }, - "ListHyperparameterTuningJobs": { - "methods": [ - "listHyperparameterTuningJobs", - "listHyperparameterTuningJobsStream", - "listHyperparameterTuningJobsAsync" - ] - }, - "ListBatchPredictionJobs": { - "methods": [ - "listBatchPredictionJobs", - "listBatchPredictionJobsStream", - "listBatchPredictionJobsAsync" - ] - }, - "SearchModelDeploymentMonitoringStatsAnomalies": { - "methods": [ - "searchModelDeploymentMonitoringStatsAnomalies", - "searchModelDeploymentMonitoringStatsAnomaliesStream", - "searchModelDeploymentMonitoringStatsAnomaliesAsync" - ] - }, - "ListModelDeploymentMonitoringJobs": { - "methods": [ - "listModelDeploymentMonitoringJobs", - "listModelDeploymentMonitoringJobsStream", - "listModelDeploymentMonitoringJobsAsync" - ] - } - } - } - } - }, - "MetadataService": { - "clients": { - "grpc": { - "libraryClient": "MetadataServiceClient", - "rpcs": { - "GetMetadataStore": { - "methods": [ - "getMetadataStore" - ] - }, - "CreateArtifact": { - "methods": [ - "createArtifact" - ] - }, - "GetArtifact": { - "methods": [ - "getArtifact" - ] - }, - "UpdateArtifact": { - "methods": [ - "updateArtifact" - ] - }, - "CreateContext": { - "methods": [ - "createContext" - ] - }, - "GetContext": { - "methods": [ - "getContext" - ] - }, - "UpdateContext": { - "methods": [ - "updateContext" - ] - }, - "AddContextArtifactsAndExecutions": { - "methods": [ - "addContextArtifactsAndExecutions" - ] - }, - "AddContextChildren": { - "methods": [ - "addContextChildren" - ] - }, - "QueryContextLineageSubgraph": { - "methods": [ - "queryContextLineageSubgraph" - ] - }, - "CreateExecution": { - "methods": [ - "createExecution" - ] - }, - "GetExecution": { - "methods": [ - "getExecution" - ] - }, - "UpdateExecution": { - "methods": [ - "updateExecution" - ] - }, - "AddExecutionEvents": { - "methods": [ - "addExecutionEvents" - ] - }, - "QueryExecutionInputsAndOutputs": { - "methods": [ - "queryExecutionInputsAndOutputs" - ] - }, - "CreateMetadataSchema": { - "methods": [ - "createMetadataSchema" - ] - }, - "GetMetadataSchema": { - "methods": [ - "getMetadataSchema" - ] - }, - "QueryArtifactLineageSubgraph": { - "methods": [ - "queryArtifactLineageSubgraph" - ] - }, - "CreateMetadataStore": { - "methods": [ - "createMetadataStore" - ] - }, - "DeleteMetadataStore": { - "methods": [ - "deleteMetadataStore" - ] - }, - "DeleteArtifact": { - "methods": [ - "deleteArtifact" - ] - }, - "PurgeArtifacts": { - "methods": [ - "purgeArtifacts" - ] - }, - "DeleteContext": { - "methods": [ - "deleteContext" - ] - }, - "PurgeContexts": { - "methods": [ - "purgeContexts" - ] - }, - "DeleteExecution": { - "methods": [ - "deleteExecution" - ] - }, - "PurgeExecutions": { - "methods": [ - "purgeExecutions" - ] - }, - "ListMetadataStores": { - "methods": [ - "listMetadataStores", - "listMetadataStoresStream", - "listMetadataStoresAsync" - ] - }, - "ListArtifacts": { - "methods": [ - "listArtifacts", - "listArtifactsStream", - "listArtifactsAsync" - ] - }, - "ListContexts": { - "methods": [ - "listContexts", - "listContextsStream", - "listContextsAsync" - ] - }, - "ListExecutions": { - "methods": [ - "listExecutions", - "listExecutionsStream", - "listExecutionsAsync" - ] - }, - "ListMetadataSchemas": { - "methods": [ - "listMetadataSchemas", - "listMetadataSchemasStream", - "listMetadataSchemasAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "MetadataServiceClient", - "rpcs": { - "GetMetadataStore": { - "methods": [ - "getMetadataStore" - ] - }, - "CreateArtifact": { - "methods": [ - "createArtifact" - ] - }, - "GetArtifact": { - "methods": [ - "getArtifact" - ] - }, - "UpdateArtifact": { - "methods": [ - "updateArtifact" - ] - }, - "CreateContext": { - "methods": [ - "createContext" - ] - }, - "GetContext": { - "methods": [ - "getContext" - ] - }, - "UpdateContext": { - "methods": [ - "updateContext" - ] - }, - "AddContextArtifactsAndExecutions": { - "methods": [ - "addContextArtifactsAndExecutions" - ] - }, - "AddContextChildren": { - "methods": [ - "addContextChildren" - ] - }, - "QueryContextLineageSubgraph": { - "methods": [ - "queryContextLineageSubgraph" - ] - }, - "CreateExecution": { - "methods": [ - "createExecution" - ] - }, - "GetExecution": { - "methods": [ - "getExecution" - ] - }, - "UpdateExecution": { - "methods": [ - "updateExecution" - ] - }, - "AddExecutionEvents": { - "methods": [ - "addExecutionEvents" - ] - }, - "QueryExecutionInputsAndOutputs": { - "methods": [ - "queryExecutionInputsAndOutputs" - ] - }, - "CreateMetadataSchema": { - "methods": [ - "createMetadataSchema" - ] - }, - "GetMetadataSchema": { - "methods": [ - "getMetadataSchema" - ] - }, - "QueryArtifactLineageSubgraph": { - "methods": [ - "queryArtifactLineageSubgraph" - ] - }, - "CreateMetadataStore": { - "methods": [ - "createMetadataStore" - ] - }, - "DeleteMetadataStore": { - "methods": [ - "deleteMetadataStore" - ] - }, - "DeleteArtifact": { - "methods": [ - "deleteArtifact" - ] - }, - "PurgeArtifacts": { - "methods": [ - "purgeArtifacts" - ] - }, - "DeleteContext": { - "methods": [ - "deleteContext" - ] - }, - "PurgeContexts": { - "methods": [ - "purgeContexts" - ] - }, - "DeleteExecution": { - "methods": [ - "deleteExecution" - ] - }, - "PurgeExecutions": { - "methods": [ - "purgeExecutions" - ] - }, - "ListMetadataStores": { - "methods": [ - "listMetadataStores", - "listMetadataStoresStream", - "listMetadataStoresAsync" - ] - }, - "ListArtifacts": { - "methods": [ - "listArtifacts", - "listArtifactsStream", - "listArtifactsAsync" - ] - }, - "ListContexts": { - "methods": [ - "listContexts", - "listContextsStream", - "listContextsAsync" - ] - }, - "ListExecutions": { - "methods": [ - "listExecutions", - "listExecutionsStream", - "listExecutionsAsync" - ] - }, - "ListMetadataSchemas": { - "methods": [ - "listMetadataSchemas", - "listMetadataSchemasStream", - "listMetadataSchemasAsync" - ] - } - } - } - } - }, - "MigrationService": { - "clients": { - "grpc": { - "libraryClient": "MigrationServiceClient", - "rpcs": { - "BatchMigrateResources": { - "methods": [ - "batchMigrateResources" - ] - }, - "SearchMigratableResources": { - "methods": [ - "searchMigratableResources", - "searchMigratableResourcesStream", - "searchMigratableResourcesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "MigrationServiceClient", - "rpcs": { - "BatchMigrateResources": { - "methods": [ - "batchMigrateResources" - ] - }, - "SearchMigratableResources": { - "methods": [ - "searchMigratableResources", - "searchMigratableResourcesStream", - "searchMigratableResourcesAsync" - ] - } - } - } - } - }, - "ModelService": { - "clients": { - "grpc": { - "libraryClient": "ModelServiceClient", - "rpcs": { - "GetModel": { - "methods": [ - "getModel" - ] - }, - "UpdateModel": { - "methods": [ - "updateModel" - ] - }, - "ImportModelEvaluation": { - "methods": [ - "importModelEvaluation" - ] - }, - "GetModelEvaluation": { - "methods": [ - "getModelEvaluation" - ] - }, - "GetModelEvaluationSlice": { - "methods": [ - "getModelEvaluationSlice" - ] - }, - "UploadModel": { - "methods": [ - "uploadModel" - ] - }, - "DeleteModel": { - "methods": [ - "deleteModel" - ] - }, - "ExportModel": { - "methods": [ - "exportModel" - ] - }, - "ListModels": { - "methods": [ - "listModels", - "listModelsStream", - "listModelsAsync" - ] - }, - "ListModelEvaluations": { - "methods": [ - "listModelEvaluations", - "listModelEvaluationsStream", - "listModelEvaluationsAsync" - ] - }, - "ListModelEvaluationSlices": { - "methods": [ - "listModelEvaluationSlices", - "listModelEvaluationSlicesStream", - "listModelEvaluationSlicesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ModelServiceClient", - "rpcs": { - "GetModel": { - "methods": [ - "getModel" - ] - }, - "UpdateModel": { - "methods": [ - "updateModel" - ] - }, - "ImportModelEvaluation": { - "methods": [ - "importModelEvaluation" - ] - }, - "GetModelEvaluation": { - "methods": [ - "getModelEvaluation" - ] - }, - "GetModelEvaluationSlice": { - "methods": [ - "getModelEvaluationSlice" - ] - }, - "UploadModel": { - "methods": [ - "uploadModel" - ] - }, - "DeleteModel": { - "methods": [ - "deleteModel" - ] - }, - "ExportModel": { - "methods": [ - "exportModel" - ] - }, - "ListModels": { - "methods": [ - "listModels", - "listModelsStream", - "listModelsAsync" - ] - }, - "ListModelEvaluations": { - "methods": [ - "listModelEvaluations", - "listModelEvaluationsStream", - "listModelEvaluationsAsync" - ] - }, - "ListModelEvaluationSlices": { - "methods": [ - "listModelEvaluationSlices", - "listModelEvaluationSlicesStream", - "listModelEvaluationSlicesAsync" - ] - } - } - } - } - }, - "PipelineService": { - "clients": { - "grpc": { - "libraryClient": "PipelineServiceClient", - "rpcs": { - "CreateTrainingPipeline": { - "methods": [ - "createTrainingPipeline" - ] - }, - "GetTrainingPipeline": { - "methods": [ - "getTrainingPipeline" - ] - }, - "CancelTrainingPipeline": { - "methods": [ - "cancelTrainingPipeline" - ] - }, - "CreatePipelineJob": { - "methods": [ - "createPipelineJob" - ] - }, - "GetPipelineJob": { - "methods": [ - "getPipelineJob" - ] - }, - "CancelPipelineJob": { - "methods": [ - "cancelPipelineJob" - ] - }, - "DeleteTrainingPipeline": { - "methods": [ - "deleteTrainingPipeline" - ] - }, - "DeletePipelineJob": { - "methods": [ - "deletePipelineJob" - ] - }, - "ListTrainingPipelines": { - "methods": [ - "listTrainingPipelines", - "listTrainingPipelinesStream", - "listTrainingPipelinesAsync" - ] - }, - "ListPipelineJobs": { - "methods": [ - "listPipelineJobs", - "listPipelineJobsStream", - "listPipelineJobsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "PipelineServiceClient", - "rpcs": { - "CreateTrainingPipeline": { - "methods": [ - "createTrainingPipeline" - ] - }, - "GetTrainingPipeline": { - "methods": [ - "getTrainingPipeline" - ] - }, - "CancelTrainingPipeline": { - "methods": [ - "cancelTrainingPipeline" - ] - }, - "CreatePipelineJob": { - "methods": [ - "createPipelineJob" - ] - }, - "GetPipelineJob": { - "methods": [ - "getPipelineJob" - ] - }, - "CancelPipelineJob": { - "methods": [ - "cancelPipelineJob" - ] - }, - "DeleteTrainingPipeline": { - "methods": [ - "deleteTrainingPipeline" - ] - }, - "DeletePipelineJob": { - "methods": [ - "deletePipelineJob" - ] - }, - "ListTrainingPipelines": { - "methods": [ - "listTrainingPipelines", - "listTrainingPipelinesStream", - "listTrainingPipelinesAsync" - ] - }, - "ListPipelineJobs": { - "methods": [ - "listPipelineJobs", - "listPipelineJobsStream", - "listPipelineJobsAsync" - ] - } - } - } - } - }, - "PredictionService": { - "clients": { - "grpc": { - "libraryClient": "PredictionServiceClient", - "rpcs": { - "Predict": { - "methods": [ - "predict" - ] - }, - "RawPredict": { - "methods": [ - "rawPredict" - ] - }, - "Explain": { - "methods": [ - "explain" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "PredictionServiceClient", - "rpcs": { - "Predict": { - "methods": [ - "predict" - ] - }, - "RawPredict": { - "methods": [ - "rawPredict" - ] - }, - "Explain": { - "methods": [ - "explain" - ] - } - } - } - } - }, - "SpecialistPoolService": { - "clients": { - "grpc": { - "libraryClient": "SpecialistPoolServiceClient", - "rpcs": { - "GetSpecialistPool": { - "methods": [ - "getSpecialistPool" - ] - }, - "CreateSpecialistPool": { - "methods": [ - "createSpecialistPool" - ] - }, - "DeleteSpecialistPool": { - "methods": [ - "deleteSpecialistPool" - ] - }, - "UpdateSpecialistPool": { - "methods": [ - "updateSpecialistPool" - ] - }, - "ListSpecialistPools": { - "methods": [ - "listSpecialistPools", - "listSpecialistPoolsStream", - "listSpecialistPoolsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "SpecialistPoolServiceClient", - "rpcs": { - "GetSpecialistPool": { - "methods": [ - "getSpecialistPool" - ] - }, - "CreateSpecialistPool": { - "methods": [ - "createSpecialistPool" - ] - }, - "DeleteSpecialistPool": { - "methods": [ - "deleteSpecialistPool" - ] - }, - "UpdateSpecialistPool": { - "methods": [ - "updateSpecialistPool" - ] - }, - "ListSpecialistPools": { - "methods": [ - "listSpecialistPools", - "listSpecialistPoolsStream", - "listSpecialistPoolsAsync" - ] - } - } - } - } - }, - "TensorboardService": { - "clients": { - "grpc": { - "libraryClient": "TensorboardServiceClient", - "rpcs": { - "GetTensorboard": { - "methods": [ - "getTensorboard" - ] - }, - "CreateTensorboardExperiment": { - "methods": [ - "createTensorboardExperiment" - ] - }, - "GetTensorboardExperiment": { - "methods": [ - "getTensorboardExperiment" - ] - }, - "UpdateTensorboardExperiment": { - "methods": [ - "updateTensorboardExperiment" - ] - }, - "CreateTensorboardRun": { - "methods": [ - "createTensorboardRun" - ] - }, - "BatchCreateTensorboardRuns": { - "methods": [ - "batchCreateTensorboardRuns" - ] - }, - "GetTensorboardRun": { - "methods": [ - "getTensorboardRun" - ] - }, - "UpdateTensorboardRun": { - "methods": [ - "updateTensorboardRun" - ] - }, - "BatchCreateTensorboardTimeSeries": { - "methods": [ - "batchCreateTensorboardTimeSeries" - ] - }, - "CreateTensorboardTimeSeries": { - "methods": [ - "createTensorboardTimeSeries" - ] - }, - "GetTensorboardTimeSeries": { - "methods": [ - "getTensorboardTimeSeries" - ] - }, - "UpdateTensorboardTimeSeries": { - "methods": [ - "updateTensorboardTimeSeries" - ] - }, - "BatchReadTensorboardTimeSeriesData": { - "methods": [ - "batchReadTensorboardTimeSeriesData" - ] - }, - "ReadTensorboardTimeSeriesData": { - "methods": [ - "readTensorboardTimeSeriesData" - ] - }, - "WriteTensorboardExperimentData": { - "methods": [ - "writeTensorboardExperimentData" - ] - }, - "WriteTensorboardRunData": { - "methods": [ - "writeTensorboardRunData" - ] - }, - "ReadTensorboardBlobData": { - "methods": [ - "readTensorboardBlobData" - ] - }, - "CreateTensorboard": { - "methods": [ - "createTensorboard" - ] - }, - "UpdateTensorboard": { - "methods": [ - "updateTensorboard" - ] - }, - "DeleteTensorboard": { - "methods": [ - "deleteTensorboard" - ] - }, - "DeleteTensorboardExperiment": { - "methods": [ - "deleteTensorboardExperiment" - ] - }, - "DeleteTensorboardRun": { - "methods": [ - "deleteTensorboardRun" - ] - }, - "DeleteTensorboardTimeSeries": { - "methods": [ - "deleteTensorboardTimeSeries" - ] - }, - "ListTensorboards": { - "methods": [ - "listTensorboards", - "listTensorboardsStream", - "listTensorboardsAsync" - ] - }, - "ListTensorboardExperiments": { - "methods": [ - "listTensorboardExperiments", - "listTensorboardExperimentsStream", - "listTensorboardExperimentsAsync" - ] - }, - "ListTensorboardRuns": { - "methods": [ - "listTensorboardRuns", - "listTensorboardRunsStream", - "listTensorboardRunsAsync" - ] - }, - "ListTensorboardTimeSeries": { - "methods": [ - "listTensorboardTimeSeries", - "listTensorboardTimeSeriesStream", - "listTensorboardTimeSeriesAsync" - ] - }, - "ExportTensorboardTimeSeriesData": { - "methods": [ - "exportTensorboardTimeSeriesData", - "exportTensorboardTimeSeriesDataStream", - "exportTensorboardTimeSeriesDataAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "TensorboardServiceClient", - "rpcs": { - "GetTensorboard": { - "methods": [ - "getTensorboard" - ] - }, - "CreateTensorboardExperiment": { - "methods": [ - "createTensorboardExperiment" - ] - }, - "GetTensorboardExperiment": { - "methods": [ - "getTensorboardExperiment" - ] - }, - "UpdateTensorboardExperiment": { - "methods": [ - "updateTensorboardExperiment" - ] - }, - "CreateTensorboardRun": { - "methods": [ - "createTensorboardRun" - ] - }, - "BatchCreateTensorboardRuns": { - "methods": [ - "batchCreateTensorboardRuns" - ] - }, - "GetTensorboardRun": { - "methods": [ - "getTensorboardRun" - ] - }, - "UpdateTensorboardRun": { - "methods": [ - "updateTensorboardRun" - ] - }, - "BatchCreateTensorboardTimeSeries": { - "methods": [ - "batchCreateTensorboardTimeSeries" - ] - }, - "CreateTensorboardTimeSeries": { - "methods": [ - "createTensorboardTimeSeries" - ] - }, - "GetTensorboardTimeSeries": { - "methods": [ - "getTensorboardTimeSeries" - ] - }, - "UpdateTensorboardTimeSeries": { - "methods": [ - "updateTensorboardTimeSeries" - ] - }, - "BatchReadTensorboardTimeSeriesData": { - "methods": [ - "batchReadTensorboardTimeSeriesData" - ] - }, - "ReadTensorboardTimeSeriesData": { - "methods": [ - "readTensorboardTimeSeriesData" - ] - }, - "WriteTensorboardExperimentData": { - "methods": [ - "writeTensorboardExperimentData" - ] - }, - "WriteTensorboardRunData": { - "methods": [ - "writeTensorboardRunData" - ] - }, - "CreateTensorboard": { - "methods": [ - "createTensorboard" - ] - }, - "UpdateTensorboard": { - "methods": [ - "updateTensorboard" - ] - }, - "DeleteTensorboard": { - "methods": [ - "deleteTensorboard" - ] - }, - "DeleteTensorboardExperiment": { - "methods": [ - "deleteTensorboardExperiment" - ] - }, - "DeleteTensorboardRun": { - "methods": [ - "deleteTensorboardRun" - ] - }, - "DeleteTensorboardTimeSeries": { - "methods": [ - "deleteTensorboardTimeSeries" - ] - }, - "ListTensorboards": { - "methods": [ - "listTensorboards", - "listTensorboardsStream", - "listTensorboardsAsync" - ] - }, - "ListTensorboardExperiments": { - "methods": [ - "listTensorboardExperiments", - "listTensorboardExperimentsStream", - "listTensorboardExperimentsAsync" - ] - }, - "ListTensorboardRuns": { - "methods": [ - "listTensorboardRuns", - "listTensorboardRunsStream", - "listTensorboardRunsAsync" - ] - }, - "ListTensorboardTimeSeries": { - "methods": [ - "listTensorboardTimeSeries", - "listTensorboardTimeSeriesStream", - "listTensorboardTimeSeriesAsync" - ] - }, - "ExportTensorboardTimeSeriesData": { - "methods": [ - "exportTensorboardTimeSeriesData", - "exportTensorboardTimeSeriesDataStream", - "exportTensorboardTimeSeriesDataAsync" - ] - } - } - } - } - }, - "VizierService": { - "clients": { - "grpc": { - "libraryClient": "VizierServiceClient", - "rpcs": { - "CreateStudy": { - "methods": [ - "createStudy" - ] - }, - "GetStudy": { - "methods": [ - "getStudy" - ] - }, - "DeleteStudy": { - "methods": [ - "deleteStudy" - ] - }, - "LookupStudy": { - "methods": [ - "lookupStudy" - ] - }, - "CreateTrial": { - "methods": [ - "createTrial" - ] - }, - "GetTrial": { - "methods": [ - "getTrial" - ] - }, - "AddTrialMeasurement": { - "methods": [ - "addTrialMeasurement" - ] - }, - "CompleteTrial": { - "methods": [ - "completeTrial" - ] - }, - "DeleteTrial": { - "methods": [ - "deleteTrial" - ] - }, - "StopTrial": { - "methods": [ - "stopTrial" - ] - }, - "ListOptimalTrials": { - "methods": [ - "listOptimalTrials" - ] - }, - "SuggestTrials": { - "methods": [ - "suggestTrials" - ] - }, - "CheckTrialEarlyStoppingState": { - "methods": [ - "checkTrialEarlyStoppingState" - ] - }, - "ListStudies": { - "methods": [ - "listStudies", - "listStudiesStream", - "listStudiesAsync" - ] - }, - "ListTrials": { - "methods": [ - "listTrials", - "listTrialsStream", - "listTrialsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "VizierServiceClient", - "rpcs": { - "CreateStudy": { - "methods": [ - "createStudy" - ] - }, - "GetStudy": { - "methods": [ - "getStudy" - ] - }, - "DeleteStudy": { - "methods": [ - "deleteStudy" - ] - }, - "LookupStudy": { - "methods": [ - "lookupStudy" - ] - }, - "CreateTrial": { - "methods": [ - "createTrial" - ] - }, - "GetTrial": { - "methods": [ - "getTrial" - ] - }, - "AddTrialMeasurement": { - "methods": [ - "addTrialMeasurement" - ] - }, - "CompleteTrial": { - "methods": [ - "completeTrial" - ] - }, - "DeleteTrial": { - "methods": [ - "deleteTrial" - ] - }, - "StopTrial": { - "methods": [ - "stopTrial" - ] - }, - "ListOptimalTrials": { - "methods": [ - "listOptimalTrials" - ] - }, - "SuggestTrials": { - "methods": [ - "suggestTrials" - ] - }, - "CheckTrialEarlyStoppingState": { - "methods": [ - "checkTrialEarlyStoppingState" - ] - }, - "ListStudies": { - "methods": [ - "listStudies", - "listStudiesStream", - "listStudiesAsync" - ] - }, - "ListTrials": { - "methods": [ - "listTrials", - "listTrialsStream", - "listTrialsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/index.ts b/owl-bot-staging/v1/src/v1/index.ts deleted file mode 100644 index e88d60a9..00000000 --- a/owl-bot-staging/v1/src/v1/index.ts +++ /dev/null @@ -1,33 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {DatasetServiceClient} from './dataset_service_client'; -export {EndpointServiceClient} from './endpoint_service_client'; -export {FeaturestoreOnlineServingServiceClient} from './featurestore_online_serving_service_client'; -export {FeaturestoreServiceClient} from './featurestore_service_client'; -export {IndexEndpointServiceClient} from './index_endpoint_service_client'; -export {IndexServiceClient} from './index_service_client'; -export {JobServiceClient} from './job_service_client'; -export {MetadataServiceClient} from './metadata_service_client'; -export {MigrationServiceClient} from './migration_service_client'; -export {ModelServiceClient} from './model_service_client'; -export {PipelineServiceClient} from './pipeline_service_client'; -export {PredictionServiceClient} from './prediction_service_client'; -export {SpecialistPoolServiceClient} from './specialist_pool_service_client'; -export {TensorboardServiceClient} from './tensorboard_service_client'; -export {VizierServiceClient} from './vizier_service_client'; diff --git a/owl-bot-staging/v1/src/v1/index_endpoint_service_client.ts b/owl-bot-staging/v1/src/v1/index_endpoint_service_client.ts deleted file mode 100644 index a1412836..00000000 --- a/owl-bot-staging/v1/src/v1/index_endpoint_service_client.ts +++ /dev/null @@ -1,3218 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/index_endpoint_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './index_endpoint_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * A service for managing Vertex AI's IndexEndpoints. - * @class - * @memberof v1 - */ -export class IndexEndpointServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - indexEndpointServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of IndexEndpointServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof IndexEndpointServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listIndexEndpoints: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'indexEndpoints') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const createIndexEndpointResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.IndexEndpoint') as gax.protobuf.Type; - const createIndexEndpointMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.CreateIndexEndpointOperationMetadata') as gax.protobuf.Type; - const deleteIndexEndpointResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteIndexEndpointMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - const deployIndexResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeployIndexResponse') as gax.protobuf.Type; - const deployIndexMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeployIndexOperationMetadata') as gax.protobuf.Type; - const undeployIndexResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.UndeployIndexResponse') as gax.protobuf.Type; - const undeployIndexMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.UndeployIndexOperationMetadata') as gax.protobuf.Type; - const mutateDeployedIndexResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.MutateDeployedIndexResponse') as gax.protobuf.Type; - const mutateDeployedIndexMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.MutateDeployedIndexOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createIndexEndpoint: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createIndexEndpointResponse.decode.bind(createIndexEndpointResponse), - createIndexEndpointMetadata.decode.bind(createIndexEndpointMetadata)), - deleteIndexEndpoint: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteIndexEndpointResponse.decode.bind(deleteIndexEndpointResponse), - deleteIndexEndpointMetadata.decode.bind(deleteIndexEndpointMetadata)), - deployIndex: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deployIndexResponse.decode.bind(deployIndexResponse), - deployIndexMetadata.decode.bind(deployIndexMetadata)), - undeployIndex: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - undeployIndexResponse.decode.bind(undeployIndexResponse), - undeployIndexMetadata.decode.bind(undeployIndexMetadata)), - mutateDeployedIndex: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - mutateDeployedIndexResponse.decode.bind(mutateDeployedIndexResponse), - mutateDeployedIndexMetadata.decode.bind(mutateDeployedIndexMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1.IndexEndpointService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.indexEndpointServiceStub) { - return this.indexEndpointServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1.IndexEndpointService. - this.indexEndpointServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.IndexEndpointService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1.IndexEndpointService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const indexEndpointServiceStubMethods = - ['createIndexEndpoint', 'getIndexEndpoint', 'listIndexEndpoints', 'updateIndexEndpoint', 'deleteIndexEndpoint', 'deployIndex', 'undeployIndex', 'mutateDeployedIndex']; - for (const methodName of indexEndpointServiceStubMethods) { - const callPromise = this.indexEndpointServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.indexEndpointServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets an IndexEndpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the IndexEndpoint resource. - * Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [IndexEndpoint]{@link google.cloud.aiplatform.v1.IndexEndpoint}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexEndpointService_GetIndexEndpoint_async - */ - getIndexEndpoint( - request?: protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest|undefined, {}|undefined - ]>; - getIndexEndpoint( - request: protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest|null|undefined, - {}|null|undefined>): void; - getIndexEndpoint( - request: protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest|null|undefined, - {}|null|undefined>): void; - getIndexEndpoint( - request?: protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1.IGetIndexEndpointRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getIndexEndpoint(request, options, callback); - } -/** - * Updates an IndexEndpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1.IndexEndpoint} request.indexEndpoint - * Required. The IndexEndpoint which replaces the resource on the server. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The update mask applies to the resource. See {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [IndexEndpoint]{@link google.cloud.aiplatform.v1.IndexEndpoint}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexEndpointService_UpdateIndexEndpoint_async - */ - updateIndexEndpoint( - request?: protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest|undefined, {}|undefined - ]>; - updateIndexEndpoint( - request: protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest|null|undefined, - {}|null|undefined>): void; - updateIndexEndpoint( - request: protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest|null|undefined, - {}|null|undefined>): void; - updateIndexEndpoint( - request?: protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1.IUpdateIndexEndpointRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'index_endpoint.name': request.indexEndpoint!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateIndexEndpoint(request, options, callback); - } - -/** - * Creates an IndexEndpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the IndexEndpoint in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1.IndexEndpoint} request.indexEndpoint - * Required. The IndexEndpoint to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexEndpointService_CreateIndexEndpoint_async - */ - createIndexEndpoint( - request?: protos.google.cloud.aiplatform.v1.ICreateIndexEndpointRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createIndexEndpoint( - request: protos.google.cloud.aiplatform.v1.ICreateIndexEndpointRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createIndexEndpoint( - request: protos.google.cloud.aiplatform.v1.ICreateIndexEndpointRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createIndexEndpoint( - request?: protos.google.cloud.aiplatform.v1.ICreateIndexEndpointRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createIndexEndpoint(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createIndexEndpoint()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexEndpointService_CreateIndexEndpoint_async - */ - async checkCreateIndexEndpointProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createIndexEndpoint, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes an IndexEndpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the IndexEndpoint resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexEndpointService_DeleteIndexEndpoint_async - */ - deleteIndexEndpoint( - request?: protos.google.cloud.aiplatform.v1.IDeleteIndexEndpointRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteIndexEndpoint( - request: protos.google.cloud.aiplatform.v1.IDeleteIndexEndpointRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteIndexEndpoint( - request: protos.google.cloud.aiplatform.v1.IDeleteIndexEndpointRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteIndexEndpoint( - request?: protos.google.cloud.aiplatform.v1.IDeleteIndexEndpointRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteIndexEndpoint(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteIndexEndpoint()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexEndpointService_DeleteIndexEndpoint_async - */ - async checkDeleteIndexEndpointProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteIndexEndpoint, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deploys an Index into this IndexEndpoint, creating a DeployedIndex within - * it. - * Only non-empty Indexes can be deployed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.indexEndpoint - * Required. The name of the IndexEndpoint resource into which to deploy an Index. - * Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param {google.cloud.aiplatform.v1.DeployedIndex} request.deployedIndex - * Required. The DeployedIndex to be created within the IndexEndpoint. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexEndpointService_DeployIndex_async - */ - deployIndex( - request?: protos.google.cloud.aiplatform.v1.IDeployIndexRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deployIndex( - request: protos.google.cloud.aiplatform.v1.IDeployIndexRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deployIndex( - request: protos.google.cloud.aiplatform.v1.IDeployIndexRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deployIndex( - request?: protos.google.cloud.aiplatform.v1.IDeployIndexRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'index_endpoint': request.indexEndpoint || '', - }); - this.initialize(); - return this.innerApiCalls.deployIndex(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deployIndex()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexEndpointService_DeployIndex_async - */ - async checkDeployIndexProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deployIndex, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Undeploys an Index from an IndexEndpoint, removing a DeployedIndex from it, - * and freeing all resources it's using. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.indexEndpoint - * Required. The name of the IndexEndpoint resource from which to undeploy an Index. - * Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param {string} request.deployedIndexId - * Required. The ID of the DeployedIndex to be undeployed from the IndexEndpoint. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexEndpointService_UndeployIndex_async - */ - undeployIndex( - request?: protos.google.cloud.aiplatform.v1.IUndeployIndexRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - undeployIndex( - request: protos.google.cloud.aiplatform.v1.IUndeployIndexRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - undeployIndex( - request: protos.google.cloud.aiplatform.v1.IUndeployIndexRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - undeployIndex( - request?: protos.google.cloud.aiplatform.v1.IUndeployIndexRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'index_endpoint': request.indexEndpoint || '', - }); - this.initialize(); - return this.innerApiCalls.undeployIndex(request, options, callback); - } -/** - * Check the status of the long running operation returned by `undeployIndex()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexEndpointService_UndeployIndex_async - */ - async checkUndeployIndexProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.undeployIndex, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Update an existing DeployedIndex under an IndexEndpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.indexEndpoint - * Required. The name of the IndexEndpoint resource into which to deploy an Index. - * Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param {google.cloud.aiplatform.v1.DeployedIndex} request.deployedIndex - * Required. The DeployedIndex to be updated within the IndexEndpoint. - * Currently, the updatable fields are {@link automatic_resources|DeployedIndex} - * and {@link dedicated_resources|DeployedIndex} - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexEndpointService_MutateDeployedIndex_async - */ - mutateDeployedIndex( - request?: protos.google.cloud.aiplatform.v1.IMutateDeployedIndexRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - mutateDeployedIndex( - request: protos.google.cloud.aiplatform.v1.IMutateDeployedIndexRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - mutateDeployedIndex( - request: protos.google.cloud.aiplatform.v1.IMutateDeployedIndexRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - mutateDeployedIndex( - request?: protos.google.cloud.aiplatform.v1.IMutateDeployedIndexRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'index_endpoint': request.indexEndpoint || '', - }); - this.initialize(); - return this.innerApiCalls.mutateDeployedIndex(request, options, callback); - } -/** - * Check the status of the long running operation returned by `mutateDeployedIndex()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexEndpointService_MutateDeployedIndex_async - */ - async checkMutateDeployedIndexProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.mutateDeployedIndex, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists IndexEndpoints in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location from which to list the IndexEndpoints. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `index_endpoint` supports = and !=. `index_endpoint` represents the - * IndexEndpoint ID, ie. the last segment of the IndexEndpoint's - * {@link google.cloud.aiplatform.v1.IndexEndpoint.name|resourcename}. - * * `display_name` supports =, != and regex() - * (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* or labels:key - key existence - * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `index_endpoint="1"` - * * `display_name="myDisplayName"` - * * `regex(display_name, "^A") -> The display name starts with an A. - * * `labels.myKey="myValue"` - * @param {number} [request.pageSize] - * Optional. The standard list page size. - * @param {string} [request.pageToken] - * Optional. The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListIndexEndpointsResponse.next_page_token|ListIndexEndpointsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.IndexEndpointService.ListIndexEndpoints|IndexEndpointService.ListIndexEndpoints} call. - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [IndexEndpoint]{@link google.cloud.aiplatform.v1.IndexEndpoint}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listIndexEndpointsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listIndexEndpoints( - request?: protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IIndexEndpoint[], - protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest|null, - protos.google.cloud.aiplatform.v1.IListIndexEndpointsResponse - ]>; - listIndexEndpoints( - request: protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, - protos.google.cloud.aiplatform.v1.IListIndexEndpointsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IIndexEndpoint>): void; - listIndexEndpoints( - request: protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, - protos.google.cloud.aiplatform.v1.IListIndexEndpointsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IIndexEndpoint>): void; - listIndexEndpoints( - request?: protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, - protos.google.cloud.aiplatform.v1.IListIndexEndpointsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IIndexEndpoint>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, - protos.google.cloud.aiplatform.v1.IListIndexEndpointsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IIndexEndpoint>): - Promise<[ - protos.google.cloud.aiplatform.v1.IIndexEndpoint[], - protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest|null, - protos.google.cloud.aiplatform.v1.IListIndexEndpointsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listIndexEndpoints(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location from which to list the IndexEndpoints. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `index_endpoint` supports = and !=. `index_endpoint` represents the - * IndexEndpoint ID, ie. the last segment of the IndexEndpoint's - * {@link google.cloud.aiplatform.v1.IndexEndpoint.name|resourcename}. - * * `display_name` supports =, != and regex() - * (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* or labels:key - key existence - * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `index_endpoint="1"` - * * `display_name="myDisplayName"` - * * `regex(display_name, "^A") -> The display name starts with an A. - * * `labels.myKey="myValue"` - * @param {number} [request.pageSize] - * Optional. The standard list page size. - * @param {string} [request.pageToken] - * Optional. The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListIndexEndpointsResponse.next_page_token|ListIndexEndpointsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.IndexEndpointService.ListIndexEndpoints|IndexEndpointService.ListIndexEndpoints} call. - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [IndexEndpoint]{@link google.cloud.aiplatform.v1.IndexEndpoint} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listIndexEndpointsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listIndexEndpointsStream( - request?: protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listIndexEndpoints']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listIndexEndpoints.createStream( - this.innerApiCalls.listIndexEndpoints as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listIndexEndpoints`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location from which to list the IndexEndpoints. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `index_endpoint` supports = and !=. `index_endpoint` represents the - * IndexEndpoint ID, ie. the last segment of the IndexEndpoint's - * {@link google.cloud.aiplatform.v1.IndexEndpoint.name|resourcename}. - * * `display_name` supports =, != and regex() - * (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* or labels:key - key existence - * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `index_endpoint="1"` - * * `display_name="myDisplayName"` - * * `regex(display_name, "^A") -> The display name starts with an A. - * * `labels.myKey="myValue"` - * @param {number} [request.pageSize] - * Optional. The standard list page size. - * @param {string} [request.pageToken] - * Optional. The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListIndexEndpointsResponse.next_page_token|ListIndexEndpointsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.IndexEndpointService.ListIndexEndpoints|IndexEndpointService.ListIndexEndpoints} call. - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [IndexEndpoint]{@link google.cloud.aiplatform.v1.IndexEndpoint}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexEndpointService_ListIndexEndpoints_async - */ - listIndexEndpointsAsync( - request?: protos.google.cloud.aiplatform.v1.IListIndexEndpointsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listIndexEndpoints']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listIndexEndpoints.asyncIterate( - this.innerApiCalls['listIndexEndpoints'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.indexEndpointServiceStub && !this._terminated) { - return this.indexEndpointServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/index_endpoint_service_client_config.json b/owl-bot-staging/v1/src/v1/index_endpoint_service_client_config.json deleted file mode 100644 index 2a6743ff..00000000 --- a/owl-bot-staging/v1/src/v1/index_endpoint_service_client_config.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1.IndexEndpointService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateIndexEndpoint": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIndexEndpoint": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListIndexEndpoints": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateIndexEndpoint": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteIndexEndpoint": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeployIndex": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UndeployIndex": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "MutateDeployedIndex": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/index_endpoint_service_proto_list.json b/owl-bot-staging/v1/src/v1/index_endpoint_service_proto_list.json deleted file mode 100644 index 581a7346..00000000 --- a/owl-bot-staging/v1/src/v1/index_endpoint_service_proto_list.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1/context.proto", - "../../protos/google/cloud/aiplatform/v1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1/event.proto", - "../../protos/google/cloud/aiplatform/v1/execution.proto", - "../../protos/google/cloud/aiplatform/v1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1/feature.proto", - "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1/index.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1/io.proto", - "../../protos/google/cloud/aiplatform/v1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1/model.proto", - "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1/operation.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1/study.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1/types.proto", - "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1/value.proto", - "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1/src/v1/index_service_client.ts b/owl-bot-staging/v1/src/v1/index_service_client.ts deleted file mode 100644 index 40090f19..00000000 --- a/owl-bot-staging/v1/src/v1/index_service_client.ts +++ /dev/null @@ -1,2884 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/index_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './index_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * A service for creating and managing Vertex AI's Index resources. - * @class - * @memberof v1 - */ -export class IndexServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - indexServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of IndexServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof IndexServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listIndexes: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'indexes') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const createIndexResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.Index') as gax.protobuf.Type; - const createIndexMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.CreateIndexOperationMetadata') as gax.protobuf.Type; - const updateIndexResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.Index') as gax.protobuf.Type; - const updateIndexMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.UpdateIndexOperationMetadata') as gax.protobuf.Type; - const deleteIndexResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteIndexMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createIndex: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createIndexResponse.decode.bind(createIndexResponse), - createIndexMetadata.decode.bind(createIndexMetadata)), - updateIndex: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateIndexResponse.decode.bind(updateIndexResponse), - updateIndexMetadata.decode.bind(updateIndexMetadata)), - deleteIndex: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteIndexResponse.decode.bind(deleteIndexResponse), - deleteIndexMetadata.decode.bind(deleteIndexMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1.IndexService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.indexServiceStub) { - return this.indexServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1.IndexService. - this.indexServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.IndexService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1.IndexService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const indexServiceStubMethods = - ['createIndex', 'getIndex', 'listIndexes', 'updateIndex', 'deleteIndex']; - for (const methodName of indexServiceStubMethods) { - const callPromise = this.indexServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.indexServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets an Index. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Index resource. - * Format: - * `projects/{project}/locations/{location}/indexes/{index}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Index]{@link google.cloud.aiplatform.v1.Index}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexService_GetIndex_async - */ - getIndex( - request?: protos.google.cloud.aiplatform.v1.IGetIndexRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IIndex, - protos.google.cloud.aiplatform.v1.IGetIndexRequest|undefined, {}|undefined - ]>; - getIndex( - request: protos.google.cloud.aiplatform.v1.IGetIndexRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IIndex, - protos.google.cloud.aiplatform.v1.IGetIndexRequest|null|undefined, - {}|null|undefined>): void; - getIndex( - request: protos.google.cloud.aiplatform.v1.IGetIndexRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IIndex, - protos.google.cloud.aiplatform.v1.IGetIndexRequest|null|undefined, - {}|null|undefined>): void; - getIndex( - request?: protos.google.cloud.aiplatform.v1.IGetIndexRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IIndex, - protos.google.cloud.aiplatform.v1.IGetIndexRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IIndex, - protos.google.cloud.aiplatform.v1.IGetIndexRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IIndex, - protos.google.cloud.aiplatform.v1.IGetIndexRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getIndex(request, options, callback); - } - -/** - * Creates an Index. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the Index in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1.Index} request.index - * Required. The Index to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexService_CreateIndex_async - */ - createIndex( - request?: protos.google.cloud.aiplatform.v1.ICreateIndexRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createIndex( - request: protos.google.cloud.aiplatform.v1.ICreateIndexRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createIndex( - request: protos.google.cloud.aiplatform.v1.ICreateIndexRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createIndex( - request?: protos.google.cloud.aiplatform.v1.ICreateIndexRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createIndex(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createIndex()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexService_CreateIndex_async - */ - async checkCreateIndexProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createIndex, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates an Index. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1.Index} request.index - * Required. The Index which updates the resource on the server. - * @param {google.protobuf.FieldMask} request.updateMask - * The update mask applies to the resource. - * For the `FieldMask` definition, see {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexService_UpdateIndex_async - */ - updateIndex( - request?: protos.google.cloud.aiplatform.v1.IUpdateIndexRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateIndex( - request: protos.google.cloud.aiplatform.v1.IUpdateIndexRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateIndex( - request: protos.google.cloud.aiplatform.v1.IUpdateIndexRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateIndex( - request?: protos.google.cloud.aiplatform.v1.IUpdateIndexRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'index.name': request.index!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateIndex(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateIndex()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexService_UpdateIndex_async - */ - async checkUpdateIndexProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateIndex, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes an Index. - * An Index can only be deleted when all its - * {@link google.cloud.aiplatform.v1.Index.deployed_indexes|DeployedIndexes} had been undeployed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Index resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/indexes/{index}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexService_DeleteIndex_async - */ - deleteIndex( - request?: protos.google.cloud.aiplatform.v1.IDeleteIndexRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteIndex( - request: protos.google.cloud.aiplatform.v1.IDeleteIndexRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteIndex( - request: protos.google.cloud.aiplatform.v1.IDeleteIndexRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteIndex( - request?: protos.google.cloud.aiplatform.v1.IDeleteIndexRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteIndex(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteIndex()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexService_DeleteIndex_async - */ - async checkDeleteIndexProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteIndex, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Indexes in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location from which to list the Indexes. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListIndexesResponse.next_page_token|ListIndexesResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.IndexService.ListIndexes|IndexService.ListIndexes} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Index]{@link google.cloud.aiplatform.v1.Index}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listIndexesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listIndexes( - request?: protos.google.cloud.aiplatform.v1.IListIndexesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IIndex[], - protos.google.cloud.aiplatform.v1.IListIndexesRequest|null, - protos.google.cloud.aiplatform.v1.IListIndexesResponse - ]>; - listIndexes( - request: protos.google.cloud.aiplatform.v1.IListIndexesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListIndexesRequest, - protos.google.cloud.aiplatform.v1.IListIndexesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IIndex>): void; - listIndexes( - request: protos.google.cloud.aiplatform.v1.IListIndexesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListIndexesRequest, - protos.google.cloud.aiplatform.v1.IListIndexesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IIndex>): void; - listIndexes( - request?: protos.google.cloud.aiplatform.v1.IListIndexesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListIndexesRequest, - protos.google.cloud.aiplatform.v1.IListIndexesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IIndex>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListIndexesRequest, - protos.google.cloud.aiplatform.v1.IListIndexesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IIndex>): - Promise<[ - protos.google.cloud.aiplatform.v1.IIndex[], - protos.google.cloud.aiplatform.v1.IListIndexesRequest|null, - protos.google.cloud.aiplatform.v1.IListIndexesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listIndexes(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location from which to list the Indexes. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListIndexesResponse.next_page_token|ListIndexesResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.IndexService.ListIndexes|IndexService.ListIndexes} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Index]{@link google.cloud.aiplatform.v1.Index} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listIndexesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listIndexesStream( - request?: protos.google.cloud.aiplatform.v1.IListIndexesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listIndexes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listIndexes.createStream( - this.innerApiCalls.listIndexes as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listIndexes`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location from which to list the Indexes. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListIndexesResponse.next_page_token|ListIndexesResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.IndexService.ListIndexes|IndexService.ListIndexes} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Index]{@link google.cloud.aiplatform.v1.Index}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_IndexService_ListIndexes_async - */ - listIndexesAsync( - request?: protos.google.cloud.aiplatform.v1.IListIndexesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listIndexes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listIndexes.asyncIterate( - this.innerApiCalls['listIndexes'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.indexServiceStub && !this._terminated) { - return this.indexServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/index_service_client_config.json b/owl-bot-staging/v1/src/v1/index_service_client_config.json deleted file mode 100644 index dcabf5f8..00000000 --- a/owl-bot-staging/v1/src/v1/index_service_client_config.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1.IndexService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateIndex": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIndex": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListIndexes": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateIndex": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteIndex": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/index_service_proto_list.json b/owl-bot-staging/v1/src/v1/index_service_proto_list.json deleted file mode 100644 index 581a7346..00000000 --- a/owl-bot-staging/v1/src/v1/index_service_proto_list.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1/context.proto", - "../../protos/google/cloud/aiplatform/v1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1/event.proto", - "../../protos/google/cloud/aiplatform/v1/execution.proto", - "../../protos/google/cloud/aiplatform/v1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1/feature.proto", - "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1/index.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1/io.proto", - "../../protos/google/cloud/aiplatform/v1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1/model.proto", - "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1/operation.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1/study.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1/types.proto", - "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1/value.proto", - "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1/src/v1/job_service_client.ts b/owl-bot-staging/v1/src/v1/job_service_client.ts deleted file mode 100644 index 22f3670d..00000000 --- a/owl-bot-staging/v1/src/v1/job_service_client.ts +++ /dev/null @@ -1,5577 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/job_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './job_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * A service for creating and managing Vertex AI's jobs. - * @class - * @memberof v1 - */ -export class JobServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - jobServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of JobServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof JobServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listCustomJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customJobs'), - listDataLabelingJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dataLabelingJobs'), - listHyperparameterTuningJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'hyperparameterTuningJobs'), - listBatchPredictionJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'batchPredictionJobs'), - searchModelDeploymentMonitoringStatsAnomalies: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'monitoringStats'), - listModelDeploymentMonitoringJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'modelDeploymentMonitoringJobs') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const deleteCustomJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteCustomJobMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - const deleteDataLabelingJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteDataLabelingJobMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - const deleteHyperparameterTuningJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteHyperparameterTuningJobMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - const deleteBatchPredictionJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteBatchPredictionJobMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - const updateModelDeploymentMonitoringJobResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob') as gax.protobuf.Type; - const updateModelDeploymentMonitoringJobMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.UpdateModelDeploymentMonitoringJobOperationMetadata') as gax.protobuf.Type; - const deleteModelDeploymentMonitoringJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteModelDeploymentMonitoringJobMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - deleteCustomJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteCustomJobResponse.decode.bind(deleteCustomJobResponse), - deleteCustomJobMetadata.decode.bind(deleteCustomJobMetadata)), - deleteDataLabelingJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteDataLabelingJobResponse.decode.bind(deleteDataLabelingJobResponse), - deleteDataLabelingJobMetadata.decode.bind(deleteDataLabelingJobMetadata)), - deleteHyperparameterTuningJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteHyperparameterTuningJobResponse.decode.bind(deleteHyperparameterTuningJobResponse), - deleteHyperparameterTuningJobMetadata.decode.bind(deleteHyperparameterTuningJobMetadata)), - deleteBatchPredictionJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteBatchPredictionJobResponse.decode.bind(deleteBatchPredictionJobResponse), - deleteBatchPredictionJobMetadata.decode.bind(deleteBatchPredictionJobMetadata)), - updateModelDeploymentMonitoringJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateModelDeploymentMonitoringJobResponse.decode.bind(updateModelDeploymentMonitoringJobResponse), - updateModelDeploymentMonitoringJobMetadata.decode.bind(updateModelDeploymentMonitoringJobMetadata)), - deleteModelDeploymentMonitoringJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteModelDeploymentMonitoringJobResponse.decode.bind(deleteModelDeploymentMonitoringJobResponse), - deleteModelDeploymentMonitoringJobMetadata.decode.bind(deleteModelDeploymentMonitoringJobMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1.JobService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.jobServiceStub) { - return this.jobServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1.JobService. - this.jobServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.JobService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1.JobService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const jobServiceStubMethods = - ['createCustomJob', 'getCustomJob', 'listCustomJobs', 'deleteCustomJob', 'cancelCustomJob', 'createDataLabelingJob', 'getDataLabelingJob', 'listDataLabelingJobs', 'deleteDataLabelingJob', 'cancelDataLabelingJob', 'createHyperparameterTuningJob', 'getHyperparameterTuningJob', 'listHyperparameterTuningJobs', 'deleteHyperparameterTuningJob', 'cancelHyperparameterTuningJob', 'createBatchPredictionJob', 'getBatchPredictionJob', 'listBatchPredictionJobs', 'deleteBatchPredictionJob', 'cancelBatchPredictionJob', 'createModelDeploymentMonitoringJob', 'searchModelDeploymentMonitoringStatsAnomalies', 'getModelDeploymentMonitoringJob', 'listModelDeploymentMonitoringJobs', 'updateModelDeploymentMonitoringJob', 'deleteModelDeploymentMonitoringJob', 'pauseModelDeploymentMonitoringJob', 'resumeModelDeploymentMonitoringJob']; - for (const methodName of jobServiceStubMethods) { - const callPromise = this.jobServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.jobServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Creates a CustomJob. A created CustomJob right away - * will be attempted to be run. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the CustomJob in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1.CustomJob} request.customJob - * Required. The CustomJob to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CustomJob]{@link google.cloud.aiplatform.v1.CustomJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_CreateCustomJob_async - */ - createCustomJob( - request?: protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ICustomJob, - protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest|undefined, {}|undefined - ]>; - createCustomJob( - request: protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ICustomJob, - protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest|null|undefined, - {}|null|undefined>): void; - createCustomJob( - request: protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ICustomJob, - protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest|null|undefined, - {}|null|undefined>): void; - createCustomJob( - request?: protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ICustomJob, - protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ICustomJob, - protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ICustomJob, - protos.google.cloud.aiplatform.v1.ICreateCustomJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createCustomJob(request, options, callback); - } -/** - * Gets a CustomJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the CustomJob resource. - * Format: - * `projects/{project}/locations/{location}/customJobs/{custom_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CustomJob]{@link google.cloud.aiplatform.v1.CustomJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_GetCustomJob_async - */ - getCustomJob( - request?: protos.google.cloud.aiplatform.v1.IGetCustomJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ICustomJob, - protos.google.cloud.aiplatform.v1.IGetCustomJobRequest|undefined, {}|undefined - ]>; - getCustomJob( - request: protos.google.cloud.aiplatform.v1.IGetCustomJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ICustomJob, - protos.google.cloud.aiplatform.v1.IGetCustomJobRequest|null|undefined, - {}|null|undefined>): void; - getCustomJob( - request: protos.google.cloud.aiplatform.v1.IGetCustomJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ICustomJob, - protos.google.cloud.aiplatform.v1.IGetCustomJobRequest|null|undefined, - {}|null|undefined>): void; - getCustomJob( - request?: protos.google.cloud.aiplatform.v1.IGetCustomJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ICustomJob, - protos.google.cloud.aiplatform.v1.IGetCustomJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ICustomJob, - protos.google.cloud.aiplatform.v1.IGetCustomJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ICustomJob, - protos.google.cloud.aiplatform.v1.IGetCustomJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getCustomJob(request, options, callback); - } -/** - * Cancels a CustomJob. - * Starts asynchronous cancellation on the CustomJob. The server - * makes a best effort to cancel the job, but success is not - * guaranteed. Clients can use {@link google.cloud.aiplatform.v1.JobService.GetCustomJob|JobService.GetCustomJob} or - * other methods to check whether the cancellation succeeded or whether the - * job completed despite cancellation. On successful cancellation, - * the CustomJob is not deleted; instead it becomes a job with - * a {@link google.cloud.aiplatform.v1.CustomJob.error|CustomJob.error} value with a {@link google.rpc.Status.code|google.rpc.Status.code} of 1, - * corresponding to `Code.CANCELLED`, and {@link google.cloud.aiplatform.v1.CustomJob.state|CustomJob.state} is set to - * `CANCELLED`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the CustomJob to cancel. - * Format: - * `projects/{project}/locations/{location}/customJobs/{custom_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_CancelCustomJob_async - */ - cancelCustomJob( - request?: protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest|undefined, {}|undefined - ]>; - cancelCustomJob( - request: protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest|null|undefined, - {}|null|undefined>): void; - cancelCustomJob( - request: protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest|null|undefined, - {}|null|undefined>): void; - cancelCustomJob( - request?: protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelCustomJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.cancelCustomJob(request, options, callback); - } -/** - * Creates a DataLabelingJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent of the DataLabelingJob. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1.DataLabelingJob} request.dataLabelingJob - * Required. The DataLabelingJob to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [DataLabelingJob]{@link google.cloud.aiplatform.v1.DataLabelingJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_CreateDataLabelingJob_async - */ - createDataLabelingJob( - request?: protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest|undefined, {}|undefined - ]>; - createDataLabelingJob( - request: protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest|null|undefined, - {}|null|undefined>): void; - createDataLabelingJob( - request: protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest|null|undefined, - {}|null|undefined>): void; - createDataLabelingJob( - request?: protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1.ICreateDataLabelingJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createDataLabelingJob(request, options, callback); - } -/** - * Gets a DataLabelingJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DataLabelingJob. - * Format: - * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [DataLabelingJob]{@link google.cloud.aiplatform.v1.DataLabelingJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_GetDataLabelingJob_async - */ - getDataLabelingJob( - request?: protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest|undefined, {}|undefined - ]>; - getDataLabelingJob( - request: protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest|null|undefined, - {}|null|undefined>): void; - getDataLabelingJob( - request: protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest|null|undefined, - {}|null|undefined>): void; - getDataLabelingJob( - request?: protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1.IGetDataLabelingJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getDataLabelingJob(request, options, callback); - } -/** - * Cancels a DataLabelingJob. Success of cancellation is not guaranteed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DataLabelingJob. - * Format: - * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_CancelDataLabelingJob_async - */ - cancelDataLabelingJob( - request?: protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest|undefined, {}|undefined - ]>; - cancelDataLabelingJob( - request: protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest|null|undefined, - {}|null|undefined>): void; - cancelDataLabelingJob( - request: protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest|null|undefined, - {}|null|undefined>): void; - cancelDataLabelingJob( - request?: protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelDataLabelingJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.cancelDataLabelingJob(request, options, callback); - } -/** - * Creates a HyperparameterTuningJob - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the HyperparameterTuningJob in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1.HyperparameterTuningJob} request.hyperparameterTuningJob - * Required. The HyperparameterTuningJob to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1.HyperparameterTuningJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_CreateHyperparameterTuningJob_async - */ - createHyperparameterTuningJob( - request?: protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest|undefined, {}|undefined - ]>; - createHyperparameterTuningJob( - request: protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>): void; - createHyperparameterTuningJob( - request: protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>): void; - createHyperparameterTuningJob( - request?: protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1.ICreateHyperparameterTuningJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createHyperparameterTuningJob(request, options, callback); - } -/** - * Gets a HyperparameterTuningJob - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the HyperparameterTuningJob resource. - * Format: - * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1.HyperparameterTuningJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_GetHyperparameterTuningJob_async - */ - getHyperparameterTuningJob( - request?: protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest|undefined, {}|undefined - ]>; - getHyperparameterTuningJob( - request: protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>): void; - getHyperparameterTuningJob( - request: protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>): void; - getHyperparameterTuningJob( - request?: protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1.IGetHyperparameterTuningJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getHyperparameterTuningJob(request, options, callback); - } -/** - * Cancels a HyperparameterTuningJob. - * Starts asynchronous cancellation on the HyperparameterTuningJob. The server - * makes a best effort to cancel the job, but success is not - * guaranteed. Clients can use {@link google.cloud.aiplatform.v1.JobService.GetHyperparameterTuningJob|JobService.GetHyperparameterTuningJob} or - * other methods to check whether the cancellation succeeded or whether the - * job completed despite cancellation. On successful cancellation, - * the HyperparameterTuningJob is not deleted; instead it becomes a job with - * a {@link google.cloud.aiplatform.v1.HyperparameterTuningJob.error|HyperparameterTuningJob.error} value with a {@link google.rpc.Status.code|google.rpc.Status.code} - * of 1, corresponding to `Code.CANCELLED`, and - * {@link google.cloud.aiplatform.v1.HyperparameterTuningJob.state|HyperparameterTuningJob.state} is set to `CANCELLED`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the HyperparameterTuningJob to cancel. - * Format: - * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_CancelHyperparameterTuningJob_async - */ - cancelHyperparameterTuningJob( - request?: protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest|undefined, {}|undefined - ]>; - cancelHyperparameterTuningJob( - request: protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>): void; - cancelHyperparameterTuningJob( - request: protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>): void; - cancelHyperparameterTuningJob( - request?: protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelHyperparameterTuningJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.cancelHyperparameterTuningJob(request, options, callback); - } -/** - * Creates a BatchPredictionJob. A BatchPredictionJob once created will - * right away be attempted to start. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the BatchPredictionJob in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1.BatchPredictionJob} request.batchPredictionJob - * Required. The BatchPredictionJob to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchPredictionJob]{@link google.cloud.aiplatform.v1.BatchPredictionJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_CreateBatchPredictionJob_async - */ - createBatchPredictionJob( - request?: protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest|undefined, {}|undefined - ]>; - createBatchPredictionJob( - request: protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest|null|undefined, - {}|null|undefined>): void; - createBatchPredictionJob( - request: protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest|null|undefined, - {}|null|undefined>): void; - createBatchPredictionJob( - request?: protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1.ICreateBatchPredictionJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createBatchPredictionJob(request, options, callback); - } -/** - * Gets a BatchPredictionJob - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the BatchPredictionJob resource. - * Format: - * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchPredictionJob]{@link google.cloud.aiplatform.v1.BatchPredictionJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_GetBatchPredictionJob_async - */ - getBatchPredictionJob( - request?: protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest|undefined, {}|undefined - ]>; - getBatchPredictionJob( - request: protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest|null|undefined, - {}|null|undefined>): void; - getBatchPredictionJob( - request: protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest|null|undefined, - {}|null|undefined>): void; - getBatchPredictionJob( - request?: protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1.IGetBatchPredictionJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getBatchPredictionJob(request, options, callback); - } -/** - * Cancels a BatchPredictionJob. - * - * Starts asynchronous cancellation on the BatchPredictionJob. The server - * makes the best effort to cancel the job, but success is not - * guaranteed. Clients can use {@link google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob|JobService.GetBatchPredictionJob} or - * other methods to check whether the cancellation succeeded or whether the - * job completed despite cancellation. On a successful cancellation, - * the BatchPredictionJob is not deleted;instead its - * {@link google.cloud.aiplatform.v1.BatchPredictionJob.state|BatchPredictionJob.state} is set to `CANCELLED`. Any files already - * outputted by the job are not deleted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the BatchPredictionJob to cancel. - * Format: - * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_CancelBatchPredictionJob_async - */ - cancelBatchPredictionJob( - request?: protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest|undefined, {}|undefined - ]>; - cancelBatchPredictionJob( - request: protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest|null|undefined, - {}|null|undefined>): void; - cancelBatchPredictionJob( - request: protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest|null|undefined, - {}|null|undefined>): void; - cancelBatchPredictionJob( - request?: protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelBatchPredictionJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.cancelBatchPredictionJob(request, options, callback); - } -/** - * Creates a ModelDeploymentMonitoringJob. It will run periodically on a - * configured interval. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent of the ModelDeploymentMonitoringJob. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob} request.modelDeploymentMonitoringJob - * Required. The ModelDeploymentMonitoringJob to create - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_CreateModelDeploymentMonitoringJob_async - */ - createModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest|undefined, {}|undefined - ]>; - createModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): void; - createModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): void; - createModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1.ICreateModelDeploymentMonitoringJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createModelDeploymentMonitoringJob(request, options, callback); - } -/** - * Gets a ModelDeploymentMonitoringJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the ModelDeploymentMonitoringJob. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_GetModelDeploymentMonitoringJob_async - */ - getModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest|undefined, {}|undefined - ]>; - getModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): void; - getModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): void; - getModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1.IGetModelDeploymentMonitoringJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getModelDeploymentMonitoringJob(request, options, callback); - } -/** - * Pauses a ModelDeploymentMonitoringJob. If the job is running, the server - * makes a best effort to cancel the job. Will mark - * {@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.state|ModelDeploymentMonitoringJob.state} to 'PAUSED'. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the ModelDeploymentMonitoringJob to pause. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_PauseModelDeploymentMonitoringJob_async - */ - pauseModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest|undefined, {}|undefined - ]>; - pauseModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): void; - pauseModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): void; - pauseModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IPauseModelDeploymentMonitoringJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.pauseModelDeploymentMonitoringJob(request, options, callback); - } -/** - * Resumes a paused ModelDeploymentMonitoringJob. It will start to run from - * next scheduled time. A deleted ModelDeploymentMonitoringJob can't be - * resumed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the ModelDeploymentMonitoringJob to resume. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_ResumeModelDeploymentMonitoringJob_async - */ - resumeModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest|undefined, {}|undefined - ]>; - resumeModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): void; - resumeModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): void; - resumeModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IResumeModelDeploymentMonitoringJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.resumeModelDeploymentMonitoringJob(request, options, callback); - } - -/** - * Deletes a CustomJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the CustomJob resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/customJobs/{custom_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_DeleteCustomJob_async - */ - deleteCustomJob( - request?: protos.google.cloud.aiplatform.v1.IDeleteCustomJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteCustomJob( - request: protos.google.cloud.aiplatform.v1.IDeleteCustomJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteCustomJob( - request: protos.google.cloud.aiplatform.v1.IDeleteCustomJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteCustomJob( - request?: protos.google.cloud.aiplatform.v1.IDeleteCustomJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteCustomJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteCustomJob()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_DeleteCustomJob_async - */ - async checkDeleteCustomJobProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteCustomJob, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a DataLabelingJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DataLabelingJob to be deleted. - * Format: - * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_DeleteDataLabelingJob_async - */ - deleteDataLabelingJob( - request?: protos.google.cloud.aiplatform.v1.IDeleteDataLabelingJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteDataLabelingJob( - request: protos.google.cloud.aiplatform.v1.IDeleteDataLabelingJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteDataLabelingJob( - request: protos.google.cloud.aiplatform.v1.IDeleteDataLabelingJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteDataLabelingJob( - request?: protos.google.cloud.aiplatform.v1.IDeleteDataLabelingJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteDataLabelingJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteDataLabelingJob()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_DeleteDataLabelingJob_async - */ - async checkDeleteDataLabelingJobProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteDataLabelingJob, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a HyperparameterTuningJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the HyperparameterTuningJob resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_DeleteHyperparameterTuningJob_async - */ - deleteHyperparameterTuningJob( - request?: protos.google.cloud.aiplatform.v1.IDeleteHyperparameterTuningJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteHyperparameterTuningJob( - request: protos.google.cloud.aiplatform.v1.IDeleteHyperparameterTuningJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteHyperparameterTuningJob( - request: protos.google.cloud.aiplatform.v1.IDeleteHyperparameterTuningJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteHyperparameterTuningJob( - request?: protos.google.cloud.aiplatform.v1.IDeleteHyperparameterTuningJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteHyperparameterTuningJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteHyperparameterTuningJob()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_DeleteHyperparameterTuningJob_async - */ - async checkDeleteHyperparameterTuningJobProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteHyperparameterTuningJob, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a BatchPredictionJob. Can only be called on jobs that already - * finished. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the BatchPredictionJob resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_DeleteBatchPredictionJob_async - */ - deleteBatchPredictionJob( - request?: protos.google.cloud.aiplatform.v1.IDeleteBatchPredictionJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteBatchPredictionJob( - request: protos.google.cloud.aiplatform.v1.IDeleteBatchPredictionJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteBatchPredictionJob( - request: protos.google.cloud.aiplatform.v1.IDeleteBatchPredictionJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteBatchPredictionJob( - request?: protos.google.cloud.aiplatform.v1.IDeleteBatchPredictionJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteBatchPredictionJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteBatchPredictionJob()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_DeleteBatchPredictionJob_async - */ - async checkDeleteBatchPredictionJobProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteBatchPredictionJob, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates a ModelDeploymentMonitoringJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob} request.modelDeploymentMonitoringJob - * Required. The model monitoring configuration which replaces the resource on the - * server. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The update mask is used to specify the fields to be overwritten in the - * ModelDeploymentMonitoringJob resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then only the non-empty fields present in the - * request will be overwritten. Set the update_mask to `*` to override all - * fields. - * For the objective config, the user can either provide the update mask for - * model_deployment_monitoring_objective_configs or any combination of its - * nested fields, such as: - * model_deployment_monitoring_objective_configs.objective_config.training_dataset. - * - * Updatable fields: - * - * * `display_name` - * * `model_deployment_monitoring_schedule_config` - * * `model_monitoring_alert_config` - * * `logging_sampling_strategy` - * * `labels` - * * `log_ttl` - * * `enable_monitoring_pipeline_logs` - * . and - * * `model_deployment_monitoring_objective_configs` - * . or - * * `model_deployment_monitoring_objective_configs.objective_config.training_dataset` - * * `model_deployment_monitoring_objective_configs.objective_config.training_prediction_skew_detection_config` - * * `model_deployment_monitoring_objective_configs.objective_config.prediction_drift_detection_config` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_UpdateModelDeploymentMonitoringJob_async - */ - updateModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1.IUpdateModelDeploymentMonitoringJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1.IUpdateModelDeploymentMonitoringJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1.IUpdateModelDeploymentMonitoringJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1.IUpdateModelDeploymentMonitoringJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'model_deployment_monitoring_job.name': request.modelDeploymentMonitoringJob!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateModelDeploymentMonitoringJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateModelDeploymentMonitoringJob()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_UpdateModelDeploymentMonitoringJob_async - */ - async checkUpdateModelDeploymentMonitoringJobProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateModelDeploymentMonitoringJob, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a ModelDeploymentMonitoringJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the model monitoring job to delete. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_DeleteModelDeploymentMonitoringJob_async - */ - deleteModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1.IDeleteModelDeploymentMonitoringJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1.IDeleteModelDeploymentMonitoringJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1.IDeleteModelDeploymentMonitoringJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1.IDeleteModelDeploymentMonitoringJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteModelDeploymentMonitoringJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteModelDeploymentMonitoringJob()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_DeleteModelDeploymentMonitoringJob_async - */ - async checkDeleteModelDeploymentMonitoringJobProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteModelDeploymentMonitoringJob, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists CustomJobs in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the CustomJobs from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListCustomJobsResponse.next_page_token|ListCustomJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.JobService.ListCustomJobs|JobService.ListCustomJobs} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [CustomJob]{@link google.cloud.aiplatform.v1.CustomJob}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listCustomJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listCustomJobs( - request?: protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ICustomJob[], - protos.google.cloud.aiplatform.v1.IListCustomJobsRequest|null, - protos.google.cloud.aiplatform.v1.IListCustomJobsResponse - ]>; - listCustomJobs( - request: protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, - protos.google.cloud.aiplatform.v1.IListCustomJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ICustomJob>): void; - listCustomJobs( - request: protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, - protos.google.cloud.aiplatform.v1.IListCustomJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ICustomJob>): void; - listCustomJobs( - request?: protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, - protos.google.cloud.aiplatform.v1.IListCustomJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ICustomJob>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, - protos.google.cloud.aiplatform.v1.IListCustomJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ICustomJob>): - Promise<[ - protos.google.cloud.aiplatform.v1.ICustomJob[], - protos.google.cloud.aiplatform.v1.IListCustomJobsRequest|null, - protos.google.cloud.aiplatform.v1.IListCustomJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listCustomJobs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the CustomJobs from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListCustomJobsResponse.next_page_token|ListCustomJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.JobService.ListCustomJobs|JobService.ListCustomJobs} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [CustomJob]{@link google.cloud.aiplatform.v1.CustomJob} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listCustomJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listCustomJobsStream( - request?: protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listCustomJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listCustomJobs.createStream( - this.innerApiCalls.listCustomJobs as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listCustomJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the CustomJobs from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListCustomJobsResponse.next_page_token|ListCustomJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.JobService.ListCustomJobs|JobService.ListCustomJobs} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [CustomJob]{@link google.cloud.aiplatform.v1.CustomJob}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_ListCustomJobs_async - */ - listCustomJobsAsync( - request?: protos.google.cloud.aiplatform.v1.IListCustomJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listCustomJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listCustomJobs.asyncIterate( - this.innerApiCalls['listCustomJobs'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists DataLabelingJobs in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent of the DataLabelingJob. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. FieldMask represents a set of - * symbolic field paths. For example, the mask can be `paths: "name"`. The - * "name" here is a field in DataLabelingJob. - * If this field is not set, all fields of the DataLabelingJob are returned. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order by - * default. - * Use `desc` after a field name for descending. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [DataLabelingJob]{@link google.cloud.aiplatform.v1.DataLabelingJob}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDataLabelingJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDataLabelingJobs( - request?: protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IDataLabelingJob[], - protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest|null, - protos.google.cloud.aiplatform.v1.IListDataLabelingJobsResponse - ]>; - listDataLabelingJobs( - request: protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, - protos.google.cloud.aiplatform.v1.IListDataLabelingJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IDataLabelingJob>): void; - listDataLabelingJobs( - request: protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, - protos.google.cloud.aiplatform.v1.IListDataLabelingJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IDataLabelingJob>): void; - listDataLabelingJobs( - request?: protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, - protos.google.cloud.aiplatform.v1.IListDataLabelingJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IDataLabelingJob>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, - protos.google.cloud.aiplatform.v1.IListDataLabelingJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IDataLabelingJob>): - Promise<[ - protos.google.cloud.aiplatform.v1.IDataLabelingJob[], - protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest|null, - protos.google.cloud.aiplatform.v1.IListDataLabelingJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listDataLabelingJobs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent of the DataLabelingJob. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. FieldMask represents a set of - * symbolic field paths. For example, the mask can be `paths: "name"`. The - * "name" here is a field in DataLabelingJob. - * If this field is not set, all fields of the DataLabelingJob are returned. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order by - * default. - * Use `desc` after a field name for descending. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [DataLabelingJob]{@link google.cloud.aiplatform.v1.DataLabelingJob} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDataLabelingJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDataLabelingJobsStream( - request?: protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDataLabelingJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDataLabelingJobs.createStream( - this.innerApiCalls.listDataLabelingJobs as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDataLabelingJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent of the DataLabelingJob. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. FieldMask represents a set of - * symbolic field paths. For example, the mask can be `paths: "name"`. The - * "name" here is a field in DataLabelingJob. - * If this field is not set, all fields of the DataLabelingJob are returned. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order by - * default. - * Use `desc` after a field name for descending. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [DataLabelingJob]{@link google.cloud.aiplatform.v1.DataLabelingJob}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_ListDataLabelingJobs_async - */ - listDataLabelingJobsAsync( - request?: protos.google.cloud.aiplatform.v1.IListDataLabelingJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDataLabelingJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDataLabelingJobs.asyncIterate( - this.innerApiCalls['listDataLabelingJobs'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists HyperparameterTuningJobs in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the HyperparameterTuningJobs - * from. Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListHyperparameterTuningJobsResponse.next_page_token|ListHyperparameterTuningJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.JobService.ListHyperparameterTuningJobs|JobService.ListHyperparameterTuningJobs} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1.HyperparameterTuningJob}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listHyperparameterTuningJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listHyperparameterTuningJobs( - request?: protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob[], - protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest|null, - protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsResponse - ]>; - listHyperparameterTuningJobs( - request: protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, - protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob>): void; - listHyperparameterTuningJobs( - request: protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, - protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob>): void; - listHyperparameterTuningJobs( - request?: protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, - protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, - protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob>): - Promise<[ - protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob[], - protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest|null, - protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listHyperparameterTuningJobs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the HyperparameterTuningJobs - * from. Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListHyperparameterTuningJobsResponse.next_page_token|ListHyperparameterTuningJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.JobService.ListHyperparameterTuningJobs|JobService.ListHyperparameterTuningJobs} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1.HyperparameterTuningJob} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listHyperparameterTuningJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listHyperparameterTuningJobsStream( - request?: protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listHyperparameterTuningJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listHyperparameterTuningJobs.createStream( - this.innerApiCalls.listHyperparameterTuningJobs as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listHyperparameterTuningJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the HyperparameterTuningJobs - * from. Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListHyperparameterTuningJobsResponse.next_page_token|ListHyperparameterTuningJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.JobService.ListHyperparameterTuningJobs|JobService.ListHyperparameterTuningJobs} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1.HyperparameterTuningJob}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_ListHyperparameterTuningJobs_async - */ - listHyperparameterTuningJobsAsync( - request?: protos.google.cloud.aiplatform.v1.IListHyperparameterTuningJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listHyperparameterTuningJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listHyperparameterTuningJobs.asyncIterate( - this.innerApiCalls['listHyperparameterTuningJobs'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists BatchPredictionJobs in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the BatchPredictionJobs - * from. Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * * `model_display_name` supports = and != - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListBatchPredictionJobsResponse.next_page_token|ListBatchPredictionJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.JobService.ListBatchPredictionJobs|JobService.ListBatchPredictionJobs} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [BatchPredictionJob]{@link google.cloud.aiplatform.v1.BatchPredictionJob}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listBatchPredictionJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listBatchPredictionJobs( - request?: protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IBatchPredictionJob[], - protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest|null, - protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsResponse - ]>; - listBatchPredictionJobs( - request: protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, - protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IBatchPredictionJob>): void; - listBatchPredictionJobs( - request: protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, - protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IBatchPredictionJob>): void; - listBatchPredictionJobs( - request?: protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, - protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IBatchPredictionJob>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, - protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IBatchPredictionJob>): - Promise<[ - protos.google.cloud.aiplatform.v1.IBatchPredictionJob[], - protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest|null, - protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listBatchPredictionJobs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the BatchPredictionJobs - * from. Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * * `model_display_name` supports = and != - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListBatchPredictionJobsResponse.next_page_token|ListBatchPredictionJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.JobService.ListBatchPredictionJobs|JobService.ListBatchPredictionJobs} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [BatchPredictionJob]{@link google.cloud.aiplatform.v1.BatchPredictionJob} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listBatchPredictionJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listBatchPredictionJobsStream( - request?: protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listBatchPredictionJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listBatchPredictionJobs.createStream( - this.innerApiCalls.listBatchPredictionJobs as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listBatchPredictionJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the BatchPredictionJobs - * from. Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * * `model_display_name` supports = and != - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListBatchPredictionJobsResponse.next_page_token|ListBatchPredictionJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.JobService.ListBatchPredictionJobs|JobService.ListBatchPredictionJobs} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [BatchPredictionJob]{@link google.cloud.aiplatform.v1.BatchPredictionJob}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_ListBatchPredictionJobs_async - */ - listBatchPredictionJobsAsync( - request?: protos.google.cloud.aiplatform.v1.IListBatchPredictionJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listBatchPredictionJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listBatchPredictionJobs.asyncIterate( - this.innerApiCalls['listBatchPredictionJobs'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Searches Model Monitoring Statistics generated within a given time window. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.modelDeploymentMonitoringJob - * Required. ModelDeploymentMonitoring Job resource name. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param {string} request.deployedModelId - * Required. The DeployedModel ID of the - * [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. - * @param {string} request.featureDisplayName - * The feature display name. If specified, only return the stats belonging to - * this feature. Format: - * {@link google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name|ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name}, - * example: "user_destination". - * @param {number[]} request.objectives - * Required. Objectives of the stats to retrieve. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * A page token received from a previous - * {@link google.cloud.aiplatform.v1.JobService.SearchModelDeploymentMonitoringStatsAnomalies|JobService.SearchModelDeploymentMonitoringStatsAnomalies} - * call. - * @param {google.protobuf.Timestamp} request.startTime - * The earliest timestamp of stats being generated. - * If not set, indicates fetching stats till the earliest possible one. - * @param {google.protobuf.Timestamp} request.endTime - * The latest timestamp of stats being generated. - * If not set, indicates feching stats till the latest possible one. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [ModelMonitoringStatsAnomalies]{@link google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `searchModelDeploymentMonitoringStatsAnomaliesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - searchModelDeploymentMonitoringStatsAnomalies( - request?: protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IModelMonitoringStatsAnomalies[], - protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest|null, - protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse - ]>; - searchModelDeploymentMonitoringStatsAnomalies( - request: protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModelMonitoringStatsAnomalies>): void; - searchModelDeploymentMonitoringStatsAnomalies( - request: protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModelMonitoringStatsAnomalies>): void; - searchModelDeploymentMonitoringStatsAnomalies( - request?: protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModelMonitoringStatsAnomalies>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModelMonitoringStatsAnomalies>): - Promise<[ - protos.google.cloud.aiplatform.v1.IModelMonitoringStatsAnomalies[], - protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest|null, - protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'model_deployment_monitoring_job': request.modelDeploymentMonitoringJob || '', - }); - this.initialize(); - return this.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.modelDeploymentMonitoringJob - * Required. ModelDeploymentMonitoring Job resource name. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param {string} request.deployedModelId - * Required. The DeployedModel ID of the - * [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. - * @param {string} request.featureDisplayName - * The feature display name. If specified, only return the stats belonging to - * this feature. Format: - * {@link google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name|ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name}, - * example: "user_destination". - * @param {number[]} request.objectives - * Required. Objectives of the stats to retrieve. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * A page token received from a previous - * {@link google.cloud.aiplatform.v1.JobService.SearchModelDeploymentMonitoringStatsAnomalies|JobService.SearchModelDeploymentMonitoringStatsAnomalies} - * call. - * @param {google.protobuf.Timestamp} request.startTime - * The earliest timestamp of stats being generated. - * If not set, indicates fetching stats till the earliest possible one. - * @param {google.protobuf.Timestamp} request.endTime - * The latest timestamp of stats being generated. - * If not set, indicates feching stats till the latest possible one. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [ModelMonitoringStatsAnomalies]{@link google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `searchModelDeploymentMonitoringStatsAnomaliesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - searchModelDeploymentMonitoringStatsAnomaliesStream( - request?: protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'model_deployment_monitoring_job': request.modelDeploymentMonitoringJob || '', - }); - const defaultCallSettings = this._defaults['searchModelDeploymentMonitoringStatsAnomalies']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream( - this.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `searchModelDeploymentMonitoringStatsAnomalies`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.modelDeploymentMonitoringJob - * Required. ModelDeploymentMonitoring Job resource name. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param {string} request.deployedModelId - * Required. The DeployedModel ID of the - * [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. - * @param {string} request.featureDisplayName - * The feature display name. If specified, only return the stats belonging to - * this feature. Format: - * {@link google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name|ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name}, - * example: "user_destination". - * @param {number[]} request.objectives - * Required. Objectives of the stats to retrieve. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * A page token received from a previous - * {@link google.cloud.aiplatform.v1.JobService.SearchModelDeploymentMonitoringStatsAnomalies|JobService.SearchModelDeploymentMonitoringStatsAnomalies} - * call. - * @param {google.protobuf.Timestamp} request.startTime - * The earliest timestamp of stats being generated. - * If not set, indicates fetching stats till the earliest possible one. - * @param {google.protobuf.Timestamp} request.endTime - * The latest timestamp of stats being generated. - * If not set, indicates feching stats till the latest possible one. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [ModelMonitoringStatsAnomalies]{@link google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_SearchModelDeploymentMonitoringStatsAnomalies_async - */ - searchModelDeploymentMonitoringStatsAnomaliesAsync( - request?: protos.google.cloud.aiplatform.v1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'model_deployment_monitoring_job': request.modelDeploymentMonitoringJob || '', - }); - const defaultCallSettings = this._defaults['searchModelDeploymentMonitoringStatsAnomalies']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate( - this.innerApiCalls['searchModelDeploymentMonitoringStatsAnomalies'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists ModelDeploymentMonitoringJobs in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent of the ModelDeploymentMonitoringJob. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listModelDeploymentMonitoringJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listModelDeploymentMonitoringJobs( - request?: protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob[], - protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest|null, - protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsResponse - ]>; - listModelDeploymentMonitoringJobs( - request: protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, - protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob>): void; - listModelDeploymentMonitoringJobs( - request: protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, - protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob>): void; - listModelDeploymentMonitoringJobs( - request?: protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, - protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, - protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob>): - Promise<[ - protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob[], - protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest|null, - protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listModelDeploymentMonitoringJobs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent of the ModelDeploymentMonitoringJob. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listModelDeploymentMonitoringJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listModelDeploymentMonitoringJobsStream( - request?: protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listModelDeploymentMonitoringJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listModelDeploymentMonitoringJobs.createStream( - this.innerApiCalls.listModelDeploymentMonitoringJobs as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listModelDeploymentMonitoringJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent of the ModelDeploymentMonitoringJob. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_JobService_ListModelDeploymentMonitoringJobs_async - */ - listModelDeploymentMonitoringJobsAsync( - request?: protos.google.cloud.aiplatform.v1.IListModelDeploymentMonitoringJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listModelDeploymentMonitoringJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate( - this.innerApiCalls['listModelDeploymentMonitoringJobs'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.jobServiceStub && !this._terminated) { - return this.jobServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/job_service_client_config.json b/owl-bot-staging/v1/src/v1/job_service_client_config.json deleted file mode 100644 index 0d72482c..00000000 --- a/owl-bot-staging/v1/src/v1/job_service_client_config.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1.JobService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateCustomJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetCustomJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListCustomJobs": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteCustomJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelCustomJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateDataLabelingJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetDataLabelingJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListDataLabelingJobs": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteDataLabelingJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelDataLabelingJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateHyperparameterTuningJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetHyperparameterTuningJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListHyperparameterTuningJobs": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteHyperparameterTuningJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelHyperparameterTuningJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateBatchPredictionJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetBatchPredictionJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListBatchPredictionJobs": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteBatchPredictionJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelBatchPredictionJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateModelDeploymentMonitoringJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SearchModelDeploymentMonitoringStatsAnomalies": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetModelDeploymentMonitoringJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListModelDeploymentMonitoringJobs": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateModelDeploymentMonitoringJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteModelDeploymentMonitoringJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PauseModelDeploymentMonitoringJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ResumeModelDeploymentMonitoringJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/job_service_proto_list.json b/owl-bot-staging/v1/src/v1/job_service_proto_list.json deleted file mode 100644 index 581a7346..00000000 --- a/owl-bot-staging/v1/src/v1/job_service_proto_list.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1/context.proto", - "../../protos/google/cloud/aiplatform/v1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1/event.proto", - "../../protos/google/cloud/aiplatform/v1/execution.proto", - "../../protos/google/cloud/aiplatform/v1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1/feature.proto", - "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1/index.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1/io.proto", - "../../protos/google/cloud/aiplatform/v1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1/model.proto", - "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1/operation.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1/study.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1/types.proto", - "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1/value.proto", - "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1/src/v1/metadata_service_client.ts b/owl-bot-staging/v1/src/v1/metadata_service_client.ts deleted file mode 100644 index 780c1264..00000000 --- a/owl-bot-staging/v1/src/v1/metadata_service_client.ts +++ /dev/null @@ -1,5917 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/metadata_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './metadata_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * Service for reading and writing metadata entries. - * @class - * @memberof v1 - */ -export class MetadataServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - metadataServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of MetadataServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof MetadataServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listMetadataStores: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'metadataStores'), - listArtifacts: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'artifacts'), - listContexts: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'contexts'), - listExecutions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'executions'), - listMetadataSchemas: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'metadataSchemas') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const createMetadataStoreResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.MetadataStore') as gax.protobuf.Type; - const createMetadataStoreMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.CreateMetadataStoreOperationMetadata') as gax.protobuf.Type; - const deleteMetadataStoreResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteMetadataStoreMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteMetadataStoreOperationMetadata') as gax.protobuf.Type; - const deleteArtifactResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteArtifactMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - const purgeArtifactsResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.PurgeArtifactsResponse') as gax.protobuf.Type; - const purgeArtifactsMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.PurgeArtifactsMetadata') as gax.protobuf.Type; - const deleteContextResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteContextMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - const purgeContextsResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.PurgeContextsResponse') as gax.protobuf.Type; - const purgeContextsMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.PurgeContextsMetadata') as gax.protobuf.Type; - const deleteExecutionResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteExecutionMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - const purgeExecutionsResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.PurgeExecutionsResponse') as gax.protobuf.Type; - const purgeExecutionsMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.PurgeExecutionsMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createMetadataStore: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createMetadataStoreResponse.decode.bind(createMetadataStoreResponse), - createMetadataStoreMetadata.decode.bind(createMetadataStoreMetadata)), - deleteMetadataStore: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteMetadataStoreResponse.decode.bind(deleteMetadataStoreResponse), - deleteMetadataStoreMetadata.decode.bind(deleteMetadataStoreMetadata)), - deleteArtifact: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteArtifactResponse.decode.bind(deleteArtifactResponse), - deleteArtifactMetadata.decode.bind(deleteArtifactMetadata)), - purgeArtifacts: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - purgeArtifactsResponse.decode.bind(purgeArtifactsResponse), - purgeArtifactsMetadata.decode.bind(purgeArtifactsMetadata)), - deleteContext: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteContextResponse.decode.bind(deleteContextResponse), - deleteContextMetadata.decode.bind(deleteContextMetadata)), - purgeContexts: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - purgeContextsResponse.decode.bind(purgeContextsResponse), - purgeContextsMetadata.decode.bind(purgeContextsMetadata)), - deleteExecution: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteExecutionResponse.decode.bind(deleteExecutionResponse), - deleteExecutionMetadata.decode.bind(deleteExecutionMetadata)), - purgeExecutions: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - purgeExecutionsResponse.decode.bind(purgeExecutionsResponse), - purgeExecutionsMetadata.decode.bind(purgeExecutionsMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1.MetadataService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.metadataServiceStub) { - return this.metadataServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1.MetadataService. - this.metadataServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.MetadataService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1.MetadataService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const metadataServiceStubMethods = - ['createMetadataStore', 'getMetadataStore', 'listMetadataStores', 'deleteMetadataStore', 'createArtifact', 'getArtifact', 'listArtifacts', 'updateArtifact', 'deleteArtifact', 'purgeArtifacts', 'createContext', 'getContext', 'listContexts', 'updateContext', 'deleteContext', 'purgeContexts', 'addContextArtifactsAndExecutions', 'addContextChildren', 'queryContextLineageSubgraph', 'createExecution', 'getExecution', 'listExecutions', 'updateExecution', 'deleteExecution', 'purgeExecutions', 'addExecutionEvents', 'queryExecutionInputsAndOutputs', 'createMetadataSchema', 'getMetadataSchema', 'listMetadataSchemas', 'queryArtifactLineageSubgraph']; - for (const methodName of metadataServiceStubMethods) { - const callPromise = this.metadataServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.metadataServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Retrieves a specific MetadataStore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the MetadataStore to retrieve. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [MetadataStore]{@link google.cloud.aiplatform.v1.MetadataStore}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_GetMetadataStore_async - */ - getMetadataStore( - request?: protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IMetadataStore, - protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest|undefined, {}|undefined - ]>; - getMetadataStore( - request: protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IMetadataStore, - protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest|null|undefined, - {}|null|undefined>): void; - getMetadataStore( - request: protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IMetadataStore, - protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest|null|undefined, - {}|null|undefined>): void; - getMetadataStore( - request?: protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IMetadataStore, - protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IMetadataStore, - protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IMetadataStore, - protos.google.cloud.aiplatform.v1.IGetMetadataStoreRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getMetadataStore(request, options, callback); - } -/** - * Creates an Artifact associated with a MetadataStore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the MetadataStore where the Artifact should - * be created. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {google.cloud.aiplatform.v1.Artifact} request.artifact - * Required. The Artifact to create. - * @param {string} request.artifactId - * The {artifact} portion of the resource name with the format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - * If not provided, the Artifact's ID will be a UUID generated by the service. - * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. - * Must be unique across all Artifacts in the parent MetadataStore. (Otherwise - * the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the - * caller can't view the preexisting Artifact.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Artifact]{@link google.cloud.aiplatform.v1.Artifact}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_CreateArtifact_async - */ - createArtifact( - request?: protos.google.cloud.aiplatform.v1.ICreateArtifactRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IArtifact, - protos.google.cloud.aiplatform.v1.ICreateArtifactRequest|undefined, {}|undefined - ]>; - createArtifact( - request: protos.google.cloud.aiplatform.v1.ICreateArtifactRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IArtifact, - protos.google.cloud.aiplatform.v1.ICreateArtifactRequest|null|undefined, - {}|null|undefined>): void; - createArtifact( - request: protos.google.cloud.aiplatform.v1.ICreateArtifactRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IArtifact, - protos.google.cloud.aiplatform.v1.ICreateArtifactRequest|null|undefined, - {}|null|undefined>): void; - createArtifact( - request?: protos.google.cloud.aiplatform.v1.ICreateArtifactRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IArtifact, - protos.google.cloud.aiplatform.v1.ICreateArtifactRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IArtifact, - protos.google.cloud.aiplatform.v1.ICreateArtifactRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IArtifact, - protos.google.cloud.aiplatform.v1.ICreateArtifactRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createArtifact(request, options, callback); - } -/** - * Retrieves a specific Artifact. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Artifact to retrieve. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Artifact]{@link google.cloud.aiplatform.v1.Artifact}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_GetArtifact_async - */ - getArtifact( - request?: protos.google.cloud.aiplatform.v1.IGetArtifactRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IArtifact, - protos.google.cloud.aiplatform.v1.IGetArtifactRequest|undefined, {}|undefined - ]>; - getArtifact( - request: protos.google.cloud.aiplatform.v1.IGetArtifactRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IArtifact, - protos.google.cloud.aiplatform.v1.IGetArtifactRequest|null|undefined, - {}|null|undefined>): void; - getArtifact( - request: protos.google.cloud.aiplatform.v1.IGetArtifactRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IArtifact, - protos.google.cloud.aiplatform.v1.IGetArtifactRequest|null|undefined, - {}|null|undefined>): void; - getArtifact( - request?: protos.google.cloud.aiplatform.v1.IGetArtifactRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IArtifact, - protos.google.cloud.aiplatform.v1.IGetArtifactRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IArtifact, - protos.google.cloud.aiplatform.v1.IGetArtifactRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IArtifact, - protos.google.cloud.aiplatform.v1.IGetArtifactRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getArtifact(request, options, callback); - } -/** - * Updates a stored Artifact. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1.Artifact} request.artifact - * Required. The Artifact containing updates. - * The Artifact's {@link google.cloud.aiplatform.v1.Artifact.name|Artifact.name} field is used to identify the Artifact to - * be updated. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. A FieldMask indicating which fields should be updated. - * Functionality of this field is not yet supported. - * @param {boolean} request.allowMissing - * If set to true, and the {@link google.cloud.aiplatform.v1.Artifact|Artifact} is not found, a new {@link google.cloud.aiplatform.v1.Artifact|Artifact} is - * created. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Artifact]{@link google.cloud.aiplatform.v1.Artifact}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_UpdateArtifact_async - */ - updateArtifact( - request?: protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IArtifact, - protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest|undefined, {}|undefined - ]>; - updateArtifact( - request: protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IArtifact, - protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest|null|undefined, - {}|null|undefined>): void; - updateArtifact( - request: protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IArtifact, - protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest|null|undefined, - {}|null|undefined>): void; - updateArtifact( - request?: protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IArtifact, - protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IArtifact, - protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IArtifact, - protos.google.cloud.aiplatform.v1.IUpdateArtifactRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'artifact.name': request.artifact!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateArtifact(request, options, callback); - } -/** - * Creates a Context associated with a MetadataStore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the MetadataStore where the Context should be - * created. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {google.cloud.aiplatform.v1.Context} request.context - * Required. The Context to create. - * @param {string} request.contextId - * The {context} portion of the resource name with the format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`. - * If not provided, the Context's ID will be a UUID generated by the service. - * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. - * Must be unique across all Contexts in the parent MetadataStore. (Otherwise - * the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the - * caller can't view the preexisting Context.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Context]{@link google.cloud.aiplatform.v1.Context}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_CreateContext_async - */ - createContext( - request?: protos.google.cloud.aiplatform.v1.ICreateContextRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IContext, - protos.google.cloud.aiplatform.v1.ICreateContextRequest|undefined, {}|undefined - ]>; - createContext( - request: protos.google.cloud.aiplatform.v1.ICreateContextRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IContext, - protos.google.cloud.aiplatform.v1.ICreateContextRequest|null|undefined, - {}|null|undefined>): void; - createContext( - request: protos.google.cloud.aiplatform.v1.ICreateContextRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IContext, - protos.google.cloud.aiplatform.v1.ICreateContextRequest|null|undefined, - {}|null|undefined>): void; - createContext( - request?: protos.google.cloud.aiplatform.v1.ICreateContextRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IContext, - protos.google.cloud.aiplatform.v1.ICreateContextRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IContext, - protos.google.cloud.aiplatform.v1.ICreateContextRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IContext, - protos.google.cloud.aiplatform.v1.ICreateContextRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createContext(request, options, callback); - } -/** - * Retrieves a specific Context. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Context to retrieve. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Context]{@link google.cloud.aiplatform.v1.Context}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_GetContext_async - */ - getContext( - request?: protos.google.cloud.aiplatform.v1.IGetContextRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IContext, - protos.google.cloud.aiplatform.v1.IGetContextRequest|undefined, {}|undefined - ]>; - getContext( - request: protos.google.cloud.aiplatform.v1.IGetContextRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IContext, - protos.google.cloud.aiplatform.v1.IGetContextRequest|null|undefined, - {}|null|undefined>): void; - getContext( - request: protos.google.cloud.aiplatform.v1.IGetContextRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IContext, - protos.google.cloud.aiplatform.v1.IGetContextRequest|null|undefined, - {}|null|undefined>): void; - getContext( - request?: protos.google.cloud.aiplatform.v1.IGetContextRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IContext, - protos.google.cloud.aiplatform.v1.IGetContextRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IContext, - protos.google.cloud.aiplatform.v1.IGetContextRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IContext, - protos.google.cloud.aiplatform.v1.IGetContextRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getContext(request, options, callback); - } -/** - * Updates a stored Context. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1.Context} request.context - * Required. The Context containing updates. - * The Context's {@link google.cloud.aiplatform.v1.Context.name|Context.name} field is used to identify the Context to be - * updated. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. A FieldMask indicating which fields should be updated. - * Functionality of this field is not yet supported. - * @param {boolean} request.allowMissing - * If set to true, and the {@link google.cloud.aiplatform.v1.Context|Context} is not found, a new {@link google.cloud.aiplatform.v1.Context|Context} is - * created. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Context]{@link google.cloud.aiplatform.v1.Context}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_UpdateContext_async - */ - updateContext( - request?: protos.google.cloud.aiplatform.v1.IUpdateContextRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IContext, - protos.google.cloud.aiplatform.v1.IUpdateContextRequest|undefined, {}|undefined - ]>; - updateContext( - request: protos.google.cloud.aiplatform.v1.IUpdateContextRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IContext, - protos.google.cloud.aiplatform.v1.IUpdateContextRequest|null|undefined, - {}|null|undefined>): void; - updateContext( - request: protos.google.cloud.aiplatform.v1.IUpdateContextRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IContext, - protos.google.cloud.aiplatform.v1.IUpdateContextRequest|null|undefined, - {}|null|undefined>): void; - updateContext( - request?: protos.google.cloud.aiplatform.v1.IUpdateContextRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IContext, - protos.google.cloud.aiplatform.v1.IUpdateContextRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IContext, - protos.google.cloud.aiplatform.v1.IUpdateContextRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IContext, - protos.google.cloud.aiplatform.v1.IUpdateContextRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'context.name': request.context!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateContext(request, options, callback); - } -/** - * Adds a set of Artifacts and Executions to a Context. If any of the - * Artifacts or Executions have already been added to a Context, they are - * simply skipped. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.context - * Required. The resource name of the Context that the Artifacts and Executions - * belong to. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * @param {string[]} request.artifacts - * The resource names of the Artifacts to attribute to the Context. - * - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - * @param {string[]} request.executions - * The resource names of the Executions to associate with the - * Context. - * - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AddContextArtifactsAndExecutionsResponse]{@link google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_AddContextArtifactsAndExecutions_async - */ - addContextArtifactsAndExecutions( - request?: protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsResponse, - protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest|undefined, {}|undefined - ]>; - addContextArtifactsAndExecutions( - request: protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsResponse, - protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest|null|undefined, - {}|null|undefined>): void; - addContextArtifactsAndExecutions( - request: protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsResponse, - protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest|null|undefined, - {}|null|undefined>): void; - addContextArtifactsAndExecutions( - request?: protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsResponse, - protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsResponse, - protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsResponse, - protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'context': request.context || '', - }); - this.initialize(); - return this.innerApiCalls.addContextArtifactsAndExecutions(request, options, callback); - } -/** - * Adds a set of Contexts as children to a parent Context. If any of the - * child Contexts have already been added to the parent Context, they are - * simply skipped. If this call would create a cycle or cause any Context to - * have more than 10 parents, the request will fail with an INVALID_ARGUMENT - * error. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.context - * Required. The resource name of the parent Context. - * - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * @param {string[]} request.childContexts - * The resource names of the child Contexts. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AddContextChildrenResponse]{@link google.cloud.aiplatform.v1.AddContextChildrenResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_AddContextChildren_async - */ - addContextChildren( - request?: protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IAddContextChildrenResponse, - protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest|undefined, {}|undefined - ]>; - addContextChildren( - request: protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IAddContextChildrenResponse, - protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest|null|undefined, - {}|null|undefined>): void; - addContextChildren( - request: protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IAddContextChildrenResponse, - protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest|null|undefined, - {}|null|undefined>): void; - addContextChildren( - request?: protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IAddContextChildrenResponse, - protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IAddContextChildrenResponse, - protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IAddContextChildrenResponse, - protos.google.cloud.aiplatform.v1.IAddContextChildrenRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'context': request.context || '', - }); - this.initialize(); - return this.innerApiCalls.addContextChildren(request, options, callback); - } -/** - * Retrieves Artifacts and Executions within the specified Context, connected - * by Event edges and returned as a LineageSubgraph. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.context - * Required. The resource name of the Context whose Artifacts and Executions - * should be retrieved as a LineageSubgraph. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * - * The request may error with FAILED_PRECONDITION if the number of Artifacts, - * the number of Executions, or the number of Events that would be returned - * for the Context exceeds 1000. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [LineageSubgraph]{@link google.cloud.aiplatform.v1.LineageSubgraph}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_QueryContextLineageSubgraph_async - */ - queryContextLineageSubgraph( - request?: protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest|undefined, {}|undefined - ]>; - queryContextLineageSubgraph( - request: protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest|null|undefined, - {}|null|undefined>): void; - queryContextLineageSubgraph( - request: protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest|null|undefined, - {}|null|undefined>): void; - queryContextLineageSubgraph( - request?: protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1.IQueryContextLineageSubgraphRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'context': request.context || '', - }); - this.initialize(); - return this.innerApiCalls.queryContextLineageSubgraph(request, options, callback); - } -/** - * Creates an Execution associated with a MetadataStore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the MetadataStore where the Execution should - * be created. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {google.cloud.aiplatform.v1.Execution} request.execution - * Required. The Execution to create. - * @param {string} request.executionId - * The {execution} portion of the resource name with the format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * If not provided, the Execution's ID will be a UUID generated by the - * service. - * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. - * Must be unique across all Executions in the parent MetadataStore. - * (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED - * if the caller can't view the preexisting Execution.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Execution]{@link google.cloud.aiplatform.v1.Execution}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_CreateExecution_async - */ - createExecution( - request?: protos.google.cloud.aiplatform.v1.ICreateExecutionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IExecution, - protos.google.cloud.aiplatform.v1.ICreateExecutionRequest|undefined, {}|undefined - ]>; - createExecution( - request: protos.google.cloud.aiplatform.v1.ICreateExecutionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IExecution, - protos.google.cloud.aiplatform.v1.ICreateExecutionRequest|null|undefined, - {}|null|undefined>): void; - createExecution( - request: protos.google.cloud.aiplatform.v1.ICreateExecutionRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IExecution, - protos.google.cloud.aiplatform.v1.ICreateExecutionRequest|null|undefined, - {}|null|undefined>): void; - createExecution( - request?: protos.google.cloud.aiplatform.v1.ICreateExecutionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IExecution, - protos.google.cloud.aiplatform.v1.ICreateExecutionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IExecution, - protos.google.cloud.aiplatform.v1.ICreateExecutionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IExecution, - protos.google.cloud.aiplatform.v1.ICreateExecutionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createExecution(request, options, callback); - } -/** - * Retrieves a specific Execution. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Execution to retrieve. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Execution]{@link google.cloud.aiplatform.v1.Execution}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_GetExecution_async - */ - getExecution( - request?: protos.google.cloud.aiplatform.v1.IGetExecutionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IExecution, - protos.google.cloud.aiplatform.v1.IGetExecutionRequest|undefined, {}|undefined - ]>; - getExecution( - request: protos.google.cloud.aiplatform.v1.IGetExecutionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IExecution, - protos.google.cloud.aiplatform.v1.IGetExecutionRequest|null|undefined, - {}|null|undefined>): void; - getExecution( - request: protos.google.cloud.aiplatform.v1.IGetExecutionRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IExecution, - protos.google.cloud.aiplatform.v1.IGetExecutionRequest|null|undefined, - {}|null|undefined>): void; - getExecution( - request?: protos.google.cloud.aiplatform.v1.IGetExecutionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IExecution, - protos.google.cloud.aiplatform.v1.IGetExecutionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IExecution, - protos.google.cloud.aiplatform.v1.IGetExecutionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IExecution, - protos.google.cloud.aiplatform.v1.IGetExecutionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getExecution(request, options, callback); - } -/** - * Updates a stored Execution. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1.Execution} request.execution - * Required. The Execution containing updates. - * The Execution's {@link google.cloud.aiplatform.v1.Execution.name|Execution.name} field is used to identify the Execution - * to be updated. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. A FieldMask indicating which fields should be updated. - * Functionality of this field is not yet supported. - * @param {boolean} request.allowMissing - * If set to true, and the {@link google.cloud.aiplatform.v1.Execution|Execution} is not found, a new {@link google.cloud.aiplatform.v1.Execution|Execution} - * is created. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Execution]{@link google.cloud.aiplatform.v1.Execution}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_UpdateExecution_async - */ - updateExecution( - request?: protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IExecution, - protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest|undefined, {}|undefined - ]>; - updateExecution( - request: protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IExecution, - protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest|null|undefined, - {}|null|undefined>): void; - updateExecution( - request: protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IExecution, - protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest|null|undefined, - {}|null|undefined>): void; - updateExecution( - request?: protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IExecution, - protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IExecution, - protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IExecution, - protos.google.cloud.aiplatform.v1.IUpdateExecutionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'execution.name': request.execution!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateExecution(request, options, callback); - } -/** - * Adds Events to the specified Execution. An Event indicates whether an - * Artifact was used as an input or output for an Execution. If an Event - * already exists between the Execution and the Artifact, the Event is - * skipped. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.execution - * Required. The resource name of the Execution that the Events connect - * Artifacts with. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * @param {number[]} request.events - * The Events to create and add. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AddExecutionEventsResponse]{@link google.cloud.aiplatform.v1.AddExecutionEventsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_AddExecutionEvents_async - */ - addExecutionEvents( - request?: protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IAddExecutionEventsResponse, - protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest|undefined, {}|undefined - ]>; - addExecutionEvents( - request: protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IAddExecutionEventsResponse, - protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest|null|undefined, - {}|null|undefined>): void; - addExecutionEvents( - request: protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IAddExecutionEventsResponse, - protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest|null|undefined, - {}|null|undefined>): void; - addExecutionEvents( - request?: protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IAddExecutionEventsResponse, - protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IAddExecutionEventsResponse, - protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IAddExecutionEventsResponse, - protos.google.cloud.aiplatform.v1.IAddExecutionEventsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'execution': request.execution || '', - }); - this.initialize(); - return this.innerApiCalls.addExecutionEvents(request, options, callback); - } -/** - * Obtains the set of input and output Artifacts for this Execution, in the - * form of LineageSubgraph that also contains the Execution and connecting - * Events. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.execution - * Required. The resource name of the Execution whose input and output Artifacts should - * be retrieved as a LineageSubgraph. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [LineageSubgraph]{@link google.cloud.aiplatform.v1.LineageSubgraph}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_QueryExecutionInputsAndOutputs_async - */ - queryExecutionInputsAndOutputs( - request?: protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest|undefined, {}|undefined - ]>; - queryExecutionInputsAndOutputs( - request: protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest|null|undefined, - {}|null|undefined>): void; - queryExecutionInputsAndOutputs( - request: protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest|null|undefined, - {}|null|undefined>): void; - queryExecutionInputsAndOutputs( - request?: protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1.IQueryExecutionInputsAndOutputsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'execution': request.execution || '', - }); - this.initialize(); - return this.innerApiCalls.queryExecutionInputsAndOutputs(request, options, callback); - } -/** - * Creates a MetadataSchema. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the MetadataStore where the MetadataSchema should - * be created. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {google.cloud.aiplatform.v1.MetadataSchema} request.metadataSchema - * Required. The MetadataSchema to create. - * @param {string} request.metadataSchemaId - * The {metadata_schema} portion of the resource name with the format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` - * If not provided, the MetadataStore's ID will be a UUID generated by the - * service. - * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. - * Must be unique across all MetadataSchemas in the parent Location. - * (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED - * if the caller can't view the preexisting MetadataSchema.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [MetadataSchema]{@link google.cloud.aiplatform.v1.MetadataSchema}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_CreateMetadataSchema_async - */ - createMetadataSchema( - request?: protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IMetadataSchema, - protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest|undefined, {}|undefined - ]>; - createMetadataSchema( - request: protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IMetadataSchema, - protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest|null|undefined, - {}|null|undefined>): void; - createMetadataSchema( - request: protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IMetadataSchema, - protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest|null|undefined, - {}|null|undefined>): void; - createMetadataSchema( - request?: protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IMetadataSchema, - protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IMetadataSchema, - protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IMetadataSchema, - protos.google.cloud.aiplatform.v1.ICreateMetadataSchemaRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createMetadataSchema(request, options, callback); - } -/** - * Retrieves a specific MetadataSchema. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the MetadataSchema to retrieve. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [MetadataSchema]{@link google.cloud.aiplatform.v1.MetadataSchema}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_GetMetadataSchema_async - */ - getMetadataSchema( - request?: protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IMetadataSchema, - protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest|undefined, {}|undefined - ]>; - getMetadataSchema( - request: protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IMetadataSchema, - protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest|null|undefined, - {}|null|undefined>): void; - getMetadataSchema( - request: protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IMetadataSchema, - protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest|null|undefined, - {}|null|undefined>): void; - getMetadataSchema( - request?: protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IMetadataSchema, - protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IMetadataSchema, - protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IMetadataSchema, - protos.google.cloud.aiplatform.v1.IGetMetadataSchemaRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getMetadataSchema(request, options, callback); - } -/** - * Retrieves lineage of an Artifact represented through Artifacts and - * Executions connected by Event edges and returned as a LineageSubgraph. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.artifact - * Required. The resource name of the Artifact whose Lineage needs to be retrieved as a - * LineageSubgraph. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - * - * The request may error with FAILED_PRECONDITION if the number of Artifacts, - * the number of Executions, or the number of Events that would be returned - * for the Context exceeds 1000. - * @param {number} request.maxHops - * Specifies the size of the lineage graph in terms of number of hops from the - * specified artifact. - * Negative Value: INVALID_ARGUMENT error is returned - * 0: Only input artifact is returned. - * No value: Transitive closure is performed to return the complete graph. - * @param {string} request.filter - * Filter specifying the boolean condition for the Artifacts to satisfy in - * order to be part of the Lineage Subgraph. - * The syntax to define filter query is based on https://google.aip.dev/160. - * The supported set of filters include the following: - * - * * **Attribute filtering**: - * For example: `display_name = "test"` - * Supported fields include: `name`, `display_name`, `uri`, `state`, - * `schema_title`, `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"` - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..`. - * For example: `metadata.field_1.number_value = 10.0` - * - * Each of the above supported filter types can be combined together using - * logical operators (`AND` & `OR`). - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [LineageSubgraph]{@link google.cloud.aiplatform.v1.LineageSubgraph}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_QueryArtifactLineageSubgraph_async - */ - queryArtifactLineageSubgraph( - request?: protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest|undefined, {}|undefined - ]>; - queryArtifactLineageSubgraph( - request: protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest|null|undefined, - {}|null|undefined>): void; - queryArtifactLineageSubgraph( - request: protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest|null|undefined, - {}|null|undefined>): void; - queryArtifactLineageSubgraph( - request?: protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1.IQueryArtifactLineageSubgraphRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'artifact': request.artifact || '', - }); - this.initialize(); - return this.innerApiCalls.queryArtifactLineageSubgraph(request, options, callback); - } - -/** - * Initializes a MetadataStore, including allocation of resources. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location where the MetadataStore should - * be created. - * Format: `projects/{project}/locations/{location}/` - * @param {google.cloud.aiplatform.v1.MetadataStore} request.metadataStore - * Required. The MetadataStore to create. - * @param {string} request.metadataStoreId - * The {metadatastore} portion of the resource name with the format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * If not provided, the MetadataStore's ID will be a UUID generated by the - * service. - * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. - * Must be unique across all MetadataStores in the parent Location. - * (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED - * if the caller can't view the preexisting MetadataStore.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_CreateMetadataStore_async - */ - createMetadataStore( - request?: protos.google.cloud.aiplatform.v1.ICreateMetadataStoreRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createMetadataStore( - request: protos.google.cloud.aiplatform.v1.ICreateMetadataStoreRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createMetadataStore( - request: protos.google.cloud.aiplatform.v1.ICreateMetadataStoreRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createMetadataStore( - request?: protos.google.cloud.aiplatform.v1.ICreateMetadataStoreRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createMetadataStore(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createMetadataStore()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_CreateMetadataStore_async - */ - async checkCreateMetadataStoreProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createMetadataStore, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single MetadataStore and all its child resources (Artifacts, - * Executions, and Contexts). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the MetadataStore to delete. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {boolean} request.force - * Deprecated: Field is no longer supported. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_DeleteMetadataStore_async - */ - deleteMetadataStore( - request?: protos.google.cloud.aiplatform.v1.IDeleteMetadataStoreRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteMetadataStore( - request: protos.google.cloud.aiplatform.v1.IDeleteMetadataStoreRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteMetadataStore( - request: protos.google.cloud.aiplatform.v1.IDeleteMetadataStoreRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteMetadataStore( - request?: protos.google.cloud.aiplatform.v1.IDeleteMetadataStoreRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteMetadataStore(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteMetadataStore()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_DeleteMetadataStore_async - */ - async checkDeleteMetadataStoreProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteMetadataStore, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes an Artifact. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Artifact to delete. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - * @param {string} [request.etag] - * Optional. The etag of the Artifact to delete. - * If this is provided, it must match the server's etag. Otherwise, the - * request will fail with a FAILED_PRECONDITION. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_DeleteArtifact_async - */ - deleteArtifact( - request?: protos.google.cloud.aiplatform.v1.IDeleteArtifactRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteArtifact( - request: protos.google.cloud.aiplatform.v1.IDeleteArtifactRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteArtifact( - request: protos.google.cloud.aiplatform.v1.IDeleteArtifactRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteArtifact( - request?: protos.google.cloud.aiplatform.v1.IDeleteArtifactRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteArtifact(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteArtifact()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_DeleteArtifact_async - */ - async checkDeleteArtifactProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteArtifact, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Purges Artifacts. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The metadata store to purge Artifacts from. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {string} request.filter - * Required. A required filter matching the Artifacts to be purged. - * E.g., `update_time <= 2020-11-19T11:30:00-04:00`. - * @param {boolean} [request.force] - * Optional. Flag to indicate to actually perform the purge. - * If `force` is set to false, the method will return a sample of - * Artifact names that would be deleted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_PurgeArtifacts_async - */ - purgeArtifacts( - request?: protos.google.cloud.aiplatform.v1.IPurgeArtifactsRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - purgeArtifacts( - request: protos.google.cloud.aiplatform.v1.IPurgeArtifactsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - purgeArtifacts( - request: protos.google.cloud.aiplatform.v1.IPurgeArtifactsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - purgeArtifacts( - request?: protos.google.cloud.aiplatform.v1.IPurgeArtifactsRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.purgeArtifacts(request, options, callback); - } -/** - * Check the status of the long running operation returned by `purgeArtifacts()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_PurgeArtifacts_async - */ - async checkPurgeArtifactsProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.purgeArtifacts, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a stored Context. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Context to delete. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * @param {boolean} request.force - * The force deletion semantics is still undefined. - * Users should not use this field. - * @param {string} [request.etag] - * Optional. The etag of the Context to delete. - * If this is provided, it must match the server's etag. Otherwise, the - * request will fail with a FAILED_PRECONDITION. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_DeleteContext_async - */ - deleteContext( - request?: protos.google.cloud.aiplatform.v1.IDeleteContextRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteContext( - request: protos.google.cloud.aiplatform.v1.IDeleteContextRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteContext( - request: protos.google.cloud.aiplatform.v1.IDeleteContextRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteContext( - request?: protos.google.cloud.aiplatform.v1.IDeleteContextRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteContext(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteContext()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_DeleteContext_async - */ - async checkDeleteContextProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteContext, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Purges Contexts. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The metadata store to purge Contexts from. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {string} request.filter - * Required. A required filter matching the Contexts to be purged. - * E.g., `update_time <= 2020-11-19T11:30:00-04:00`. - * @param {boolean} [request.force] - * Optional. Flag to indicate to actually perform the purge. - * If `force` is set to false, the method will return a sample of - * Context names that would be deleted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_PurgeContexts_async - */ - purgeContexts( - request?: protos.google.cloud.aiplatform.v1.IPurgeContextsRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - purgeContexts( - request: protos.google.cloud.aiplatform.v1.IPurgeContextsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - purgeContexts( - request: protos.google.cloud.aiplatform.v1.IPurgeContextsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - purgeContexts( - request?: protos.google.cloud.aiplatform.v1.IPurgeContextsRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.purgeContexts(request, options, callback); - } -/** - * Check the status of the long running operation returned by `purgeContexts()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_PurgeContexts_async - */ - async checkPurgeContextsProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.purgeContexts, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes an Execution. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Execution to delete. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * @param {string} [request.etag] - * Optional. The etag of the Execution to delete. - * If this is provided, it must match the server's etag. Otherwise, the - * request will fail with a FAILED_PRECONDITION. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_DeleteExecution_async - */ - deleteExecution( - request?: protos.google.cloud.aiplatform.v1.IDeleteExecutionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteExecution( - request: protos.google.cloud.aiplatform.v1.IDeleteExecutionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteExecution( - request: protos.google.cloud.aiplatform.v1.IDeleteExecutionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteExecution( - request?: protos.google.cloud.aiplatform.v1.IDeleteExecutionRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteExecution(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteExecution()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_DeleteExecution_async - */ - async checkDeleteExecutionProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteExecution, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Purges Executions. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The metadata store to purge Executions from. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {string} request.filter - * Required. A required filter matching the Executions to be purged. - * E.g., `update_time <= 2020-11-19T11:30:00-04:00`. - * @param {boolean} [request.force] - * Optional. Flag to indicate to actually perform the purge. - * If `force` is set to false, the method will return a sample of - * Execution names that would be deleted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_PurgeExecutions_async - */ - purgeExecutions( - request?: protos.google.cloud.aiplatform.v1.IPurgeExecutionsRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - purgeExecutions( - request: protos.google.cloud.aiplatform.v1.IPurgeExecutionsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - purgeExecutions( - request: protos.google.cloud.aiplatform.v1.IPurgeExecutionsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - purgeExecutions( - request?: protos.google.cloud.aiplatform.v1.IPurgeExecutionsRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.purgeExecutions(request, options, callback); - } -/** - * Check the status of the long running operation returned by `purgeExecutions()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_PurgeExecutions_async - */ - async checkPurgeExecutionsProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.purgeExecutions, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists MetadataStores for a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Location whose MetadataStores should be listed. - * Format: - * `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * The maximum number of Metadata Stores to return. The service may return - * fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.MetadataService.ListMetadataStores|MetadataService.ListMetadataStores} call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [MetadataStore]{@link google.cloud.aiplatform.v1.MetadataStore}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listMetadataStoresAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listMetadataStores( - request?: protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IMetadataStore[], - protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest|null, - protos.google.cloud.aiplatform.v1.IListMetadataStoresResponse - ]>; - listMetadataStores( - request: protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, - protos.google.cloud.aiplatform.v1.IListMetadataStoresResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IMetadataStore>): void; - listMetadataStores( - request: protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, - protos.google.cloud.aiplatform.v1.IListMetadataStoresResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IMetadataStore>): void; - listMetadataStores( - request?: protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, - protos.google.cloud.aiplatform.v1.IListMetadataStoresResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IMetadataStore>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, - protos.google.cloud.aiplatform.v1.IListMetadataStoresResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IMetadataStore>): - Promise<[ - protos.google.cloud.aiplatform.v1.IMetadataStore[], - protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest|null, - protos.google.cloud.aiplatform.v1.IListMetadataStoresResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listMetadataStores(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Location whose MetadataStores should be listed. - * Format: - * `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * The maximum number of Metadata Stores to return. The service may return - * fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.MetadataService.ListMetadataStores|MetadataService.ListMetadataStores} call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [MetadataStore]{@link google.cloud.aiplatform.v1.MetadataStore} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listMetadataStoresAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listMetadataStoresStream( - request?: protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listMetadataStores']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listMetadataStores.createStream( - this.innerApiCalls.listMetadataStores as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listMetadataStores`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Location whose MetadataStores should be listed. - * Format: - * `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * The maximum number of Metadata Stores to return. The service may return - * fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.MetadataService.ListMetadataStores|MetadataService.ListMetadataStores} call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [MetadataStore]{@link google.cloud.aiplatform.v1.MetadataStore}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_ListMetadataStores_async - */ - listMetadataStoresAsync( - request?: protos.google.cloud.aiplatform.v1.IListMetadataStoresRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listMetadataStores']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listMetadataStores.asyncIterate( - this.innerApiCalls['listMetadataStores'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists Artifacts in the MetadataStore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose Artifacts should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of Artifacts to return. The service may return fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous {@link google.cloud.aiplatform.v1.MetadataService.ListArtifacts|MetadataService.ListArtifacts} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * Filter specifying the boolean condition for the Artifacts to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * The supported set of filters include the following: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `uri`, `state`, - * `schema_title`, `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"` - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..`. - * For example: `metadata.field_1.number_value = 10.0` - * * **Context based filtering**: - * To filter Artifacts based on the contexts to which they belong, use the - * function operator with the full resource name - * `in_context()`. - * For example: - * `in_context("projects//locations//metadataStores//contexts/")` - * - * Each of the above supported filter types can be combined together using - * logical operators (`AND` & `OR`). - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Artifact]{@link google.cloud.aiplatform.v1.Artifact}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listArtifactsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listArtifacts( - request?: protos.google.cloud.aiplatform.v1.IListArtifactsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IArtifact[], - protos.google.cloud.aiplatform.v1.IListArtifactsRequest|null, - protos.google.cloud.aiplatform.v1.IListArtifactsResponse - ]>; - listArtifacts( - request: protos.google.cloud.aiplatform.v1.IListArtifactsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListArtifactsRequest, - protos.google.cloud.aiplatform.v1.IListArtifactsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IArtifact>): void; - listArtifacts( - request: protos.google.cloud.aiplatform.v1.IListArtifactsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListArtifactsRequest, - protos.google.cloud.aiplatform.v1.IListArtifactsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IArtifact>): void; - listArtifacts( - request?: protos.google.cloud.aiplatform.v1.IListArtifactsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListArtifactsRequest, - protos.google.cloud.aiplatform.v1.IListArtifactsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IArtifact>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListArtifactsRequest, - protos.google.cloud.aiplatform.v1.IListArtifactsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IArtifact>): - Promise<[ - protos.google.cloud.aiplatform.v1.IArtifact[], - protos.google.cloud.aiplatform.v1.IListArtifactsRequest|null, - protos.google.cloud.aiplatform.v1.IListArtifactsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listArtifacts(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose Artifacts should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of Artifacts to return. The service may return fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous {@link google.cloud.aiplatform.v1.MetadataService.ListArtifacts|MetadataService.ListArtifacts} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * Filter specifying the boolean condition for the Artifacts to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * The supported set of filters include the following: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `uri`, `state`, - * `schema_title`, `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"` - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..`. - * For example: `metadata.field_1.number_value = 10.0` - * * **Context based filtering**: - * To filter Artifacts based on the contexts to which they belong, use the - * function operator with the full resource name - * `in_context()`. - * For example: - * `in_context("projects//locations//metadataStores//contexts/")` - * - * Each of the above supported filter types can be combined together using - * logical operators (`AND` & `OR`). - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Artifact]{@link google.cloud.aiplatform.v1.Artifact} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listArtifactsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listArtifactsStream( - request?: protos.google.cloud.aiplatform.v1.IListArtifactsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listArtifacts']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listArtifacts.createStream( - this.innerApiCalls.listArtifacts as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listArtifacts`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose Artifacts should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of Artifacts to return. The service may return fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous {@link google.cloud.aiplatform.v1.MetadataService.ListArtifacts|MetadataService.ListArtifacts} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * Filter specifying the boolean condition for the Artifacts to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * The supported set of filters include the following: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `uri`, `state`, - * `schema_title`, `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"` - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..`. - * For example: `metadata.field_1.number_value = 10.0` - * * **Context based filtering**: - * To filter Artifacts based on the contexts to which they belong, use the - * function operator with the full resource name - * `in_context()`. - * For example: - * `in_context("projects//locations//metadataStores//contexts/")` - * - * Each of the above supported filter types can be combined together using - * logical operators (`AND` & `OR`). - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Artifact]{@link google.cloud.aiplatform.v1.Artifact}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_ListArtifacts_async - */ - listArtifactsAsync( - request?: protos.google.cloud.aiplatform.v1.IListArtifactsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listArtifacts']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listArtifacts.asyncIterate( - this.innerApiCalls['listArtifacts'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists Contexts on the MetadataStore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose Contexts should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of Contexts to return. The service may return fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous {@link google.cloud.aiplatform.v1.MetadataService.ListContexts|MetadataService.ListContexts} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * Filter specifying the boolean condition for the Contexts to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * Following are the supported set of filters: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `schema_title`, - * `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"`. - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..`. - * For example: `metadata.field_1.number_value = 10.0`. - * * **Parent Child filtering**: - * To filter Contexts based on parent-child relationship use the HAS - * operator as follows: - * - * ``` - * parent_contexts: - * "projects//locations//metadataStores//contexts/" - * child_contexts: - * "projects//locations//metadataStores//contexts/" - * ``` - * - * Each of the above supported filters can be combined together using - * logical operators (`AND` & `OR`). - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Context]{@link google.cloud.aiplatform.v1.Context}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listContextsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listContexts( - request?: protos.google.cloud.aiplatform.v1.IListContextsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IContext[], - protos.google.cloud.aiplatform.v1.IListContextsRequest|null, - protos.google.cloud.aiplatform.v1.IListContextsResponse - ]>; - listContexts( - request: protos.google.cloud.aiplatform.v1.IListContextsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListContextsRequest, - protos.google.cloud.aiplatform.v1.IListContextsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IContext>): void; - listContexts( - request: protos.google.cloud.aiplatform.v1.IListContextsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListContextsRequest, - protos.google.cloud.aiplatform.v1.IListContextsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IContext>): void; - listContexts( - request?: protos.google.cloud.aiplatform.v1.IListContextsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListContextsRequest, - protos.google.cloud.aiplatform.v1.IListContextsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IContext>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListContextsRequest, - protos.google.cloud.aiplatform.v1.IListContextsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IContext>): - Promise<[ - protos.google.cloud.aiplatform.v1.IContext[], - protos.google.cloud.aiplatform.v1.IListContextsRequest|null, - protos.google.cloud.aiplatform.v1.IListContextsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listContexts(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose Contexts should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of Contexts to return. The service may return fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous {@link google.cloud.aiplatform.v1.MetadataService.ListContexts|MetadataService.ListContexts} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * Filter specifying the boolean condition for the Contexts to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * Following are the supported set of filters: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `schema_title`, - * `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"`. - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..`. - * For example: `metadata.field_1.number_value = 10.0`. - * * **Parent Child filtering**: - * To filter Contexts based on parent-child relationship use the HAS - * operator as follows: - * - * ``` - * parent_contexts: - * "projects//locations//metadataStores//contexts/" - * child_contexts: - * "projects//locations//metadataStores//contexts/" - * ``` - * - * Each of the above supported filters can be combined together using - * logical operators (`AND` & `OR`). - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Context]{@link google.cloud.aiplatform.v1.Context} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listContextsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listContextsStream( - request?: protos.google.cloud.aiplatform.v1.IListContextsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listContexts']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listContexts.createStream( - this.innerApiCalls.listContexts as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listContexts`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose Contexts should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of Contexts to return. The service may return fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous {@link google.cloud.aiplatform.v1.MetadataService.ListContexts|MetadataService.ListContexts} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * Filter specifying the boolean condition for the Contexts to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * Following are the supported set of filters: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `schema_title`, - * `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"`. - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..`. - * For example: `metadata.field_1.number_value = 10.0`. - * * **Parent Child filtering**: - * To filter Contexts based on parent-child relationship use the HAS - * operator as follows: - * - * ``` - * parent_contexts: - * "projects//locations//metadataStores//contexts/" - * child_contexts: - * "projects//locations//metadataStores//contexts/" - * ``` - * - * Each of the above supported filters can be combined together using - * logical operators (`AND` & `OR`). - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Context]{@link google.cloud.aiplatform.v1.Context}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_ListContexts_async - */ - listContextsAsync( - request?: protos.google.cloud.aiplatform.v1.IListContextsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listContexts']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listContexts.asyncIterate( - this.innerApiCalls['listContexts'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists Executions in the MetadataStore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose Executions should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of Executions to return. The service may return fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous {@link google.cloud.aiplatform.v1.MetadataService.ListExecutions|MetadataService.ListExecutions} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with an - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * Filter specifying the boolean condition for the Executions to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * Following are the supported set of filters: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `state`, - * `schema_title`, `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"`. - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..` - * For example: `metadata.field_1.number_value = 10.0` - * * **Context based filtering**: - * To filter Executions based on the contexts to which they belong use - * the function operator with the full resource name: - * `in_context()`. - * For example: - * `in_context("projects//locations//metadataStores//contexts/")` - * - * Each of the above supported filters can be combined together using - * logical operators (`AND` & `OR`). - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Execution]{@link google.cloud.aiplatform.v1.Execution}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listExecutionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listExecutions( - request?: protos.google.cloud.aiplatform.v1.IListExecutionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IExecution[], - protos.google.cloud.aiplatform.v1.IListExecutionsRequest|null, - protos.google.cloud.aiplatform.v1.IListExecutionsResponse - ]>; - listExecutions( - request: protos.google.cloud.aiplatform.v1.IListExecutionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListExecutionsRequest, - protos.google.cloud.aiplatform.v1.IListExecutionsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IExecution>): void; - listExecutions( - request: protos.google.cloud.aiplatform.v1.IListExecutionsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListExecutionsRequest, - protos.google.cloud.aiplatform.v1.IListExecutionsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IExecution>): void; - listExecutions( - request?: protos.google.cloud.aiplatform.v1.IListExecutionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListExecutionsRequest, - protos.google.cloud.aiplatform.v1.IListExecutionsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IExecution>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListExecutionsRequest, - protos.google.cloud.aiplatform.v1.IListExecutionsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IExecution>): - Promise<[ - protos.google.cloud.aiplatform.v1.IExecution[], - protos.google.cloud.aiplatform.v1.IListExecutionsRequest|null, - protos.google.cloud.aiplatform.v1.IListExecutionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listExecutions(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose Executions should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of Executions to return. The service may return fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous {@link google.cloud.aiplatform.v1.MetadataService.ListExecutions|MetadataService.ListExecutions} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with an - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * Filter specifying the boolean condition for the Executions to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * Following are the supported set of filters: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `state`, - * `schema_title`, `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"`. - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..` - * For example: `metadata.field_1.number_value = 10.0` - * * **Context based filtering**: - * To filter Executions based on the contexts to which they belong use - * the function operator with the full resource name: - * `in_context()`. - * For example: - * `in_context("projects//locations//metadataStores//contexts/")` - * - * Each of the above supported filters can be combined together using - * logical operators (`AND` & `OR`). - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Execution]{@link google.cloud.aiplatform.v1.Execution} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listExecutionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listExecutionsStream( - request?: protos.google.cloud.aiplatform.v1.IListExecutionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listExecutions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listExecutions.createStream( - this.innerApiCalls.listExecutions as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listExecutions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose Executions should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of Executions to return. The service may return fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous {@link google.cloud.aiplatform.v1.MetadataService.ListExecutions|MetadataService.ListExecutions} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with an - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * Filter specifying the boolean condition for the Executions to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * Following are the supported set of filters: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `state`, - * `schema_title`, `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"`. - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..` - * For example: `metadata.field_1.number_value = 10.0` - * * **Context based filtering**: - * To filter Executions based on the contexts to which they belong use - * the function operator with the full resource name: - * `in_context()`. - * For example: - * `in_context("projects//locations//metadataStores//contexts/")` - * - * Each of the above supported filters can be combined together using - * logical operators (`AND` & `OR`). - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Execution]{@link google.cloud.aiplatform.v1.Execution}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_ListExecutions_async - */ - listExecutionsAsync( - request?: protos.google.cloud.aiplatform.v1.IListExecutionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listExecutions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listExecutions.asyncIterate( - this.innerApiCalls['listExecutions'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists MetadataSchemas. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose MetadataSchemas should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of MetadataSchemas to return. The service may return - * fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.MetadataService.ListMetadataSchemas|MetadataService.ListMetadataSchemas} call. Provide this to retrieve the - * next page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * A query to filter available MetadataSchemas for matching results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [MetadataSchema]{@link google.cloud.aiplatform.v1.MetadataSchema}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listMetadataSchemasAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listMetadataSchemas( - request?: protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IMetadataSchema[], - protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest|null, - protos.google.cloud.aiplatform.v1.IListMetadataSchemasResponse - ]>; - listMetadataSchemas( - request: protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, - protos.google.cloud.aiplatform.v1.IListMetadataSchemasResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IMetadataSchema>): void; - listMetadataSchemas( - request: protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, - protos.google.cloud.aiplatform.v1.IListMetadataSchemasResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IMetadataSchema>): void; - listMetadataSchemas( - request?: protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, - protos.google.cloud.aiplatform.v1.IListMetadataSchemasResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IMetadataSchema>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, - protos.google.cloud.aiplatform.v1.IListMetadataSchemasResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IMetadataSchema>): - Promise<[ - protos.google.cloud.aiplatform.v1.IMetadataSchema[], - protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest|null, - protos.google.cloud.aiplatform.v1.IListMetadataSchemasResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listMetadataSchemas(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose MetadataSchemas should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of MetadataSchemas to return. The service may return - * fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.MetadataService.ListMetadataSchemas|MetadataService.ListMetadataSchemas} call. Provide this to retrieve the - * next page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * A query to filter available MetadataSchemas for matching results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [MetadataSchema]{@link google.cloud.aiplatform.v1.MetadataSchema} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listMetadataSchemasAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listMetadataSchemasStream( - request?: protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listMetadataSchemas']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listMetadataSchemas.createStream( - this.innerApiCalls.listMetadataSchemas as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listMetadataSchemas`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose MetadataSchemas should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of MetadataSchemas to return. The service may return - * fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.MetadataService.ListMetadataSchemas|MetadataService.ListMetadataSchemas} call. Provide this to retrieve the - * next page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * A query to filter available MetadataSchemas for matching results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [MetadataSchema]{@link google.cloud.aiplatform.v1.MetadataSchema}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MetadataService_ListMetadataSchemas_async - */ - listMetadataSchemasAsync( - request?: protos.google.cloud.aiplatform.v1.IListMetadataSchemasRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listMetadataSchemas']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listMetadataSchemas.asyncIterate( - this.innerApiCalls['listMetadataSchemas'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.metadataServiceStub && !this._terminated) { - return this.metadataServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/metadata_service_client_config.json b/owl-bot-staging/v1/src/v1/metadata_service_client_config.json deleted file mode 100644 index 22fd826d..00000000 --- a/owl-bot-staging/v1/src/v1/metadata_service_client_config.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1.MetadataService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateMetadataStore": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetMetadataStore": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListMetadataStores": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteMetadataStore": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateArtifact": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetArtifact": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListArtifacts": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateArtifact": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteArtifact": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PurgeArtifacts": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateContext": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetContext": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListContexts": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateContext": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteContext": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PurgeContexts": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "AddContextArtifactsAndExecutions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "AddContextChildren": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "QueryContextLineageSubgraph": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateExecution": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetExecution": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListExecutions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateExecution": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteExecution": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PurgeExecutions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "AddExecutionEvents": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "QueryExecutionInputsAndOutputs": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateMetadataSchema": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetMetadataSchema": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListMetadataSchemas": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "QueryArtifactLineageSubgraph": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/metadata_service_proto_list.json b/owl-bot-staging/v1/src/v1/metadata_service_proto_list.json deleted file mode 100644 index 581a7346..00000000 --- a/owl-bot-staging/v1/src/v1/metadata_service_proto_list.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1/context.proto", - "../../protos/google/cloud/aiplatform/v1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1/event.proto", - "../../protos/google/cloud/aiplatform/v1/execution.proto", - "../../protos/google/cloud/aiplatform/v1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1/feature.proto", - "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1/index.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1/io.proto", - "../../protos/google/cloud/aiplatform/v1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1/model.proto", - "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1/operation.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1/study.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1/types.proto", - "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1/value.proto", - "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1/src/v1/migration_service_client.ts b/owl-bot-staging/v1/src/v1/migration_service_client.ts deleted file mode 100644 index f7ffabba..00000000 --- a/owl-bot-staging/v1/src/v1/migration_service_client.ts +++ /dev/null @@ -1,2642 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/migration_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './migration_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * A service that migrates resources from automl.googleapis.com, - * datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. - * @class - * @memberof v1 - */ -export class MigrationServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - migrationServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of MigrationServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof MigrationServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - searchMigratableResources: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'migratableResources') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const batchMigrateResourcesResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.BatchMigrateResourcesResponse') as gax.protobuf.Type; - const batchMigrateResourcesMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.BatchMigrateResourcesOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - batchMigrateResources: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - batchMigrateResourcesResponse.decode.bind(batchMigrateResourcesResponse), - batchMigrateResourcesMetadata.decode.bind(batchMigrateResourcesMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1.MigrationService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.migrationServiceStub) { - return this.migrationServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1.MigrationService. - this.migrationServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.MigrationService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1.MigrationService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const migrationServiceStubMethods = - ['searchMigratableResources', 'batchMigrateResources']; - for (const methodName of migrationServiceStubMethods) { - const callPromise = this.migrationServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.migrationServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - -/** - * Batch migrates resources from ml.googleapis.com, automl.googleapis.com, - * and datalabeling.googleapis.com to Vertex AI. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location of the migrated resource will live in. - * Format: `projects/{project}/locations/{location}` - * @param {number[]} request.migrateResourceRequests - * Required. The request messages specifying the resources to migrate. - * They must be in the same location as the destination. - * Up to 50 resources can be migrated in one batch. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MigrationService_BatchMigrateResources_async - */ - batchMigrateResources( - request?: protos.google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - batchMigrateResources( - request: protos.google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchMigrateResources( - request: protos.google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchMigrateResources( - request?: protos.google.cloud.aiplatform.v1.IBatchMigrateResourcesRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.batchMigrateResources(request, options, callback); - } -/** - * Check the status of the long running operation returned by `batchMigrateResources()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MigrationService_BatchMigrateResources_async - */ - async checkBatchMigrateResourcesProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.batchMigrateResources, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Searches all of the resources in automl.googleapis.com, - * datalabeling.googleapis.com and ml.googleapis.com that can be migrated to - * Vertex AI's given location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location that the migratable resources should be searched from. - * It's the Vertex AI location that the resources can be migrated to, not - * the resources' original location. - * Format: - * `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * The standard page size. - * The default and maximum value is 100. - * @param {string} request.pageToken - * The standard page token. - * @param {string} request.filter - * A filter for your search. You can use the following types of filters: - * - * * Resource type filters. The following strings filter for a specific type - * of {@link google.cloud.aiplatform.v1.MigratableResource|MigratableResource}: - * * `ml_engine_model_version:*` - * * `automl_model:*` - * * `automl_dataset:*` - * * `data_labeling_dataset:*` - * * "Migrated or not" filters. The following strings filter for resources - * that either have or have not already been migrated: - * * `last_migrate_time:*` filters for migrated resources. - * * `NOT last_migrate_time:*` filters for not yet migrated resources. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [MigratableResource]{@link google.cloud.aiplatform.v1.MigratableResource}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `searchMigratableResourcesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - searchMigratableResources( - request?: protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IMigratableResource[], - protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest|null, - protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse - ]>; - searchMigratableResources( - request: protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, - protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IMigratableResource>): void; - searchMigratableResources( - request: protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, - protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IMigratableResource>): void; - searchMigratableResources( - request?: protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, - protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IMigratableResource>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, - protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IMigratableResource>): - Promise<[ - protos.google.cloud.aiplatform.v1.IMigratableResource[], - protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest|null, - protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.searchMigratableResources(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location that the migratable resources should be searched from. - * It's the Vertex AI location that the resources can be migrated to, not - * the resources' original location. - * Format: - * `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * The standard page size. - * The default and maximum value is 100. - * @param {string} request.pageToken - * The standard page token. - * @param {string} request.filter - * A filter for your search. You can use the following types of filters: - * - * * Resource type filters. The following strings filter for a specific type - * of {@link google.cloud.aiplatform.v1.MigratableResource|MigratableResource}: - * * `ml_engine_model_version:*` - * * `automl_model:*` - * * `automl_dataset:*` - * * `data_labeling_dataset:*` - * * "Migrated or not" filters. The following strings filter for resources - * that either have or have not already been migrated: - * * `last_migrate_time:*` filters for migrated resources. - * * `NOT last_migrate_time:*` filters for not yet migrated resources. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [MigratableResource]{@link google.cloud.aiplatform.v1.MigratableResource} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `searchMigratableResourcesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - searchMigratableResourcesStream( - request?: protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['searchMigratableResources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchMigratableResources.createStream( - this.innerApiCalls.searchMigratableResources as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `searchMigratableResources`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location that the migratable resources should be searched from. - * It's the Vertex AI location that the resources can be migrated to, not - * the resources' original location. - * Format: - * `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * The standard page size. - * The default and maximum value is 100. - * @param {string} request.pageToken - * The standard page token. - * @param {string} request.filter - * A filter for your search. You can use the following types of filters: - * - * * Resource type filters. The following strings filter for a specific type - * of {@link google.cloud.aiplatform.v1.MigratableResource|MigratableResource}: - * * `ml_engine_model_version:*` - * * `automl_model:*` - * * `automl_dataset:*` - * * `data_labeling_dataset:*` - * * "Migrated or not" filters. The following strings filter for resources - * that either have or have not already been migrated: - * * `last_migrate_time:*` filters for migrated resources. - * * `NOT last_migrate_time:*` filters for not yet migrated resources. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [MigratableResource]{@link google.cloud.aiplatform.v1.MigratableResource}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_MigrationService_SearchMigratableResources_async - */ - searchMigratableResourcesAsync( - request?: protos.google.cloud.aiplatform.v1.ISearchMigratableResourcesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['searchMigratableResources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchMigratableResources.asyncIterate( - this.innerApiCalls['searchMigratableResources'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.migrationServiceStub && !this._terminated) { - return this.migrationServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/migration_service_client_config.json b/owl-bot-staging/v1/src/v1/migration_service_client_config.json deleted file mode 100644 index 59e4d9aa..00000000 --- a/owl-bot-staging/v1/src/v1/migration_service_client_config.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1.MigrationService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "SearchMigratableResources": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchMigrateResources": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/migration_service_proto_list.json b/owl-bot-staging/v1/src/v1/migration_service_proto_list.json deleted file mode 100644 index 581a7346..00000000 --- a/owl-bot-staging/v1/src/v1/migration_service_proto_list.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1/context.proto", - "../../protos/google/cloud/aiplatform/v1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1/event.proto", - "../../protos/google/cloud/aiplatform/v1/execution.proto", - "../../protos/google/cloud/aiplatform/v1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1/feature.proto", - "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1/index.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1/io.proto", - "../../protos/google/cloud/aiplatform/v1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1/model.proto", - "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1/operation.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1/study.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1/types.proto", - "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1/value.proto", - "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1/src/v1/model_service_client.ts b/owl-bot-staging/v1/src/v1/model_service_client.ts deleted file mode 100644 index 29e16e20..00000000 --- a/owl-bot-staging/v1/src/v1/model_service_client.ts +++ /dev/null @@ -1,3672 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/model_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './model_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * A service for managing Vertex AI's machine learning Models. - * @class - * @memberof v1 - */ -export class ModelServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - modelServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ModelServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof ModelServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listModels: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'models'), - listModelEvaluations: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'modelEvaluations'), - listModelEvaluationSlices: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'modelEvaluationSlices') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const uploadModelResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.UploadModelResponse') as gax.protobuf.Type; - const uploadModelMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.UploadModelOperationMetadata') as gax.protobuf.Type; - const deleteModelResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteModelMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - const exportModelResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.ExportModelResponse') as gax.protobuf.Type; - const exportModelMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.ExportModelOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - uploadModel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - uploadModelResponse.decode.bind(uploadModelResponse), - uploadModelMetadata.decode.bind(uploadModelMetadata)), - deleteModel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteModelResponse.decode.bind(deleteModelResponse), - deleteModelMetadata.decode.bind(deleteModelMetadata)), - exportModel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - exportModelResponse.decode.bind(exportModelResponse), - exportModelMetadata.decode.bind(exportModelMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1.ModelService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.modelServiceStub) { - return this.modelServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1.ModelService. - this.modelServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.ModelService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1.ModelService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const modelServiceStubMethods = - ['uploadModel', 'getModel', 'listModels', 'updateModel', 'deleteModel', 'exportModel', 'importModelEvaluation', 'getModelEvaluation', 'listModelEvaluations', 'getModelEvaluationSlice', 'listModelEvaluationSlices']; - for (const methodName of modelServiceStubMethods) { - const callPromise = this.modelServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.modelServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets a Model. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Model resource. - * Format: `projects/{project}/locations/{location}/models/{model}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Model]{@link google.cloud.aiplatform.v1.Model}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_ModelService_GetModel_async - */ - getModel( - request?: protos.google.cloud.aiplatform.v1.IGetModelRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IModel, - protos.google.cloud.aiplatform.v1.IGetModelRequest|undefined, {}|undefined - ]>; - getModel( - request: protos.google.cloud.aiplatform.v1.IGetModelRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IModel, - protos.google.cloud.aiplatform.v1.IGetModelRequest|null|undefined, - {}|null|undefined>): void; - getModel( - request: protos.google.cloud.aiplatform.v1.IGetModelRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IModel, - protos.google.cloud.aiplatform.v1.IGetModelRequest|null|undefined, - {}|null|undefined>): void; - getModel( - request?: protos.google.cloud.aiplatform.v1.IGetModelRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IModel, - protos.google.cloud.aiplatform.v1.IGetModelRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IModel, - protos.google.cloud.aiplatform.v1.IGetModelRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IModel, - protos.google.cloud.aiplatform.v1.IGetModelRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getModel(request, options, callback); - } -/** - * Updates a Model. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1.Model} request.model - * Required. The Model which replaces the resource on the server. - * When Model Versioning is enabled, the model.name will be used to determine - * whether to update the model or model version. - * 1. model.name with the @ value, e.g. models/123@1, refers to a version - * specific update. - * 2. model.name without the @ value, e.g. models/123, refers to a model - * update. - * 3. model.name with @-, e.g. models/123@-, refers to a model update. - * 4. Supported model fields: display_name, description; supported - * version-specific fields: version_description. Labels are supported in both - * scenarios. Both the model labels and the version labels are merged when a - * model is returned. When updating labels, if the request is for - * model-specific update, model label gets updated. Otherwise, version labels - * get updated. - * 5. A model name or model version name fields update mismatch will cause a - * precondition error. - * 6. One request cannot update both the model and the version fields. You - * must update them separately. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The update mask applies to the resource. - * For the `FieldMask` definition, see {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Model]{@link google.cloud.aiplatform.v1.Model}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_ModelService_UpdateModel_async - */ - updateModel( - request?: protos.google.cloud.aiplatform.v1.IUpdateModelRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IModel, - protos.google.cloud.aiplatform.v1.IUpdateModelRequest|undefined, {}|undefined - ]>; - updateModel( - request: protos.google.cloud.aiplatform.v1.IUpdateModelRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IModel, - protos.google.cloud.aiplatform.v1.IUpdateModelRequest|null|undefined, - {}|null|undefined>): void; - updateModel( - request: protos.google.cloud.aiplatform.v1.IUpdateModelRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IModel, - protos.google.cloud.aiplatform.v1.IUpdateModelRequest|null|undefined, - {}|null|undefined>): void; - updateModel( - request?: protos.google.cloud.aiplatform.v1.IUpdateModelRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IModel, - protos.google.cloud.aiplatform.v1.IUpdateModelRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IModel, - protos.google.cloud.aiplatform.v1.IUpdateModelRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IModel, - protos.google.cloud.aiplatform.v1.IUpdateModelRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'model.name': request.model!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateModel(request, options, callback); - } -/** - * Imports an externally generated ModelEvaluation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent model resource. - * Format: `projects/{project}/locations/{location}/models/{model}` - * @param {google.cloud.aiplatform.v1.ModelEvaluation} request.modelEvaluation - * Required. Model evaluation resource to be imported. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ModelEvaluation]{@link google.cloud.aiplatform.v1.ModelEvaluation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_ModelService_ImportModelEvaluation_async - */ - importModelEvaluation( - request?: protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IModelEvaluation, - protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest|undefined, {}|undefined - ]>; - importModelEvaluation( - request: protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IModelEvaluation, - protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest|null|undefined, - {}|null|undefined>): void; - importModelEvaluation( - request: protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IModelEvaluation, - protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest|null|undefined, - {}|null|undefined>): void; - importModelEvaluation( - request?: protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IModelEvaluation, - protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IModelEvaluation, - protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IModelEvaluation, - protos.google.cloud.aiplatform.v1.IImportModelEvaluationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.importModelEvaluation(request, options, callback); - } -/** - * Gets a ModelEvaluation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the ModelEvaluation resource. - * Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ModelEvaluation]{@link google.cloud.aiplatform.v1.ModelEvaluation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_ModelService_GetModelEvaluation_async - */ - getModelEvaluation( - request?: protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IModelEvaluation, - protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest|undefined, {}|undefined - ]>; - getModelEvaluation( - request: protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IModelEvaluation, - protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest|null|undefined, - {}|null|undefined>): void; - getModelEvaluation( - request: protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IModelEvaluation, - protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest|null|undefined, - {}|null|undefined>): void; - getModelEvaluation( - request?: protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IModelEvaluation, - protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IModelEvaluation, - protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IModelEvaluation, - protos.google.cloud.aiplatform.v1.IGetModelEvaluationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getModelEvaluation(request, options, callback); - } -/** - * Gets a ModelEvaluationSlice. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the ModelEvaluationSlice resource. - * Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ModelEvaluationSlice]{@link google.cloud.aiplatform.v1.ModelEvaluationSlice}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_ModelService_GetModelEvaluationSlice_async - */ - getModelEvaluationSlice( - request?: protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IModelEvaluationSlice, - protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest|undefined, {}|undefined - ]>; - getModelEvaluationSlice( - request: protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IModelEvaluationSlice, - protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest|null|undefined, - {}|null|undefined>): void; - getModelEvaluationSlice( - request: protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IModelEvaluationSlice, - protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest|null|undefined, - {}|null|undefined>): void; - getModelEvaluationSlice( - request?: protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IModelEvaluationSlice, - protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IModelEvaluationSlice, - protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IModelEvaluationSlice, - protos.google.cloud.aiplatform.v1.IGetModelEvaluationSliceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getModelEvaluationSlice(request, options, callback); - } - -/** - * Uploads a Model artifact into Vertex AI. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location into which to upload the Model. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1.Model} request.model - * Required. The Model to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_ModelService_UploadModel_async - */ - uploadModel( - request?: protos.google.cloud.aiplatform.v1.IUploadModelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - uploadModel( - request: protos.google.cloud.aiplatform.v1.IUploadModelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - uploadModel( - request: protos.google.cloud.aiplatform.v1.IUploadModelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - uploadModel( - request?: protos.google.cloud.aiplatform.v1.IUploadModelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.uploadModel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `uploadModel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_ModelService_UploadModel_async - */ - async checkUploadModelProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.uploadModel, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a Model. - * - * A model cannot be deleted if any {@link google.cloud.aiplatform.v1.Endpoint|Endpoint} resource has a - * {@link google.cloud.aiplatform.v1.DeployedModel|DeployedModel} based on the model in its - * {@link google.cloud.aiplatform.v1.Endpoint.deployed_models|deployed_models} field. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Model resource to be deleted. - * Format: `projects/{project}/locations/{location}/models/{model}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_ModelService_DeleteModel_async - */ - deleteModel( - request?: protos.google.cloud.aiplatform.v1.IDeleteModelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteModel( - request: protos.google.cloud.aiplatform.v1.IDeleteModelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteModel( - request: protos.google.cloud.aiplatform.v1.IDeleteModelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteModel( - request?: protos.google.cloud.aiplatform.v1.IDeleteModelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteModel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteModel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_ModelService_DeleteModel_async - */ - async checkDeleteModelProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteModel, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Exports a trained, exportable Model to a location specified by the - * user. A Model is considered to be exportable if it has at least one - * {@link google.cloud.aiplatform.v1.Model.supported_export_formats|supported export format}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Model to export. - * @param {google.cloud.aiplatform.v1.ExportModelRequest.OutputConfig} request.outputConfig - * Required. The desired output location and configuration. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_ModelService_ExportModel_async - */ - exportModel( - request?: protos.google.cloud.aiplatform.v1.IExportModelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - exportModel( - request: protos.google.cloud.aiplatform.v1.IExportModelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportModel( - request: protos.google.cloud.aiplatform.v1.IExportModelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportModel( - request?: protos.google.cloud.aiplatform.v1.IExportModelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.exportModel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `exportModel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_ModelService_ExportModel_async - */ - async checkExportModelProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.exportModel, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Models in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the Models from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `model` supports = and !=. `model` represents the Model ID, - * i.e. the last segment of the Model's {@link google.cloud.aiplatform.v1.Model.name|resource name}. - * * `display_name` supports = and != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `model=1234` - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.ModelService.ListModels|ModelService.ListModels} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * * `display_name` - * * `create_time` - * * `update_time` - * - * Example: `display_name, create_time desc`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Model]{@link google.cloud.aiplatform.v1.Model}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listModelsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listModels( - request?: protos.google.cloud.aiplatform.v1.IListModelsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IModel[], - protos.google.cloud.aiplatform.v1.IListModelsRequest|null, - protos.google.cloud.aiplatform.v1.IListModelsResponse - ]>; - listModels( - request: protos.google.cloud.aiplatform.v1.IListModelsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelsRequest, - protos.google.cloud.aiplatform.v1.IListModelsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModel>): void; - listModels( - request: protos.google.cloud.aiplatform.v1.IListModelsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelsRequest, - protos.google.cloud.aiplatform.v1.IListModelsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModel>): void; - listModels( - request?: protos.google.cloud.aiplatform.v1.IListModelsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelsRequest, - protos.google.cloud.aiplatform.v1.IListModelsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModel>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelsRequest, - protos.google.cloud.aiplatform.v1.IListModelsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModel>): - Promise<[ - protos.google.cloud.aiplatform.v1.IModel[], - protos.google.cloud.aiplatform.v1.IListModelsRequest|null, - protos.google.cloud.aiplatform.v1.IListModelsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listModels(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the Models from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `model` supports = and !=. `model` represents the Model ID, - * i.e. the last segment of the Model's {@link google.cloud.aiplatform.v1.Model.name|resource name}. - * * `display_name` supports = and != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `model=1234` - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.ModelService.ListModels|ModelService.ListModels} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * * `display_name` - * * `create_time` - * * `update_time` - * - * Example: `display_name, create_time desc`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Model]{@link google.cloud.aiplatform.v1.Model} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listModelsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listModelsStream( - request?: protos.google.cloud.aiplatform.v1.IListModelsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listModels']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listModels.createStream( - this.innerApiCalls.listModels as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listModels`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the Models from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `model` supports = and !=. `model` represents the Model ID, - * i.e. the last segment of the Model's {@link google.cloud.aiplatform.v1.Model.name|resource name}. - * * `display_name` supports = and != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `model=1234` - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.ModelService.ListModels|ModelService.ListModels} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * * `display_name` - * * `create_time` - * * `update_time` - * - * Example: `display_name, create_time desc`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Model]{@link google.cloud.aiplatform.v1.Model}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_ModelService_ListModels_async - */ - listModelsAsync( - request?: protos.google.cloud.aiplatform.v1.IListModelsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listModels']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listModels.asyncIterate( - this.innerApiCalls['listModels'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists ModelEvaluations in a Model. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Model to list the ModelEvaluations from. - * Format: `projects/{project}/locations/{location}/models/{model}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.ModelService.ListModelEvaluations|ModelService.ListModelEvaluations} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [ModelEvaluation]{@link google.cloud.aiplatform.v1.ModelEvaluation}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listModelEvaluationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listModelEvaluations( - request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IModelEvaluation[], - protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest|null, - protos.google.cloud.aiplatform.v1.IListModelEvaluationsResponse - ]>; - listModelEvaluations( - request: protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, - protos.google.cloud.aiplatform.v1.IListModelEvaluationsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModelEvaluation>): void; - listModelEvaluations( - request: protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, - protos.google.cloud.aiplatform.v1.IListModelEvaluationsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModelEvaluation>): void; - listModelEvaluations( - request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, - protos.google.cloud.aiplatform.v1.IListModelEvaluationsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModelEvaluation>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, - protos.google.cloud.aiplatform.v1.IListModelEvaluationsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModelEvaluation>): - Promise<[ - protos.google.cloud.aiplatform.v1.IModelEvaluation[], - protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest|null, - protos.google.cloud.aiplatform.v1.IListModelEvaluationsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listModelEvaluations(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Model to list the ModelEvaluations from. - * Format: `projects/{project}/locations/{location}/models/{model}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.ModelService.ListModelEvaluations|ModelService.ListModelEvaluations} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [ModelEvaluation]{@link google.cloud.aiplatform.v1.ModelEvaluation} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listModelEvaluationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listModelEvaluationsStream( - request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listModelEvaluations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listModelEvaluations.createStream( - this.innerApiCalls.listModelEvaluations as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listModelEvaluations`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Model to list the ModelEvaluations from. - * Format: `projects/{project}/locations/{location}/models/{model}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.ModelService.ListModelEvaluations|ModelService.ListModelEvaluations} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [ModelEvaluation]{@link google.cloud.aiplatform.v1.ModelEvaluation}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_ModelService_ListModelEvaluations_async - */ - listModelEvaluationsAsync( - request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listModelEvaluations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listModelEvaluations.asyncIterate( - this.innerApiCalls['listModelEvaluations'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists ModelEvaluationSlices in a ModelEvaluation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the ModelEvaluation to list the ModelEvaluationSlices - * from. Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` - * @param {string} request.filter - * The standard list filter. - * - * * `slice.dimension` - for =. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListModelEvaluationSlicesResponse.next_page_token|ListModelEvaluationSlicesResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices|ModelService.ListModelEvaluationSlices} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [ModelEvaluationSlice]{@link google.cloud.aiplatform.v1.ModelEvaluationSlice}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listModelEvaluationSlicesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listModelEvaluationSlices( - request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IModelEvaluationSlice[], - protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest|null, - protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesResponse - ]>; - listModelEvaluationSlices( - request: protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, - protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModelEvaluationSlice>): void; - listModelEvaluationSlices( - request: protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, - protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModelEvaluationSlice>): void; - listModelEvaluationSlices( - request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, - protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModelEvaluationSlice>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, - protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModelEvaluationSlice>): - Promise<[ - protos.google.cloud.aiplatform.v1.IModelEvaluationSlice[], - protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest|null, - protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listModelEvaluationSlices(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the ModelEvaluation to list the ModelEvaluationSlices - * from. Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` - * @param {string} request.filter - * The standard list filter. - * - * * `slice.dimension` - for =. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListModelEvaluationSlicesResponse.next_page_token|ListModelEvaluationSlicesResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices|ModelService.ListModelEvaluationSlices} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [ModelEvaluationSlice]{@link google.cloud.aiplatform.v1.ModelEvaluationSlice} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listModelEvaluationSlicesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listModelEvaluationSlicesStream( - request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listModelEvaluationSlices']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listModelEvaluationSlices.createStream( - this.innerApiCalls.listModelEvaluationSlices as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listModelEvaluationSlices`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the ModelEvaluation to list the ModelEvaluationSlices - * from. Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` - * @param {string} request.filter - * The standard list filter. - * - * * `slice.dimension` - for =. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListModelEvaluationSlicesResponse.next_page_token|ListModelEvaluationSlicesResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices|ModelService.ListModelEvaluationSlices} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [ModelEvaluationSlice]{@link google.cloud.aiplatform.v1.ModelEvaluationSlice}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_ModelService_ListModelEvaluationSlices_async - */ - listModelEvaluationSlicesAsync( - request?: protos.google.cloud.aiplatform.v1.IListModelEvaluationSlicesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listModelEvaluationSlices']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listModelEvaluationSlices.asyncIterate( - this.innerApiCalls['listModelEvaluationSlices'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.modelServiceStub && !this._terminated) { - return this.modelServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/model_service_client_config.json b/owl-bot-staging/v1/src/v1/model_service_client_config.json deleted file mode 100644 index 8ecf5e9a..00000000 --- a/owl-bot-staging/v1/src/v1/model_service_client_config.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1.ModelService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "UploadModel": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetModel": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListModels": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateModel": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteModel": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ExportModel": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ImportModelEvaluation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetModelEvaluation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListModelEvaluations": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetModelEvaluationSlice": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListModelEvaluationSlices": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/model_service_proto_list.json b/owl-bot-staging/v1/src/v1/model_service_proto_list.json deleted file mode 100644 index 581a7346..00000000 --- a/owl-bot-staging/v1/src/v1/model_service_proto_list.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1/context.proto", - "../../protos/google/cloud/aiplatform/v1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1/event.proto", - "../../protos/google/cloud/aiplatform/v1/execution.proto", - "../../protos/google/cloud/aiplatform/v1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1/feature.proto", - "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1/index.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1/io.proto", - "../../protos/google/cloud/aiplatform/v1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1/model.proto", - "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1/operation.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1/study.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1/types.proto", - "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1/value.proto", - "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1/src/v1/pipeline_service_client.ts b/owl-bot-staging/v1/src/v1/pipeline_service_client.ts deleted file mode 100644 index 9a013482..00000000 --- a/owl-bot-staging/v1/src/v1/pipeline_service_client.ts +++ /dev/null @@ -1,3550 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/pipeline_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './pipeline_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * A service for creating and managing Vertex AI's pipelines. This includes both - * `TrainingPipeline` resources (used for AutoML and custom training) and - * `PipelineJob` resources (used for Vertex AI Pipelines). - * @class - * @memberof v1 - */ -export class PipelineServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - pipelineServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of PipelineServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof PipelineServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listTrainingPipelines: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'trainingPipelines'), - listPipelineJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'pipelineJobs') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const deleteTrainingPipelineResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteTrainingPipelineMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - const deletePipelineJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deletePipelineJobMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - deleteTrainingPipeline: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteTrainingPipelineResponse.decode.bind(deleteTrainingPipelineResponse), - deleteTrainingPipelineMetadata.decode.bind(deleteTrainingPipelineMetadata)), - deletePipelineJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deletePipelineJobResponse.decode.bind(deletePipelineJobResponse), - deletePipelineJobMetadata.decode.bind(deletePipelineJobMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1.PipelineService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.pipelineServiceStub) { - return this.pipelineServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1.PipelineService. - this.pipelineServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.PipelineService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1.PipelineService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const pipelineServiceStubMethods = - ['createTrainingPipeline', 'getTrainingPipeline', 'listTrainingPipelines', 'deleteTrainingPipeline', 'cancelTrainingPipeline', 'createPipelineJob', 'getPipelineJob', 'listPipelineJobs', 'deletePipelineJob', 'cancelPipelineJob']; - for (const methodName of pipelineServiceStubMethods) { - const callPromise = this.pipelineServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.pipelineServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Creates a TrainingPipeline. A created TrainingPipeline right away will be - * attempted to be run. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the TrainingPipeline in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1.TrainingPipeline} request.trainingPipeline - * Required. The TrainingPipeline to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TrainingPipeline]{@link google.cloud.aiplatform.v1.TrainingPipeline}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_PipelineService_CreateTrainingPipeline_async - */ - createTrainingPipeline( - request?: protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest|undefined, {}|undefined - ]>; - createTrainingPipeline( - request: protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest|null|undefined, - {}|null|undefined>): void; - createTrainingPipeline( - request: protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest|null|undefined, - {}|null|undefined>): void; - createTrainingPipeline( - request?: protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1.ICreateTrainingPipelineRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createTrainingPipeline(request, options, callback); - } -/** - * Gets a TrainingPipeline. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the TrainingPipeline resource. - * Format: - * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TrainingPipeline]{@link google.cloud.aiplatform.v1.TrainingPipeline}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_PipelineService_GetTrainingPipeline_async - */ - getTrainingPipeline( - request?: protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest|undefined, {}|undefined - ]>; - getTrainingPipeline( - request: protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest|null|undefined, - {}|null|undefined>): void; - getTrainingPipeline( - request: protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest|null|undefined, - {}|null|undefined>): void; - getTrainingPipeline( - request?: protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1.IGetTrainingPipelineRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getTrainingPipeline(request, options, callback); - } -/** - * Cancels a TrainingPipeline. - * Starts asynchronous cancellation on the TrainingPipeline. The server - * makes a best effort to cancel the pipeline, but success is not - * guaranteed. Clients can use {@link google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline|PipelineService.GetTrainingPipeline} or - * other methods to check whether the cancellation succeeded or whether the - * pipeline completed despite cancellation. On successful cancellation, - * the TrainingPipeline is not deleted; instead it becomes a pipeline with - * a {@link google.cloud.aiplatform.v1.TrainingPipeline.error|TrainingPipeline.error} value with a {@link google.rpc.Status.code|google.rpc.Status.code} of 1, - * corresponding to `Code.CANCELLED`, and {@link google.cloud.aiplatform.v1.TrainingPipeline.state|TrainingPipeline.state} is set to - * `CANCELLED`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the TrainingPipeline to cancel. - * Format: - * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_PipelineService_CancelTrainingPipeline_async - */ - cancelTrainingPipeline( - request?: protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest|undefined, {}|undefined - ]>; - cancelTrainingPipeline( - request: protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest|null|undefined, - {}|null|undefined>): void; - cancelTrainingPipeline( - request: protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest|null|undefined, - {}|null|undefined>): void; - cancelTrainingPipeline( - request?: protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelTrainingPipelineRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.cancelTrainingPipeline(request, options, callback); - } -/** - * Creates a PipelineJob. A PipelineJob will run immediately when created. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the PipelineJob in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1.PipelineJob} request.pipelineJob - * Required. The PipelineJob to create. - * @param {string} request.pipelineJobId - * The ID to use for the PipelineJob, which will become the final component of - * the PipelineJob name. If not provided, an ID will be automatically - * generated. - * - * This value should be less than 128 characters, and valid characters - * are /{@link 0-9|a-z}-/. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [PipelineJob]{@link google.cloud.aiplatform.v1.PipelineJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_PipelineService_CreatePipelineJob_async - */ - createPipelineJob( - request?: protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IPipelineJob, - protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest|undefined, {}|undefined - ]>; - createPipelineJob( - request: protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IPipelineJob, - protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest|null|undefined, - {}|null|undefined>): void; - createPipelineJob( - request: protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IPipelineJob, - protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest|null|undefined, - {}|null|undefined>): void; - createPipelineJob( - request?: protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IPipelineJob, - protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IPipelineJob, - protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IPipelineJob, - protos.google.cloud.aiplatform.v1.ICreatePipelineJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createPipelineJob(request, options, callback); - } -/** - * Gets a PipelineJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the PipelineJob resource. - * Format: - * `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [PipelineJob]{@link google.cloud.aiplatform.v1.PipelineJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_PipelineService_GetPipelineJob_async - */ - getPipelineJob( - request?: protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IPipelineJob, - protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest|undefined, {}|undefined - ]>; - getPipelineJob( - request: protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IPipelineJob, - protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest|null|undefined, - {}|null|undefined>): void; - getPipelineJob( - request: protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IPipelineJob, - protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest|null|undefined, - {}|null|undefined>): void; - getPipelineJob( - request?: protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IPipelineJob, - protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IPipelineJob, - protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IPipelineJob, - protos.google.cloud.aiplatform.v1.IGetPipelineJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getPipelineJob(request, options, callback); - } -/** - * Cancels a PipelineJob. - * Starts asynchronous cancellation on the PipelineJob. The server - * makes a best effort to cancel the pipeline, but success is not - * guaranteed. Clients can use {@link google.cloud.aiplatform.v1.PipelineService.GetPipelineJob|PipelineService.GetPipelineJob} or - * other methods to check whether the cancellation succeeded or whether the - * pipeline completed despite cancellation. On successful cancellation, - * the PipelineJob is not deleted; instead it becomes a pipeline with - * a {@link google.cloud.aiplatform.v1.PipelineJob.error|PipelineJob.error} value with a {@link google.rpc.Status.code|google.rpc.Status.code} of 1, - * corresponding to `Code.CANCELLED`, and {@link google.cloud.aiplatform.v1.PipelineJob.state|PipelineJob.state} is set to - * `CANCELLED`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the PipelineJob to cancel. - * Format: - * `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_PipelineService_CancelPipelineJob_async - */ - cancelPipelineJob( - request?: protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest|undefined, {}|undefined - ]>; - cancelPipelineJob( - request: protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest|null|undefined, - {}|null|undefined>): void; - cancelPipelineJob( - request: protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest|null|undefined, - {}|null|undefined>): void; - cancelPipelineJob( - request?: protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.ICancelPipelineJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.cancelPipelineJob(request, options, callback); - } - -/** - * Deletes a TrainingPipeline. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the TrainingPipeline resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_PipelineService_DeleteTrainingPipeline_async - */ - deleteTrainingPipeline( - request?: protos.google.cloud.aiplatform.v1.IDeleteTrainingPipelineRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteTrainingPipeline( - request: protos.google.cloud.aiplatform.v1.IDeleteTrainingPipelineRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTrainingPipeline( - request: protos.google.cloud.aiplatform.v1.IDeleteTrainingPipelineRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTrainingPipeline( - request?: protos.google.cloud.aiplatform.v1.IDeleteTrainingPipelineRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteTrainingPipeline(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteTrainingPipeline()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_PipelineService_DeleteTrainingPipeline_async - */ - async checkDeleteTrainingPipelineProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTrainingPipeline, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a PipelineJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the PipelineJob resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_PipelineService_DeletePipelineJob_async - */ - deletePipelineJob( - request?: protos.google.cloud.aiplatform.v1.IDeletePipelineJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deletePipelineJob( - request: protos.google.cloud.aiplatform.v1.IDeletePipelineJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deletePipelineJob( - request: protos.google.cloud.aiplatform.v1.IDeletePipelineJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deletePipelineJob( - request?: protos.google.cloud.aiplatform.v1.IDeletePipelineJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deletePipelineJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deletePipelineJob()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_PipelineService_DeletePipelineJob_async - */ - async checkDeletePipelineJobProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deletePipelineJob, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists TrainingPipelines in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the TrainingPipelines from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name="my_pipeline"` - * - * * `state="PIPELINE_STATE_RUNNING" OR display_name="my_pipeline"` - * - * * `NOT display_name="my_pipeline"` - * - * * `state="PIPELINE_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListTrainingPipelinesResponse.next_page_token|ListTrainingPipelinesResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.PipelineService.ListTrainingPipelines|PipelineService.ListTrainingPipelines} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [TrainingPipeline]{@link google.cloud.aiplatform.v1.TrainingPipeline}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listTrainingPipelinesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTrainingPipelines( - request?: protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITrainingPipeline[], - protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest|null, - protos.google.cloud.aiplatform.v1.IListTrainingPipelinesResponse - ]>; - listTrainingPipelines( - request: protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, - protos.google.cloud.aiplatform.v1.IListTrainingPipelinesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITrainingPipeline>): void; - listTrainingPipelines( - request: protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, - protos.google.cloud.aiplatform.v1.IListTrainingPipelinesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITrainingPipeline>): void; - listTrainingPipelines( - request?: protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, - protos.google.cloud.aiplatform.v1.IListTrainingPipelinesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITrainingPipeline>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, - protos.google.cloud.aiplatform.v1.IListTrainingPipelinesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITrainingPipeline>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITrainingPipeline[], - protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest|null, - protos.google.cloud.aiplatform.v1.IListTrainingPipelinesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listTrainingPipelines(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the TrainingPipelines from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name="my_pipeline"` - * - * * `state="PIPELINE_STATE_RUNNING" OR display_name="my_pipeline"` - * - * * `NOT display_name="my_pipeline"` - * - * * `state="PIPELINE_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListTrainingPipelinesResponse.next_page_token|ListTrainingPipelinesResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.PipelineService.ListTrainingPipelines|PipelineService.ListTrainingPipelines} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [TrainingPipeline]{@link google.cloud.aiplatform.v1.TrainingPipeline} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listTrainingPipelinesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTrainingPipelinesStream( - request?: protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTrainingPipelines']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTrainingPipelines.createStream( - this.innerApiCalls.listTrainingPipelines as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTrainingPipelines`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the TrainingPipelines from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name="my_pipeline"` - * - * * `state="PIPELINE_STATE_RUNNING" OR display_name="my_pipeline"` - * - * * `NOT display_name="my_pipeline"` - * - * * `state="PIPELINE_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListTrainingPipelinesResponse.next_page_token|ListTrainingPipelinesResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.PipelineService.ListTrainingPipelines|PipelineService.ListTrainingPipelines} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [TrainingPipeline]{@link google.cloud.aiplatform.v1.TrainingPipeline}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_PipelineService_ListTrainingPipelines_async - */ - listTrainingPipelinesAsync( - request?: protos.google.cloud.aiplatform.v1.IListTrainingPipelinesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTrainingPipelines']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTrainingPipelines.asyncIterate( - this.innerApiCalls['listTrainingPipelines'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists PipelineJobs in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the PipelineJobs from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the PipelineJobs that match the filter expression. The following - * fields are supported: - * - * * `pipeline_name`: Supports `=` and `!=` comparisons. - * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. - * * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. - * for example, can check if pipeline's display_name contains *step* by doing - * display_name:\"*step*\" - * * `state`: Supports `=` and `!=` comparisons. - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `labels`: Supports key-value equality and key presence. - * * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. - * * `template_metadata.version_name`: Supports `=`, `!=` comparisons, and `:` - * wildcard. - * - * Filter expressions can be combined together using logical operators - * (`AND` & `OR`). - * For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. - * - * The syntax to define filter expression is based on - * https://google.aip.dev/160. - * - * Examples: - * - * * `create_time>"2021-05-18T00:00:00Z" OR - * update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated - * after 2020-05-18 00:00:00 UTC. - * * `labels.env = "prod"` - * PipelineJobs with label "env" set to "prod". - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListPipelineJobsResponse.next_page_token|ListPipelineJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.PipelineService.ListPipelineJobs|PipelineService.ListPipelineJobs} call. - * @param {string} request.orderBy - * A comma-separated list of fields to order by. The default sort order is in - * ascending order. Use "desc" after a field name for descending. You can have - * multiple order_by fields provided e.g. "create_time desc, end_time", - * "end_time, start_time, update_time" For example, using "create_time desc, - * end_time" will order results by create time in descending order, and if - * there are multiple jobs having the same create time, order them by the end - * time in ascending order. if order_by is not specified, it will order by - * default order is create time in descending order. Supported fields: - * * `create_time` - * * `update_time` - * * `end_time` - * * `start_time` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [PipelineJob]{@link google.cloud.aiplatform.v1.PipelineJob}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listPipelineJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listPipelineJobs( - request?: protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IPipelineJob[], - protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest|null, - protos.google.cloud.aiplatform.v1.IListPipelineJobsResponse - ]>; - listPipelineJobs( - request: protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, - protos.google.cloud.aiplatform.v1.IListPipelineJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IPipelineJob>): void; - listPipelineJobs( - request: protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, - protos.google.cloud.aiplatform.v1.IListPipelineJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IPipelineJob>): void; - listPipelineJobs( - request?: protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, - protos.google.cloud.aiplatform.v1.IListPipelineJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IPipelineJob>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, - protos.google.cloud.aiplatform.v1.IListPipelineJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IPipelineJob>): - Promise<[ - protos.google.cloud.aiplatform.v1.IPipelineJob[], - protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest|null, - protos.google.cloud.aiplatform.v1.IListPipelineJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listPipelineJobs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the PipelineJobs from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the PipelineJobs that match the filter expression. The following - * fields are supported: - * - * * `pipeline_name`: Supports `=` and `!=` comparisons. - * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. - * * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. - * for example, can check if pipeline's display_name contains *step* by doing - * display_name:\"*step*\" - * * `state`: Supports `=` and `!=` comparisons. - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `labels`: Supports key-value equality and key presence. - * * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. - * * `template_metadata.version_name`: Supports `=`, `!=` comparisons, and `:` - * wildcard. - * - * Filter expressions can be combined together using logical operators - * (`AND` & `OR`). - * For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. - * - * The syntax to define filter expression is based on - * https://google.aip.dev/160. - * - * Examples: - * - * * `create_time>"2021-05-18T00:00:00Z" OR - * update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated - * after 2020-05-18 00:00:00 UTC. - * * `labels.env = "prod"` - * PipelineJobs with label "env" set to "prod". - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListPipelineJobsResponse.next_page_token|ListPipelineJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.PipelineService.ListPipelineJobs|PipelineService.ListPipelineJobs} call. - * @param {string} request.orderBy - * A comma-separated list of fields to order by. The default sort order is in - * ascending order. Use "desc" after a field name for descending. You can have - * multiple order_by fields provided e.g. "create_time desc, end_time", - * "end_time, start_time, update_time" For example, using "create_time desc, - * end_time" will order results by create time in descending order, and if - * there are multiple jobs having the same create time, order them by the end - * time in ascending order. if order_by is not specified, it will order by - * default order is create time in descending order. Supported fields: - * * `create_time` - * * `update_time` - * * `end_time` - * * `start_time` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [PipelineJob]{@link google.cloud.aiplatform.v1.PipelineJob} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listPipelineJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listPipelineJobsStream( - request?: protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listPipelineJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listPipelineJobs.createStream( - this.innerApiCalls.listPipelineJobs as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listPipelineJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the PipelineJobs from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the PipelineJobs that match the filter expression. The following - * fields are supported: - * - * * `pipeline_name`: Supports `=` and `!=` comparisons. - * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. - * * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. - * for example, can check if pipeline's display_name contains *step* by doing - * display_name:\"*step*\" - * * `state`: Supports `=` and `!=` comparisons. - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `labels`: Supports key-value equality and key presence. - * * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. - * * `template_metadata.version_name`: Supports `=`, `!=` comparisons, and `:` - * wildcard. - * - * Filter expressions can be combined together using logical operators - * (`AND` & `OR`). - * For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. - * - * The syntax to define filter expression is based on - * https://google.aip.dev/160. - * - * Examples: - * - * * `create_time>"2021-05-18T00:00:00Z" OR - * update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated - * after 2020-05-18 00:00:00 UTC. - * * `labels.env = "prod"` - * PipelineJobs with label "env" set to "prod". - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1.ListPipelineJobsResponse.next_page_token|ListPipelineJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1.PipelineService.ListPipelineJobs|PipelineService.ListPipelineJobs} call. - * @param {string} request.orderBy - * A comma-separated list of fields to order by. The default sort order is in - * ascending order. Use "desc" after a field name for descending. You can have - * multiple order_by fields provided e.g. "create_time desc, end_time", - * "end_time, start_time, update_time" For example, using "create_time desc, - * end_time" will order results by create time in descending order, and if - * there are multiple jobs having the same create time, order them by the end - * time in ascending order. if order_by is not specified, it will order by - * default order is create time in descending order. Supported fields: - * * `create_time` - * * `update_time` - * * `end_time` - * * `start_time` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [PipelineJob]{@link google.cloud.aiplatform.v1.PipelineJob}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_PipelineService_ListPipelineJobs_async - */ - listPipelineJobsAsync( - request?: protos.google.cloud.aiplatform.v1.IListPipelineJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listPipelineJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listPipelineJobs.asyncIterate( - this.innerApiCalls['listPipelineJobs'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.pipelineServiceStub && !this._terminated) { - return this.pipelineServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/pipeline_service_client_config.json b/owl-bot-staging/v1/src/v1/pipeline_service_client_config.json deleted file mode 100644 index 0c4df912..00000000 --- a/owl-bot-staging/v1/src/v1/pipeline_service_client_config.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1.PipelineService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateTrainingPipeline": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetTrainingPipeline": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListTrainingPipelines": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteTrainingPipeline": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelTrainingPipeline": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreatePipelineJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetPipelineJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListPipelineJobs": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeletePipelineJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelPipelineJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/pipeline_service_proto_list.json b/owl-bot-staging/v1/src/v1/pipeline_service_proto_list.json deleted file mode 100644 index 581a7346..00000000 --- a/owl-bot-staging/v1/src/v1/pipeline_service_proto_list.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1/context.proto", - "../../protos/google/cloud/aiplatform/v1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1/event.proto", - "../../protos/google/cloud/aiplatform/v1/execution.proto", - "../../protos/google/cloud/aiplatform/v1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1/feature.proto", - "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1/index.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1/io.proto", - "../../protos/google/cloud/aiplatform/v1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1/model.proto", - "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1/operation.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1/study.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1/types.proto", - "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1/value.proto", - "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1/src/v1/prediction_service_client.ts b/owl-bot-staging/v1/src/v1/prediction_service_client.ts deleted file mode 100644 index c12c53de..00000000 --- a/owl-bot-staging/v1/src/v1/prediction_service_client.ts +++ /dev/null @@ -1,2532 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/prediction_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './prediction_service_client_config.json'; - -const version = require('../../../package.json').version; - -/** - * A service for online predictions and explanations. - * @class - * @memberof v1 - */ -export class PredictionServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - predictionServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of PredictionServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof PredictionServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1.PredictionService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.predictionServiceStub) { - return this.predictionServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1.PredictionService. - this.predictionServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.PredictionService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1.PredictionService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const predictionServiceStubMethods = - ['predict', 'rawPredict', 'explain']; - for (const methodName of predictionServiceStubMethods) { - const callPromise = this.predictionServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.predictionServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Perform an online prediction. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.endpoint - * Required. The name of the Endpoint requested to serve the prediction. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param {number[]} request.instances - * Required. The instances that are the input to the prediction call. - * A DeployedModel may have an upper limit on the number of instances it - * supports per request, and when it is exceeded the prediction call errors - * in case of AutoML Models, or, in case of customer created Models, the - * behaviour is as documented by that Model. - * The schema of any single instance may be specified via Endpoint's - * DeployedModels' {@link google.cloud.aiplatform.v1.DeployedModel.model|Model's} - * {@link google.cloud.aiplatform.v1.Model.predict_schemata|PredictSchemata's} - * {@link google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri|instance_schema_uri}. - * @param {google.protobuf.Value} request.parameters - * The parameters that govern the prediction. The schema of the parameters may - * be specified via Endpoint's DeployedModels' {@link google.cloud.aiplatform.v1.DeployedModel.model|Model's } - * {@link google.cloud.aiplatform.v1.Model.predict_schemata|PredictSchemata's} - * {@link google.cloud.aiplatform.v1.PredictSchemata.parameters_schema_uri|parameters_schema_uri}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [PredictResponse]{@link google.cloud.aiplatform.v1.PredictResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_PredictionService_Predict_async - */ - predict( - request?: protos.google.cloud.aiplatform.v1.IPredictRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IPredictResponse, - protos.google.cloud.aiplatform.v1.IPredictRequest|undefined, {}|undefined - ]>; - predict( - request: protos.google.cloud.aiplatform.v1.IPredictRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IPredictResponse, - protos.google.cloud.aiplatform.v1.IPredictRequest|null|undefined, - {}|null|undefined>): void; - predict( - request: protos.google.cloud.aiplatform.v1.IPredictRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IPredictResponse, - protos.google.cloud.aiplatform.v1.IPredictRequest|null|undefined, - {}|null|undefined>): void; - predict( - request?: protos.google.cloud.aiplatform.v1.IPredictRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IPredictResponse, - protos.google.cloud.aiplatform.v1.IPredictRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IPredictResponse, - protos.google.cloud.aiplatform.v1.IPredictRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IPredictResponse, - protos.google.cloud.aiplatform.v1.IPredictRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'endpoint': request.endpoint || '', - }); - this.initialize(); - return this.innerApiCalls.predict(request, options, callback); - } -/** - * Perform an online prediction with an arbitrary HTTP payload. - * - * The response includes the following HTTP headers: - * - * * `X-Vertex-AI-Endpoint-Id`: ID of the {@link google.cloud.aiplatform.v1.Endpoint|Endpoint} that served this - * prediction. - * - * * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's {@link google.cloud.aiplatform.v1.DeployedModel|DeployedModel} - * that served this prediction. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.endpoint - * Required. The name of the Endpoint requested to serve the prediction. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param {google.api.HttpBody} request.httpBody - * The prediction input. Supports HTTP headers and arbitrary data payload. - * - * A {@link google.cloud.aiplatform.v1.DeployedModel|DeployedModel} may have an upper limit on the number of instances it - * supports per request. When this limit it is exceeded for an AutoML model, - * the {@link google.cloud.aiplatform.v1.PredictionService.RawPredict|RawPredict} method returns an error. - * When this limit is exceeded for a custom-trained model, the behavior varies - * depending on the model. - * - * You can specify the schema for each instance in the - * {@link google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri|predict_schemata.instance_schema_uri} - * field when you create a {@link google.cloud.aiplatform.v1.Model|Model}. This schema applies when you deploy the - * `Model` as a `DeployedModel` to an {@link google.cloud.aiplatform.v1.Endpoint|Endpoint} and use the `RawPredict` - * method. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [HttpBody]{@link google.api.HttpBody}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_PredictionService_RawPredict_async - */ - rawPredict( - request?: protos.google.cloud.aiplatform.v1.IRawPredictRequest, - options?: CallOptions): - Promise<[ - protos.google.api.IHttpBody, - protos.google.cloud.aiplatform.v1.IRawPredictRequest|undefined, {}|undefined - ]>; - rawPredict( - request: protos.google.cloud.aiplatform.v1.IRawPredictRequest, - options: CallOptions, - callback: Callback< - protos.google.api.IHttpBody, - protos.google.cloud.aiplatform.v1.IRawPredictRequest|null|undefined, - {}|null|undefined>): void; - rawPredict( - request: protos.google.cloud.aiplatform.v1.IRawPredictRequest, - callback: Callback< - protos.google.api.IHttpBody, - protos.google.cloud.aiplatform.v1.IRawPredictRequest|null|undefined, - {}|null|undefined>): void; - rawPredict( - request?: protos.google.cloud.aiplatform.v1.IRawPredictRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.api.IHttpBody, - protos.google.cloud.aiplatform.v1.IRawPredictRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.api.IHttpBody, - protos.google.cloud.aiplatform.v1.IRawPredictRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.api.IHttpBody, - protos.google.cloud.aiplatform.v1.IRawPredictRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'endpoint': request.endpoint || '', - }); - this.initialize(); - return this.innerApiCalls.rawPredict(request, options, callback); - } -/** - * Perform an online explanation. - * - * If {@link google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id|deployed_model_id} is specified, - * the corresponding DeployModel must have - * {@link google.cloud.aiplatform.v1.DeployedModel.explanation_spec|explanation_spec} - * populated. If {@link google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id|deployed_model_id} - * is not specified, all DeployedModels must have - * {@link google.cloud.aiplatform.v1.DeployedModel.explanation_spec|explanation_spec} - * populated. Only deployed AutoML tabular Models have - * explanation_spec. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.endpoint - * Required. The name of the Endpoint requested to serve the explanation. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param {number[]} request.instances - * Required. The instances that are the input to the explanation call. - * A DeployedModel may have an upper limit on the number of instances it - * supports per request, and when it is exceeded the explanation call errors - * in case of AutoML Models, or, in case of customer created Models, the - * behaviour is as documented by that Model. - * The schema of any single instance may be specified via Endpoint's - * DeployedModels' {@link google.cloud.aiplatform.v1.DeployedModel.model|Model's} - * {@link google.cloud.aiplatform.v1.Model.predict_schemata|PredictSchemata's} - * {@link google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri|instance_schema_uri}. - * @param {google.protobuf.Value} request.parameters - * The parameters that govern the prediction. The schema of the parameters may - * be specified via Endpoint's DeployedModels' {@link google.cloud.aiplatform.v1.DeployedModel.model|Model's } - * {@link google.cloud.aiplatform.v1.Model.predict_schemata|PredictSchemata's} - * {@link google.cloud.aiplatform.v1.PredictSchemata.parameters_schema_uri|parameters_schema_uri}. - * @param {google.cloud.aiplatform.v1.ExplanationSpecOverride} request.explanationSpecOverride - * If specified, overrides the - * {@link google.cloud.aiplatform.v1.DeployedModel.explanation_spec|explanation_spec} of the DeployedModel. - * Can be used for explaining prediction results with different - * configurations, such as: - * - Explaining top-5 predictions results as opposed to top-1; - * - Increasing path count or step count of the attribution methods to reduce - * approximate errors; - * - Using different baselines for explaining the prediction results. - * @param {string} request.deployedModelId - * If specified, this ExplainRequest will be served by the chosen - * DeployedModel, overriding {@link google.cloud.aiplatform.v1.Endpoint.traffic_split|Endpoint.traffic_split}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ExplainResponse]{@link google.cloud.aiplatform.v1.ExplainResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_PredictionService_Explain_async - */ - explain( - request?: protos.google.cloud.aiplatform.v1.IExplainRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IExplainResponse, - protos.google.cloud.aiplatform.v1.IExplainRequest|undefined, {}|undefined - ]>; - explain( - request: protos.google.cloud.aiplatform.v1.IExplainRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IExplainResponse, - protos.google.cloud.aiplatform.v1.IExplainRequest|null|undefined, - {}|null|undefined>): void; - explain( - request: protos.google.cloud.aiplatform.v1.IExplainRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IExplainResponse, - protos.google.cloud.aiplatform.v1.IExplainRequest|null|undefined, - {}|null|undefined>): void; - explain( - request?: protos.google.cloud.aiplatform.v1.IExplainRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IExplainResponse, - protos.google.cloud.aiplatform.v1.IExplainRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IExplainResponse, - protos.google.cloud.aiplatform.v1.IExplainRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IExplainResponse, - protos.google.cloud.aiplatform.v1.IExplainRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'endpoint': request.endpoint || '', - }); - this.initialize(); - return this.innerApiCalls.explain(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.predictionServiceStub && !this._terminated) { - return this.predictionServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/prediction_service_client_config.json b/owl-bot-staging/v1/src/v1/prediction_service_client_config.json deleted file mode 100644 index e043161e..00000000 --- a/owl-bot-staging/v1/src/v1/prediction_service_client_config.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1.PredictionService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "Predict": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RawPredict": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "Explain": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/prediction_service_proto_list.json b/owl-bot-staging/v1/src/v1/prediction_service_proto_list.json deleted file mode 100644 index 581a7346..00000000 --- a/owl-bot-staging/v1/src/v1/prediction_service_proto_list.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1/context.proto", - "../../protos/google/cloud/aiplatform/v1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1/event.proto", - "../../protos/google/cloud/aiplatform/v1/execution.proto", - "../../protos/google/cloud/aiplatform/v1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1/feature.proto", - "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1/index.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1/io.proto", - "../../protos/google/cloud/aiplatform/v1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1/model.proto", - "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1/operation.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1/study.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1/types.proto", - "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1/value.proto", - "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1/src/v1/specialist_pool_service_client.ts b/owl-bot-staging/v1/src/v1/specialist_pool_service_client.ts deleted file mode 100644 index a7e01c72..00000000 --- a/owl-bot-staging/v1/src/v1/specialist_pool_service_client.ts +++ /dev/null @@ -1,2883 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/specialist_pool_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './specialist_pool_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * A service for creating and managing Customer SpecialistPools. - * When customers start Data Labeling jobs, they can reuse/create Specialist - * Pools to bring their own Specialists to label the data. - * Customers can add/remove Managers for the Specialist Pool on Cloud console, - * then Managers will get email notifications to manage Specialists and tasks on - * CrowdCompute console. - * @class - * @memberof v1 - */ -export class SpecialistPoolServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - specialistPoolServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of SpecialistPoolServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof SpecialistPoolServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listSpecialistPools: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'specialistPools') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const createSpecialistPoolResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.SpecialistPool') as gax.protobuf.Type; - const createSpecialistPoolMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata') as gax.protobuf.Type; - const deleteSpecialistPoolResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteSpecialistPoolMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - const updateSpecialistPoolResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.SpecialistPool') as gax.protobuf.Type; - const updateSpecialistPoolMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createSpecialistPool: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createSpecialistPoolResponse.decode.bind(createSpecialistPoolResponse), - createSpecialistPoolMetadata.decode.bind(createSpecialistPoolMetadata)), - deleteSpecialistPool: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteSpecialistPoolResponse.decode.bind(deleteSpecialistPoolResponse), - deleteSpecialistPoolMetadata.decode.bind(deleteSpecialistPoolMetadata)), - updateSpecialistPool: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateSpecialistPoolResponse.decode.bind(updateSpecialistPoolResponse), - updateSpecialistPoolMetadata.decode.bind(updateSpecialistPoolMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1.SpecialistPoolService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.specialistPoolServiceStub) { - return this.specialistPoolServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1.SpecialistPoolService. - this.specialistPoolServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.SpecialistPoolService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1.SpecialistPoolService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const specialistPoolServiceStubMethods = - ['createSpecialistPool', 'getSpecialistPool', 'listSpecialistPools', 'deleteSpecialistPool', 'updateSpecialistPool']; - for (const methodName of specialistPoolServiceStubMethods) { - const callPromise = this.specialistPoolServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.specialistPoolServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets a SpecialistPool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the SpecialistPool resource. - * The form is - * `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SpecialistPool]{@link google.cloud.aiplatform.v1.SpecialistPool}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_SpecialistPoolService_GetSpecialistPool_async - */ - getSpecialistPool( - request?: protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ISpecialistPool, - protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest|undefined, {}|undefined - ]>; - getSpecialistPool( - request: protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ISpecialistPool, - protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest|null|undefined, - {}|null|undefined>): void; - getSpecialistPool( - request: protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ISpecialistPool, - protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest|null|undefined, - {}|null|undefined>): void; - getSpecialistPool( - request?: protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ISpecialistPool, - protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ISpecialistPool, - protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ISpecialistPool, - protos.google.cloud.aiplatform.v1.IGetSpecialistPoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getSpecialistPool(request, options, callback); - } - -/** - * Creates a SpecialistPool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent Project name for the new SpecialistPool. - * The form is `projects/{project}/locations/{location}`. - * @param {google.cloud.aiplatform.v1.SpecialistPool} request.specialistPool - * Required. The SpecialistPool to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_SpecialistPoolService_CreateSpecialistPool_async - */ - createSpecialistPool( - request?: protos.google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createSpecialistPool( - request: protos.google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createSpecialistPool( - request: protos.google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createSpecialistPool( - request?: protos.google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createSpecialistPool(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createSpecialistPool()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_SpecialistPoolService_CreateSpecialistPool_async - */ - async checkCreateSpecialistPoolProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createSpecialistPool, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a SpecialistPool as well as all Specialists in the pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the SpecialistPool to delete. Format: - * `projects/{project}/locations/{location}/specialistPools/{specialist_pool}` - * @param {boolean} request.force - * If set to true, any specialist managers in this SpecialistPool will also be - * deleted. (Otherwise, the request will only work if the SpecialistPool has - * no specialist managers.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_SpecialistPoolService_DeleteSpecialistPool_async - */ - deleteSpecialistPool( - request?: protos.google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteSpecialistPool( - request: protos.google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteSpecialistPool( - request: protos.google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteSpecialistPool( - request?: protos.google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteSpecialistPool(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteSpecialistPool()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_SpecialistPoolService_DeleteSpecialistPool_async - */ - async checkDeleteSpecialistPoolProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteSpecialistPool, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates a SpecialistPool. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1.SpecialistPool} request.specialistPool - * Required. The SpecialistPool which replaces the resource on the server. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The update mask applies to the resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_SpecialistPoolService_UpdateSpecialistPool_async - */ - updateSpecialistPool( - request?: protos.google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateSpecialistPool( - request: protos.google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateSpecialistPool( - request: protos.google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateSpecialistPool( - request?: protos.google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'specialist_pool.name': request.specialistPool!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateSpecialistPool(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateSpecialistPool()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_SpecialistPoolService_UpdateSpecialistPool_async - */ - async checkUpdateSpecialistPoolProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateSpecialistPool, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists SpecialistPools in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the SpecialistPool's parent resource. - * Format: `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained by {@link google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.next_page_token|ListSpecialistPoolsResponse.next_page_token} of - * the previous {@link google.cloud.aiplatform.v1.SpecialistPoolService.ListSpecialistPools|SpecialistPoolService.ListSpecialistPools} call. Return - * first page if empty. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. FieldMask represents a set of - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [SpecialistPool]{@link google.cloud.aiplatform.v1.SpecialistPool}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listSpecialistPoolsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listSpecialistPools( - request?: protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ISpecialistPool[], - protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest|null, - protos.google.cloud.aiplatform.v1.IListSpecialistPoolsResponse - ]>; - listSpecialistPools( - request: protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, - protos.google.cloud.aiplatform.v1.IListSpecialistPoolsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ISpecialistPool>): void; - listSpecialistPools( - request: protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, - protos.google.cloud.aiplatform.v1.IListSpecialistPoolsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ISpecialistPool>): void; - listSpecialistPools( - request?: protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, - protos.google.cloud.aiplatform.v1.IListSpecialistPoolsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ISpecialistPool>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, - protos.google.cloud.aiplatform.v1.IListSpecialistPoolsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ISpecialistPool>): - Promise<[ - protos.google.cloud.aiplatform.v1.ISpecialistPool[], - protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest|null, - protos.google.cloud.aiplatform.v1.IListSpecialistPoolsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listSpecialistPools(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the SpecialistPool's parent resource. - * Format: `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained by {@link google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.next_page_token|ListSpecialistPoolsResponse.next_page_token} of - * the previous {@link google.cloud.aiplatform.v1.SpecialistPoolService.ListSpecialistPools|SpecialistPoolService.ListSpecialistPools} call. Return - * first page if empty. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. FieldMask represents a set of - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [SpecialistPool]{@link google.cloud.aiplatform.v1.SpecialistPool} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listSpecialistPoolsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listSpecialistPoolsStream( - request?: protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listSpecialistPools']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSpecialistPools.createStream( - this.innerApiCalls.listSpecialistPools as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSpecialistPools`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the SpecialistPool's parent resource. - * Format: `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained by {@link google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.next_page_token|ListSpecialistPoolsResponse.next_page_token} of - * the previous {@link google.cloud.aiplatform.v1.SpecialistPoolService.ListSpecialistPools|SpecialistPoolService.ListSpecialistPools} call. Return - * first page if empty. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. FieldMask represents a set of - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [SpecialistPool]{@link google.cloud.aiplatform.v1.SpecialistPool}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_SpecialistPoolService_ListSpecialistPools_async - */ - listSpecialistPoolsAsync( - request?: protos.google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listSpecialistPools']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSpecialistPools.asyncIterate( - this.innerApiCalls['listSpecialistPools'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.specialistPoolServiceStub && !this._terminated) { - return this.specialistPoolServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/specialist_pool_service_client_config.json b/owl-bot-staging/v1/src/v1/specialist_pool_service_client_config.json deleted file mode 100644 index a80b72c2..00000000 --- a/owl-bot-staging/v1/src/v1/specialist_pool_service_client_config.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1.SpecialistPoolService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateSpecialistPool": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetSpecialistPool": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListSpecialistPools": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteSpecialistPool": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateSpecialistPool": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/specialist_pool_service_proto_list.json b/owl-bot-staging/v1/src/v1/specialist_pool_service_proto_list.json deleted file mode 100644 index 581a7346..00000000 --- a/owl-bot-staging/v1/src/v1/specialist_pool_service_proto_list.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1/context.proto", - "../../protos/google/cloud/aiplatform/v1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1/event.proto", - "../../protos/google/cloud/aiplatform/v1/execution.proto", - "../../protos/google/cloud/aiplatform/v1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1/feature.proto", - "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1/index.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1/io.proto", - "../../protos/google/cloud/aiplatform/v1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1/model.proto", - "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1/operation.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1/study.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1/types.proto", - "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1/value.proto", - "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1/src/v1/tensorboard_service_client.ts b/owl-bot-staging/v1/src/v1/tensorboard_service_client.ts deleted file mode 100644 index 4d0c6c02..00000000 --- a/owl-bot-staging/v1/src/v1/tensorboard_service_client.ts +++ /dev/null @@ -1,5388 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall, GoogleError} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import { PassThrough } from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/tensorboard_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './tensorboard_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * TensorboardService - * @class - * @memberof v1 - */ -export class TensorboardServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - tensorboardServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of TensorboardServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof TensorboardServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listTensorboards: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tensorboards'), - listTensorboardExperiments: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tensorboardExperiments'), - listTensorboardRuns: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tensorboardRuns'), - listTensorboardTimeSeries: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tensorboardTimeSeries'), - exportTensorboardTimeSeriesData: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'timeSeriesDataPoints') - }; - - // Some of the methods on this service provide streaming responses. - // Provide descriptors for these. - this.descriptors.stream = { - readTensorboardBlobData: new this._gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING) - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const createTensorboardResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.Tensorboard') as gax.protobuf.Type; - const createTensorboardMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata') as gax.protobuf.Type; - const updateTensorboardResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.Tensorboard') as gax.protobuf.Type; - const updateTensorboardMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata') as gax.protobuf.Type; - const deleteTensorboardResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteTensorboardMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - const deleteTensorboardExperimentResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteTensorboardExperimentMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - const deleteTensorboardRunResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteTensorboardRunMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - const deleteTensorboardTimeSeriesResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteTensorboardTimeSeriesMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.DeleteOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createTensorboard: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createTensorboardResponse.decode.bind(createTensorboardResponse), - createTensorboardMetadata.decode.bind(createTensorboardMetadata)), - updateTensorboard: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateTensorboardResponse.decode.bind(updateTensorboardResponse), - updateTensorboardMetadata.decode.bind(updateTensorboardMetadata)), - deleteTensorboard: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteTensorboardResponse.decode.bind(deleteTensorboardResponse), - deleteTensorboardMetadata.decode.bind(deleteTensorboardMetadata)), - deleteTensorboardExperiment: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteTensorboardExperimentResponse.decode.bind(deleteTensorboardExperimentResponse), - deleteTensorboardExperimentMetadata.decode.bind(deleteTensorboardExperimentMetadata)), - deleteTensorboardRun: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteTensorboardRunResponse.decode.bind(deleteTensorboardRunResponse), - deleteTensorboardRunMetadata.decode.bind(deleteTensorboardRunMetadata)), - deleteTensorboardTimeSeries: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteTensorboardTimeSeriesResponse.decode.bind(deleteTensorboardTimeSeriesResponse), - deleteTensorboardTimeSeriesMetadata.decode.bind(deleteTensorboardTimeSeriesMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1.TensorboardService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.tensorboardServiceStub) { - return this.tensorboardServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1.TensorboardService. - this.tensorboardServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.TensorboardService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1.TensorboardService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const tensorboardServiceStubMethods = - ['createTensorboard', 'getTensorboard', 'updateTensorboard', 'listTensorboards', 'deleteTensorboard', 'createTensorboardExperiment', 'getTensorboardExperiment', 'updateTensorboardExperiment', 'listTensorboardExperiments', 'deleteTensorboardExperiment', 'createTensorboardRun', 'batchCreateTensorboardRuns', 'getTensorboardRun', 'updateTensorboardRun', 'listTensorboardRuns', 'deleteTensorboardRun', 'batchCreateTensorboardTimeSeries', 'createTensorboardTimeSeries', 'getTensorboardTimeSeries', 'updateTensorboardTimeSeries', 'listTensorboardTimeSeries', 'deleteTensorboardTimeSeries', 'batchReadTensorboardTimeSeriesData', 'readTensorboardTimeSeriesData', 'readTensorboardBlobData', 'writeTensorboardExperimentData', 'writeTensorboardRunData', 'exportTensorboardTimeSeriesData']; - for (const methodName of tensorboardServiceStubMethods) { - const callPromise = this.tensorboardServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - if (methodName in this.descriptors.stream) { - const stream = new PassThrough(); - setImmediate(() => { - stream.emit('error', new GoogleError('The client has already been closed.')); - }); - return stream; - } - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.tensorboardServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets a Tensorboard. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Tensorboard resource. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Tensorboard]{@link google.cloud.aiplatform.v1.Tensorboard}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_GetTensorboard_async - */ - getTensorboard( - request?: protos.google.cloud.aiplatform.v1.IGetTensorboardRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboard, - protos.google.cloud.aiplatform.v1.IGetTensorboardRequest|undefined, {}|undefined - ]>; - getTensorboard( - request: protos.google.cloud.aiplatform.v1.IGetTensorboardRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboard, - protos.google.cloud.aiplatform.v1.IGetTensorboardRequest|null|undefined, - {}|null|undefined>): void; - getTensorboard( - request: protos.google.cloud.aiplatform.v1.IGetTensorboardRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboard, - protos.google.cloud.aiplatform.v1.IGetTensorboardRequest|null|undefined, - {}|null|undefined>): void; - getTensorboard( - request?: protos.google.cloud.aiplatform.v1.IGetTensorboardRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ITensorboard, - protos.google.cloud.aiplatform.v1.IGetTensorboardRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ITensorboard, - protos.google.cloud.aiplatform.v1.IGetTensorboardRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboard, - protos.google.cloud.aiplatform.v1.IGetTensorboardRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getTensorboard(request, options, callback); - } -/** - * Creates a TensorboardExperiment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Tensorboard to create the TensorboardExperiment - * in. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - * @param {google.cloud.aiplatform.v1.TensorboardExperiment} request.tensorboardExperiment - * The TensorboardExperiment to create. - * @param {string} request.tensorboardExperimentId - * Required. The ID to use for the Tensorboard experiment, which will become the final - * component of the Tensorboard experiment's resource name. - * - * This value should be 1-128 characters, and valid characters - * are /{@link 0-9|a-z}-/. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TensorboardExperiment]{@link google.cloud.aiplatform.v1.TensorboardExperiment}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_CreateTensorboardExperiment_async - */ - createTensorboardExperiment( - request?: protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest|undefined, {}|undefined - ]>; - createTensorboardExperiment( - request: protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest|null|undefined, - {}|null|undefined>): void; - createTensorboardExperiment( - request: protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest|null|undefined, - {}|null|undefined>): void; - createTensorboardExperiment( - request?: protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createTensorboardExperiment(request, options, callback); - } -/** - * Gets a TensorboardExperiment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the TensorboardExperiment resource. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TensorboardExperiment]{@link google.cloud.aiplatform.v1.TensorboardExperiment}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_GetTensorboardExperiment_async - */ - getTensorboardExperiment( - request?: protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest|undefined, {}|undefined - ]>; - getTensorboardExperiment( - request: protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest|null|undefined, - {}|null|undefined>): void; - getTensorboardExperiment( - request: protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest|null|undefined, - {}|null|undefined>): void; - getTensorboardExperiment( - request?: protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getTensorboardExperiment(request, options, callback); - } -/** - * Updates a TensorboardExperiment. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Field mask is used to specify the fields to be overwritten in the - * TensorboardExperiment resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten if new - * values are specified. - * @param {google.cloud.aiplatform.v1.TensorboardExperiment} request.tensorboardExperiment - * Required. The TensorboardExperiment's `name` field is used to identify the - * TensorboardExperiment to be updated. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TensorboardExperiment]{@link google.cloud.aiplatform.v1.TensorboardExperiment}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_UpdateTensorboardExperiment_async - */ - updateTensorboardExperiment( - request?: protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest|undefined, {}|undefined - ]>; - updateTensorboardExperiment( - request: protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest|null|undefined, - {}|null|undefined>): void; - updateTensorboardExperiment( - request: protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest|null|undefined, - {}|null|undefined>): void; - updateTensorboardExperiment( - request?: protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard_experiment.name': request.tensorboardExperiment!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateTensorboardExperiment(request, options, callback); - } -/** - * Creates a TensorboardRun. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardExperiment to create the TensorboardRun - * in. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * @param {google.cloud.aiplatform.v1.TensorboardRun} request.tensorboardRun - * Required. The TensorboardRun to create. - * @param {string} request.tensorboardRunId - * Required. The ID to use for the Tensorboard run, which will become the final - * component of the Tensorboard run's resource name. - * - * This value should be 1-128 characters, and valid characters - * are /{@link 0-9|a-z}-/. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TensorboardRun]{@link google.cloud.aiplatform.v1.TensorboardRun}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_CreateTensorboardRun_async - */ - createTensorboardRun( - request?: protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardRun, - protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest|undefined, {}|undefined - ]>; - createTensorboardRun( - request: protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardRun, - protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest|null|undefined, - {}|null|undefined>): void; - createTensorboardRun( - request: protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardRun, - protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest|null|undefined, - {}|null|undefined>): void; - createTensorboardRun( - request?: protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ITensorboardRun, - protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardRun, - protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardRun, - protos.google.cloud.aiplatform.v1.ICreateTensorboardRunRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createTensorboardRun(request, options, callback); - } -/** - * Batch create TensorboardRuns. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardExperiment to create the - * TensorboardRuns in. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * The parent field in the CreateTensorboardRunRequest messages must match - * this field. - * @param {number[]} request.requests - * Required. The request message specifying the TensorboardRuns to create. - * A maximum of 1000 TensorboardRuns can be created in a batch. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchCreateTensorboardRunsResponse]{@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_BatchCreateTensorboardRuns_async - */ - batchCreateTensorboardRuns( - request?: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse, - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest|undefined, {}|undefined - ]>; - batchCreateTensorboardRuns( - request: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse, - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest|null|undefined, - {}|null|undefined>): void; - batchCreateTensorboardRuns( - request: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse, - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest|null|undefined, - {}|null|undefined>): void; - batchCreateTensorboardRuns( - request?: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse, - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse, - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse, - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.batchCreateTensorboardRuns(request, options, callback); - } -/** - * Gets a TensorboardRun. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the TensorboardRun resource. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TensorboardRun]{@link google.cloud.aiplatform.v1.TensorboardRun}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_GetTensorboardRun_async - */ - getTensorboardRun( - request?: protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardRun, - protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest|undefined, {}|undefined - ]>; - getTensorboardRun( - request: protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardRun, - protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest|null|undefined, - {}|null|undefined>): void; - getTensorboardRun( - request: protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardRun, - protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest|null|undefined, - {}|null|undefined>): void; - getTensorboardRun( - request?: protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ITensorboardRun, - protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardRun, - protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardRun, - protos.google.cloud.aiplatform.v1.IGetTensorboardRunRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getTensorboardRun(request, options, callback); - } -/** - * Updates a TensorboardRun. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Field mask is used to specify the fields to be overwritten in the - * TensorboardRun resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten if new - * values are specified. - * @param {google.cloud.aiplatform.v1.TensorboardRun} request.tensorboardRun - * Required. The TensorboardRun's `name` field is used to identify the TensorboardRun to - * be updated. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TensorboardRun]{@link google.cloud.aiplatform.v1.TensorboardRun}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_UpdateTensorboardRun_async - */ - updateTensorboardRun( - request?: protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardRun, - protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest|undefined, {}|undefined - ]>; - updateTensorboardRun( - request: protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardRun, - protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest|null|undefined, - {}|null|undefined>): void; - updateTensorboardRun( - request: protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardRun, - protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest|null|undefined, - {}|null|undefined>): void; - updateTensorboardRun( - request?: protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ITensorboardRun, - protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardRun, - protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardRun, - protos.google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard_run.name': request.tensorboardRun!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateTensorboardRun(request, options, callback); - } -/** - * Batch create TensorboardTimeSeries that belong to a TensorboardExperiment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardExperiment to create the - * TensorboardTimeSeries in. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * The TensorboardRuns referenced by the parent fields in the - * CreateTensorboardTimeSeriesRequest messages must be sub resources of this - * TensorboardExperiment. - * @param {number[]} request.requests - * Required. The request message specifying the TensorboardTimeSeries to create. - * A maximum of 1000 TensorboardTimeSeries can be created in a batch. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchCreateTensorboardTimeSeriesResponse]{@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_BatchCreateTensorboardTimeSeries_async - */ - batchCreateTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse, - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest|undefined, {}|undefined - ]>; - batchCreateTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse, - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): void; - batchCreateTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse, - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): void; - batchCreateTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse, - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse, - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse, - protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.batchCreateTensorboardTimeSeries(request, options, callback); - } -/** - * Creates a TensorboardTimeSeries. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardRun to create the - * TensorboardTimeSeries in. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - * @param {string} [request.tensorboardTimeSeriesId] - * Optional. The user specified unique ID to use for the TensorboardTimeSeries, which - * will become the final component of the TensorboardTimeSeries's resource - * name. - * This value should match "{@link a-z0-9-|a-z0-9}{0, 127}" - * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries} request.tensorboardTimeSeries - * Required. The TensorboardTimeSeries to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1.TensorboardTimeSeries}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_CreateTensorboardTimeSeries_async - */ - createTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest|undefined, {}|undefined - ]>; - createTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): void; - createTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): void; - createTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createTensorboardTimeSeries(request, options, callback); - } -/** - * Gets a TensorboardTimeSeries. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the TensorboardTimeSeries resource. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1.TensorboardTimeSeries}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_GetTensorboardTimeSeries_async - */ - getTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest|undefined, {}|undefined - ]>; - getTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): void; - getTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): void; - getTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getTensorboardTimeSeries(request, options, callback); - } -/** - * Updates a TensorboardTimeSeries. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Field mask is used to specify the fields to be overwritten in the - * TensorboardTimeSeries resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten if new - * values are specified. - * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries} request.tensorboardTimeSeries - * Required. The TensorboardTimeSeries' `name` field is used to identify the - * TensorboardTimeSeries to be updated. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1.TensorboardTimeSeries}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_UpdateTensorboardTimeSeries_async - */ - updateTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest|undefined, {}|undefined - ]>; - updateTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): void; - updateTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): void; - updateTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard_time_series.name': request.tensorboardTimeSeries!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateTensorboardTimeSeries(request, options, callback); - } -/** - * Reads multiple TensorboardTimeSeries' data. The data point number limit is - * 1000 for scalars, 100 for tensors and blob references. If the number of - * data points stored is less than the limit, all data will be returned. - * Otherwise, that limit number of data points will be randomly selected from - * this time series and returned. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tensorboard - * Required. The resource name of the Tensorboard containing TensorboardTimeSeries to - * read data from. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}`. - * The TensorboardTimeSeries referenced by {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest.time_series|time_series} must be sub - * resources of this Tensorboard. - * @param {string[]} request.timeSeries - * Required. The resource names of the TensorboardTimeSeries to read data from. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchReadTensorboardTimeSeriesDataResponse]{@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_BatchReadTensorboardTimeSeriesData_async - */ - batchReadTensorboardTimeSeriesData( - request?: protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest|undefined, {}|undefined - ]>; - batchReadTensorboardTimeSeriesData( - request: protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest|null|undefined, - {}|null|undefined>): void; - batchReadTensorboardTimeSeriesData( - request: protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest|null|undefined, - {}|null|undefined>): void; - batchReadTensorboardTimeSeriesData( - request?: protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard': request.tensorboard || '', - }); - this.initialize(); - return this.innerApiCalls.batchReadTensorboardTimeSeriesData(request, options, callback); - } -/** - * Reads a TensorboardTimeSeries' data. By default, if the number of data - * points stored is less than 1000, all data will be returned. Otherwise, 1000 - * data points will be randomly selected from this time series and returned. - * This value can be changed by changing max_data_points, which can't be - * greater than 10k. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tensorboardTimeSeries - * Required. The resource name of the TensorboardTimeSeries to read data from. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param {number} request.maxDataPoints - * The maximum number of TensorboardTimeSeries' data to return. - * - * This value should be a positive integer. - * This value can be set to -1 to return all data. - * @param {string} request.filter - * Reads the TensorboardTimeSeries' data that match the filter expression. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ReadTensorboardTimeSeriesDataResponse]{@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_ReadTensorboardTimeSeriesData_async - */ - readTensorboardTimeSeriesData( - request?: protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest|undefined, {}|undefined - ]>; - readTensorboardTimeSeriesData( - request: protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest|null|undefined, - {}|null|undefined>): void; - readTensorboardTimeSeriesData( - request: protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest|null|undefined, - {}|null|undefined>): void; - readTensorboardTimeSeriesData( - request?: protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard_time_series': request.tensorboardTimeSeries || '', - }); - this.initialize(); - return this.innerApiCalls.readTensorboardTimeSeriesData(request, options, callback); - } -/** - * Write time series data points of multiple TensorboardTimeSeries in multiple - * TensorboardRun's. If any data fail to be ingested, an error will be - * returned. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tensorboardExperiment - * Required. The resource name of the TensorboardExperiment to write data to. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * @param {number[]} request.writeRunDataRequests - * Required. Requests containing per-run TensorboardTimeSeries data to write. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [WriteTensorboardExperimentDataResponse]{@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_WriteTensorboardExperimentData_async - */ - writeTensorboardExperimentData( - request?: protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse, - protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest|undefined, {}|undefined - ]>; - writeTensorboardExperimentData( - request: protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse, - protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest|null|undefined, - {}|null|undefined>): void; - writeTensorboardExperimentData( - request: protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse, - protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest|null|undefined, - {}|null|undefined>): void; - writeTensorboardExperimentData( - request?: protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse, - protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse, - protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse, - protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard_experiment': request.tensorboardExperiment || '', - }); - this.initialize(); - return this.innerApiCalls.writeTensorboardExperimentData(request, options, callback); - } -/** - * Write time series data points into multiple TensorboardTimeSeries under - * a TensorboardRun. If any data fail to be ingested, an error will be - * returned. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tensorboardRun - * Required. The resource name of the TensorboardRun to write data to. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - * @param {number[]} request.timeSeriesData - * Required. The TensorboardTimeSeries data to write. - * Values with in a time series are indexed by their step value. - * Repeated writes to the same step will overwrite the existing value for that - * step. - * The upper limit of data points per write request is 5000. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [WriteTensorboardRunDataResponse]{@link google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_WriteTensorboardRunData_async - */ - writeTensorboardRunData( - request?: protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse, - protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest|undefined, {}|undefined - ]>; - writeTensorboardRunData( - request: protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse, - protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest|null|undefined, - {}|null|undefined>): void; - writeTensorboardRunData( - request: protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse, - protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest|null|undefined, - {}|null|undefined>): void; - writeTensorboardRunData( - request?: protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse, - protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse, - protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse, - protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard_run': request.tensorboardRun || '', - }); - this.initialize(); - return this.innerApiCalls.writeTensorboardRunData(request, options, callback); - } - -/** - * Gets bytes of TensorboardBlobs. - * This is to allow reading blob data stored in consumer project's Cloud - * Storage bucket without users having to obtain Cloud Storage access - * permission. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.timeSeries - * Required. The resource name of the TensorboardTimeSeries to list Blobs. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - * @param {string[]} request.blobIds - * IDs of the blobs to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits [ReadTensorboardBlobDataResponse]{@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse} on 'data' event. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_ReadTensorboardBlobData_async - */ - readTensorboardBlobData( - request?: protos.google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest, - options?: CallOptions): - gax.CancellableStream{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'time_series': request.timeSeries || '', - }); - this.initialize(); - return this.innerApiCalls.readTensorboardBlobData(request, options); - } - -/** - * Creates a Tensorboard. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the Tensorboard in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1.Tensorboard} request.tensorboard - * Required. The Tensorboard to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_CreateTensorboard_async - */ - createTensorboard( - request?: protos.google.cloud.aiplatform.v1.ICreateTensorboardRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createTensorboard( - request: protos.google.cloud.aiplatform.v1.ICreateTensorboardRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createTensorboard( - request: protos.google.cloud.aiplatform.v1.ICreateTensorboardRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createTensorboard( - request?: protos.google.cloud.aiplatform.v1.ICreateTensorboardRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createTensorboard(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createTensorboard()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_CreateTensorboard_async - */ - async checkCreateTensorboardProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createTensorboard, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates a Tensorboard. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Field mask is used to specify the fields to be overwritten in the - * Tensorboard resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten if new - * values are specified. - * @param {google.cloud.aiplatform.v1.Tensorboard} request.tensorboard - * Required. The Tensorboard's `name` field is used to identify the - * Tensorboard to be updated. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_UpdateTensorboard_async - */ - updateTensorboard( - request?: protos.google.cloud.aiplatform.v1.IUpdateTensorboardRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateTensorboard( - request: protos.google.cloud.aiplatform.v1.IUpdateTensorboardRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateTensorboard( - request: protos.google.cloud.aiplatform.v1.IUpdateTensorboardRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateTensorboard( - request?: protos.google.cloud.aiplatform.v1.IUpdateTensorboardRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard.name': request.tensorboard!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateTensorboard(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateTensorboard()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_UpdateTensorboard_async - */ - async checkUpdateTensorboardProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateTensorboard, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a Tensorboard. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Tensorboard to be deleted. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_DeleteTensorboard_async - */ - deleteTensorboard( - request?: protos.google.cloud.aiplatform.v1.IDeleteTensorboardRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteTensorboard( - request: protos.google.cloud.aiplatform.v1.IDeleteTensorboardRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTensorboard( - request: protos.google.cloud.aiplatform.v1.IDeleteTensorboardRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTensorboard( - request?: protos.google.cloud.aiplatform.v1.IDeleteTensorboardRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteTensorboard(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteTensorboard()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_DeleteTensorboard_async - */ - async checkDeleteTensorboardProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTensorboard, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a TensorboardExperiment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the TensorboardExperiment to be deleted. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_DeleteTensorboardExperiment_async - */ - deleteTensorboardExperiment( - request?: protos.google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteTensorboardExperiment( - request: protos.google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTensorboardExperiment( - request: protos.google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTensorboardExperiment( - request?: protos.google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteTensorboardExperiment(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteTensorboardExperiment()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_DeleteTensorboardExperiment_async - */ - async checkDeleteTensorboardExperimentProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTensorboardExperiment, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a TensorboardRun. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the TensorboardRun to be deleted. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_DeleteTensorboardRun_async - */ - deleteTensorboardRun( - request?: protos.google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteTensorboardRun( - request: protos.google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTensorboardRun( - request: protos.google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTensorboardRun( - request?: protos.google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteTensorboardRun(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteTensorboardRun()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_DeleteTensorboardRun_async - */ - async checkDeleteTensorboardRunProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTensorboardRun, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a TensorboardTimeSeries. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the TensorboardTimeSeries to be deleted. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_DeleteTensorboardTimeSeries_async - */ - deleteTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteTensorboardTimeSeries(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteTensorboardTimeSeries()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_DeleteTensorboardTimeSeries_async - */ - async checkDeleteTensorboardTimeSeriesProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTensorboardTimeSeries, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Tensorboards in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list Tensorboards. - * Format: - * `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the Tensorboards that match the filter expression. - * @param {number} request.pageSize - * The maximum number of Tensorboards to return. The service may return - * fewer than this value. If unspecified, at most 100 Tensorboards will be - * returned. The maximum value is 100; values above 100 will be coerced to - * 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Tensorboard]{@link google.cloud.aiplatform.v1.Tensorboard}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listTensorboardsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTensorboards( - request?: protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboard[], - protos.google.cloud.aiplatform.v1.IListTensorboardsRequest|null, - protos.google.cloud.aiplatform.v1.IListTensorboardsResponse - ]>; - listTensorboards( - request: protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, - protos.google.cloud.aiplatform.v1.IListTensorboardsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITensorboard>): void; - listTensorboards( - request: protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, - protos.google.cloud.aiplatform.v1.IListTensorboardsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITensorboard>): void; - listTensorboards( - request?: protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, - protos.google.cloud.aiplatform.v1.IListTensorboardsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITensorboard>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, - protos.google.cloud.aiplatform.v1.IListTensorboardsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITensorboard>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboard[], - protos.google.cloud.aiplatform.v1.IListTensorboardsRequest|null, - protos.google.cloud.aiplatform.v1.IListTensorboardsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listTensorboards(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list Tensorboards. - * Format: - * `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the Tensorboards that match the filter expression. - * @param {number} request.pageSize - * The maximum number of Tensorboards to return. The service may return - * fewer than this value. If unspecified, at most 100 Tensorboards will be - * returned. The maximum value is 100; values above 100 will be coerced to - * 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Tensorboard]{@link google.cloud.aiplatform.v1.Tensorboard} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listTensorboardsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTensorboardsStream( - request?: protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTensorboards']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTensorboards.createStream( - this.innerApiCalls.listTensorboards as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTensorboards`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list Tensorboards. - * Format: - * `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the Tensorboards that match the filter expression. - * @param {number} request.pageSize - * The maximum number of Tensorboards to return. The service may return - * fewer than this value. If unspecified, at most 100 Tensorboards will be - * returned. The maximum value is 100; values above 100 will be coerced to - * 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Tensorboard]{@link google.cloud.aiplatform.v1.Tensorboard}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_ListTensorboards_async - */ - listTensorboardsAsync( - request?: protos.google.cloud.aiplatform.v1.IListTensorboardsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTensorboards']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTensorboards.asyncIterate( - this.innerApiCalls['listTensorboards'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists TensorboardExperiments in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Tensorboard to list TensorboardExperiments. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - * @param {string} request.filter - * Lists the TensorboardExperiments that match the filter expression. - * @param {number} request.pageSize - * The maximum number of TensorboardExperiments to return. The service may - * return fewer than this value. If unspecified, at most 50 - * TensorboardExperiments will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [TensorboardExperiment]{@link google.cloud.aiplatform.v1.TensorboardExperiment}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listTensorboardExperimentsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTensorboardExperiments( - request?: protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardExperiment[], - protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest|null, - protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse - ]>; - listTensorboardExperiments( - request: protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, - protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITensorboardExperiment>): void; - listTensorboardExperiments( - request: protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, - protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITensorboardExperiment>): void; - listTensorboardExperiments( - request?: protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, - protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITensorboardExperiment>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, - protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITensorboardExperiment>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardExperiment[], - protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest|null, - protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listTensorboardExperiments(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Tensorboard to list TensorboardExperiments. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - * @param {string} request.filter - * Lists the TensorboardExperiments that match the filter expression. - * @param {number} request.pageSize - * The maximum number of TensorboardExperiments to return. The service may - * return fewer than this value. If unspecified, at most 50 - * TensorboardExperiments will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [TensorboardExperiment]{@link google.cloud.aiplatform.v1.TensorboardExperiment} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listTensorboardExperimentsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTensorboardExperimentsStream( - request?: protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTensorboardExperiments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTensorboardExperiments.createStream( - this.innerApiCalls.listTensorboardExperiments as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTensorboardExperiments`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Tensorboard to list TensorboardExperiments. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - * @param {string} request.filter - * Lists the TensorboardExperiments that match the filter expression. - * @param {number} request.pageSize - * The maximum number of TensorboardExperiments to return. The service may - * return fewer than this value. If unspecified, at most 50 - * TensorboardExperiments will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [TensorboardExperiment]{@link google.cloud.aiplatform.v1.TensorboardExperiment}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_ListTensorboardExperiments_async - */ - listTensorboardExperimentsAsync( - request?: protos.google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTensorboardExperiments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTensorboardExperiments.asyncIterate( - this.innerApiCalls['listTensorboardExperiments'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists TensorboardRuns in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardExperiment to list TensorboardRuns. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - * @param {string} request.filter - * Lists the TensorboardRuns that match the filter expression. - * @param {number} request.pageSize - * The maximum number of TensorboardRuns to return. The service may return - * fewer than this value. If unspecified, at most 50 TensorboardRuns will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [TensorboardRun]{@link google.cloud.aiplatform.v1.TensorboardRun}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listTensorboardRunsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTensorboardRuns( - request?: protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardRun[], - protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest|null, - protos.google.cloud.aiplatform.v1.IListTensorboardRunsResponse - ]>; - listTensorboardRuns( - request: protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, - protos.google.cloud.aiplatform.v1.IListTensorboardRunsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITensorboardRun>): void; - listTensorboardRuns( - request: protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, - protos.google.cloud.aiplatform.v1.IListTensorboardRunsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITensorboardRun>): void; - listTensorboardRuns( - request?: protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, - protos.google.cloud.aiplatform.v1.IListTensorboardRunsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITensorboardRun>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, - protos.google.cloud.aiplatform.v1.IListTensorboardRunsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITensorboardRun>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardRun[], - protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest|null, - protos.google.cloud.aiplatform.v1.IListTensorboardRunsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listTensorboardRuns(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardExperiment to list TensorboardRuns. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - * @param {string} request.filter - * Lists the TensorboardRuns that match the filter expression. - * @param {number} request.pageSize - * The maximum number of TensorboardRuns to return. The service may return - * fewer than this value. If unspecified, at most 50 TensorboardRuns will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [TensorboardRun]{@link google.cloud.aiplatform.v1.TensorboardRun} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listTensorboardRunsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTensorboardRunsStream( - request?: protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTensorboardRuns']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTensorboardRuns.createStream( - this.innerApiCalls.listTensorboardRuns as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTensorboardRuns`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardExperiment to list TensorboardRuns. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - * @param {string} request.filter - * Lists the TensorboardRuns that match the filter expression. - * @param {number} request.pageSize - * The maximum number of TensorboardRuns to return. The service may return - * fewer than this value. If unspecified, at most 50 TensorboardRuns will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [TensorboardRun]{@link google.cloud.aiplatform.v1.TensorboardRun}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_ListTensorboardRuns_async - */ - listTensorboardRunsAsync( - request?: protos.google.cloud.aiplatform.v1.IListTensorboardRunsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTensorboardRuns']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTensorboardRuns.asyncIterate( - this.innerApiCalls['listTensorboardRuns'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists TensorboardTimeSeries in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardRun to list TensorboardTimeSeries. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - * @param {string} request.filter - * Lists the TensorboardTimeSeries that match the filter expression. - * @param {number} request.pageSize - * The maximum number of TensorboardTimeSeries to return. The service may - * return fewer than this value. If unspecified, at most 50 - * TensorboardTimeSeries will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1.TensorboardTimeSeries}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listTensorboardTimeSeriesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries[], - protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest|null, - protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse - ]>; - listTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, - protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries>): void; - listTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, - protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries>): void; - listTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, - protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, - protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries[], - protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest|null, - protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listTensorboardTimeSeries(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardRun to list TensorboardTimeSeries. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - * @param {string} request.filter - * Lists the TensorboardTimeSeries that match the filter expression. - * @param {number} request.pageSize - * The maximum number of TensorboardTimeSeries to return. The service may - * return fewer than this value. If unspecified, at most 50 - * TensorboardTimeSeries will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1.TensorboardTimeSeries} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listTensorboardTimeSeriesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTensorboardTimeSeriesStream( - request?: protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTensorboardTimeSeries']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTensorboardTimeSeries.createStream( - this.innerApiCalls.listTensorboardTimeSeries as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTensorboardTimeSeries`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardRun to list TensorboardTimeSeries. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - * @param {string} request.filter - * Lists the TensorboardTimeSeries that match the filter expression. - * @param {number} request.pageSize - * The maximum number of TensorboardTimeSeries to return. The service may - * return fewer than this value. If unspecified, at most 50 - * TensorboardTimeSeries will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1.TensorboardTimeSeries}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_ListTensorboardTimeSeries_async - */ - listTensorboardTimeSeriesAsync( - request?: protos.google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTensorboardTimeSeries']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTensorboardTimeSeries.asyncIterate( - this.innerApiCalls['listTensorboardTimeSeries'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Exports a TensorboardTimeSeries' data. Data is returned in paginated - * responses. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tensorboardTimeSeries - * Required. The resource name of the TensorboardTimeSeries to export data from. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param {string} request.filter - * Exports the TensorboardTimeSeries' data that match the filter expression. - * @param {number} request.pageSize - * The maximum number of data points to return per page. - * The default page_size will be 1000. Values must be between 1 and 10000. - * Values above 10000 will be coerced to 10000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link |TensorboardService.ExportTensorboardTimeSeries} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link |TensorboardService.ExportTensorboardTimeSeries} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the TensorboardTimeSeries' data. - * By default, TensorboardTimeSeries' data will be returned in a pseudo random - * order. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [TimeSeriesDataPoint]{@link google.cloud.aiplatform.v1.TimeSeriesDataPoint}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `exportTensorboardTimeSeriesDataAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - exportTensorboardTimeSeriesData( - request?: protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITimeSeriesDataPoint[], - protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest|null, - protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse - ]>; - exportTensorboardTimeSeriesData( - request: protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, - protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITimeSeriesDataPoint>): void; - exportTensorboardTimeSeriesData( - request: protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, - protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITimeSeriesDataPoint>): void; - exportTensorboardTimeSeriesData( - request?: protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, - protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITimeSeriesDataPoint>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, - protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITimeSeriesDataPoint>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITimeSeriesDataPoint[], - protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest|null, - protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard_time_series': request.tensorboardTimeSeries || '', - }); - this.initialize(); - return this.innerApiCalls.exportTensorboardTimeSeriesData(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tensorboardTimeSeries - * Required. The resource name of the TensorboardTimeSeries to export data from. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param {string} request.filter - * Exports the TensorboardTimeSeries' data that match the filter expression. - * @param {number} request.pageSize - * The maximum number of data points to return per page. - * The default page_size will be 1000. Values must be between 1 and 10000. - * Values above 10000 will be coerced to 10000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link |TensorboardService.ExportTensorboardTimeSeries} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link |TensorboardService.ExportTensorboardTimeSeries} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the TensorboardTimeSeries' data. - * By default, TensorboardTimeSeries' data will be returned in a pseudo random - * order. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [TimeSeriesDataPoint]{@link google.cloud.aiplatform.v1.TimeSeriesDataPoint} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `exportTensorboardTimeSeriesDataAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - exportTensorboardTimeSeriesDataStream( - request?: protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard_time_series': request.tensorboardTimeSeries || '', - }); - const defaultCallSettings = this._defaults['exportTensorboardTimeSeriesData']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.exportTensorboardTimeSeriesData.createStream( - this.innerApiCalls.exportTensorboardTimeSeriesData as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `exportTensorboardTimeSeriesData`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tensorboardTimeSeries - * Required. The resource name of the TensorboardTimeSeries to export data from. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param {string} request.filter - * Exports the TensorboardTimeSeries' data that match the filter expression. - * @param {number} request.pageSize - * The maximum number of data points to return per page. - * The default page_size will be 1000. Values must be between 1 and 10000. - * Values above 10000 will be coerced to 10000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link |TensorboardService.ExportTensorboardTimeSeries} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link |TensorboardService.ExportTensorboardTimeSeries} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the TensorboardTimeSeries' data. - * By default, TensorboardTimeSeries' data will be returned in a pseudo random - * order. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [TimeSeriesDataPoint]{@link google.cloud.aiplatform.v1.TimeSeriesDataPoint}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_TensorboardService_ExportTensorboardTimeSeriesData_async - */ - exportTensorboardTimeSeriesDataAsync( - request?: protos.google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard_time_series': request.tensorboardTimeSeries || '', - }); - const defaultCallSettings = this._defaults['exportTensorboardTimeSeriesData']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate( - this.innerApiCalls['exportTensorboardTimeSeriesData'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.tensorboardServiceStub && !this._terminated) { - return this.tensorboardServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/tensorboard_service_client_config.json b/owl-bot-staging/v1/src/v1/tensorboard_service_client_config.json deleted file mode 100644 index 8f49b63c..00000000 --- a/owl-bot-staging/v1/src/v1/tensorboard_service_client_config.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1.TensorboardService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateTensorboard": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetTensorboard": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateTensorboard": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListTensorboards": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteTensorboard": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateTensorboardExperiment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetTensorboardExperiment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateTensorboardExperiment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListTensorboardExperiments": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteTensorboardExperiment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateTensorboardRun": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchCreateTensorboardRuns": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetTensorboardRun": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateTensorboardRun": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListTensorboardRuns": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteTensorboardRun": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchCreateTensorboardTimeSeries": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateTensorboardTimeSeries": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetTensorboardTimeSeries": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateTensorboardTimeSeries": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListTensorboardTimeSeries": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteTensorboardTimeSeries": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchReadTensorboardTimeSeriesData": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ReadTensorboardTimeSeriesData": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ReadTensorboardBlobData": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "WriteTensorboardExperimentData": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "WriteTensorboardRunData": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ExportTensorboardTimeSeriesData": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/tensorboard_service_proto_list.json b/owl-bot-staging/v1/src/v1/tensorboard_service_proto_list.json deleted file mode 100644 index 581a7346..00000000 --- a/owl-bot-staging/v1/src/v1/tensorboard_service_proto_list.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1/context.proto", - "../../protos/google/cloud/aiplatform/v1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1/event.proto", - "../../protos/google/cloud/aiplatform/v1/execution.proto", - "../../protos/google/cloud/aiplatform/v1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1/feature.proto", - "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1/index.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1/io.proto", - "../../protos/google/cloud/aiplatform/v1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1/model.proto", - "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1/operation.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1/study.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1/types.proto", - "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1/value.proto", - "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1/src/v1/vizier_service_client.ts b/owl-bot-staging/v1/src/v1/vizier_service_client.ts deleted file mode 100644 index 23655d18..00000000 --- a/owl-bot-staging/v1/src/v1/vizier_service_client.ts +++ /dev/null @@ -1,3713 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/vizier_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './vizier_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * Vertex AI Vizier API. - * - * Vertex AI Vizier is a service to solve blackbox optimization problems, - * such as tuning machine learning hyperparameters and searching over deep - * learning architectures. - * @class - * @memberof v1 - */ -export class VizierServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - vizierServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of VizierServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof VizierServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listStudies: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'studies'), - listTrials: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'trials') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const suggestTrialsResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.SuggestTrialsResponse') as gax.protobuf.Type; - const suggestTrialsMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.SuggestTrialsMetadata') as gax.protobuf.Type; - const checkTrialEarlyStoppingStateResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateResponse') as gax.protobuf.Type; - const checkTrialEarlyStoppingStateMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateMetatdata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - suggestTrials: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - suggestTrialsResponse.decode.bind(suggestTrialsResponse), - suggestTrialsMetadata.decode.bind(suggestTrialsMetadata)), - checkTrialEarlyStoppingState: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - checkTrialEarlyStoppingStateResponse.decode.bind(checkTrialEarlyStoppingStateResponse), - checkTrialEarlyStoppingStateMetadata.decode.bind(checkTrialEarlyStoppingStateMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1.VizierService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.vizierServiceStub) { - return this.vizierServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1.VizierService. - this.vizierServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1.VizierService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1.VizierService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const vizierServiceStubMethods = - ['createStudy', 'getStudy', 'listStudies', 'deleteStudy', 'lookupStudy', 'suggestTrials', 'createTrial', 'getTrial', 'listTrials', 'addTrialMeasurement', 'completeTrial', 'deleteTrial', 'checkTrialEarlyStoppingState', 'stopTrial', 'listOptimalTrials']; - for (const methodName of vizierServiceStubMethods) { - const callPromise = this.vizierServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.vizierServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Creates a Study. A resource name will be generated after creation of the - * Study. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the CustomJob in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1.Study} request.study - * Required. The Study configuration used to create the Study. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Study]{@link google.cloud.aiplatform.v1.Study}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_VizierService_CreateStudy_async - */ - createStudy( - request?: protos.google.cloud.aiplatform.v1.ICreateStudyRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IStudy, - protos.google.cloud.aiplatform.v1.ICreateStudyRequest|undefined, {}|undefined - ]>; - createStudy( - request: protos.google.cloud.aiplatform.v1.ICreateStudyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IStudy, - protos.google.cloud.aiplatform.v1.ICreateStudyRequest|null|undefined, - {}|null|undefined>): void; - createStudy( - request: protos.google.cloud.aiplatform.v1.ICreateStudyRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IStudy, - protos.google.cloud.aiplatform.v1.ICreateStudyRequest|null|undefined, - {}|null|undefined>): void; - createStudy( - request?: protos.google.cloud.aiplatform.v1.ICreateStudyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IStudy, - protos.google.cloud.aiplatform.v1.ICreateStudyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IStudy, - protos.google.cloud.aiplatform.v1.ICreateStudyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IStudy, - protos.google.cloud.aiplatform.v1.ICreateStudyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createStudy(request, options, callback); - } -/** - * Gets a Study by name. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Study resource. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Study]{@link google.cloud.aiplatform.v1.Study}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_VizierService_GetStudy_async - */ - getStudy( - request?: protos.google.cloud.aiplatform.v1.IGetStudyRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IStudy, - protos.google.cloud.aiplatform.v1.IGetStudyRequest|undefined, {}|undefined - ]>; - getStudy( - request: protos.google.cloud.aiplatform.v1.IGetStudyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IStudy, - protos.google.cloud.aiplatform.v1.IGetStudyRequest|null|undefined, - {}|null|undefined>): void; - getStudy( - request: protos.google.cloud.aiplatform.v1.IGetStudyRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IStudy, - protos.google.cloud.aiplatform.v1.IGetStudyRequest|null|undefined, - {}|null|undefined>): void; - getStudy( - request?: protos.google.cloud.aiplatform.v1.IGetStudyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IStudy, - protos.google.cloud.aiplatform.v1.IGetStudyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IStudy, - protos.google.cloud.aiplatform.v1.IGetStudyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IStudy, - protos.google.cloud.aiplatform.v1.IGetStudyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getStudy(request, options, callback); - } -/** - * Deletes a Study. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Study resource to be deleted. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_VizierService_DeleteStudy_async - */ - deleteStudy( - request?: protos.google.cloud.aiplatform.v1.IDeleteStudyRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IDeleteStudyRequest|undefined, {}|undefined - ]>; - deleteStudy( - request: protos.google.cloud.aiplatform.v1.IDeleteStudyRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IDeleteStudyRequest|null|undefined, - {}|null|undefined>): void; - deleteStudy( - request: protos.google.cloud.aiplatform.v1.IDeleteStudyRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IDeleteStudyRequest|null|undefined, - {}|null|undefined>): void; - deleteStudy( - request?: protos.google.cloud.aiplatform.v1.IDeleteStudyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IDeleteStudyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IDeleteStudyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IDeleteStudyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteStudy(request, options, callback); - } -/** - * Looks a study up using the user-defined display_name field instead of the - * fully qualified resource name. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to get the Study from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.displayName - * Required. The user-defined display name of the Study - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Study]{@link google.cloud.aiplatform.v1.Study}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_VizierService_LookupStudy_async - */ - lookupStudy( - request?: protos.google.cloud.aiplatform.v1.ILookupStudyRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IStudy, - protos.google.cloud.aiplatform.v1.ILookupStudyRequest|undefined, {}|undefined - ]>; - lookupStudy( - request: protos.google.cloud.aiplatform.v1.ILookupStudyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IStudy, - protos.google.cloud.aiplatform.v1.ILookupStudyRequest|null|undefined, - {}|null|undefined>): void; - lookupStudy( - request: protos.google.cloud.aiplatform.v1.ILookupStudyRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IStudy, - protos.google.cloud.aiplatform.v1.ILookupStudyRequest|null|undefined, - {}|null|undefined>): void; - lookupStudy( - request?: protos.google.cloud.aiplatform.v1.ILookupStudyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IStudy, - protos.google.cloud.aiplatform.v1.ILookupStudyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IStudy, - protos.google.cloud.aiplatform.v1.ILookupStudyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IStudy, - protos.google.cloud.aiplatform.v1.ILookupStudyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.lookupStudy(request, options, callback); - } -/** - * Adds a user provided Trial to a Study. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Study to create the Trial in. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param {google.cloud.aiplatform.v1.Trial} request.trial - * Required. The Trial to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1.Trial}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_VizierService_CreateTrial_async - */ - createTrial( - request?: protos.google.cloud.aiplatform.v1.ICreateTrialRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.ICreateTrialRequest|undefined, {}|undefined - ]>; - createTrial( - request: protos.google.cloud.aiplatform.v1.ICreateTrialRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.ICreateTrialRequest|null|undefined, - {}|null|undefined>): void; - createTrial( - request: protos.google.cloud.aiplatform.v1.ICreateTrialRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.ICreateTrialRequest|null|undefined, - {}|null|undefined>): void; - createTrial( - request?: protos.google.cloud.aiplatform.v1.ICreateTrialRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.ICreateTrialRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.ICreateTrialRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.ICreateTrialRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createTrial(request, options, callback); - } -/** - * Gets a Trial. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Trial resource. - * Format: - * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1.Trial}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_VizierService_GetTrial_async - */ - getTrial( - request?: protos.google.cloud.aiplatform.v1.IGetTrialRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.IGetTrialRequest|undefined, {}|undefined - ]>; - getTrial( - request: protos.google.cloud.aiplatform.v1.IGetTrialRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.IGetTrialRequest|null|undefined, - {}|null|undefined>): void; - getTrial( - request: protos.google.cloud.aiplatform.v1.IGetTrialRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.IGetTrialRequest|null|undefined, - {}|null|undefined>): void; - getTrial( - request?: protos.google.cloud.aiplatform.v1.IGetTrialRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.IGetTrialRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.IGetTrialRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.IGetTrialRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getTrial(request, options, callback); - } -/** - * Adds a measurement of the objective metrics to a Trial. This measurement - * is assumed to have been taken before the Trial is complete. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.trialName - * Required. The name of the trial to add measurement. - * Format: - * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` - * @param {google.cloud.aiplatform.v1.Measurement} request.measurement - * Required. The measurement to be added to a Trial. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1.Trial}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_VizierService_AddTrialMeasurement_async - */ - addTrialMeasurement( - request?: protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest|undefined, {}|undefined - ]>; - addTrialMeasurement( - request: protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest|null|undefined, - {}|null|undefined>): void; - addTrialMeasurement( - request: protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest|null|undefined, - {}|null|undefined>): void; - addTrialMeasurement( - request?: protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.IAddTrialMeasurementRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'trial_name': request.trialName || '', - }); - this.initialize(); - return this.innerApiCalls.addTrialMeasurement(request, options, callback); - } -/** - * Marks a Trial as complete. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The Trial's name. - * Format: - * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` - * @param {google.cloud.aiplatform.v1.Measurement} [request.finalMeasurement] - * Optional. If provided, it will be used as the completed Trial's - * final_measurement; Otherwise, the service will auto-select a - * previously reported measurement as the final-measurement - * @param {boolean} [request.trialInfeasible] - * Optional. True if the Trial cannot be run with the given Parameter, and - * final_measurement will be ignored. - * @param {string} [request.infeasibleReason] - * Optional. A human readable reason why the trial was infeasible. This should - * only be provided if `trial_infeasible` is true. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1.Trial}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_VizierService_CompleteTrial_async - */ - completeTrial( - request?: protos.google.cloud.aiplatform.v1.ICompleteTrialRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.ICompleteTrialRequest|undefined, {}|undefined - ]>; - completeTrial( - request: protos.google.cloud.aiplatform.v1.ICompleteTrialRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.ICompleteTrialRequest|null|undefined, - {}|null|undefined>): void; - completeTrial( - request: protos.google.cloud.aiplatform.v1.ICompleteTrialRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.ICompleteTrialRequest|null|undefined, - {}|null|undefined>): void; - completeTrial( - request?: protos.google.cloud.aiplatform.v1.ICompleteTrialRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.ICompleteTrialRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.ICompleteTrialRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.ICompleteTrialRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.completeTrial(request, options, callback); - } -/** - * Deletes a Trial. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The Trial's name. - * Format: - * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_VizierService_DeleteTrial_async - */ - deleteTrial( - request?: protos.google.cloud.aiplatform.v1.IDeleteTrialRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IDeleteTrialRequest|undefined, {}|undefined - ]>; - deleteTrial( - request: protos.google.cloud.aiplatform.v1.IDeleteTrialRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IDeleteTrialRequest|null|undefined, - {}|null|undefined>): void; - deleteTrial( - request: protos.google.cloud.aiplatform.v1.IDeleteTrialRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IDeleteTrialRequest|null|undefined, - {}|null|undefined>): void; - deleteTrial( - request?: protos.google.cloud.aiplatform.v1.IDeleteTrialRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IDeleteTrialRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IDeleteTrialRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1.IDeleteTrialRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteTrial(request, options, callback); - } -/** - * Stops a Trial. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The Trial's name. - * Format: - * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1.Trial}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_VizierService_StopTrial_async - */ - stopTrial( - request?: protos.google.cloud.aiplatform.v1.IStopTrialRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.IStopTrialRequest|undefined, {}|undefined - ]>; - stopTrial( - request: protos.google.cloud.aiplatform.v1.IStopTrialRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.IStopTrialRequest|null|undefined, - {}|null|undefined>): void; - stopTrial( - request: protos.google.cloud.aiplatform.v1.IStopTrialRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.IStopTrialRequest|null|undefined, - {}|null|undefined>): void; - stopTrial( - request?: protos.google.cloud.aiplatform.v1.IStopTrialRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.IStopTrialRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.IStopTrialRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITrial, - protos.google.cloud.aiplatform.v1.IStopTrialRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.stopTrial(request, options, callback); - } -/** - * Lists the pareto-optimal Trials for multi-objective Study or the - * optimal Trials for single-objective Study. The definition of - * pareto-optimal can be checked in wiki page. - * https://en.wikipedia.org/wiki/Pareto_efficiency - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the Study that the optimal Trial belongs to. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListOptimalTrialsResponse]{@link google.cloud.aiplatform.v1.ListOptimalTrialsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_VizierService_ListOptimalTrials_async - */ - listOptimalTrials( - request?: protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IListOptimalTrialsResponse, - protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest|undefined, {}|undefined - ]>; - listOptimalTrials( - request: protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IListOptimalTrialsResponse, - protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest|null|undefined, - {}|null|undefined>): void; - listOptimalTrials( - request: protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IListOptimalTrialsResponse, - protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest|null|undefined, - {}|null|undefined>): void; - listOptimalTrials( - request?: protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IListOptimalTrialsResponse, - protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IListOptimalTrialsResponse, - protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IListOptimalTrialsResponse, - protos.google.cloud.aiplatform.v1.IListOptimalTrialsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listOptimalTrials(request, options, callback); - } - -/** - * Adds one or more Trials to a Study, with parameter values - * suggested by Vertex AI Vizier. Returns a long-running - * operation associated with the generation of Trial suggestions. - * When this long-running operation succeeds, it will contain - * a {@link google.cloud.ml.v1.SuggestTrialsResponse|SuggestTrialsResponse}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location that the Study belongs to. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param {number} request.suggestionCount - * Required. The number of suggestions requested. - * @param {string} request.clientId - * Required. The identifier of the client that is requesting the suggestion. - * - * If multiple SuggestTrialsRequests have the same `client_id`, - * the service will return the identical suggested Trial if the Trial is - * pending, and provide a new Trial if the last suggested Trial was completed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_VizierService_SuggestTrials_async - */ - suggestTrials( - request?: protos.google.cloud.aiplatform.v1.ISuggestTrialsRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - suggestTrials( - request: protos.google.cloud.aiplatform.v1.ISuggestTrialsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - suggestTrials( - request: protos.google.cloud.aiplatform.v1.ISuggestTrialsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - suggestTrials( - request?: protos.google.cloud.aiplatform.v1.ISuggestTrialsRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.suggestTrials(request, options, callback); - } -/** - * Check the status of the long running operation returned by `suggestTrials()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_VizierService_SuggestTrials_async - */ - async checkSuggestTrialsProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.suggestTrials, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Checks whether a Trial should stop or not. Returns a - * long-running operation. When the operation is successful, - * it will contain a - * {@link google.cloud.ml.v1.CheckTrialEarlyStoppingStateResponse|CheckTrialEarlyStoppingStateResponse}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.trialName - * Required. The Trial's name. - * Format: - * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_VizierService_CheckTrialEarlyStoppingState_async - */ - checkTrialEarlyStoppingState( - request?: protos.google.cloud.aiplatform.v1.ICheckTrialEarlyStoppingStateRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - checkTrialEarlyStoppingState( - request: protos.google.cloud.aiplatform.v1.ICheckTrialEarlyStoppingStateRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - checkTrialEarlyStoppingState( - request: protos.google.cloud.aiplatform.v1.ICheckTrialEarlyStoppingStateRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - checkTrialEarlyStoppingState( - request?: protos.google.cloud.aiplatform.v1.ICheckTrialEarlyStoppingStateRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'trial_name': request.trialName || '', - }); - this.initialize(); - return this.innerApiCalls.checkTrialEarlyStoppingState(request, options, callback); - } -/** - * Check the status of the long running operation returned by `checkTrialEarlyStoppingState()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_VizierService_CheckTrialEarlyStoppingState_async - */ - async checkCheckTrialEarlyStoppingStateProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.checkTrialEarlyStoppingState, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists all the studies in a region for an associated project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the Study from. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.pageToken] - * Optional. A page token to request the next page of results. - * If unspecified, there are no subsequent pages. - * @param {number} [request.pageSize] - * Optional. The maximum number of studies to return per "page" of results. - * If unspecified, service will pick an appropriate default. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Study]{@link google.cloud.aiplatform.v1.Study}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listStudiesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listStudies( - request?: protos.google.cloud.aiplatform.v1.IListStudiesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IStudy[], - protos.google.cloud.aiplatform.v1.IListStudiesRequest|null, - protos.google.cloud.aiplatform.v1.IListStudiesResponse - ]>; - listStudies( - request: protos.google.cloud.aiplatform.v1.IListStudiesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListStudiesRequest, - protos.google.cloud.aiplatform.v1.IListStudiesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IStudy>): void; - listStudies( - request: protos.google.cloud.aiplatform.v1.IListStudiesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListStudiesRequest, - protos.google.cloud.aiplatform.v1.IListStudiesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IStudy>): void; - listStudies( - request?: protos.google.cloud.aiplatform.v1.IListStudiesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListStudiesRequest, - protos.google.cloud.aiplatform.v1.IListStudiesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IStudy>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListStudiesRequest, - protos.google.cloud.aiplatform.v1.IListStudiesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IStudy>): - Promise<[ - protos.google.cloud.aiplatform.v1.IStudy[], - protos.google.cloud.aiplatform.v1.IListStudiesRequest|null, - protos.google.cloud.aiplatform.v1.IListStudiesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listStudies(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the Study from. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.pageToken] - * Optional. A page token to request the next page of results. - * If unspecified, there are no subsequent pages. - * @param {number} [request.pageSize] - * Optional. The maximum number of studies to return per "page" of results. - * If unspecified, service will pick an appropriate default. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Study]{@link google.cloud.aiplatform.v1.Study} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listStudiesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listStudiesStream( - request?: protos.google.cloud.aiplatform.v1.IListStudiesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listStudies']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listStudies.createStream( - this.innerApiCalls.listStudies as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listStudies`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the Study from. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.pageToken] - * Optional. A page token to request the next page of results. - * If unspecified, there are no subsequent pages. - * @param {number} [request.pageSize] - * Optional. The maximum number of studies to return per "page" of results. - * If unspecified, service will pick an appropriate default. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Study]{@link google.cloud.aiplatform.v1.Study}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_VizierService_ListStudies_async - */ - listStudiesAsync( - request?: protos.google.cloud.aiplatform.v1.IListStudiesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listStudies']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listStudies.asyncIterate( - this.innerApiCalls['listStudies'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists the Trials associated with a Study. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Study to list the Trial from. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param {string} [request.pageToken] - * Optional. A page token to request the next page of results. - * If unspecified, there are no subsequent pages. - * @param {number} [request.pageSize] - * Optional. The number of Trials to retrieve per "page" of results. - * If unspecified, the service will pick an appropriate default. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Trial]{@link google.cloud.aiplatform.v1.Trial}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listTrialsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTrials( - request?: protos.google.cloud.aiplatform.v1.IListTrialsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ITrial[], - protos.google.cloud.aiplatform.v1.IListTrialsRequest|null, - protos.google.cloud.aiplatform.v1.IListTrialsResponse - ]>; - listTrials( - request: protos.google.cloud.aiplatform.v1.IListTrialsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTrialsRequest, - protos.google.cloud.aiplatform.v1.IListTrialsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITrial>): void; - listTrials( - request: protos.google.cloud.aiplatform.v1.IListTrialsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTrialsRequest, - protos.google.cloud.aiplatform.v1.IListTrialsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITrial>): void; - listTrials( - request?: protos.google.cloud.aiplatform.v1.IListTrialsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTrialsRequest, - protos.google.cloud.aiplatform.v1.IListTrialsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITrial>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListTrialsRequest, - protos.google.cloud.aiplatform.v1.IListTrialsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ITrial>): - Promise<[ - protos.google.cloud.aiplatform.v1.ITrial[], - protos.google.cloud.aiplatform.v1.IListTrialsRequest|null, - protos.google.cloud.aiplatform.v1.IListTrialsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listTrials(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Study to list the Trial from. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param {string} [request.pageToken] - * Optional. A page token to request the next page of results. - * If unspecified, there are no subsequent pages. - * @param {number} [request.pageSize] - * Optional. The number of Trials to retrieve per "page" of results. - * If unspecified, the service will pick an appropriate default. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Trial]{@link google.cloud.aiplatform.v1.Trial} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listTrialsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTrialsStream( - request?: protos.google.cloud.aiplatform.v1.IListTrialsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTrials']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTrials.createStream( - this.innerApiCalls.listTrials as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTrials`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Study to list the Trial from. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param {string} [request.pageToken] - * Optional. A page token to request the next page of results. - * If unspecified, there are no subsequent pages. - * @param {number} [request.pageSize] - * Optional. The number of Trials to retrieve per "page" of results. - * If unspecified, the service will pick an appropriate default. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Trial]{@link google.cloud.aiplatform.v1.Trial}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1_generated_VizierService_ListTrials_async - */ - listTrialsAsync( - request?: protos.google.cloud.aiplatform.v1.IListTrialsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTrials']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTrials.asyncIterate( - this.innerApiCalls['listTrials'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.vizierServiceStub && !this._terminated) { - return this.vizierServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/vizier_service_client_config.json b/owl-bot-staging/v1/src/v1/vizier_service_client_config.json deleted file mode 100644 index fe86ba2b..00000000 --- a/owl-bot-staging/v1/src/v1/vizier_service_client_config.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1.VizierService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateStudy": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetStudy": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListStudies": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteStudy": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "LookupStudy": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SuggestTrials": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateTrial": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetTrial": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListTrials": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "AddTrialMeasurement": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CompleteTrial": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteTrial": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CheckTrialEarlyStoppingState": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "StopTrial": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListOptimalTrials": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/vizier_service_proto_list.json b/owl-bot-staging/v1/src/v1/vizier_service_proto_list.json deleted file mode 100644 index 581a7346..00000000 --- a/owl-bot-staging/v1/src/v1/vizier_service_proto_list.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1/context.proto", - "../../protos/google/cloud/aiplatform/v1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1/event.proto", - "../../protos/google/cloud/aiplatform/v1/execution.proto", - "../../protos/google/cloud/aiplatform/v1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1/feature.proto", - "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1/index.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1/io.proto", - "../../protos/google/cloud/aiplatform/v1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1/model.proto", - "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1/operation.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1/study.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1/types.proto", - "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1/value.proto", - "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index ffac9b16..00000000 --- a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,41 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const aiplatform = require('@google-cloud/aiplatform'); - -function main() { - const datasetServiceClient = new aiplatform.DatasetServiceClient(); - const endpointServiceClient = new aiplatform.EndpointServiceClient(); - const featurestoreOnlineServingServiceClient = new aiplatform.FeaturestoreOnlineServingServiceClient(); - const featurestoreServiceClient = new aiplatform.FeaturestoreServiceClient(); - const indexEndpointServiceClient = new aiplatform.IndexEndpointServiceClient(); - const indexServiceClient = new aiplatform.IndexServiceClient(); - const jobServiceClient = new aiplatform.JobServiceClient(); - const metadataServiceClient = new aiplatform.MetadataServiceClient(); - const migrationServiceClient = new aiplatform.MigrationServiceClient(); - const modelServiceClient = new aiplatform.ModelServiceClient(); - const pipelineServiceClient = new aiplatform.PipelineServiceClient(); - const predictionServiceClient = new aiplatform.PredictionServiceClient(); - const specialistPoolServiceClient = new aiplatform.SpecialistPoolServiceClient(); - const tensorboardServiceClient = new aiplatform.TensorboardServiceClient(); - const vizierServiceClient = new aiplatform.VizierServiceClient(); -} - -main(); diff --git a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 6d8165e0..00000000 --- a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,116 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {DatasetServiceClient, EndpointServiceClient, FeaturestoreOnlineServingServiceClient, FeaturestoreServiceClient, IndexEndpointServiceClient, IndexServiceClient, JobServiceClient, MetadataServiceClient, MigrationServiceClient, ModelServiceClient, PipelineServiceClient, PredictionServiceClient, SpecialistPoolServiceClient, TensorboardServiceClient, VizierServiceClient} from '@google-cloud/aiplatform'; - -// check that the client class type name can be used -function doStuffWithDatasetServiceClient(client: DatasetServiceClient) { - client.close(); -} -function doStuffWithEndpointServiceClient(client: EndpointServiceClient) { - client.close(); -} -function doStuffWithFeaturestoreOnlineServingServiceClient(client: FeaturestoreOnlineServingServiceClient) { - client.close(); -} -function doStuffWithFeaturestoreServiceClient(client: FeaturestoreServiceClient) { - client.close(); -} -function doStuffWithIndexEndpointServiceClient(client: IndexEndpointServiceClient) { - client.close(); -} -function doStuffWithIndexServiceClient(client: IndexServiceClient) { - client.close(); -} -function doStuffWithJobServiceClient(client: JobServiceClient) { - client.close(); -} -function doStuffWithMetadataServiceClient(client: MetadataServiceClient) { - client.close(); -} -function doStuffWithMigrationServiceClient(client: MigrationServiceClient) { - client.close(); -} -function doStuffWithModelServiceClient(client: ModelServiceClient) { - client.close(); -} -function doStuffWithPipelineServiceClient(client: PipelineServiceClient) { - client.close(); -} -function doStuffWithPredictionServiceClient(client: PredictionServiceClient) { - client.close(); -} -function doStuffWithSpecialistPoolServiceClient(client: SpecialistPoolServiceClient) { - client.close(); -} -function doStuffWithTensorboardServiceClient(client: TensorboardServiceClient) { - client.close(); -} -function doStuffWithVizierServiceClient(client: VizierServiceClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const datasetServiceClient = new DatasetServiceClient(); - doStuffWithDatasetServiceClient(datasetServiceClient); - // check that the client instance can be created - const endpointServiceClient = new EndpointServiceClient(); - doStuffWithEndpointServiceClient(endpointServiceClient); - // check that the client instance can be created - const featurestoreOnlineServingServiceClient = new FeaturestoreOnlineServingServiceClient(); - doStuffWithFeaturestoreOnlineServingServiceClient(featurestoreOnlineServingServiceClient); - // check that the client instance can be created - const featurestoreServiceClient = new FeaturestoreServiceClient(); - doStuffWithFeaturestoreServiceClient(featurestoreServiceClient); - // check that the client instance can be created - const indexEndpointServiceClient = new IndexEndpointServiceClient(); - doStuffWithIndexEndpointServiceClient(indexEndpointServiceClient); - // check that the client instance can be created - const indexServiceClient = new IndexServiceClient(); - doStuffWithIndexServiceClient(indexServiceClient); - // check that the client instance can be created - const jobServiceClient = new JobServiceClient(); - doStuffWithJobServiceClient(jobServiceClient); - // check that the client instance can be created - const metadataServiceClient = new MetadataServiceClient(); - doStuffWithMetadataServiceClient(metadataServiceClient); - // check that the client instance can be created - const migrationServiceClient = new MigrationServiceClient(); - doStuffWithMigrationServiceClient(migrationServiceClient); - // check that the client instance can be created - const modelServiceClient = new ModelServiceClient(); - doStuffWithModelServiceClient(modelServiceClient); - // check that the client instance can be created - const pipelineServiceClient = new PipelineServiceClient(); - doStuffWithPipelineServiceClient(pipelineServiceClient); - // check that the client instance can be created - const predictionServiceClient = new PredictionServiceClient(); - doStuffWithPredictionServiceClient(predictionServiceClient); - // check that the client instance can be created - const specialistPoolServiceClient = new SpecialistPoolServiceClient(); - doStuffWithSpecialistPoolServiceClient(specialistPoolServiceClient); - // check that the client instance can be created - const tensorboardServiceClient = new TensorboardServiceClient(); - doStuffWithTensorboardServiceClient(tensorboardServiceClient); - // check that the client instance can be created - const vizierServiceClient = new VizierServiceClient(); - doStuffWithVizierServiceClient(vizierServiceClient); -} - -main(); diff --git a/owl-bot-staging/v1/system-test/install.ts b/owl-bot-staging/v1/system-test/install.ts deleted file mode 100644 index 8ec45222..00000000 --- a/owl-bot-staging/v1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import { packNTest } from 'pack-n-play'; -import { readFileSync } from 'fs'; -import { describe, it } from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/v1/test/gapic_dataset_service_v1.ts b/owl-bot-staging/v1/test/gapic_dataset_service_v1.ts deleted file mode 100644 index 3d43d6ab..00000000 --- a/owl-bot-staging/v1/test/gapic_dataset_service_v1.ts +++ /dev/null @@ -1,3419 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as datasetserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.DatasetServiceClient', () => { - it('has servicePath', () => { - const servicePath = datasetserviceModule.v1.DatasetServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = datasetserviceModule.v1.DatasetServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = datasetserviceModule.v1.DatasetServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new datasetserviceModule.v1.DatasetServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.datasetServiceStub, undefined); - await client.initialize(); - assert(client.datasetServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.datasetServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.datasetServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('getDataset', () => { - it('invokes getDataset without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetDatasetRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()); - client.innerApiCalls.getDataset = stubSimpleCall(expectedResponse); - const [response] = await client.getDataset(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDataset without error using callback', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetDatasetRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()); - client.innerApiCalls.getDataset = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDataset( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IDataset|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getDataset with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetDatasetRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataset = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataset(request), expectedError); - assert((client.innerApiCalls.getDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDataset with closed client', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetDatasetRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDataset(request), expectedError); - }); - }); - - describe('updateDataset', () => { - it('invokes updateDataset without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateDatasetRequest()); - request.dataset = {}; - request.dataset.name = ''; - const expectedHeaderRequestParams = "dataset.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()); - client.innerApiCalls.updateDataset = stubSimpleCall(expectedResponse); - const [response] = await client.updateDataset(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateDataset without error using callback', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateDatasetRequest()); - request.dataset = {}; - request.dataset.name = ''; - const expectedHeaderRequestParams = "dataset.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()); - client.innerApiCalls.updateDataset = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDataset( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IDataset|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateDataset with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateDatasetRequest()); - request.dataset = {}; - request.dataset.name = ''; - const expectedHeaderRequestParams = "dataset.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDataset = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDataset(request), expectedError); - assert((client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateDataset with closed client', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateDatasetRequest()); - request.dataset = {}; - request.dataset.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateDataset(request), expectedError); - }); - }); - - describe('getAnnotationSpec', () => { - it('invokes getAnnotationSpec without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetAnnotationSpecRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AnnotationSpec()); - client.innerApiCalls.getAnnotationSpec = stubSimpleCall(expectedResponse); - const [response] = await client.getAnnotationSpec(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getAnnotationSpec without error using callback', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetAnnotationSpecRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AnnotationSpec()); - client.innerApiCalls.getAnnotationSpec = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getAnnotationSpec( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IAnnotationSpec|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getAnnotationSpec with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetAnnotationSpecRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getAnnotationSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAnnotationSpec(request), expectedError); - assert((client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getAnnotationSpec with closed client', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetAnnotationSpecRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getAnnotationSpec(request), expectedError); - }); - }); - - describe('createDataset', () => { - it('invokes createDataset without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateDatasetRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createDataset = stubLongRunningCall(expectedResponse); - const [operation] = await client.createDataset(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createDataset without error using callback', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateDatasetRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createDataset = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDataset( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createDataset with call error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateDatasetRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createDataset = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createDataset(request), expectedError); - assert((client.innerApiCalls.createDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createDataset with LRO error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateDatasetRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createDataset = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createDataset(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateDatasetProgress without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateDatasetProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateDatasetProgress with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateDatasetProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteDataset', () => { - it('invokes deleteDataset without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteDatasetRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteDataset = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteDataset(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteDataset without error using callback', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteDatasetRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteDataset = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteDataset( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteDataset with call error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteDatasetRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataset = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteDataset(request), expectedError); - assert((client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteDataset with LRO error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteDatasetRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataset = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteDataset(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteDatasetProgress without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteDatasetProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteDatasetProgress with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteDatasetProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('importData', () => { - it('invokes importData without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportDataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.importData = stubLongRunningCall(expectedResponse); - const [operation] = await client.importData(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.importData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes importData without error using callback', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportDataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.importData = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.importData( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.importData as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes importData with call error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportDataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.importData = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.importData(request), expectedError); - assert((client.innerApiCalls.importData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes importData with LRO error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportDataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.importData = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.importData(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.importData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkImportDataProgress without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkImportDataProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkImportDataProgress with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkImportDataProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('exportData', () => { - it('invokes exportData without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportDataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.exportData = stubLongRunningCall(expectedResponse); - const [operation] = await client.exportData(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.exportData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes exportData without error using callback', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportDataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.exportData = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.exportData( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.exportData as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes exportData with call error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportDataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportData = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.exportData(request), expectedError); - assert((client.innerApiCalls.exportData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes exportData with LRO error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportDataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportData = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.exportData(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.exportData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkExportDataProgress without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkExportDataProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkExportDataProgress with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkExportDataProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listDatasets', () => { - it('invokes listDatasets without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDatasetsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), - ]; - client.innerApiCalls.listDatasets = stubSimpleCall(expectedResponse); - const [response] = await client.listDatasets(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDatasets as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDatasets without error using callback', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDatasetsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), - ]; - client.innerApiCalls.listDatasets = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDatasets( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IDataset[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDatasets as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listDatasets with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDatasetsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listDatasets = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDatasets(request), expectedError); - assert((client.innerApiCalls.listDatasets as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDatasetsStream without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDatasetsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), - ]; - client.descriptors.page.listDatasets.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDatasetsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Dataset[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Dataset) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listDatasets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDatasets, request)); - assert.strictEqual( - (client.descriptors.page.listDatasets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listDatasetsStream with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDatasetsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listDatasets.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDatasetsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Dataset[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Dataset) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDatasets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDatasets, request)); - assert.strictEqual( - (client.descriptors.page.listDatasets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDatasets without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDatasetsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), - ]; - client.descriptors.page.listDatasets.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IDataset[] = []; - const iterable = client.listDatasetsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDatasets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDatasets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDatasets with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDatasetsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listDatasets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDatasetsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IDataset[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDatasets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDatasets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listDataItems', () => { - it('invokes listDataItems without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataItemsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), - ]; - client.innerApiCalls.listDataItems = stubSimpleCall(expectedResponse); - const [response] = await client.listDataItems(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDataItems as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDataItems without error using callback', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataItemsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), - ]; - client.innerApiCalls.listDataItems = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDataItems( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IDataItem[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDataItems as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listDataItems with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataItemsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listDataItems = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDataItems(request), expectedError); - assert((client.innerApiCalls.listDataItems as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDataItemsStream without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataItemsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), - ]; - client.descriptors.page.listDataItems.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDataItemsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.DataItem[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.DataItem) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listDataItems.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDataItems, request)); - assert.strictEqual( - (client.descriptors.page.listDataItems.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listDataItemsStream with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataItemsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listDataItems.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDataItemsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.DataItem[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.DataItem) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDataItems.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDataItems, request)); - assert.strictEqual( - (client.descriptors.page.listDataItems.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDataItems without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataItemsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), - ]; - client.descriptors.page.listDataItems.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IDataItem[] = []; - const iterable = client.listDataItemsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDataItems.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDataItems.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDataItems with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataItemsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listDataItems.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDataItemsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IDataItem[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDataItems.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDataItems.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listAnnotations', () => { - it('invokes listAnnotations without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListAnnotationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), - ]; - client.innerApiCalls.listAnnotations = stubSimpleCall(expectedResponse); - const [response] = await client.listAnnotations(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listAnnotations without error using callback', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListAnnotationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), - ]; - client.innerApiCalls.listAnnotations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAnnotations( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IAnnotation[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listAnnotations with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListAnnotationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listAnnotations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAnnotations(request), expectedError); - assert((client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listAnnotationsStream without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListAnnotationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), - ]; - client.descriptors.page.listAnnotations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAnnotationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Annotation[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Annotation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listAnnotations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAnnotations, request)); - assert.strictEqual( - (client.descriptors.page.listAnnotations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listAnnotationsStream with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListAnnotationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listAnnotations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAnnotationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Annotation[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Annotation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAnnotations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAnnotations, request)); - assert.strictEqual( - (client.descriptors.page.listAnnotations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listAnnotations without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListAnnotationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Annotation()), - ]; - client.descriptors.page.listAnnotations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IAnnotation[] = []; - const iterable = client.listAnnotationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listAnnotations with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListAnnotationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listAnnotations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAnnotationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IAnnotation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/test/gapic_endpoint_service_v1.ts b/owl-bot-staging/v1/test/gapic_endpoint_service_v1.ts deleted file mode 100644 index c498411e..00000000 --- a/owl-bot-staging/v1/test/gapic_endpoint_service_v1.ts +++ /dev/null @@ -1,2876 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as endpointserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.EndpointServiceClient', () => { - it('has servicePath', () => { - const servicePath = endpointserviceModule.v1.EndpointServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = endpointserviceModule.v1.EndpointServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = endpointserviceModule.v1.EndpointServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new endpointserviceModule.v1.EndpointServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.endpointServiceStub, undefined); - await client.initialize(); - assert(client.endpointServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.endpointServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.endpointServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('getEndpoint', () => { - it('invokes getEndpoint without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()); - client.innerApiCalls.getEndpoint = stubSimpleCall(expectedResponse); - const [response] = await client.getEndpoint(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getEndpoint without error using callback', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()); - client.innerApiCalls.getEndpoint = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getEndpoint( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IEndpoint|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getEndpoint with error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getEndpoint = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getEndpoint(request), expectedError); - assert((client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getEndpoint with closed client', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetEndpointRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getEndpoint(request), expectedError); - }); - }); - - describe('updateEndpoint', () => { - it('invokes updateEndpoint without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateEndpointRequest()); - request.endpoint = {}; - request.endpoint.name = ''; - const expectedHeaderRequestParams = "endpoint.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()); - client.innerApiCalls.updateEndpoint = stubSimpleCall(expectedResponse); - const [response] = await client.updateEndpoint(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateEndpoint without error using callback', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateEndpointRequest()); - request.endpoint = {}; - request.endpoint.name = ''; - const expectedHeaderRequestParams = "endpoint.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()); - client.innerApiCalls.updateEndpoint = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateEndpoint( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IEndpoint|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateEndpoint with error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateEndpointRequest()); - request.endpoint = {}; - request.endpoint.name = ''; - const expectedHeaderRequestParams = "endpoint.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateEndpoint = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateEndpoint(request), expectedError); - assert((client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateEndpoint with closed client', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateEndpointRequest()); - request.endpoint = {}; - request.endpoint.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateEndpoint(request), expectedError); - }); - }); - - describe('createEndpoint', () => { - it('invokes createEndpoint without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateEndpointRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createEndpoint = stubLongRunningCall(expectedResponse); - const [operation] = await client.createEndpoint(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createEndpoint without error using callback', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateEndpointRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createEndpoint = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createEndpoint( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createEndpoint with call error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateEndpointRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createEndpoint = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createEndpoint(request), expectedError); - assert((client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createEndpoint with LRO error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateEndpointRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createEndpoint = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createEndpoint(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateEndpointProgress without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateEndpointProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateEndpointProgress with error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateEndpointProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteEndpoint', () => { - it('invokes deleteEndpoint without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteEndpoint = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteEndpoint(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteEndpoint without error using callback', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteEndpoint = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteEndpoint( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteEndpoint with call error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEndpoint = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteEndpoint(request), expectedError); - assert((client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteEndpoint with LRO error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEndpoint = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteEndpoint(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteEndpointProgress without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteEndpointProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteEndpointProgress with error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteEndpointProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deployModel', () => { - it('invokes deployModel without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeployModelRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deployModel = stubLongRunningCall(expectedResponse); - const [operation] = await client.deployModel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deployModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deployModel without error using callback', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeployModelRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deployModel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deployModel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deployModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deployModel with call error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeployModelRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deployModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deployModel(request), expectedError); - assert((client.innerApiCalls.deployModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deployModel with LRO error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeployModelRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deployModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deployModel(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deployModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeployModelProgress without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeployModelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeployModelProgress with error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeployModelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('undeployModel', () => { - it('invokes undeployModel without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UndeployModelRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.undeployModel = stubLongRunningCall(expectedResponse); - const [operation] = await client.undeployModel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes undeployModel without error using callback', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UndeployModelRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.undeployModel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.undeployModel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes undeployModel with call error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UndeployModelRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.undeployModel(request), expectedError); - assert((client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes undeployModel with LRO error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UndeployModelRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.undeployModel(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUndeployModelProgress without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUndeployModelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUndeployModelProgress with error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUndeployModelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listEndpoints', () => { - it('invokes listEndpoints without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), - ]; - client.innerApiCalls.listEndpoints = stubSimpleCall(expectedResponse); - const [response] = await client.listEndpoints(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listEndpoints without error using callback', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), - ]; - client.innerApiCalls.listEndpoints = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listEndpoints( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IEndpoint[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listEndpoints with error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listEndpoints = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listEndpoints(request), expectedError); - assert((client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listEndpointsStream without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), - ]; - client.descriptors.page.listEndpoints.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listEndpointsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Endpoint[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Endpoint) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listEndpoints.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEndpoints, request)); - assert.strictEqual( - (client.descriptors.page.listEndpoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listEndpointsStream with error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listEndpoints.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listEndpointsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Endpoint[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Endpoint) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listEndpoints.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEndpoints, request)); - assert.strictEqual( - (client.descriptors.page.listEndpoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listEndpoints without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), - ]; - client.descriptors.page.listEndpoints.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IEndpoint[] = []; - const iterable = client.listEndpointsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listEndpoints with error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listEndpoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listEndpointsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IEndpoint[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/test/gapic_featurestore_online_serving_service_v1.ts b/owl-bot-staging/v1/test/gapic_featurestore_online_serving_service_v1.ts deleted file mode 100644 index 61862c2d..00000000 --- a/owl-bot-staging/v1/test/gapic_featurestore_online_serving_service_v1.ts +++ /dev/null @@ -1,1978 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as featurestoreonlineservingserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubServerStreamingCall(response?: ResponseType, error?: Error) { - const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // write something to the stream to trigger transformStub and send the response back to the client - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - return sinon.stub().returns(mockStream); -} - -describe('v1.FeaturestoreOnlineServingServiceClient', () => { - it('has servicePath', () => { - const servicePath = featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.featurestoreOnlineServingServiceStub, undefined); - await client.initialize(); - assert(client.featurestoreOnlineServingServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.featurestoreOnlineServingServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.featurestoreOnlineServingServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('readFeatureValues', () => { - it('invokes readFeatureValues without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse()); - client.innerApiCalls.readFeatureValues = stubSimpleCall(expectedResponse); - const [response] = await client.readFeatureValues(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes readFeatureValues without error using callback', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse()); - client.innerApiCalls.readFeatureValues = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.readFeatureValues( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IReadFeatureValuesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes readFeatureValues with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.readFeatureValues = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.readFeatureValues(request), expectedError); - assert((client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes readFeatureValues with closed client', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadFeatureValuesRequest()); - request.entityType = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.readFeatureValues(request), expectedError); - }); - }); - - describe('streamingReadFeatureValues', () => { - it('invokes streamingReadFeatureValues without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.StreamingReadFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse()); - client.innerApiCalls.streamingReadFeatureValues = stubServerStreamingCall(expectedResponse); - const stream = client.streamingReadFeatureValues(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.streamingReadFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions)); - }); - - it('invokes streamingReadFeatureValues with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.StreamingReadFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.streamingReadFeatureValues = stubServerStreamingCall(undefined, expectedError); - const stream = client.streamingReadFeatureValues(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.innerApiCalls.streamingReadFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions)); - }); - - it('invokes streamingReadFeatureValues with closed client', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.StreamingReadFeatureValuesRequest()); - request.entityType = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - const stream = client.streamingReadFeatureValues(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/test/gapic_featurestore_service_v1.ts b/owl-bot-staging/v1/test/gapic_featurestore_service_v1.ts deleted file mode 100644 index a6263b8c..00000000 --- a/owl-bot-staging/v1/test/gapic_featurestore_service_v1.ts +++ /dev/null @@ -1,4882 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as featurestoreserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.FeaturestoreServiceClient', () => { - it('has servicePath', () => { - const servicePath = featurestoreserviceModule.v1.FeaturestoreServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = featurestoreserviceModule.v1.FeaturestoreServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = featurestoreserviceModule.v1.FeaturestoreServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.featurestoreServiceStub, undefined); - await client.initialize(); - assert(client.featurestoreServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.featurestoreServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.featurestoreServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('getFeaturestore', () => { - it('invokes getFeaturestore without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetFeaturestoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()); - client.innerApiCalls.getFeaturestore = stubSimpleCall(expectedResponse); - const [response] = await client.getFeaturestore(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getFeaturestore without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetFeaturestoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()); - client.innerApiCalls.getFeaturestore = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getFeaturestore( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IFeaturestore|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getFeaturestore with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetFeaturestoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getFeaturestore = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getFeaturestore(request), expectedError); - assert((client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getFeaturestore with closed client', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetFeaturestoreRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getFeaturestore(request), expectedError); - }); - }); - - describe('getEntityType', () => { - it('invokes getEntityType without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetEntityTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()); - client.innerApiCalls.getEntityType = stubSimpleCall(expectedResponse); - const [response] = await client.getEntityType(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getEntityType without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetEntityTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()); - client.innerApiCalls.getEntityType = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getEntityType( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IEntityType|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getEntityType with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetEntityTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getEntityType = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getEntityType(request), expectedError); - assert((client.innerApiCalls.getEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getEntityType with closed client', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetEntityTypeRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getEntityType(request), expectedError); - }); - }); - - describe('updateEntityType', () => { - it('invokes updateEntityType without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateEntityTypeRequest()); - request.entityType = {}; - request.entityType.name = ''; - const expectedHeaderRequestParams = "entity_type.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()); - client.innerApiCalls.updateEntityType = stubSimpleCall(expectedResponse); - const [response] = await client.updateEntityType(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateEntityType without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateEntityTypeRequest()); - request.entityType = {}; - request.entityType.name = ''; - const expectedHeaderRequestParams = "entity_type.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()); - client.innerApiCalls.updateEntityType = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateEntityType( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IEntityType|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateEntityType with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateEntityTypeRequest()); - request.entityType = {}; - request.entityType.name = ''; - const expectedHeaderRequestParams = "entity_type.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateEntityType = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateEntityType(request), expectedError); - assert((client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateEntityType with closed client', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateEntityTypeRequest()); - request.entityType = {}; - request.entityType.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateEntityType(request), expectedError); - }); - }); - - describe('getFeature', () => { - it('invokes getFeature without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetFeatureRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()); - client.innerApiCalls.getFeature = stubSimpleCall(expectedResponse); - const [response] = await client.getFeature(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getFeature without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetFeatureRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()); - client.innerApiCalls.getFeature = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getFeature( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IFeature|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getFeature with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetFeatureRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getFeature = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getFeature(request), expectedError); - assert((client.innerApiCalls.getFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getFeature with closed client', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetFeatureRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getFeature(request), expectedError); - }); - }); - - describe('updateFeature', () => { - it('invokes updateFeature without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateFeatureRequest()); - request.feature = {}; - request.feature.name = ''; - const expectedHeaderRequestParams = "feature.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()); - client.innerApiCalls.updateFeature = stubSimpleCall(expectedResponse); - const [response] = await client.updateFeature(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateFeature without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateFeatureRequest()); - request.feature = {}; - request.feature.name = ''; - const expectedHeaderRequestParams = "feature.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()); - client.innerApiCalls.updateFeature = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateFeature( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IFeature|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateFeature with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateFeatureRequest()); - request.feature = {}; - request.feature.name = ''; - const expectedHeaderRequestParams = "feature.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateFeature = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateFeature(request), expectedError); - assert((client.innerApiCalls.updateFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateFeature with closed client', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateFeatureRequest()); - request.feature = {}; - request.feature.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateFeature(request), expectedError); - }); - }); - - describe('createFeaturestore', () => { - it('invokes createFeaturestore without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateFeaturestoreRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createFeaturestore = stubLongRunningCall(expectedResponse); - const [operation] = await client.createFeaturestore(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createFeaturestore without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateFeaturestoreRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createFeaturestore = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createFeaturestore( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createFeaturestore with call error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateFeaturestoreRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createFeaturestore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createFeaturestore(request), expectedError); - assert((client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createFeaturestore with LRO error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateFeaturestoreRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createFeaturestore(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateFeaturestoreProgress without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateFeaturestoreProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateFeaturestoreProgress with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateFeaturestoreProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateFeaturestore', () => { - it('invokes updateFeaturestore without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateFeaturestoreRequest()); - request.featurestore = {}; - request.featurestore.name = ''; - const expectedHeaderRequestParams = "featurestore.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateFeaturestore = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateFeaturestore(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateFeaturestore without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateFeaturestoreRequest()); - request.featurestore = {}; - request.featurestore.name = ''; - const expectedHeaderRequestParams = "featurestore.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateFeaturestore = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateFeaturestore( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateFeaturestore with call error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateFeaturestoreRequest()); - request.featurestore = {}; - request.featurestore.name = ''; - const expectedHeaderRequestParams = "featurestore.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateFeaturestore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateFeaturestore(request), expectedError); - assert((client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateFeaturestore with LRO error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateFeaturestoreRequest()); - request.featurestore = {}; - request.featurestore.name = ''; - const expectedHeaderRequestParams = "featurestore.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateFeaturestore(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUpdateFeaturestoreProgress without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateFeaturestoreProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateFeaturestoreProgress with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateFeaturestoreProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteFeaturestore', () => { - it('invokes deleteFeaturestore without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteFeaturestoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteFeaturestore(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteFeaturestore without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteFeaturestoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteFeaturestore = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteFeaturestore( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteFeaturestore with call error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteFeaturestoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteFeaturestore(request), expectedError); - assert((client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteFeaturestore with LRO error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteFeaturestoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteFeaturestore(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteFeaturestoreProgress without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteFeaturestoreProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteFeaturestoreProgress with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteFeaturestoreProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createEntityType', () => { - it('invokes createEntityType without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateEntityTypeRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createEntityType = stubLongRunningCall(expectedResponse); - const [operation] = await client.createEntityType(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createEntityType without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateEntityTypeRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createEntityType = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createEntityType( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createEntityType with call error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateEntityTypeRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createEntityType = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createEntityType(request), expectedError); - assert((client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createEntityType with LRO error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateEntityTypeRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createEntityType = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createEntityType(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateEntityTypeProgress without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateEntityTypeProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateEntityTypeProgress with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateEntityTypeProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteEntityType', () => { - it('invokes deleteEntityType without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteEntityTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteEntityType = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteEntityType(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteEntityType without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteEntityTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteEntityType = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteEntityType( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteEntityType with call error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteEntityTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEntityType = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteEntityType(request), expectedError); - assert((client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteEntityType with LRO error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteEntityTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEntityType = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteEntityType(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteEntityTypeProgress without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteEntityTypeProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteEntityTypeProgress with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteEntityTypeProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createFeature', () => { - it('invokes createFeature without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateFeatureRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createFeature = stubLongRunningCall(expectedResponse); - const [operation] = await client.createFeature(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createFeature without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateFeatureRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createFeature = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createFeature( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createFeature with call error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateFeatureRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createFeature = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createFeature(request), expectedError); - assert((client.innerApiCalls.createFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createFeature with LRO error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateFeatureRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createFeature = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createFeature(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateFeatureProgress without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateFeatureProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateFeatureProgress with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateFeatureProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('batchCreateFeatures', () => { - it('invokes batchCreateFeatures without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchCreateFeatures(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchCreateFeatures without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.batchCreateFeatures = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchCreateFeatures( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes batchCreateFeatures with call error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchCreateFeatures(request), expectedError); - assert((client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchCreateFeatures with LRO error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchCreateFeatures(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkBatchCreateFeaturesProgress without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkBatchCreateFeaturesProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkBatchCreateFeaturesProgress with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkBatchCreateFeaturesProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteFeature', () => { - it('invokes deleteFeature without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteFeatureRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteFeature = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteFeature(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteFeature without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteFeatureRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteFeature = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteFeature( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteFeature with call error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteFeatureRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeature = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteFeature(request), expectedError); - assert((client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteFeature with LRO error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteFeatureRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeature = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteFeature(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteFeatureProgress without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteFeatureProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteFeatureProgress with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteFeatureProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('importFeatureValues', () => { - it('invokes importFeatureValues without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.importFeatureValues = stubLongRunningCall(expectedResponse); - const [operation] = await client.importFeatureValues(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes importFeatureValues without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.importFeatureValues = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.importFeatureValues( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes importFeatureValues with call error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.importFeatureValues = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.importFeatureValues(request), expectedError); - assert((client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes importFeatureValues with LRO error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.importFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.importFeatureValues(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkImportFeatureValuesProgress without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkImportFeatureValuesProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkImportFeatureValuesProgress with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkImportFeatureValuesProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('batchReadFeatureValues', () => { - it('invokes batchReadFeatureValues without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadFeatureValuesRequest()); - request.featurestore = ''; - const expectedHeaderRequestParams = "featurestore="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchReadFeatureValues(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchReadFeatureValues without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadFeatureValuesRequest()); - request.featurestore = ''; - const expectedHeaderRequestParams = "featurestore="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.batchReadFeatureValues = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchReadFeatureValues( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes batchReadFeatureValues with call error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadFeatureValuesRequest()); - request.featurestore = ''; - const expectedHeaderRequestParams = "featurestore="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchReadFeatureValues(request), expectedError); - assert((client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchReadFeatureValues with LRO error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadFeatureValuesRequest()); - request.featurestore = ''; - const expectedHeaderRequestParams = "featurestore="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchReadFeatureValues(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkBatchReadFeatureValuesProgress without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkBatchReadFeatureValuesProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkBatchReadFeatureValuesProgress with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkBatchReadFeatureValuesProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('exportFeatureValues', () => { - it('invokes exportFeatureValues without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.exportFeatureValues = stubLongRunningCall(expectedResponse); - const [operation] = await client.exportFeatureValues(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes exportFeatureValues without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.exportFeatureValues = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.exportFeatureValues( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes exportFeatureValues with call error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportFeatureValues = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.exportFeatureValues(request), expectedError); - assert((client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes exportFeatureValues with LRO error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.exportFeatureValues(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkExportFeatureValuesProgress without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkExportFeatureValuesProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkExportFeatureValuesProgress with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkExportFeatureValuesProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listFeaturestores', () => { - it('invokes listFeaturestores without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturestoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), - ]; - client.innerApiCalls.listFeaturestores = stubSimpleCall(expectedResponse); - const [response] = await client.listFeaturestores(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listFeaturestores without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturestoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), - ]; - client.innerApiCalls.listFeaturestores = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listFeaturestores( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IFeaturestore[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listFeaturestores with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturestoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listFeaturestores = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listFeaturestores(request), expectedError); - assert((client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listFeaturestoresStream without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturestoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), - ]; - client.descriptors.page.listFeaturestores.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listFeaturestoresStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Featurestore[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Featurestore) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listFeaturestores.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listFeaturestores, request)); - assert.strictEqual( - (client.descriptors.page.listFeaturestores.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listFeaturestoresStream with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturestoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listFeaturestores.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listFeaturestoresStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Featurestore[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Featurestore) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listFeaturestores.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listFeaturestores, request)); - assert.strictEqual( - (client.descriptors.page.listFeaturestores.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listFeaturestores without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturestoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Featurestore()), - ]; - client.descriptors.page.listFeaturestores.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IFeaturestore[] = []; - const iterable = client.listFeaturestoresAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listFeaturestores with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturestoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listFeaturestores.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listFeaturestoresAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IFeaturestore[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listEntityTypes', () => { - it('invokes listEntityTypes without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEntityTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), - ]; - client.innerApiCalls.listEntityTypes = stubSimpleCall(expectedResponse); - const [response] = await client.listEntityTypes(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listEntityTypes without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEntityTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), - ]; - client.innerApiCalls.listEntityTypes = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listEntityTypes( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IEntityType[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listEntityTypes with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEntityTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listEntityTypes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listEntityTypes(request), expectedError); - assert((client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listEntityTypesStream without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEntityTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), - ]; - client.descriptors.page.listEntityTypes.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listEntityTypesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.EntityType[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.EntityType) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listEntityTypes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEntityTypes, request)); - assert.strictEqual( - (client.descriptors.page.listEntityTypes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listEntityTypesStream with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEntityTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listEntityTypes.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listEntityTypesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.EntityType[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.EntityType) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listEntityTypes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEntityTypes, request)); - assert.strictEqual( - (client.descriptors.page.listEntityTypes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listEntityTypes without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEntityTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.EntityType()), - ]; - client.descriptors.page.listEntityTypes.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IEntityType[] = []; - const iterable = client.listEntityTypesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listEntityTypes with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListEntityTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listEntityTypes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listEntityTypesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IEntityType[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listFeatures', () => { - it('invokes listFeatures without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - ]; - client.innerApiCalls.listFeatures = stubSimpleCall(expectedResponse); - const [response] = await client.listFeatures(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listFeatures without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - ]; - client.innerApiCalls.listFeatures = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listFeatures( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IFeature[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listFeatures with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listFeatures = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listFeatures(request), expectedError); - assert((client.innerApiCalls.listFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listFeaturesStream without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - ]; - client.descriptors.page.listFeatures.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listFeaturesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Feature[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Feature) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listFeatures.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listFeatures, request)); - assert.strictEqual( - (client.descriptors.page.listFeatures.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listFeaturesStream with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listFeatures.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listFeaturesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Feature[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Feature) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listFeatures.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listFeatures, request)); - assert.strictEqual( - (client.descriptors.page.listFeatures.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listFeatures without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - ]; - client.descriptors.page.listFeatures.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IFeature[] = []; - const iterable = client.listFeaturesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listFeatures.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listFeatures.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listFeatures with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listFeatures.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listFeaturesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IFeature[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listFeatures.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listFeatures.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('searchFeatures', () => { - it('invokes searchFeatures without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchFeaturesRequest()); - request.location = ''; - const expectedHeaderRequestParams = "location="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - ]; - client.innerApiCalls.searchFeatures = stubSimpleCall(expectedResponse); - const [response] = await client.searchFeatures(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes searchFeatures without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchFeaturesRequest()); - request.location = ''; - const expectedHeaderRequestParams = "location="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - ]; - client.innerApiCalls.searchFeatures = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.searchFeatures( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IFeature[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes searchFeatures with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchFeaturesRequest()); - request.location = ''; - const expectedHeaderRequestParams = "location="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.searchFeatures = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchFeatures(request), expectedError); - assert((client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes searchFeaturesStream without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchFeaturesRequest()); - request.location = ''; - const expectedHeaderRequestParams = "location="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - ]; - client.descriptors.page.searchFeatures.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchFeaturesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Feature[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Feature) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.searchFeatures.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchFeatures, request)); - assert.strictEqual( - (client.descriptors.page.searchFeatures.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes searchFeaturesStream with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchFeaturesRequest()); - request.location = ''; - const expectedHeaderRequestParams = "location="; - const expectedError = new Error('expected'); - client.descriptors.page.searchFeatures.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchFeaturesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Feature[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Feature) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.searchFeatures.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchFeatures, request)); - assert.strictEqual( - (client.descriptors.page.searchFeatures.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with searchFeatures without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchFeaturesRequest()); - request.location = ''; - const expectedHeaderRequestParams = "location="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), - ]; - client.descriptors.page.searchFeatures.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IFeature[] = []; - const iterable = client.searchFeaturesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with searchFeatures with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchFeaturesRequest()); - request.location = ''; - const expectedHeaderRequestParams = "location=";const expectedError = new Error('expected'); - client.descriptors.page.searchFeatures.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchFeaturesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IFeature[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/test/gapic_index_endpoint_service_v1.ts b/owl-bot-staging/v1/test/gapic_index_endpoint_service_v1.ts deleted file mode 100644 index b864da79..00000000 --- a/owl-bot-staging/v1/test/gapic_index_endpoint_service_v1.ts +++ /dev/null @@ -1,3020 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as indexendpointserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.IndexEndpointServiceClient', () => { - it('has servicePath', () => { - const servicePath = indexendpointserviceModule.v1.IndexEndpointServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = indexendpointserviceModule.v1.IndexEndpointServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = indexendpointserviceModule.v1.IndexEndpointServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.indexEndpointServiceStub, undefined); - await client.initialize(); - assert(client.indexEndpointServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.indexEndpointServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.indexEndpointServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('getIndexEndpoint', () => { - it('invokes getIndexEndpoint without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetIndexEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()); - client.innerApiCalls.getIndexEndpoint = stubSimpleCall(expectedResponse); - const [response] = await client.getIndexEndpoint(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getIndexEndpoint without error using callback', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetIndexEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()); - client.innerApiCalls.getIndexEndpoint = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIndexEndpoint( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IIndexEndpoint|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getIndexEndpoint with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetIndexEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getIndexEndpoint = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIndexEndpoint(request), expectedError); - assert((client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getIndexEndpoint with closed client', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetIndexEndpointRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getIndexEndpoint(request), expectedError); - }); - }); - - describe('updateIndexEndpoint', () => { - it('invokes updateIndexEndpoint without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateIndexEndpointRequest()); - request.indexEndpoint = {}; - request.indexEndpoint.name = ''; - const expectedHeaderRequestParams = "index_endpoint.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()); - client.innerApiCalls.updateIndexEndpoint = stubSimpleCall(expectedResponse); - const [response] = await client.updateIndexEndpoint(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateIndexEndpoint without error using callback', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateIndexEndpointRequest()); - request.indexEndpoint = {}; - request.indexEndpoint.name = ''; - const expectedHeaderRequestParams = "index_endpoint.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()); - client.innerApiCalls.updateIndexEndpoint = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateIndexEndpoint( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IIndexEndpoint|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateIndexEndpoint with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateIndexEndpointRequest()); - request.indexEndpoint = {}; - request.indexEndpoint.name = ''; - const expectedHeaderRequestParams = "index_endpoint.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateIndexEndpoint = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateIndexEndpoint(request), expectedError); - assert((client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateIndexEndpoint with closed client', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateIndexEndpointRequest()); - request.indexEndpoint = {}; - request.indexEndpoint.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateIndexEndpoint(request), expectedError); - }); - }); - - describe('createIndexEndpoint', () => { - it('invokes createIndexEndpoint without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateIndexEndpointRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(expectedResponse); - const [operation] = await client.createIndexEndpoint(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createIndexEndpoint without error using callback', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateIndexEndpointRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createIndexEndpoint = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createIndexEndpoint( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createIndexEndpoint with call error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateIndexEndpointRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createIndexEndpoint(request), expectedError); - assert((client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createIndexEndpoint with LRO error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateIndexEndpointRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createIndexEndpoint(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateIndexEndpointProgress without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateIndexEndpointProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateIndexEndpointProgress with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateIndexEndpointProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteIndexEndpoint', () => { - it('invokes deleteIndexEndpoint without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteIndexEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteIndexEndpoint(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteIndexEndpoint without error using callback', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteIndexEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteIndexEndpoint( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteIndexEndpoint with call error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteIndexEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteIndexEndpoint(request), expectedError); - assert((client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteIndexEndpoint with LRO error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteIndexEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteIndexEndpoint(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteIndexEndpointProgress without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteIndexEndpointProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteIndexEndpointProgress with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteIndexEndpointProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deployIndex', () => { - it('invokes deployIndex without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeployIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deployIndex = stubLongRunningCall(expectedResponse); - const [operation] = await client.deployIndex(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deployIndex without error using callback', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeployIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deployIndex = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deployIndex( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deployIndex with call error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeployIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deployIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deployIndex(request), expectedError); - assert((client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deployIndex with LRO error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeployIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deployIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deployIndex(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeployIndexProgress without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeployIndexProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeployIndexProgress with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeployIndexProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('undeployIndex', () => { - it('invokes undeployIndex without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UndeployIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.undeployIndex = stubLongRunningCall(expectedResponse); - const [operation] = await client.undeployIndex(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes undeployIndex without error using callback', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UndeployIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.undeployIndex = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.undeployIndex( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes undeployIndex with call error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UndeployIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.undeployIndex(request), expectedError); - assert((client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes undeployIndex with LRO error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UndeployIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.undeployIndex(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUndeployIndexProgress without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUndeployIndexProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUndeployIndexProgress with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUndeployIndexProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('mutateDeployedIndex', () => { - it('invokes mutateDeployedIndex without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MutateDeployedIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(expectedResponse); - const [operation] = await client.mutateDeployedIndex(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes mutateDeployedIndex without error using callback', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MutateDeployedIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.mutateDeployedIndex = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.mutateDeployedIndex( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes mutateDeployedIndex with call error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MutateDeployedIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.mutateDeployedIndex(request), expectedError); - assert((client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes mutateDeployedIndex with LRO error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MutateDeployedIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.mutateDeployedIndex(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkMutateDeployedIndexProgress without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkMutateDeployedIndexProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkMutateDeployedIndexProgress with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkMutateDeployedIndexProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listIndexEndpoints', () => { - it('invokes listIndexEndpoints without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), - ]; - client.innerApiCalls.listIndexEndpoints = stubSimpleCall(expectedResponse); - const [response] = await client.listIndexEndpoints(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listIndexEndpoints without error using callback', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), - ]; - client.innerApiCalls.listIndexEndpoints = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listIndexEndpoints( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IIndexEndpoint[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listIndexEndpoints with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listIndexEndpoints = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listIndexEndpoints(request), expectedError); - assert((client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listIndexEndpointsStream without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), - ]; - client.descriptors.page.listIndexEndpoints.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listIndexEndpointsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.IndexEndpoint[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.IndexEndpoint) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listIndexEndpoints.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listIndexEndpoints, request)); - assert.strictEqual( - (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listIndexEndpointsStream with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listIndexEndpoints.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listIndexEndpointsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.IndexEndpoint[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.IndexEndpoint) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listIndexEndpoints.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listIndexEndpoints, request)); - assert.strictEqual( - (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listIndexEndpoints without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.IndexEndpoint()), - ]; - client.descriptors.page.listIndexEndpoints.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IIndexEndpoint[] = []; - const iterable = client.listIndexEndpointsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listIndexEndpoints with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listIndexEndpoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listIndexEndpointsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IIndexEndpoint[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/test/gapic_index_service_v1.ts b/owl-bot-staging/v1/test/gapic_index_service_v1.ts deleted file mode 100644 index 32f83b15..00000000 --- a/owl-bot-staging/v1/test/gapic_index_service_v1.ts +++ /dev/null @@ -1,2635 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as indexserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.IndexServiceClient', () => { - it('has servicePath', () => { - const servicePath = indexserviceModule.v1.IndexServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = indexserviceModule.v1.IndexServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = indexserviceModule.v1.IndexServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new indexserviceModule.v1.IndexServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.indexServiceStub, undefined); - await client.initialize(); - assert(client.indexServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.indexServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.indexServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('getIndex', () => { - it('invokes getIndex without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetIndexRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()); - client.innerApiCalls.getIndex = stubSimpleCall(expectedResponse); - const [response] = await client.getIndex(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getIndex without error using callback', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetIndexRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()); - client.innerApiCalls.getIndex = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIndex( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IIndex|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getIndex with error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetIndexRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getIndex = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIndex(request), expectedError); - assert((client.innerApiCalls.getIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getIndex with closed client', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetIndexRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getIndex(request), expectedError); - }); - }); - - describe('createIndex', () => { - it('invokes createIndex without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateIndexRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createIndex = stubLongRunningCall(expectedResponse); - const [operation] = await client.createIndex(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createIndex without error using callback', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateIndexRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createIndex = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createIndex( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createIndex with call error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateIndexRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createIndex(request), expectedError); - assert((client.innerApiCalls.createIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createIndex with LRO error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateIndexRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createIndex(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateIndexProgress without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateIndexProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateIndexProgress with error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateIndexProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateIndex', () => { - it('invokes updateIndex without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateIndexRequest()); - request.index = {}; - request.index.name = ''; - const expectedHeaderRequestParams = "index.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateIndex = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateIndex(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateIndex without error using callback', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateIndexRequest()); - request.index = {}; - request.index.name = ''; - const expectedHeaderRequestParams = "index.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateIndex = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateIndex( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateIndex with call error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateIndexRequest()); - request.index = {}; - request.index.name = ''; - const expectedHeaderRequestParams = "index.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateIndex(request), expectedError); - assert((client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateIndex with LRO error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateIndexRequest()); - request.index = {}; - request.index.name = ''; - const expectedHeaderRequestParams = "index.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateIndex(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUpdateIndexProgress without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateIndexProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateIndexProgress with error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateIndexProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteIndex', () => { - it('invokes deleteIndex without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteIndexRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteIndex = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteIndex(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteIndex without error using callback', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteIndexRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteIndex = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteIndex( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteIndex with call error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteIndexRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteIndex(request), expectedError); - assert((client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteIndex with LRO error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteIndexRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteIndex(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteIndexProgress without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteIndexProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteIndexProgress with error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteIndexProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listIndexes', () => { - it('invokes listIndexes without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), - ]; - client.innerApiCalls.listIndexes = stubSimpleCall(expectedResponse); - const [response] = await client.listIndexes(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listIndexes as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listIndexes without error using callback', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), - ]; - client.innerApiCalls.listIndexes = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listIndexes( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IIndex[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listIndexes as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listIndexes with error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listIndexes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listIndexes(request), expectedError); - assert((client.innerApiCalls.listIndexes as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listIndexesStream without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), - ]; - client.descriptors.page.listIndexes.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listIndexesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Index[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Index) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listIndexes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listIndexes, request)); - assert.strictEqual( - (client.descriptors.page.listIndexes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listIndexesStream with error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listIndexes.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listIndexesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Index[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Index) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listIndexes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listIndexes, request)); - assert.strictEqual( - (client.descriptors.page.listIndexes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listIndexes without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), - ]; - client.descriptors.page.listIndexes.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IIndex[] = []; - const iterable = client.listIndexesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listIndexes with error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListIndexesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listIndexes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listIndexesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IIndex[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/test/gapic_job_service_v1.ts b/owl-bot-staging/v1/test/gapic_job_service_v1.ts deleted file mode 100644 index 40715ff5..00000000 --- a/owl-bot-staging/v1/test/gapic_job_service_v1.ts +++ /dev/null @@ -1,5637 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as jobserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.JobServiceClient', () => { - it('has servicePath', () => { - const servicePath = jobserviceModule.v1.JobServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = jobserviceModule.v1.JobServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = jobserviceModule.v1.JobServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new jobserviceModule.v1.JobServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new jobserviceModule.v1.JobServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.jobServiceStub, undefined); - await client.initialize(); - assert(client.jobServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.jobServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.jobServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('createCustomJob', () => { - it('invokes createCustomJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateCustomJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()); - client.innerApiCalls.createCustomJob = stubSimpleCall(expectedResponse); - const [response] = await client.createCustomJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createCustomJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateCustomJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()); - client.innerApiCalls.createCustomJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCustomJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ICustomJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createCustomJob with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateCustomJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createCustomJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createCustomJob(request), expectedError); - assert((client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createCustomJob with closed client', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateCustomJobRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createCustomJob(request), expectedError); - }); - }); - - describe('getCustomJob', () => { - it('invokes getCustomJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()); - client.innerApiCalls.getCustomJob = stubSimpleCall(expectedResponse); - const [response] = await client.getCustomJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getCustomJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()); - client.innerApiCalls.getCustomJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCustomJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ICustomJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getCustomJob with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getCustomJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCustomJob(request), expectedError); - assert((client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getCustomJob with closed client', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetCustomJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getCustomJob(request), expectedError); - }); - }); - - describe('cancelCustomJob', () => { - it('invokes cancelCustomJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelCustomJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelCustomJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelCustomJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelCustomJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelCustomJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes cancelCustomJob with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelCustomJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelCustomJob(request), expectedError); - assert((client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelCustomJob with closed client', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelCustomJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelCustomJob(request), expectedError); - }); - }); - - describe('createDataLabelingJob', () => { - it('invokes createDataLabelingJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateDataLabelingJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()); - client.innerApiCalls.createDataLabelingJob = stubSimpleCall(expectedResponse); - const [response] = await client.createDataLabelingJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createDataLabelingJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateDataLabelingJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()); - client.innerApiCalls.createDataLabelingJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDataLabelingJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IDataLabelingJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createDataLabelingJob with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateDataLabelingJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createDataLabelingJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDataLabelingJob(request), expectedError); - assert((client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createDataLabelingJob with closed client', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateDataLabelingJobRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createDataLabelingJob(request), expectedError); - }); - }); - - describe('getDataLabelingJob', () => { - it('invokes getDataLabelingJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()); - client.innerApiCalls.getDataLabelingJob = stubSimpleCall(expectedResponse); - const [response] = await client.getDataLabelingJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDataLabelingJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()); - client.innerApiCalls.getDataLabelingJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDataLabelingJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IDataLabelingJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getDataLabelingJob with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataLabelingJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataLabelingJob(request), expectedError); - assert((client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDataLabelingJob with closed client', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetDataLabelingJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDataLabelingJob(request), expectedError); - }); - }); - - describe('cancelDataLabelingJob', () => { - it('invokes cancelDataLabelingJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelDataLabelingJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelDataLabelingJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelDataLabelingJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelDataLabelingJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes cancelDataLabelingJob with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelDataLabelingJob(request), expectedError); - assert((client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelDataLabelingJob with closed client', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelDataLabelingJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelDataLabelingJob(request), expectedError); - }); - }); - - describe('createHyperparameterTuningJob', () => { - it('invokes createHyperparameterTuningJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateHyperparameterTuningJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()); - client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCall(expectedResponse); - const [response] = await client.createHyperparameterTuningJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createHyperparameterTuningJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateHyperparameterTuningJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()); - client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createHyperparameterTuningJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createHyperparameterTuningJob with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateHyperparameterTuningJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createHyperparameterTuningJob(request), expectedError); - assert((client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createHyperparameterTuningJob with closed client', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateHyperparameterTuningJobRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createHyperparameterTuningJob(request), expectedError); - }); - }); - - describe('getHyperparameterTuningJob', () => { - it('invokes getHyperparameterTuningJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()); - client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCall(expectedResponse); - const [response] = await client.getHyperparameterTuningJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getHyperparameterTuningJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()); - client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getHyperparameterTuningJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getHyperparameterTuningJob with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getHyperparameterTuningJob(request), expectedError); - assert((client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getHyperparameterTuningJob with closed client', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetHyperparameterTuningJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getHyperparameterTuningJob(request), expectedError); - }); - }); - - describe('cancelHyperparameterTuningJob', () => { - it('invokes cancelHyperparameterTuningJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelHyperparameterTuningJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelHyperparameterTuningJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelHyperparameterTuningJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes cancelHyperparameterTuningJob with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelHyperparameterTuningJob(request), expectedError); - assert((client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelHyperparameterTuningJob with closed client', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelHyperparameterTuningJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelHyperparameterTuningJob(request), expectedError); - }); - }); - - describe('createBatchPredictionJob', () => { - it('invokes createBatchPredictionJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateBatchPredictionJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()); - client.innerApiCalls.createBatchPredictionJob = stubSimpleCall(expectedResponse); - const [response] = await client.createBatchPredictionJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createBatchPredictionJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateBatchPredictionJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()); - client.innerApiCalls.createBatchPredictionJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createBatchPredictionJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IBatchPredictionJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createBatchPredictionJob with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateBatchPredictionJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createBatchPredictionJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createBatchPredictionJob(request), expectedError); - assert((client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createBatchPredictionJob with closed client', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateBatchPredictionJobRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createBatchPredictionJob(request), expectedError); - }); - }); - - describe('getBatchPredictionJob', () => { - it('invokes getBatchPredictionJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()); - client.innerApiCalls.getBatchPredictionJob = stubSimpleCall(expectedResponse); - const [response] = await client.getBatchPredictionJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getBatchPredictionJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()); - client.innerApiCalls.getBatchPredictionJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getBatchPredictionJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IBatchPredictionJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getBatchPredictionJob with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getBatchPredictionJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBatchPredictionJob(request), expectedError); - assert((client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getBatchPredictionJob with closed client', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetBatchPredictionJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getBatchPredictionJob(request), expectedError); - }); - }); - - describe('cancelBatchPredictionJob', () => { - it('invokes cancelBatchPredictionJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelBatchPredictionJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelBatchPredictionJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelBatchPredictionJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes cancelBatchPredictionJob with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelBatchPredictionJob(request), expectedError); - assert((client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelBatchPredictionJob with closed client', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelBatchPredictionJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelBatchPredictionJob(request), expectedError); - }); - }); - - describe('createModelDeploymentMonitoringJob', () => { - it('invokes createModelDeploymentMonitoringJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateModelDeploymentMonitoringJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()); - client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); - const [response] = await client.createModelDeploymentMonitoringJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createModelDeploymentMonitoringJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateModelDeploymentMonitoringJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()); - client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createModelDeploymentMonitoringJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createModelDeploymentMonitoringJob with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateModelDeploymentMonitoringJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createModelDeploymentMonitoringJob(request), expectedError); - assert((client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createModelDeploymentMonitoringJob with closed client', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateModelDeploymentMonitoringJobRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createModelDeploymentMonitoringJob(request), expectedError); - }); - }); - - describe('getModelDeploymentMonitoringJob', () => { - it('invokes getModelDeploymentMonitoringJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()); - client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); - const [response] = await client.getModelDeploymentMonitoringJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getModelDeploymentMonitoringJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()); - client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getModelDeploymentMonitoringJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getModelDeploymentMonitoringJob with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getModelDeploymentMonitoringJob(request), expectedError); - assert((client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getModelDeploymentMonitoringJob with closed client', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getModelDeploymentMonitoringJob(request), expectedError); - }); - }); - - describe('pauseModelDeploymentMonitoringJob', () => { - it('invokes pauseModelDeploymentMonitoringJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PauseModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); - const [response] = await client.pauseModelDeploymentMonitoringJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes pauseModelDeploymentMonitoringJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PauseModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.pauseModelDeploymentMonitoringJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes pauseModelDeploymentMonitoringJob with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PauseModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.pauseModelDeploymentMonitoringJob(request), expectedError); - assert((client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes pauseModelDeploymentMonitoringJob with closed client', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PauseModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.pauseModelDeploymentMonitoringJob(request), expectedError); - }); - }); - - describe('resumeModelDeploymentMonitoringJob', () => { - it('invokes resumeModelDeploymentMonitoringJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ResumeModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); - const [response] = await client.resumeModelDeploymentMonitoringJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes resumeModelDeploymentMonitoringJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ResumeModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.resumeModelDeploymentMonitoringJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes resumeModelDeploymentMonitoringJob with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ResumeModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.resumeModelDeploymentMonitoringJob(request), expectedError); - assert((client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes resumeModelDeploymentMonitoringJob with closed client', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ResumeModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.resumeModelDeploymentMonitoringJob(request), expectedError); - }); - }); - - describe('deleteCustomJob', () => { - it('invokes deleteCustomJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteCustomJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteCustomJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteCustomJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteCustomJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteCustomJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteCustomJob with call error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCustomJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteCustomJob(request), expectedError); - assert((client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteCustomJob with LRO error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCustomJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteCustomJob(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteCustomJobProgress without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteCustomJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteCustomJobProgress with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteCustomJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteDataLabelingJob', () => { - it('invokes deleteDataLabelingJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteDataLabelingJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteDataLabelingJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteDataLabelingJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteDataLabelingJob with call error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteDataLabelingJob(request), expectedError); - assert((client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteDataLabelingJob with LRO error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteDataLabelingJob(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteDataLabelingJobProgress without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteDataLabelingJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteDataLabelingJobProgress with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteDataLabelingJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteHyperparameterTuningJob', () => { - it('invokes deleteHyperparameterTuningJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteHyperparameterTuningJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteHyperparameterTuningJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteHyperparameterTuningJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteHyperparameterTuningJob with call error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteHyperparameterTuningJob(request), expectedError); - assert((client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteHyperparameterTuningJob with LRO error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteHyperparameterTuningJob(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteHyperparameterTuningJobProgress without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteHyperparameterTuningJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteHyperparameterTuningJobProgress with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteHyperparameterTuningJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteBatchPredictionJob', () => { - it('invokes deleteBatchPredictionJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteBatchPredictionJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteBatchPredictionJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteBatchPredictionJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteBatchPredictionJob with call error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteBatchPredictionJob(request), expectedError); - assert((client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteBatchPredictionJob with LRO error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteBatchPredictionJob(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteBatchPredictionJobProgress without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteBatchPredictionJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteBatchPredictionJobProgress with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteBatchPredictionJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateModelDeploymentMonitoringJob', () => { - it('invokes updateModelDeploymentMonitoringJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateModelDeploymentMonitoringJobRequest()); - request.modelDeploymentMonitoringJob = {}; - request.modelDeploymentMonitoringJob.name = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateModelDeploymentMonitoringJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateModelDeploymentMonitoringJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateModelDeploymentMonitoringJobRequest()); - request.modelDeploymentMonitoringJob = {}; - request.modelDeploymentMonitoringJob.name = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateModelDeploymentMonitoringJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateModelDeploymentMonitoringJob with call error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateModelDeploymentMonitoringJobRequest()); - request.modelDeploymentMonitoringJob = {}; - request.modelDeploymentMonitoringJob.name = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateModelDeploymentMonitoringJob(request), expectedError); - assert((client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateModelDeploymentMonitoringJob with LRO error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateModelDeploymentMonitoringJobRequest()); - request.modelDeploymentMonitoringJob = {}; - request.modelDeploymentMonitoringJob.name = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateModelDeploymentMonitoringJob(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUpdateModelDeploymentMonitoringJobProgress without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateModelDeploymentMonitoringJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateModelDeploymentMonitoringJobProgress with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateModelDeploymentMonitoringJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteModelDeploymentMonitoringJob', () => { - it('invokes deleteModelDeploymentMonitoringJob without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteModelDeploymentMonitoringJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteModelDeploymentMonitoringJob without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteModelDeploymentMonitoringJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteModelDeploymentMonitoringJob with call error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteModelDeploymentMonitoringJob(request), expectedError); - assert((client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteModelDeploymentMonitoringJob with LRO error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteModelDeploymentMonitoringJob(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteModelDeploymentMonitoringJobProgress without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteModelDeploymentMonitoringJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteModelDeploymentMonitoringJobProgress with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteModelDeploymentMonitoringJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listCustomJobs', () => { - it('invokes listCustomJobs without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListCustomJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), - ]; - client.innerApiCalls.listCustomJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listCustomJobs(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listCustomJobs without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListCustomJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), - ]; - client.innerApiCalls.listCustomJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listCustomJobs( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ICustomJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listCustomJobs with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListCustomJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listCustomJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listCustomJobs(request), expectedError); - assert((client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listCustomJobsStream without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListCustomJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), - ]; - client.descriptors.page.listCustomJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listCustomJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.CustomJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.CustomJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listCustomJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listCustomJobs, request)); - assert.strictEqual( - (client.descriptors.page.listCustomJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listCustomJobsStream with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListCustomJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listCustomJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listCustomJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.CustomJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.CustomJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listCustomJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listCustomJobs, request)); - assert.strictEqual( - (client.descriptors.page.listCustomJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listCustomJobs without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListCustomJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.CustomJob()), - ]; - client.descriptors.page.listCustomJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.ICustomJob[] = []; - const iterable = client.listCustomJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listCustomJobs with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListCustomJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listCustomJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listCustomJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.ICustomJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listDataLabelingJobs', () => { - it('invokes listDataLabelingJobs without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), - ]; - client.innerApiCalls.listDataLabelingJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listDataLabelingJobs(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDataLabelingJobs without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), - ]; - client.innerApiCalls.listDataLabelingJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDataLabelingJobs( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IDataLabelingJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listDataLabelingJobs with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listDataLabelingJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDataLabelingJobs(request), expectedError); - assert((client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDataLabelingJobsStream without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), - ]; - client.descriptors.page.listDataLabelingJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDataLabelingJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.DataLabelingJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.DataLabelingJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDataLabelingJobs, request)); - assert.strictEqual( - (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listDataLabelingJobsStream with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listDataLabelingJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDataLabelingJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.DataLabelingJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.DataLabelingJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDataLabelingJobs, request)); - assert.strictEqual( - (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDataLabelingJobs without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataLabelingJob()), - ]; - client.descriptors.page.listDataLabelingJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IDataLabelingJob[] = []; - const iterable = client.listDataLabelingJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDataLabelingJobs with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listDataLabelingJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDataLabelingJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IDataLabelingJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listHyperparameterTuningJobs', () => { - it('invokes listHyperparameterTuningJobs without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), - ]; - client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listHyperparameterTuningJobs(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listHyperparameterTuningJobs without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), - ]; - client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listHyperparameterTuningJobs( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listHyperparameterTuningJobs with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listHyperparameterTuningJobs(request), expectedError); - assert((client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listHyperparameterTuningJobsStream without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), - ]; - client.descriptors.page.listHyperparameterTuningJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listHyperparameterTuningJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.HyperparameterTuningJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.HyperparameterTuningJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listHyperparameterTuningJobs, request)); - assert.strictEqual( - (client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listHyperparameterTuningJobsStream with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listHyperparameterTuningJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listHyperparameterTuningJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.HyperparameterTuningJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.HyperparameterTuningJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listHyperparameterTuningJobs, request)); - assert.strictEqual( - (client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listHyperparameterTuningJobs without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob()), - ]; - client.descriptors.page.listHyperparameterTuningJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob[] = []; - const iterable = client.listHyperparameterTuningJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listHyperparameterTuningJobs with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listHyperparameterTuningJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listHyperparameterTuningJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IHyperparameterTuningJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listBatchPredictionJobs', () => { - it('invokes listBatchPredictionJobs without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), - ]; - client.innerApiCalls.listBatchPredictionJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listBatchPredictionJobs(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listBatchPredictionJobs without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), - ]; - client.innerApiCalls.listBatchPredictionJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listBatchPredictionJobs( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IBatchPredictionJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listBatchPredictionJobs with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listBatchPredictionJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listBatchPredictionJobs(request), expectedError); - assert((client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listBatchPredictionJobsStream without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), - ]; - client.descriptors.page.listBatchPredictionJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBatchPredictionJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.BatchPredictionJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.BatchPredictionJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBatchPredictionJobs, request)); - assert.strictEqual( - (client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listBatchPredictionJobsStream with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listBatchPredictionJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listBatchPredictionJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.BatchPredictionJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.BatchPredictionJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBatchPredictionJobs, request)); - assert.strictEqual( - (client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listBatchPredictionJobs without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchPredictionJob()), - ]; - client.descriptors.page.listBatchPredictionJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IBatchPredictionJob[] = []; - const iterable = client.listBatchPredictionJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listBatchPredictionJobs with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listBatchPredictionJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBatchPredictionJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IBatchPredictionJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('searchModelDeploymentMonitoringStatsAnomalies', () => { - it('invokes searchModelDeploymentMonitoringStatsAnomalies without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), - ]; - client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCall(expectedResponse); - const [response] = await client.searchModelDeploymentMonitoringStatsAnomalies(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes searchModelDeploymentMonitoringStatsAnomalies without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), - ]; - client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.searchModelDeploymentMonitoringStatsAnomalies( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModelMonitoringStatsAnomalies[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes searchModelDeploymentMonitoringStatsAnomalies with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchModelDeploymentMonitoringStatsAnomalies(request), expectedError); - assert((client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes searchModelDeploymentMonitoringStatsAnomaliesStream without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), - ]; - client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchModelDeploymentMonitoringStatsAnomaliesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies, request)); - assert.strictEqual( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes searchModelDeploymentMonitoringStatsAnomaliesStream with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job="; - const expectedError = new Error('expected'); - client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchModelDeploymentMonitoringStatsAnomaliesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies, request)); - assert.strictEqual( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with searchModelDeploymentMonitoringStatsAnomalies without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies()), - ]; - client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IModelMonitoringStatsAnomalies[] = []; - const iterable = client.searchModelDeploymentMonitoringStatsAnomaliesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with searchModelDeploymentMonitoringStatsAnomalies with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job=";const expectedError = new Error('expected'); - client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchModelDeploymentMonitoringStatsAnomaliesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IModelMonitoringStatsAnomalies[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listModelDeploymentMonitoringJobs', () => { - it('invokes listModelDeploymentMonitoringJobs without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), - ]; - client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listModelDeploymentMonitoringJobs(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listModelDeploymentMonitoringJobs without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), - ]; - client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listModelDeploymentMonitoringJobs( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listModelDeploymentMonitoringJobs with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModelDeploymentMonitoringJobs(request), expectedError); - assert((client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listModelDeploymentMonitoringJobsStream without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), - ]; - client.descriptors.page.listModelDeploymentMonitoringJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listModelDeploymentMonitoringJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModelDeploymentMonitoringJobs, request)); - assert.strictEqual( - (client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listModelDeploymentMonitoringJobsStream with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listModelDeploymentMonitoringJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listModelDeploymentMonitoringJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModelDeploymentMonitoringJobs, request)); - assert.strictEqual( - (client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listModelDeploymentMonitoringJobs without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob()), - ]; - client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob[] = []; - const iterable = client.listModelDeploymentMonitoringJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listModelDeploymentMonitoringJobs with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listModelDeploymentMonitoringJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IModelDeploymentMonitoringJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/test/gapic_metadata_service_v1.ts b/owl-bot-staging/v1/test/gapic_metadata_service_v1.ts deleted file mode 100644 index 6c826745..00000000 --- a/owl-bot-staging/v1/test/gapic_metadata_service_v1.ts +++ /dev/null @@ -1,5934 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as metadataserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.MetadataServiceClient', () => { - it('has servicePath', () => { - const servicePath = metadataserviceModule.v1.MetadataServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = metadataserviceModule.v1.MetadataServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = metadataserviceModule.v1.MetadataServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new metadataserviceModule.v1.MetadataServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.metadataServiceStub, undefined); - await client.initialize(); - assert(client.metadataServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.metadataServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.metadataServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('getMetadataStore', () => { - it('invokes getMetadataStore without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetMetadataStoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()); - client.innerApiCalls.getMetadataStore = stubSimpleCall(expectedResponse); - const [response] = await client.getMetadataStore(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getMetadataStore without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetMetadataStoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()); - client.innerApiCalls.getMetadataStore = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getMetadataStore( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IMetadataStore|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getMetadataStore with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetMetadataStoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getMetadataStore = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getMetadataStore(request), expectedError); - assert((client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getMetadataStore with closed client', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetMetadataStoreRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getMetadataStore(request), expectedError); - }); - }); - - describe('createArtifact', () => { - it('invokes createArtifact without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateArtifactRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()); - client.innerApiCalls.createArtifact = stubSimpleCall(expectedResponse); - const [response] = await client.createArtifact(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createArtifact without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateArtifactRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()); - client.innerApiCalls.createArtifact = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createArtifact( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IArtifact|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createArtifact with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateArtifactRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createArtifact = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createArtifact(request), expectedError); - assert((client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createArtifact with closed client', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateArtifactRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createArtifact(request), expectedError); - }); - }); - - describe('getArtifact', () => { - it('invokes getArtifact without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetArtifactRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()); - client.innerApiCalls.getArtifact = stubSimpleCall(expectedResponse); - const [response] = await client.getArtifact(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getArtifact without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetArtifactRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()); - client.innerApiCalls.getArtifact = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getArtifact( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IArtifact|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getArtifact with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetArtifactRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getArtifact = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getArtifact(request), expectedError); - assert((client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getArtifact with closed client', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetArtifactRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getArtifact(request), expectedError); - }); - }); - - describe('updateArtifact', () => { - it('invokes updateArtifact without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateArtifactRequest()); - request.artifact = {}; - request.artifact.name = ''; - const expectedHeaderRequestParams = "artifact.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()); - client.innerApiCalls.updateArtifact = stubSimpleCall(expectedResponse); - const [response] = await client.updateArtifact(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateArtifact without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateArtifactRequest()); - request.artifact = {}; - request.artifact.name = ''; - const expectedHeaderRequestParams = "artifact.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()); - client.innerApiCalls.updateArtifact = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateArtifact( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IArtifact|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateArtifact with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateArtifactRequest()); - request.artifact = {}; - request.artifact.name = ''; - const expectedHeaderRequestParams = "artifact.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateArtifact = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateArtifact(request), expectedError); - assert((client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateArtifact with closed client', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateArtifactRequest()); - request.artifact = {}; - request.artifact.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateArtifact(request), expectedError); - }); - }); - - describe('createContext', () => { - it('invokes createContext without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateContextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()); - client.innerApiCalls.createContext = stubSimpleCall(expectedResponse); - const [response] = await client.createContext(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createContext without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateContextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()); - client.innerApiCalls.createContext = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createContext( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IContext|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createContext with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateContextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createContext = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createContext(request), expectedError); - assert((client.innerApiCalls.createContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createContext with closed client', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateContextRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createContext(request), expectedError); - }); - }); - - describe('getContext', () => { - it('invokes getContext without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetContextRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()); - client.innerApiCalls.getContext = stubSimpleCall(expectedResponse); - const [response] = await client.getContext(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getContext without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetContextRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()); - client.innerApiCalls.getContext = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getContext( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IContext|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getContext with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetContextRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getContext = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getContext(request), expectedError); - assert((client.innerApiCalls.getContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getContext with closed client', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetContextRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getContext(request), expectedError); - }); - }); - - describe('updateContext', () => { - it('invokes updateContext without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateContextRequest()); - request.context = {}; - request.context.name = ''; - const expectedHeaderRequestParams = "context.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()); - client.innerApiCalls.updateContext = stubSimpleCall(expectedResponse); - const [response] = await client.updateContext(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateContext without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateContextRequest()); - request.context = {}; - request.context.name = ''; - const expectedHeaderRequestParams = "context.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()); - client.innerApiCalls.updateContext = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateContext( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IContext|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateContext with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateContextRequest()); - request.context = {}; - request.context.name = ''; - const expectedHeaderRequestParams = "context.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateContext = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateContext(request), expectedError); - assert((client.innerApiCalls.updateContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateContext with closed client', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateContextRequest()); - request.context = {}; - request.context.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateContext(request), expectedError); - }); - }); - - describe('addContextArtifactsAndExecutions', () => { - it('invokes addContextArtifactsAndExecutions without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsRequest()); - request.context = ''; - const expectedHeaderRequestParams = "context="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsResponse()); - client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCall(expectedResponse); - const [response] = await client.addContextArtifactsAndExecutions(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes addContextArtifactsAndExecutions without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsRequest()); - request.context = ''; - const expectedHeaderRequestParams = "context="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsResponse()); - client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.addContextArtifactsAndExecutions( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IAddContextArtifactsAndExecutionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes addContextArtifactsAndExecutions with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsRequest()); - request.context = ''; - const expectedHeaderRequestParams = "context="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addContextArtifactsAndExecutions(request), expectedError); - assert((client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes addContextArtifactsAndExecutions with closed client', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsRequest()); - request.context = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.addContextArtifactsAndExecutions(request), expectedError); - }); - }); - - describe('addContextChildren', () => { - it('invokes addContextChildren without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextChildrenRequest()); - request.context = ''; - const expectedHeaderRequestParams = "context="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextChildrenResponse()); - client.innerApiCalls.addContextChildren = stubSimpleCall(expectedResponse); - const [response] = await client.addContextChildren(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes addContextChildren without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextChildrenRequest()); - request.context = ''; - const expectedHeaderRequestParams = "context="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextChildrenResponse()); - client.innerApiCalls.addContextChildren = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.addContextChildren( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IAddContextChildrenResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes addContextChildren with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextChildrenRequest()); - request.context = ''; - const expectedHeaderRequestParams = "context="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.addContextChildren = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addContextChildren(request), expectedError); - assert((client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes addContextChildren with closed client', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddContextChildrenRequest()); - request.context = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.addContextChildren(request), expectedError); - }); - }); - - describe('queryContextLineageSubgraph', () => { - it('invokes queryContextLineageSubgraph without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryContextLineageSubgraphRequest()); - request.context = ''; - const expectedHeaderRequestParams = "context="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LineageSubgraph()); - client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCall(expectedResponse); - const [response] = await client.queryContextLineageSubgraph(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryContextLineageSubgraph without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryContextLineageSubgraphRequest()); - request.context = ''; - const expectedHeaderRequestParams = "context="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LineageSubgraph()); - client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.queryContextLineageSubgraph( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ILineageSubgraph|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes queryContextLineageSubgraph with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryContextLineageSubgraphRequest()); - request.context = ''; - const expectedHeaderRequestParams = "context="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryContextLineageSubgraph(request), expectedError); - assert((client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryContextLineageSubgraph with closed client', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryContextLineageSubgraphRequest()); - request.context = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.queryContextLineageSubgraph(request), expectedError); - }); - }); - - describe('createExecution', () => { - it('invokes createExecution without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateExecutionRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()); - client.innerApiCalls.createExecution = stubSimpleCall(expectedResponse); - const [response] = await client.createExecution(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createExecution without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateExecutionRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()); - client.innerApiCalls.createExecution = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createExecution( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IExecution|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createExecution with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateExecutionRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createExecution = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createExecution(request), expectedError); - assert((client.innerApiCalls.createExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createExecution with closed client', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateExecutionRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createExecution(request), expectedError); - }); - }); - - describe('getExecution', () => { - it('invokes getExecution without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetExecutionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()); - client.innerApiCalls.getExecution = stubSimpleCall(expectedResponse); - const [response] = await client.getExecution(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getExecution without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetExecutionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()); - client.innerApiCalls.getExecution = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getExecution( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IExecution|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getExecution with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetExecutionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getExecution = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getExecution(request), expectedError); - assert((client.innerApiCalls.getExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getExecution with closed client', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetExecutionRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getExecution(request), expectedError); - }); - }); - - describe('updateExecution', () => { - it('invokes updateExecution without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateExecutionRequest()); - request.execution = {}; - request.execution.name = ''; - const expectedHeaderRequestParams = "execution.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()); - client.innerApiCalls.updateExecution = stubSimpleCall(expectedResponse); - const [response] = await client.updateExecution(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateExecution without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateExecutionRequest()); - request.execution = {}; - request.execution.name = ''; - const expectedHeaderRequestParams = "execution.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()); - client.innerApiCalls.updateExecution = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateExecution( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IExecution|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateExecution with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateExecutionRequest()); - request.execution = {}; - request.execution.name = ''; - const expectedHeaderRequestParams = "execution.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateExecution = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateExecution(request), expectedError); - assert((client.innerApiCalls.updateExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateExecution with closed client', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateExecutionRequest()); - request.execution = {}; - request.execution.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateExecution(request), expectedError); - }); - }); - - describe('addExecutionEvents', () => { - it('invokes addExecutionEvents without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddExecutionEventsRequest()); - request.execution = ''; - const expectedHeaderRequestParams = "execution="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddExecutionEventsResponse()); - client.innerApiCalls.addExecutionEvents = stubSimpleCall(expectedResponse); - const [response] = await client.addExecutionEvents(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes addExecutionEvents without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddExecutionEventsRequest()); - request.execution = ''; - const expectedHeaderRequestParams = "execution="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddExecutionEventsResponse()); - client.innerApiCalls.addExecutionEvents = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.addExecutionEvents( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IAddExecutionEventsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes addExecutionEvents with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddExecutionEventsRequest()); - request.execution = ''; - const expectedHeaderRequestParams = "execution="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.addExecutionEvents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addExecutionEvents(request), expectedError); - assert((client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes addExecutionEvents with closed client', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddExecutionEventsRequest()); - request.execution = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.addExecutionEvents(request), expectedError); - }); - }); - - describe('queryExecutionInputsAndOutputs', () => { - it('invokes queryExecutionInputsAndOutputs without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryExecutionInputsAndOutputsRequest()); - request.execution = ''; - const expectedHeaderRequestParams = "execution="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LineageSubgraph()); - client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCall(expectedResponse); - const [response] = await client.queryExecutionInputsAndOutputs(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryExecutionInputsAndOutputs without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryExecutionInputsAndOutputsRequest()); - request.execution = ''; - const expectedHeaderRequestParams = "execution="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LineageSubgraph()); - client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.queryExecutionInputsAndOutputs( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ILineageSubgraph|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes queryExecutionInputsAndOutputs with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryExecutionInputsAndOutputsRequest()); - request.execution = ''; - const expectedHeaderRequestParams = "execution="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryExecutionInputsAndOutputs(request), expectedError); - assert((client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryExecutionInputsAndOutputs with closed client', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryExecutionInputsAndOutputsRequest()); - request.execution = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.queryExecutionInputsAndOutputs(request), expectedError); - }); - }); - - describe('createMetadataSchema', () => { - it('invokes createMetadataSchema without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateMetadataSchemaRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()); - client.innerApiCalls.createMetadataSchema = stubSimpleCall(expectedResponse); - const [response] = await client.createMetadataSchema(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createMetadataSchema without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateMetadataSchemaRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()); - client.innerApiCalls.createMetadataSchema = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createMetadataSchema( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IMetadataSchema|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createMetadataSchema with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateMetadataSchemaRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createMetadataSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createMetadataSchema(request), expectedError); - assert((client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createMetadataSchema with closed client', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateMetadataSchemaRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createMetadataSchema(request), expectedError); - }); - }); - - describe('getMetadataSchema', () => { - it('invokes getMetadataSchema without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetMetadataSchemaRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()); - client.innerApiCalls.getMetadataSchema = stubSimpleCall(expectedResponse); - const [response] = await client.getMetadataSchema(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getMetadataSchema without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetMetadataSchemaRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()); - client.innerApiCalls.getMetadataSchema = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getMetadataSchema( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IMetadataSchema|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getMetadataSchema with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetMetadataSchemaRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getMetadataSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getMetadataSchema(request), expectedError); - assert((client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getMetadataSchema with closed client', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetMetadataSchemaRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getMetadataSchema(request), expectedError); - }); - }); - - describe('queryArtifactLineageSubgraph', () => { - it('invokes queryArtifactLineageSubgraph without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest()); - request.artifact = ''; - const expectedHeaderRequestParams = "artifact="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LineageSubgraph()); - client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCall(expectedResponse); - const [response] = await client.queryArtifactLineageSubgraph(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryArtifactLineageSubgraph without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest()); - request.artifact = ''; - const expectedHeaderRequestParams = "artifact="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LineageSubgraph()); - client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.queryArtifactLineageSubgraph( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ILineageSubgraph|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes queryArtifactLineageSubgraph with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest()); - request.artifact = ''; - const expectedHeaderRequestParams = "artifact="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryArtifactLineageSubgraph(request), expectedError); - assert((client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryArtifactLineageSubgraph with closed client', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest()); - request.artifact = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.queryArtifactLineageSubgraph(request), expectedError); - }); - }); - - describe('createMetadataStore', () => { - it('invokes createMetadataStore without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateMetadataStoreRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createMetadataStore = stubLongRunningCall(expectedResponse); - const [operation] = await client.createMetadataStore(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createMetadataStore without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateMetadataStoreRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createMetadataStore = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createMetadataStore( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createMetadataStore with call error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateMetadataStoreRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createMetadataStore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createMetadataStore(request), expectedError); - assert((client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createMetadataStore with LRO error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateMetadataStoreRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createMetadataStore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createMetadataStore(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateMetadataStoreProgress without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateMetadataStoreProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateMetadataStoreProgress with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateMetadataStoreProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteMetadataStore', () => { - it('invokes deleteMetadataStore without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteMetadataStoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteMetadataStore(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteMetadataStore without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteMetadataStoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteMetadataStore = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteMetadataStore( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteMetadataStore with call error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteMetadataStoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteMetadataStore(request), expectedError); - assert((client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteMetadataStore with LRO error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteMetadataStoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteMetadataStore(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteMetadataStoreProgress without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteMetadataStoreProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteMetadataStoreProgress with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteMetadataStoreProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteArtifact', () => { - it('invokes deleteArtifact without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteArtifactRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteArtifact = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteArtifact(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteArtifact without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteArtifactRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteArtifact = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteArtifact( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteArtifact with call error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteArtifactRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteArtifact = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteArtifact(request), expectedError); - assert((client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteArtifact with LRO error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteArtifactRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteArtifact = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteArtifact(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteArtifactProgress without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteArtifactProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteArtifactProgress with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteArtifactProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('purgeArtifacts', () => { - it('invokes purgeArtifacts without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.purgeArtifacts = stubLongRunningCall(expectedResponse); - const [operation] = await client.purgeArtifacts(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes purgeArtifacts without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.purgeArtifacts = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.purgeArtifacts( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes purgeArtifacts with call error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeArtifacts = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.purgeArtifacts(request), expectedError); - assert((client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes purgeArtifacts with LRO error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeArtifacts = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.purgeArtifacts(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkPurgeArtifactsProgress without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkPurgeArtifactsProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkPurgeArtifactsProgress with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkPurgeArtifactsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteContext', () => { - it('invokes deleteContext without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteContextRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteContext = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteContext(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteContext without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteContextRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteContext = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteContext( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteContext with call error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteContextRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteContext = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteContext(request), expectedError); - assert((client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteContext with LRO error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteContextRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteContext = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteContext(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteContextProgress without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteContextProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteContextProgress with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteContextProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('purgeContexts', () => { - it('invokes purgeContexts without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.purgeContexts = stubLongRunningCall(expectedResponse); - const [operation] = await client.purgeContexts(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes purgeContexts without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.purgeContexts = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.purgeContexts( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes purgeContexts with call error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeContexts = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.purgeContexts(request), expectedError); - assert((client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes purgeContexts with LRO error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeContexts = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.purgeContexts(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkPurgeContextsProgress without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkPurgeContextsProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkPurgeContextsProgress with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkPurgeContextsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteExecution', () => { - it('invokes deleteExecution without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteExecutionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteExecution = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteExecution(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteExecution without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteExecutionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteExecution = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteExecution( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteExecution with call error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteExecutionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteExecution(request), expectedError); - assert((client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteExecution with LRO error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteExecutionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteExecution(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteExecutionProgress without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteExecutionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteExecutionProgress with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteExecutionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('purgeExecutions', () => { - it('invokes purgeExecutions without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.purgeExecutions = stubLongRunningCall(expectedResponse); - const [operation] = await client.purgeExecutions(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes purgeExecutions without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.purgeExecutions = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.purgeExecutions( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes purgeExecutions with call error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeExecutions = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.purgeExecutions(request), expectedError); - assert((client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes purgeExecutions with LRO error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PurgeExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeExecutions = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.purgeExecutions(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkPurgeExecutionsProgress without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkPurgeExecutionsProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkPurgeExecutionsProgress with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkPurgeExecutionsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listMetadataStores', () => { - it('invokes listMetadataStores without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataStoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), - ]; - client.innerApiCalls.listMetadataStores = stubSimpleCall(expectedResponse); - const [response] = await client.listMetadataStores(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listMetadataStores without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataStoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), - ]; - client.innerApiCalls.listMetadataStores = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listMetadataStores( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IMetadataStore[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listMetadataStores with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataStoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listMetadataStores = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listMetadataStores(request), expectedError); - assert((client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listMetadataStoresStream without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataStoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), - ]; - client.descriptors.page.listMetadataStores.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listMetadataStoresStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.MetadataStore[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.MetadataStore) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listMetadataStores.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listMetadataStores, request)); - assert.strictEqual( - (client.descriptors.page.listMetadataStores.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listMetadataStoresStream with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataStoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listMetadataStores.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listMetadataStoresStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.MetadataStore[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.MetadataStore) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listMetadataStores.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listMetadataStores, request)); - assert.strictEqual( - (client.descriptors.page.listMetadataStores.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listMetadataStores without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataStoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataStore()), - ]; - client.descriptors.page.listMetadataStores.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IMetadataStore[] = []; - const iterable = client.listMetadataStoresAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listMetadataStores with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataStoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listMetadataStores.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listMetadataStoresAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IMetadataStore[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listArtifacts', () => { - it('invokes listArtifacts without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), - ]; - client.innerApiCalls.listArtifacts = stubSimpleCall(expectedResponse); - const [response] = await client.listArtifacts(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listArtifacts without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), - ]; - client.innerApiCalls.listArtifacts = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listArtifacts( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IArtifact[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listArtifacts with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listArtifacts = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listArtifacts(request), expectedError); - assert((client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listArtifactsStream without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), - ]; - client.descriptors.page.listArtifacts.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listArtifactsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Artifact[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Artifact) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listArtifacts.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listArtifacts, request)); - assert.strictEqual( - (client.descriptors.page.listArtifacts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listArtifactsStream with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listArtifacts.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listArtifactsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Artifact[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Artifact) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listArtifacts.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listArtifacts, request)); - assert.strictEqual( - (client.descriptors.page.listArtifacts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listArtifacts without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), - ]; - client.descriptors.page.listArtifacts.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IArtifact[] = []; - const iterable = client.listArtifactsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listArtifacts with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listArtifacts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listArtifactsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IArtifact[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listContexts', () => { - it('invokes listContexts without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), - ]; - client.innerApiCalls.listContexts = stubSimpleCall(expectedResponse); - const [response] = await client.listContexts(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listContexts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listContexts without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), - ]; - client.innerApiCalls.listContexts = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listContexts( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IContext[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listContexts as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listContexts with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listContexts = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listContexts(request), expectedError); - assert((client.innerApiCalls.listContexts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listContextsStream without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), - ]; - client.descriptors.page.listContexts.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listContextsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Context[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Context) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listContexts.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listContexts, request)); - assert.strictEqual( - (client.descriptors.page.listContexts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listContextsStream with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listContexts.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listContextsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Context[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Context) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listContexts.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listContexts, request)); - assert.strictEqual( - (client.descriptors.page.listContexts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listContexts without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), - ]; - client.descriptors.page.listContexts.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IContext[] = []; - const iterable = client.listContextsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listContexts.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listContexts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listContexts with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listContexts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listContextsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IContext[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listContexts.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listContexts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listExecutions', () => { - it('invokes listExecutions without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), - ]; - client.innerApiCalls.listExecutions = stubSimpleCall(expectedResponse); - const [response] = await client.listExecutions(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listExecutions without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), - ]; - client.innerApiCalls.listExecutions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listExecutions( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IExecution[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listExecutions with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listExecutions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listExecutions(request), expectedError); - assert((client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listExecutionsStream without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), - ]; - client.descriptors.page.listExecutions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listExecutionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Execution[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Execution) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listExecutions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listExecutions, request)); - assert.strictEqual( - (client.descriptors.page.listExecutions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listExecutionsStream with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listExecutions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listExecutionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Execution[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Execution) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listExecutions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listExecutions, request)); - assert.strictEqual( - (client.descriptors.page.listExecutions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listExecutions without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Execution()), - ]; - client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IExecution[] = []; - const iterable = client.listExecutionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listExecutions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listExecutions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listExecutions with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listExecutionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IExecution[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listExecutions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listExecutions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listMetadataSchemas', () => { - it('invokes listMetadataSchemas without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataSchemasRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), - ]; - client.innerApiCalls.listMetadataSchemas = stubSimpleCall(expectedResponse); - const [response] = await client.listMetadataSchemas(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listMetadataSchemas without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataSchemasRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), - ]; - client.innerApiCalls.listMetadataSchemas = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listMetadataSchemas( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IMetadataSchema[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listMetadataSchemas with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataSchemasRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listMetadataSchemas = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listMetadataSchemas(request), expectedError); - assert((client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listMetadataSchemasStream without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataSchemasRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), - ]; - client.descriptors.page.listMetadataSchemas.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listMetadataSchemasStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.MetadataSchema[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.MetadataSchema) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listMetadataSchemas.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listMetadataSchemas, request)); - assert.strictEqual( - (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listMetadataSchemasStream with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataSchemasRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listMetadataSchemas.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listMetadataSchemasStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.MetadataSchema[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.MetadataSchema) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listMetadataSchemas.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listMetadataSchemas, request)); - assert.strictEqual( - (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listMetadataSchemas without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataSchemasRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MetadataSchema()), - ]; - client.descriptors.page.listMetadataSchemas.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IMetadataSchema[] = []; - const iterable = client.listMetadataSchemasAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listMetadataSchemas with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListMetadataSchemasRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listMetadataSchemas.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listMetadataSchemasAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IMetadataSchema[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/test/gapic_migration_service_v1.ts b/owl-bot-staging/v1/test/gapic_migration_service_v1.ts deleted file mode 100644 index b7238a7e..00000000 --- a/owl-bot-staging/v1/test/gapic_migration_service_v1.ts +++ /dev/null @@ -1,2246 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as migrationserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.MigrationServiceClient', () => { - it('has servicePath', () => { - const servicePath = migrationserviceModule.v1.MigrationServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = migrationserviceModule.v1.MigrationServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = migrationserviceModule.v1.MigrationServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new migrationserviceModule.v1.MigrationServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.migrationServiceStub, undefined); - await client.initialize(); - assert(client.migrationServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.migrationServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.migrationServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('batchMigrateResources', () => { - it('invokes batchMigrateResources without error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchMigrateResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.batchMigrateResources = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchMigrateResources(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchMigrateResources without error using callback', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchMigrateResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.batchMigrateResources = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchMigrateResources( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes batchMigrateResources with call error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchMigrateResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchMigrateResources = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchMigrateResources(request), expectedError); - assert((client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchMigrateResources with LRO error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchMigrateResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchMigrateResources = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchMigrateResources(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkBatchMigrateResourcesProgress without error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkBatchMigrateResourcesProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkBatchMigrateResourcesProgress with error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkBatchMigrateResourcesProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('searchMigratableResources', () => { - it('invokes searchMigratableResources without error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), - ]; - client.innerApiCalls.searchMigratableResources = stubSimpleCall(expectedResponse); - const [response] = await client.searchMigratableResources(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes searchMigratableResources without error using callback', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), - ]; - client.innerApiCalls.searchMigratableResources = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.searchMigratableResources( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IMigratableResource[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes searchMigratableResources with error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.searchMigratableResources = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchMigratableResources(request), expectedError); - assert((client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes searchMigratableResourcesStream without error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), - ]; - client.descriptors.page.searchMigratableResources.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchMigratableResourcesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.MigratableResource[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.MigratableResource) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.searchMigratableResources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchMigratableResources, request)); - assert.strictEqual( - (client.descriptors.page.searchMigratableResources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes searchMigratableResourcesStream with error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.searchMigratableResources.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchMigratableResourcesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.MigratableResource[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.MigratableResource) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.searchMigratableResources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchMigratableResources, request)); - assert.strictEqual( - (client.descriptors.page.searchMigratableResources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with searchMigratableResources without error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.MigratableResource()), - ]; - client.descriptors.page.searchMigratableResources.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IMigratableResource[] = []; - const iterable = client.searchMigratableResourcesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with searchMigratableResources with error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.searchMigratableResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchMigratableResourcesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IMigratableResource[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/test/gapic_model_service_v1.ts b/owl-bot-staging/v1/test/gapic_model_service_v1.ts deleted file mode 100644 index 10c7597a..00000000 --- a/owl-bot-staging/v1/test/gapic_model_service_v1.ts +++ /dev/null @@ -1,3469 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as modelserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.ModelServiceClient', () => { - it('has servicePath', () => { - const servicePath = modelserviceModule.v1.ModelServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = modelserviceModule.v1.ModelServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = modelserviceModule.v1.ModelServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new modelserviceModule.v1.ModelServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.modelServiceStub, undefined); - await client.initialize(); - assert(client.modelServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.modelServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.modelServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('getModel', () => { - it('invokes getModel without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()); - client.innerApiCalls.getModel = stubSimpleCall(expectedResponse); - const [response] = await client.getModel(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getModel without error using callback', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()); - client.innerApiCalls.getModel = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getModel( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModel|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getModel with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getModel(request), expectedError); - assert((client.innerApiCalls.getModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getModel with closed client', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getModel(request), expectedError); - }); - }); - - describe('updateModel', () => { - it('invokes updateModel without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateModelRequest()); - request.model = {}; - request.model.name = ''; - const expectedHeaderRequestParams = "model.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()); - client.innerApiCalls.updateModel = stubSimpleCall(expectedResponse); - const [response] = await client.updateModel(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateModel without error using callback', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateModelRequest()); - request.model = {}; - request.model.name = ''; - const expectedHeaderRequestParams = "model.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()); - client.innerApiCalls.updateModel = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateModel( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModel|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateModel with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateModelRequest()); - request.model = {}; - request.model.name = ''; - const expectedHeaderRequestParams = "model.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateModel = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateModel(request), expectedError); - assert((client.innerApiCalls.updateModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateModel with closed client', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateModelRequest()); - request.model = {}; - request.model.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateModel(request), expectedError); - }); - }); - - describe('importModelEvaluation', () => { - it('invokes importModelEvaluation without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportModelEvaluationRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()); - client.innerApiCalls.importModelEvaluation = stubSimpleCall(expectedResponse); - const [response] = await client.importModelEvaluation(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes importModelEvaluation without error using callback', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportModelEvaluationRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()); - client.innerApiCalls.importModelEvaluation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.importModelEvaluation( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModelEvaluation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes importModelEvaluation with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportModelEvaluationRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.importModelEvaluation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.importModelEvaluation(request), expectedError); - assert((client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes importModelEvaluation with closed client', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ImportModelEvaluationRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.importModelEvaluation(request), expectedError); - }); - }); - - describe('getModelEvaluation', () => { - it('invokes getModelEvaluation without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelEvaluationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()); - client.innerApiCalls.getModelEvaluation = stubSimpleCall(expectedResponse); - const [response] = await client.getModelEvaluation(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getModelEvaluation without error using callback', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelEvaluationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()); - client.innerApiCalls.getModelEvaluation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getModelEvaluation( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModelEvaluation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getModelEvaluation with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelEvaluationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getModelEvaluation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getModelEvaluation(request), expectedError); - assert((client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getModelEvaluation with closed client', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelEvaluationRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getModelEvaluation(request), expectedError); - }); - }); - - describe('getModelEvaluationSlice', () => { - it('invokes getModelEvaluationSlice without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelEvaluationSliceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()); - client.innerApiCalls.getModelEvaluationSlice = stubSimpleCall(expectedResponse); - const [response] = await client.getModelEvaluationSlice(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getModelEvaluationSlice without error using callback', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelEvaluationSliceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()); - client.innerApiCalls.getModelEvaluationSlice = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getModelEvaluationSlice( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModelEvaluationSlice|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getModelEvaluationSlice with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelEvaluationSliceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getModelEvaluationSlice = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getModelEvaluationSlice(request), expectedError); - assert((client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getModelEvaluationSlice with closed client', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetModelEvaluationSliceRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getModelEvaluationSlice(request), expectedError); - }); - }); - - describe('uploadModel', () => { - it('invokes uploadModel without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UploadModelRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.uploadModel = stubLongRunningCall(expectedResponse); - const [operation] = await client.uploadModel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes uploadModel without error using callback', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UploadModelRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.uploadModel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.uploadModel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes uploadModel with call error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UploadModelRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.uploadModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.uploadModel(request), expectedError); - assert((client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes uploadModel with LRO error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UploadModelRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.uploadModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.uploadModel(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUploadModelProgress without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUploadModelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUploadModelProgress with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUploadModelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteModel', () => { - it('invokes deleteModel without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteModel = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteModel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteModel without error using callback', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteModel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteModel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteModel with call error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteModel(request), expectedError); - assert((client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteModel with LRO error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteModel(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteModelProgress without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteModelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteModelProgress with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteModelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('exportModel', () => { - it('invokes exportModel without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.exportModel = stubLongRunningCall(expectedResponse); - const [operation] = await client.exportModel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.exportModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes exportModel without error using callback', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.exportModel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.exportModel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.exportModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes exportModel with call error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.exportModel(request), expectedError); - assert((client.innerApiCalls.exportModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes exportModel with LRO error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.exportModel(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.exportModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkExportModelProgress without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkExportModelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkExportModelProgress with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkExportModelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listModels', () => { - it('invokes listModels without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), - ]; - client.innerApiCalls.listModels = stubSimpleCall(expectedResponse); - const [response] = await client.listModels(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listModels as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listModels without error using callback', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), - ]; - client.innerApiCalls.listModels = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listModels( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModel[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listModels as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listModels with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listModels = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModels(request), expectedError); - assert((client.innerApiCalls.listModels as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listModelsStream without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), - ]; - client.descriptors.page.listModels.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listModelsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Model[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Model) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listModels.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModels, request)); - assert.strictEqual( - (client.descriptors.page.listModels.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listModelsStream with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listModels.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listModelsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Model[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Model) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listModels.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModels, request)); - assert.strictEqual( - (client.descriptors.page.listModels.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listModels without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), - ]; - client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IModel[] = []; - const iterable = client.listModelsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listModels.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listModels.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listModels with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listModelsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IModel[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listModels.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listModels.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listModelEvaluations', () => { - it('invokes listModelEvaluations without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), - ]; - client.innerApiCalls.listModelEvaluations = stubSimpleCall(expectedResponse); - const [response] = await client.listModelEvaluations(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listModelEvaluations without error using callback', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), - ]; - client.innerApiCalls.listModelEvaluations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listModelEvaluations( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModelEvaluation[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listModelEvaluations with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listModelEvaluations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModelEvaluations(request), expectedError); - assert((client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listModelEvaluationsStream without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), - ]; - client.descriptors.page.listModelEvaluations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listModelEvaluationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.ModelEvaluation[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.ModelEvaluation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listModelEvaluations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModelEvaluations, request)); - assert.strictEqual( - (client.descriptors.page.listModelEvaluations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listModelEvaluationsStream with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listModelEvaluations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listModelEvaluationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.ModelEvaluation[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.ModelEvaluation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listModelEvaluations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModelEvaluations, request)); - assert.strictEqual( - (client.descriptors.page.listModelEvaluations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listModelEvaluations without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluation()), - ]; - client.descriptors.page.listModelEvaluations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IModelEvaluation[] = []; - const iterable = client.listModelEvaluationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listModelEvaluations with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listModelEvaluations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listModelEvaluationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IModelEvaluation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listModelEvaluationSlices', () => { - it('invokes listModelEvaluationSlices without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), - ]; - client.innerApiCalls.listModelEvaluationSlices = stubSimpleCall(expectedResponse); - const [response] = await client.listModelEvaluationSlices(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listModelEvaluationSlices without error using callback', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), - ]; - client.innerApiCalls.listModelEvaluationSlices = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listModelEvaluationSlices( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IModelEvaluationSlice[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listModelEvaluationSlices with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listModelEvaluationSlices = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModelEvaluationSlices(request), expectedError); - assert((client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listModelEvaluationSlicesStream without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), - ]; - client.descriptors.page.listModelEvaluationSlices.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listModelEvaluationSlicesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.ModelEvaluationSlice[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.ModelEvaluationSlice) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModelEvaluationSlices, request)); - assert.strictEqual( - (client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listModelEvaluationSlicesStream with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listModelEvaluationSlices.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listModelEvaluationSlicesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.ModelEvaluationSlice[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.ModelEvaluationSlice) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModelEvaluationSlices, request)); - assert.strictEqual( - (client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listModelEvaluationSlices without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice()), - ]; - client.descriptors.page.listModelEvaluationSlices.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IModelEvaluationSlice[] = []; - const iterable = client.listModelEvaluationSlicesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listModelEvaluationSlices with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listModelEvaluationSlices.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listModelEvaluationSlicesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IModelEvaluationSlice[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/test/gapic_pipeline_service_v1.ts b/owl-bot-staging/v1/test/gapic_pipeline_service_v1.ts deleted file mode 100644 index 4df4dfa4..00000000 --- a/owl-bot-staging/v1/test/gapic_pipeline_service_v1.ts +++ /dev/null @@ -1,3195 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as pipelineserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.PipelineServiceClient', () => { - it('has servicePath', () => { - const servicePath = pipelineserviceModule.v1.PipelineServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = pipelineserviceModule.v1.PipelineServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = pipelineserviceModule.v1.PipelineServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.pipelineServiceStub, undefined); - await client.initialize(); - assert(client.pipelineServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.pipelineServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.pipelineServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('createTrainingPipeline', () => { - it('invokes createTrainingPipeline without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTrainingPipelineRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()); - client.innerApiCalls.createTrainingPipeline = stubSimpleCall(expectedResponse); - const [response] = await client.createTrainingPipeline(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTrainingPipeline without error using callback', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTrainingPipelineRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()); - client.innerApiCalls.createTrainingPipeline = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTrainingPipeline( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITrainingPipeline|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createTrainingPipeline with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTrainingPipelineRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createTrainingPipeline = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTrainingPipeline(request), expectedError); - assert((client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTrainingPipeline with closed client', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTrainingPipelineRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createTrainingPipeline(request), expectedError); - }); - }); - - describe('getTrainingPipeline', () => { - it('invokes getTrainingPipeline without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()); - client.innerApiCalls.getTrainingPipeline = stubSimpleCall(expectedResponse); - const [response] = await client.getTrainingPipeline(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTrainingPipeline without error using callback', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()); - client.innerApiCalls.getTrainingPipeline = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTrainingPipeline( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITrainingPipeline|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getTrainingPipeline with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getTrainingPipeline = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTrainingPipeline(request), expectedError); - assert((client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTrainingPipeline with closed client', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTrainingPipelineRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTrainingPipeline(request), expectedError); - }); - }); - - describe('cancelTrainingPipeline', () => { - it('invokes cancelTrainingPipeline without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall(expectedResponse); - const [response] = await client.cancelTrainingPipeline(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelTrainingPipeline without error using callback', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelTrainingPipeline = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelTrainingPipeline( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes cancelTrainingPipeline with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelTrainingPipeline(request), expectedError); - assert((client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelTrainingPipeline with closed client', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelTrainingPipelineRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelTrainingPipeline(request), expectedError); - }); - }); - - describe('createPipelineJob', () => { - it('invokes createPipelineJob without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreatePipelineJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()); - client.innerApiCalls.createPipelineJob = stubSimpleCall(expectedResponse); - const [response] = await client.createPipelineJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createPipelineJob without error using callback', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreatePipelineJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()); - client.innerApiCalls.createPipelineJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createPipelineJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IPipelineJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createPipelineJob with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreatePipelineJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createPipelineJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createPipelineJob(request), expectedError); - assert((client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createPipelineJob with closed client', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreatePipelineJobRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createPipelineJob(request), expectedError); - }); - }); - - describe('getPipelineJob', () => { - it('invokes getPipelineJob without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetPipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()); - client.innerApiCalls.getPipelineJob = stubSimpleCall(expectedResponse); - const [response] = await client.getPipelineJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getPipelineJob without error using callback', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetPipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()); - client.innerApiCalls.getPipelineJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getPipelineJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IPipelineJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getPipelineJob with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetPipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getPipelineJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getPipelineJob(request), expectedError); - assert((client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getPipelineJob with closed client', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetPipelineJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getPipelineJob(request), expectedError); - }); - }); - - describe('cancelPipelineJob', () => { - it('invokes cancelPipelineJob without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelPipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelPipelineJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelPipelineJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelPipelineJob without error using callback', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelPipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelPipelineJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelPipelineJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes cancelPipelineJob with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelPipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelPipelineJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelPipelineJob(request), expectedError); - assert((client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelPipelineJob with closed client', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CancelPipelineJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelPipelineJob(request), expectedError); - }); - }); - - describe('deleteTrainingPipeline', () => { - it('invokes deleteTrainingPipeline without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteTrainingPipeline(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTrainingPipeline without error using callback', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTrainingPipeline( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteTrainingPipeline with call error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTrainingPipeline(request), expectedError); - assert((client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTrainingPipeline with LRO error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTrainingPipeline(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteTrainingPipelineProgress without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteTrainingPipelineProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteTrainingPipelineProgress with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteTrainingPipelineProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deletePipelineJob', () => { - it('invokes deletePipelineJob without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeletePipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deletePipelineJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deletePipelineJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deletePipelineJob without error using callback', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeletePipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deletePipelineJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deletePipelineJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deletePipelineJob with call error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeletePipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deletePipelineJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deletePipelineJob(request), expectedError); - assert((client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deletePipelineJob with LRO error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeletePipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deletePipelineJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deletePipelineJob(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeletePipelineJobProgress without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeletePipelineJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeletePipelineJobProgress with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeletePipelineJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listTrainingPipelines', () => { - it('invokes listTrainingPipelines without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), - ]; - client.innerApiCalls.listTrainingPipelines = stubSimpleCall(expectedResponse); - const [response] = await client.listTrainingPipelines(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTrainingPipelines without error using callback', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), - ]; - client.innerApiCalls.listTrainingPipelines = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTrainingPipelines( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITrainingPipeline[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listTrainingPipelines with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listTrainingPipelines = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTrainingPipelines(request), expectedError); - assert((client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTrainingPipelinesStream without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), - ]; - client.descriptors.page.listTrainingPipelines.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTrainingPipelinesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.TrainingPipeline[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.TrainingPipeline) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listTrainingPipelines.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTrainingPipelines, request)); - assert.strictEqual( - (client.descriptors.page.listTrainingPipelines.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listTrainingPipelinesStream with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listTrainingPipelines.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTrainingPipelinesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.TrainingPipeline[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.TrainingPipeline) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTrainingPipelines.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTrainingPipelines, request)); - assert.strictEqual( - (client.descriptors.page.listTrainingPipelines.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTrainingPipelines without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TrainingPipeline()), - ]; - client.descriptors.page.listTrainingPipelines.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.ITrainingPipeline[] = []; - const iterable = client.listTrainingPipelinesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTrainingPipelines with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listTrainingPipelines.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTrainingPipelinesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.ITrainingPipeline[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listPipelineJobs', () => { - it('invokes listPipelineJobs without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListPipelineJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), - ]; - client.innerApiCalls.listPipelineJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listPipelineJobs(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listPipelineJobs without error using callback', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListPipelineJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), - ]; - client.innerApiCalls.listPipelineJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listPipelineJobs( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IPipelineJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listPipelineJobs with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListPipelineJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listPipelineJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listPipelineJobs(request), expectedError); - assert((client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listPipelineJobsStream without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListPipelineJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), - ]; - client.descriptors.page.listPipelineJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listPipelineJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.PipelineJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.PipelineJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listPipelineJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listPipelineJobs, request)); - assert.strictEqual( - (client.descriptors.page.listPipelineJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listPipelineJobsStream with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListPipelineJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listPipelineJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listPipelineJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.PipelineJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.PipelineJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listPipelineJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listPipelineJobs, request)); - assert.strictEqual( - (client.descriptors.page.listPipelineJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listPipelineJobs without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListPipelineJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.PipelineJob()), - ]; - client.descriptors.page.listPipelineJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IPipelineJob[] = []; - const iterable = client.listPipelineJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listPipelineJobs with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListPipelineJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listPipelineJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listPipelineJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IPipelineJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/test/gapic_prediction_service_v1.ts b/owl-bot-staging/v1/test/gapic_prediction_service_v1.ts deleted file mode 100644 index 1c7d6c06..00000000 --- a/owl-bot-staging/v1/test/gapic_prediction_service_v1.ts +++ /dev/null @@ -1,2069 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as predictionserviceModule from '../src'; - -import {protobuf} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -describe('v1.PredictionServiceClient', () => { - it('has servicePath', () => { - const servicePath = predictionserviceModule.v1.PredictionServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = predictionserviceModule.v1.PredictionServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = predictionserviceModule.v1.PredictionServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new predictionserviceModule.v1.PredictionServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.predictionServiceStub, undefined); - await client.initialize(); - assert(client.predictionServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.predictionServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.predictionServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('predict', () => { - it('invokes predict without error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PredictRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PredictResponse()); - client.innerApiCalls.predict = stubSimpleCall(expectedResponse); - const [response] = await client.predict(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.predict as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes predict without error using callback', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PredictRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PredictResponse()); - client.innerApiCalls.predict = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.predict( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IPredictResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.predict as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes predict with error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PredictRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.predict = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.predict(request), expectedError); - assert((client.innerApiCalls.predict as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes predict with closed client', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.PredictRequest()); - request.endpoint = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.predict(request), expectedError); - }); - }); - - describe('rawPredict', () => { - it('invokes rawPredict without error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.RawPredictRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.api.HttpBody()); - client.innerApiCalls.rawPredict = stubSimpleCall(expectedResponse); - const [response] = await client.rawPredict(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.rawPredict as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes rawPredict without error using callback', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.RawPredictRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.api.HttpBody()); - client.innerApiCalls.rawPredict = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.rawPredict( - request, - (err?: Error|null, result?: protos.google.api.IHttpBody|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.rawPredict as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes rawPredict with error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.RawPredictRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.rawPredict = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.rawPredict(request), expectedError); - assert((client.innerApiCalls.rawPredict as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes rawPredict with closed client', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.RawPredictRequest()); - request.endpoint = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.rawPredict(request), expectedError); - }); - }); - - describe('explain', () => { - it('invokes explain without error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExplainRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExplainResponse()); - client.innerApiCalls.explain = stubSimpleCall(expectedResponse); - const [response] = await client.explain(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.explain as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes explain without error using callback', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExplainRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExplainResponse()); - client.innerApiCalls.explain = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.explain( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IExplainResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.explain as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes explain with error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExplainRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.explain = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.explain(request), expectedError); - assert((client.innerApiCalls.explain as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes explain with closed client', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExplainRequest()); - request.endpoint = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.explain(request), expectedError); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/test/gapic_specialist_pool_service_v1.ts b/owl-bot-staging/v1/test/gapic_specialist_pool_service_v1.ts deleted file mode 100644 index 9daff9e3..00000000 --- a/owl-bot-staging/v1/test/gapic_specialist_pool_service_v1.ts +++ /dev/null @@ -1,2635 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as specialistpoolserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.SpecialistPoolServiceClient', () => { - it('has servicePath', () => { - const servicePath = specialistpoolserviceModule.v1.SpecialistPoolServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = specialistpoolserviceModule.v1.SpecialistPoolServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = specialistpoolserviceModule.v1.SpecialistPoolServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.specialistPoolServiceStub, undefined); - await client.initialize(); - assert(client.specialistPoolServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.specialistPoolServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.specialistPoolServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('getSpecialistPool', () => { - it('invokes getSpecialistPool without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetSpecialistPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()); - client.innerApiCalls.getSpecialistPool = stubSimpleCall(expectedResponse); - const [response] = await client.getSpecialistPool(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getSpecialistPool without error using callback', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetSpecialistPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()); - client.innerApiCalls.getSpecialistPool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSpecialistPool( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ISpecialistPool|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getSpecialistPool with error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetSpecialistPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getSpecialistPool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSpecialistPool(request), expectedError); - assert((client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getSpecialistPool with closed client', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetSpecialistPoolRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getSpecialistPool(request), expectedError); - }); - }); - - describe('createSpecialistPool', () => { - it('invokes createSpecialistPool without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateSpecialistPoolRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createSpecialistPool = stubLongRunningCall(expectedResponse); - const [operation] = await client.createSpecialistPool(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createSpecialistPool without error using callback', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateSpecialistPoolRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createSpecialistPool = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSpecialistPool( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createSpecialistPool with call error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateSpecialistPoolRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createSpecialistPool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createSpecialistPool(request), expectedError); - assert((client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createSpecialistPool with LRO error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateSpecialistPoolRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createSpecialistPool(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateSpecialistPoolProgress without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateSpecialistPoolProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateSpecialistPoolProgress with error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateSpecialistPoolProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteSpecialistPool', () => { - it('invokes deleteSpecialistPool without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteSpecialistPool(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteSpecialistPool without error using callback', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteSpecialistPool = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteSpecialistPool( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteSpecialistPool with call error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteSpecialistPool(request), expectedError); - assert((client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteSpecialistPool with LRO error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteSpecialistPool(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteSpecialistPoolProgress without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteSpecialistPoolProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteSpecialistPoolProgress with error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteSpecialistPoolProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateSpecialistPool', () => { - it('invokes updateSpecialistPool without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest()); - request.specialistPool = {}; - request.specialistPool.name = ''; - const expectedHeaderRequestParams = "specialist_pool.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateSpecialistPool(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateSpecialistPool without error using callback', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest()); - request.specialistPool = {}; - request.specialistPool.name = ''; - const expectedHeaderRequestParams = "specialist_pool.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateSpecialistPool = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateSpecialistPool( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateSpecialistPool with call error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest()); - request.specialistPool = {}; - request.specialistPool.name = ''; - const expectedHeaderRequestParams = "specialist_pool.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateSpecialistPool(request), expectedError); - assert((client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateSpecialistPool with LRO error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest()); - request.specialistPool = {}; - request.specialistPool.name = ''; - const expectedHeaderRequestParams = "specialist_pool.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateSpecialistPool(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUpdateSpecialistPoolProgress without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateSpecialistPoolProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateSpecialistPoolProgress with error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateSpecialistPoolProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listSpecialistPools', () => { - it('invokes listSpecialistPools without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), - ]; - client.innerApiCalls.listSpecialistPools = stubSimpleCall(expectedResponse); - const [response] = await client.listSpecialistPools(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listSpecialistPools without error using callback', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), - ]; - client.innerApiCalls.listSpecialistPools = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSpecialistPools( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ISpecialistPool[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listSpecialistPools with error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listSpecialistPools = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSpecialistPools(request), expectedError); - assert((client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listSpecialistPoolsStream without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), - ]; - client.descriptors.page.listSpecialistPools.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSpecialistPoolsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.SpecialistPool[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.SpecialistPool) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listSpecialistPools.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSpecialistPools, request)); - assert.strictEqual( - (client.descriptors.page.listSpecialistPools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listSpecialistPoolsStream with error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listSpecialistPools.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSpecialistPoolsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.SpecialistPool[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.SpecialistPool) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSpecialistPools.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSpecialistPools, request)); - assert.strictEqual( - (client.descriptors.page.listSpecialistPools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listSpecialistPools without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SpecialistPool()), - ]; - client.descriptors.page.listSpecialistPools.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.ISpecialistPool[] = []; - const iterable = client.listSpecialistPoolsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listSpecialistPools with error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listSpecialistPools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSpecialistPoolsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.ISpecialistPool[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/test/gapic_tensorboard_service_v1.ts b/owl-bot-staging/v1/test/gapic_tensorboard_service_v1.ts deleted file mode 100644 index 8cc6150b..00000000 --- a/owl-bot-staging/v1/test/gapic_tensorboard_service_v1.ts +++ /dev/null @@ -1,5557 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as tensorboardserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubServerStreamingCall(response?: ResponseType, error?: Error) { - const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // write something to the stream to trigger transformStub and send the response back to the client - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - return sinon.stub().returns(mockStream); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.TensorboardServiceClient', () => { - it('has servicePath', () => { - const servicePath = tensorboardserviceModule.v1.TensorboardServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = tensorboardserviceModule.v1.TensorboardServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = tensorboardserviceModule.v1.TensorboardServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.tensorboardServiceStub, undefined); - await client.initialize(); - assert(client.tensorboardServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.tensorboardServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.tensorboardServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('getTensorboard', () => { - it('invokes getTensorboard without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()); - client.innerApiCalls.getTensorboard = stubSimpleCall(expectedResponse); - const [response] = await client.getTensorboard(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTensorboard without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()); - client.innerApiCalls.getTensorboard = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTensorboard( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboard|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getTensorboard with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getTensorboard = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTensorboard(request), expectedError); - assert((client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTensorboard with closed client', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTensorboard(request), expectedError); - }); - }); - - describe('createTensorboardExperiment', () => { - it('invokes createTensorboardExperiment without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()); - client.innerApiCalls.createTensorboardExperiment = stubSimpleCall(expectedResponse); - const [response] = await client.createTensorboardExperiment(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTensorboardExperiment without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()); - client.innerApiCalls.createTensorboardExperiment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTensorboardExperiment( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardExperiment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createTensorboardExperiment with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboardExperiment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTensorboardExperiment(request), expectedError); - assert((client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTensorboardExperiment with closed client', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createTensorboardExperiment(request), expectedError); - }); - }); - - describe('getTensorboardExperiment', () => { - it('invokes getTensorboardExperiment without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardExperimentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()); - client.innerApiCalls.getTensorboardExperiment = stubSimpleCall(expectedResponse); - const [response] = await client.getTensorboardExperiment(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTensorboardExperiment without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardExperimentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()); - client.innerApiCalls.getTensorboardExperiment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTensorboardExperiment( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardExperiment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getTensorboardExperiment with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardExperimentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getTensorboardExperiment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTensorboardExperiment(request), expectedError); - assert((client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTensorboardExperiment with closed client', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardExperimentRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTensorboardExperiment(request), expectedError); - }); - }); - - describe('updateTensorboardExperiment', () => { - it('invokes updateTensorboardExperiment without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest()); - request.tensorboardExperiment = {}; - request.tensorboardExperiment.name = ''; - const expectedHeaderRequestParams = "tensorboard_experiment.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()); - client.innerApiCalls.updateTensorboardExperiment = stubSimpleCall(expectedResponse); - const [response] = await client.updateTensorboardExperiment(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateTensorboardExperiment without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest()); - request.tensorboardExperiment = {}; - request.tensorboardExperiment.name = ''; - const expectedHeaderRequestParams = "tensorboard_experiment.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()); - client.innerApiCalls.updateTensorboardExperiment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateTensorboardExperiment( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardExperiment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateTensorboardExperiment with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest()); - request.tensorboardExperiment = {}; - request.tensorboardExperiment.name = ''; - const expectedHeaderRequestParams = "tensorboard_experiment.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboardExperiment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateTensorboardExperiment(request), expectedError); - assert((client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateTensorboardExperiment with closed client', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest()); - request.tensorboardExperiment = {}; - request.tensorboardExperiment.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateTensorboardExperiment(request), expectedError); - }); - }); - - describe('createTensorboardRun', () => { - it('invokes createTensorboardRun without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardRunRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()); - client.innerApiCalls.createTensorboardRun = stubSimpleCall(expectedResponse); - const [response] = await client.createTensorboardRun(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTensorboardRun without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardRunRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()); - client.innerApiCalls.createTensorboardRun = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTensorboardRun( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardRun|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createTensorboardRun with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardRunRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboardRun = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTensorboardRun(request), expectedError); - assert((client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTensorboardRun with closed client', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardRunRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createTensorboardRun(request), expectedError); - }); - }); - - describe('batchCreateTensorboardRuns', () => { - it('invokes batchCreateTensorboardRuns without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse()); - client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCall(expectedResponse); - const [response] = await client.batchCreateTensorboardRuns(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchCreateTensorboardRuns without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse()); - client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchCreateTensorboardRuns( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes batchCreateTensorboardRuns with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchCreateTensorboardRuns(request), expectedError); - assert((client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchCreateTensorboardRuns with closed client', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchCreateTensorboardRuns(request), expectedError); - }); - }); - - describe('getTensorboardRun', () => { - it('invokes getTensorboardRun without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardRunRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()); - client.innerApiCalls.getTensorboardRun = stubSimpleCall(expectedResponse); - const [response] = await client.getTensorboardRun(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTensorboardRun without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardRunRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()); - client.innerApiCalls.getTensorboardRun = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTensorboardRun( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardRun|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getTensorboardRun with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardRunRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getTensorboardRun = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTensorboardRun(request), expectedError); - assert((client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTensorboardRun with closed client', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardRunRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTensorboardRun(request), expectedError); - }); - }); - - describe('updateTensorboardRun', () => { - it('invokes updateTensorboardRun without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardRunRequest()); - request.tensorboardRun = {}; - request.tensorboardRun.name = ''; - const expectedHeaderRequestParams = "tensorboard_run.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()); - client.innerApiCalls.updateTensorboardRun = stubSimpleCall(expectedResponse); - const [response] = await client.updateTensorboardRun(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateTensorboardRun without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardRunRequest()); - request.tensorboardRun = {}; - request.tensorboardRun.name = ''; - const expectedHeaderRequestParams = "tensorboard_run.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()); - client.innerApiCalls.updateTensorboardRun = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateTensorboardRun( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardRun|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateTensorboardRun with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardRunRequest()); - request.tensorboardRun = {}; - request.tensorboardRun.name = ''; - const expectedHeaderRequestParams = "tensorboard_run.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboardRun = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateTensorboardRun(request), expectedError); - assert((client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateTensorboardRun with closed client', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardRunRequest()); - request.tensorboardRun = {}; - request.tensorboardRun.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateTensorboardRun(request), expectedError); - }); - }); - - describe('batchCreateTensorboardTimeSeries', () => { - it('invokes batchCreateTensorboardTimeSeries without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse()); - client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCall(expectedResponse); - const [response] = await client.batchCreateTensorboardTimeSeries(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchCreateTensorboardTimeSeries without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse()); - client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchCreateTensorboardTimeSeries( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes batchCreateTensorboardTimeSeries with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchCreateTensorboardTimeSeries(request), expectedError); - assert((client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchCreateTensorboardTimeSeries with closed client', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchCreateTensorboardTimeSeries(request), expectedError); - }); - }); - - describe('createTensorboardTimeSeries', () => { - it('invokes createTensorboardTimeSeries without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()); - client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCall(expectedResponse); - const [response] = await client.createTensorboardTimeSeries(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTensorboardTimeSeries without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()); - client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTensorboardTimeSeries( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createTensorboardTimeSeries with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTensorboardTimeSeries(request), expectedError); - assert((client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTensorboardTimeSeries with closed client', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createTensorboardTimeSeries(request), expectedError); - }); - }); - - describe('getTensorboardTimeSeries', () => { - it('invokes getTensorboardTimeSeries without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()); - client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCall(expectedResponse); - const [response] = await client.getTensorboardTimeSeries(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTensorboardTimeSeries without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()); - client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTensorboardTimeSeries( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getTensorboardTimeSeries with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTensorboardTimeSeries(request), expectedError); - assert((client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTensorboardTimeSeries with closed client', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTensorboardTimeSeries(request), expectedError); - }); - }); - - describe('updateTensorboardTimeSeries', () => { - it('invokes updateTensorboardTimeSeries without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest()); - request.tensorboardTimeSeries = {}; - request.tensorboardTimeSeries.name = ''; - const expectedHeaderRequestParams = "tensorboard_time_series.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()); - client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCall(expectedResponse); - const [response] = await client.updateTensorboardTimeSeries(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateTensorboardTimeSeries without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest()); - request.tensorboardTimeSeries = {}; - request.tensorboardTimeSeries.name = ''; - const expectedHeaderRequestParams = "tensorboard_time_series.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()); - client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateTensorboardTimeSeries( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateTensorboardTimeSeries with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest()); - request.tensorboardTimeSeries = {}; - request.tensorboardTimeSeries.name = ''; - const expectedHeaderRequestParams = "tensorboard_time_series.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateTensorboardTimeSeries(request), expectedError); - assert((client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateTensorboardTimeSeries with closed client', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest()); - request.tensorboardTimeSeries = {}; - request.tensorboardTimeSeries.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateTensorboardTimeSeries(request), expectedError); - }); - }); - - describe('batchReadTensorboardTimeSeriesData', () => { - it('invokes batchReadTensorboardTimeSeriesData without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest()); - request.tensorboard = ''; - const expectedHeaderRequestParams = "tensorboard="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse()); - client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCall(expectedResponse); - const [response] = await client.batchReadTensorboardTimeSeriesData(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchReadTensorboardTimeSeriesData without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest()); - request.tensorboard = ''; - const expectedHeaderRequestParams = "tensorboard="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse()); - client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchReadTensorboardTimeSeriesData( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes batchReadTensorboardTimeSeriesData with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest()); - request.tensorboard = ''; - const expectedHeaderRequestParams = "tensorboard="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchReadTensorboardTimeSeriesData(request), expectedError); - assert((client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchReadTensorboardTimeSeriesData with closed client', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest()); - request.tensorboard = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchReadTensorboardTimeSeriesData(request), expectedError); - }); - }); - - describe('readTensorboardTimeSeriesData', () => { - it('invokes readTensorboardTimeSeriesData without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse()); - client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCall(expectedResponse); - const [response] = await client.readTensorboardTimeSeriesData(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes readTensorboardTimeSeriesData without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse()); - client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.readTensorboardTimeSeriesData( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes readTensorboardTimeSeriesData with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.readTensorboardTimeSeriesData(request), expectedError); - assert((client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes readTensorboardTimeSeriesData with closed client', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.readTensorboardTimeSeriesData(request), expectedError); - }); - }); - - describe('writeTensorboardExperimentData', () => { - it('invokes writeTensorboardExperimentData without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest()); - request.tensorboardExperiment = ''; - const expectedHeaderRequestParams = "tensorboard_experiment="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse()); - client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCall(expectedResponse); - const [response] = await client.writeTensorboardExperimentData(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes writeTensorboardExperimentData without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest()); - request.tensorboardExperiment = ''; - const expectedHeaderRequestParams = "tensorboard_experiment="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse()); - client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.writeTensorboardExperimentData( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes writeTensorboardExperimentData with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest()); - request.tensorboardExperiment = ''; - const expectedHeaderRequestParams = "tensorboard_experiment="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.writeTensorboardExperimentData(request), expectedError); - assert((client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes writeTensorboardExperimentData with closed client', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest()); - request.tensorboardExperiment = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.writeTensorboardExperimentData(request), expectedError); - }); - }); - - describe('writeTensorboardRunData', () => { - it('invokes writeTensorboardRunData without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest()); - request.tensorboardRun = ''; - const expectedHeaderRequestParams = "tensorboard_run="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse()); - client.innerApiCalls.writeTensorboardRunData = stubSimpleCall(expectedResponse); - const [response] = await client.writeTensorboardRunData(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes writeTensorboardRunData without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest()); - request.tensorboardRun = ''; - const expectedHeaderRequestParams = "tensorboard_run="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse()); - client.innerApiCalls.writeTensorboardRunData = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.writeTensorboardRunData( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes writeTensorboardRunData with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest()); - request.tensorboardRun = ''; - const expectedHeaderRequestParams = "tensorboard_run="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.writeTensorboardRunData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.writeTensorboardRunData(request), expectedError); - assert((client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes writeTensorboardRunData with closed client', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest()); - request.tensorboardRun = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.writeTensorboardRunData(request), expectedError); - }); - }); - - describe('createTensorboard', () => { - it('invokes createTensorboard without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createTensorboard = stubLongRunningCall(expectedResponse); - const [operation] = await client.createTensorboard(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTensorboard without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createTensorboard = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTensorboard( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createTensorboard with call error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboard = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createTensorboard(request), expectedError); - assert((client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTensorboard with LRO error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTensorboardRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboard = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createTensorboard(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateTensorboardProgress without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateTensorboardProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateTensorboardProgress with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateTensorboardProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateTensorboard', () => { - it('invokes updateTensorboard without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardRequest()); - request.tensorboard = {}; - request.tensorboard.name = ''; - const expectedHeaderRequestParams = "tensorboard.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateTensorboard = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateTensorboard(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateTensorboard without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardRequest()); - request.tensorboard = {}; - request.tensorboard.name = ''; - const expectedHeaderRequestParams = "tensorboard.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateTensorboard = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateTensorboard( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateTensorboard with call error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardRequest()); - request.tensorboard = {}; - request.tensorboard.name = ''; - const expectedHeaderRequestParams = "tensorboard.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboard = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateTensorboard(request), expectedError); - assert((client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateTensorboard with LRO error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.UpdateTensorboardRequest()); - request.tensorboard = {}; - request.tensorboard.name = ''; - const expectedHeaderRequestParams = "tensorboard.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboard = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateTensorboard(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUpdateTensorboardProgress without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateTensorboardProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateTensorboardProgress with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateTensorboardProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteTensorboard', () => { - it('invokes deleteTensorboard without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTensorboard = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteTensorboard(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTensorboard without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTensorboard = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTensorboard( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteTensorboard with call error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboard = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTensorboard(request), expectedError); - assert((client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTensorboard with LRO error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboard = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTensorboard(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteTensorboardProgress without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteTensorboardProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteTensorboardProgress with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteTensorboardProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteTensorboardExperiment', () => { - it('invokes deleteTensorboardExperiment without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteTensorboardExperiment(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTensorboardExperiment without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTensorboardExperiment( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteTensorboardExperiment with call error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTensorboardExperiment(request), expectedError); - assert((client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTensorboardExperiment with LRO error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTensorboardExperiment(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteTensorboardExperimentProgress without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteTensorboardExperimentProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteTensorboardExperimentProgress with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteTensorboardExperimentProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteTensorboardRun', () => { - it('invokes deleteTensorboardRun without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardRunRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteTensorboardRun(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTensorboardRun without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardRunRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTensorboardRun = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTensorboardRun( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteTensorboardRun with call error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardRunRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTensorboardRun(request), expectedError); - assert((client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTensorboardRun with LRO error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardRunRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTensorboardRun(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteTensorboardRunProgress without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteTensorboardRunProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteTensorboardRunProgress with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteTensorboardRunProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteTensorboardTimeSeries', () => { - it('invokes deleteTensorboardTimeSeries without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteTensorboardTimeSeries(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTensorboardTimeSeries without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTensorboardTimeSeries( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteTensorboardTimeSeries with call error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTensorboardTimeSeries(request), expectedError); - assert((client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTensorboardTimeSeries with LRO error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTensorboardTimeSeries(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteTensorboardTimeSeriesProgress without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteTensorboardTimeSeriesProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteTensorboardTimeSeriesProgress with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteTensorboardTimeSeriesProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('readTensorboardBlobData', () => { - it('invokes readTensorboardBlobData without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest()); - request.timeSeries = ''; - const expectedHeaderRequestParams = "time_series="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse()); - client.innerApiCalls.readTensorboardBlobData = stubServerStreamingCall(expectedResponse); - const stream = client.readTensorboardBlobData(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.readTensorboardBlobData as SinonStub) - .getCall(0).calledWith(request, expectedOptions)); - }); - - it('invokes readTensorboardBlobData with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest()); - request.timeSeries = ''; - const expectedHeaderRequestParams = "time_series="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.readTensorboardBlobData = stubServerStreamingCall(undefined, expectedError); - const stream = client.readTensorboardBlobData(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.innerApiCalls.readTensorboardBlobData as SinonStub) - .getCall(0).calledWith(request, expectedOptions)); - }); - - it('invokes readTensorboardBlobData with closed client', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest()); - request.timeSeries = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - const stream = client.readTensorboardBlobData(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - }); - }); - - describe('listTensorboards', () => { - it('invokes listTensorboards without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), - ]; - client.innerApiCalls.listTensorboards = stubSimpleCall(expectedResponse); - const [response] = await client.listTensorboards(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTensorboards without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), - ]; - client.innerApiCalls.listTensorboards = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTensorboards( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboard[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listTensorboards with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listTensorboards = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTensorboards(request), expectedError); - assert((client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTensorboardsStream without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), - ]; - client.descriptors.page.listTensorboards.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTensorboardsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Tensorboard[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Tensorboard) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listTensorboards.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTensorboards, request)); - assert.strictEqual( - (client.descriptors.page.listTensorboards.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listTensorboardsStream with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listTensorboards.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTensorboardsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Tensorboard[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Tensorboard) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTensorboards.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTensorboards, request)); - assert.strictEqual( - (client.descriptors.page.listTensorboards.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTensorboards without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Tensorboard()), - ]; - client.descriptors.page.listTensorboards.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.ITensorboard[] = []; - const iterable = client.listTensorboardsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTensorboards with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listTensorboards.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTensorboardsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.ITensorboard[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listTensorboardExperiments', () => { - it('invokes listTensorboardExperiments without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), - ]; - client.innerApiCalls.listTensorboardExperiments = stubSimpleCall(expectedResponse); - const [response] = await client.listTensorboardExperiments(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTensorboardExperiments without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), - ]; - client.innerApiCalls.listTensorboardExperiments = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTensorboardExperiments( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardExperiment[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listTensorboardExperiments with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listTensorboardExperiments = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTensorboardExperiments(request), expectedError); - assert((client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTensorboardExperimentsStream without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), - ]; - client.descriptors.page.listTensorboardExperiments.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTensorboardExperimentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.TensorboardExperiment[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.TensorboardExperiment) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTensorboardExperiments, request)); - assert.strictEqual( - (client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listTensorboardExperimentsStream with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listTensorboardExperiments.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTensorboardExperimentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.TensorboardExperiment[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.TensorboardExperiment) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTensorboardExperiments, request)); - assert.strictEqual( - (client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTensorboardExperiments without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardExperiment()), - ]; - client.descriptors.page.listTensorboardExperiments.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.ITensorboardExperiment[] = []; - const iterable = client.listTensorboardExperimentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTensorboardExperiments with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listTensorboardExperiments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTensorboardExperimentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.ITensorboardExperiment[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listTensorboardRuns', () => { - it('invokes listTensorboardRuns without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), - ]; - client.innerApiCalls.listTensorboardRuns = stubSimpleCall(expectedResponse); - const [response] = await client.listTensorboardRuns(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTensorboardRuns without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), - ]; - client.innerApiCalls.listTensorboardRuns = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTensorboardRuns( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardRun[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listTensorboardRuns with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listTensorboardRuns = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTensorboardRuns(request), expectedError); - assert((client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTensorboardRunsStream without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), - ]; - client.descriptors.page.listTensorboardRuns.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTensorboardRunsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.TensorboardRun[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.TensorboardRun) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listTensorboardRuns.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTensorboardRuns, request)); - assert.strictEqual( - (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listTensorboardRunsStream with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listTensorboardRuns.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTensorboardRunsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.TensorboardRun[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.TensorboardRun) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTensorboardRuns.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTensorboardRuns, request)); - assert.strictEqual( - (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTensorboardRuns without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardRun()), - ]; - client.descriptors.page.listTensorboardRuns.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.ITensorboardRun[] = []; - const iterable = client.listTensorboardRunsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTensorboardRuns with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listTensorboardRuns.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTensorboardRunsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.ITensorboardRun[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listTensorboardTimeSeries', () => { - it('invokes listTensorboardTimeSeries without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), - ]; - client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCall(expectedResponse); - const [response] = await client.listTensorboardTimeSeries(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTensorboardTimeSeries without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), - ]; - client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTensorboardTimeSeries( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listTensorboardTimeSeries with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTensorboardTimeSeries(request), expectedError); - assert((client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTensorboardTimeSeriesStream without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), - ]; - client.descriptors.page.listTensorboardTimeSeries.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTensorboardTimeSeriesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.TensorboardTimeSeries[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.TensorboardTimeSeries) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTensorboardTimeSeries, request)); - assert.strictEqual( - (client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listTensorboardTimeSeriesStream with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listTensorboardTimeSeries.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTensorboardTimeSeriesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.TensorboardTimeSeries[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.TensorboardTimeSeries) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTensorboardTimeSeries, request)); - assert.strictEqual( - (client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTensorboardTimeSeries without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries()), - ]; - client.descriptors.page.listTensorboardTimeSeries.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries[] = []; - const iterable = client.listTensorboardTimeSeriesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTensorboardTimeSeries with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listTensorboardTimeSeries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTensorboardTimeSeriesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.ITensorboardTimeSeries[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('exportTensorboardTimeSeriesData', () => { - it('invokes exportTensorboardTimeSeriesData without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), - ]; - client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCall(expectedResponse); - const [response] = await client.exportTensorboardTimeSeriesData(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes exportTensorboardTimeSeriesData without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), - ]; - client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.exportTensorboardTimeSeriesData( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITimeSeriesDataPoint[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes exportTensorboardTimeSeriesData with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.exportTensorboardTimeSeriesData(request), expectedError); - assert((client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes exportTensorboardTimeSeriesDataStream without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), - ]; - client.descriptors.page.exportTensorboardTimeSeriesData.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.exportTensorboardTimeSeriesDataStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.exportTensorboardTimeSeriesData, request)); - assert.strictEqual( - (client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes exportTensorboardTimeSeriesDataStream with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series="; - const expectedError = new Error('expected'); - client.descriptors.page.exportTensorboardTimeSeriesData.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.exportTensorboardTimeSeriesDataStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.exportTensorboardTimeSeriesData, request)); - assert.strictEqual( - (client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with exportTensorboardTimeSeriesData without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint()), - ]; - client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.ITimeSeriesDataPoint[] = []; - const iterable = client.exportTensorboardTimeSeriesDataAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with exportTensorboardTimeSeriesData with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series=";const expectedError = new Error('expected'); - client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.exportTensorboardTimeSeriesDataAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.ITimeSeriesDataPoint[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/test/gapic_vizier_service_v1.ts b/owl-bot-staging/v1/test/gapic_vizier_service_v1.ts deleted file mode 100644 index 26a7fa45..00000000 --- a/owl-bot-staging/v1/test/gapic_vizier_service_v1.ts +++ /dev/null @@ -1,3680 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as vizierserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.VizierServiceClient', () => { - it('has servicePath', () => { - const servicePath = vizierserviceModule.v1.VizierServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = vizierserviceModule.v1.VizierServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = vizierserviceModule.v1.VizierServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new vizierserviceModule.v1.VizierServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.vizierServiceStub, undefined); - await client.initialize(); - assert(client.vizierServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.vizierServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.vizierServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('createStudy', () => { - it('invokes createStudy without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateStudyRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()); - client.innerApiCalls.createStudy = stubSimpleCall(expectedResponse); - const [response] = await client.createStudy(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createStudy without error using callback', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateStudyRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()); - client.innerApiCalls.createStudy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createStudy( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IStudy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createStudy with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateStudyRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createStudy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createStudy(request), expectedError); - assert((client.innerApiCalls.createStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createStudy with closed client', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateStudyRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createStudy(request), expectedError); - }); - }); - - describe('getStudy', () => { - it('invokes getStudy without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetStudyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()); - client.innerApiCalls.getStudy = stubSimpleCall(expectedResponse); - const [response] = await client.getStudy(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getStudy without error using callback', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetStudyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()); - client.innerApiCalls.getStudy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getStudy( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IStudy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getStudy with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetStudyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getStudy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getStudy(request), expectedError); - assert((client.innerApiCalls.getStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getStudy with closed client', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetStudyRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getStudy(request), expectedError); - }); - }); - - describe('deleteStudy', () => { - it('invokes deleteStudy without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteStudyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteStudy = stubSimpleCall(expectedResponse); - const [response] = await client.deleteStudy(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteStudy without error using callback', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteStudyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteStudy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteStudy( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteStudy with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteStudyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteStudy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteStudy(request), expectedError); - assert((client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteStudy with closed client', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteStudyRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteStudy(request), expectedError); - }); - }); - - describe('lookupStudy', () => { - it('invokes lookupStudy without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LookupStudyRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()); - client.innerApiCalls.lookupStudy = stubSimpleCall(expectedResponse); - const [response] = await client.lookupStudy(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes lookupStudy without error using callback', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LookupStudyRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()); - client.innerApiCalls.lookupStudy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.lookupStudy( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IStudy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes lookupStudy with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LookupStudyRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.lookupStudy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.lookupStudy(request), expectedError); - assert((client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes lookupStudy with closed client', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.LookupStudyRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.lookupStudy(request), expectedError); - }); - }); - - describe('createTrial', () => { - it('invokes createTrial without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTrialRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); - client.innerApiCalls.createTrial = stubSimpleCall(expectedResponse); - const [response] = await client.createTrial(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTrial without error using callback', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTrialRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); - client.innerApiCalls.createTrial = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTrial( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITrial|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createTrial with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTrialRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTrial(request), expectedError); - assert((client.innerApiCalls.createTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTrial with closed client', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CreateTrialRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createTrial(request), expectedError); - }); - }); - - describe('getTrial', () => { - it('invokes getTrial without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); - client.innerApiCalls.getTrial = stubSimpleCall(expectedResponse); - const [response] = await client.getTrial(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTrial without error using callback', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); - client.innerApiCalls.getTrial = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTrial( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITrial|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getTrial with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTrial(request), expectedError); - assert((client.innerApiCalls.getTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTrial with closed client', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.GetTrialRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTrial(request), expectedError); - }); - }); - - describe('addTrialMeasurement', () => { - it('invokes addTrialMeasurement without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddTrialMeasurementRequest()); - request.trialName = ''; - const expectedHeaderRequestParams = "trial_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); - client.innerApiCalls.addTrialMeasurement = stubSimpleCall(expectedResponse); - const [response] = await client.addTrialMeasurement(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes addTrialMeasurement without error using callback', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddTrialMeasurementRequest()); - request.trialName = ''; - const expectedHeaderRequestParams = "trial_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); - client.innerApiCalls.addTrialMeasurement = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.addTrialMeasurement( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITrial|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes addTrialMeasurement with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddTrialMeasurementRequest()); - request.trialName = ''; - const expectedHeaderRequestParams = "trial_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.addTrialMeasurement = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addTrialMeasurement(request), expectedError); - assert((client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes addTrialMeasurement with closed client', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.AddTrialMeasurementRequest()); - request.trialName = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.addTrialMeasurement(request), expectedError); - }); - }); - - describe('completeTrial', () => { - it('invokes completeTrial without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CompleteTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); - client.innerApiCalls.completeTrial = stubSimpleCall(expectedResponse); - const [response] = await client.completeTrial(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.completeTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes completeTrial without error using callback', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CompleteTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); - client.innerApiCalls.completeTrial = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.completeTrial( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITrial|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.completeTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes completeTrial with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CompleteTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.completeTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.completeTrial(request), expectedError); - assert((client.innerApiCalls.completeTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes completeTrial with closed client', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CompleteTrialRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.completeTrial(request), expectedError); - }); - }); - - describe('deleteTrial', () => { - it('invokes deleteTrial without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteTrial = stubSimpleCall(expectedResponse); - const [response] = await client.deleteTrial(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTrial without error using callback', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteTrial = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTrial( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteTrial with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteTrial(request), expectedError); - assert((client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTrial with closed client', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.DeleteTrialRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteTrial(request), expectedError); - }); - }); - - describe('stopTrial', () => { - it('invokes stopTrial without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.StopTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); - client.innerApiCalls.stopTrial = stubSimpleCall(expectedResponse); - const [response] = await client.stopTrial(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.stopTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes stopTrial without error using callback', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.StopTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()); - client.innerApiCalls.stopTrial = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.stopTrial( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITrial|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.stopTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes stopTrial with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.StopTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.stopTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.stopTrial(request), expectedError); - assert((client.innerApiCalls.stopTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes stopTrial with closed client', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.StopTrialRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.stopTrial(request), expectedError); - }); - }); - - describe('listOptimalTrials', () => { - it('invokes listOptimalTrials without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListOptimalTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListOptimalTrialsResponse()); - client.innerApiCalls.listOptimalTrials = stubSimpleCall(expectedResponse); - const [response] = await client.listOptimalTrials(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listOptimalTrials without error using callback', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListOptimalTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListOptimalTrialsResponse()); - client.innerApiCalls.listOptimalTrials = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listOptimalTrials( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IListOptimalTrialsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listOptimalTrials with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListOptimalTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listOptimalTrials = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listOptimalTrials(request), expectedError); - assert((client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listOptimalTrials with closed client', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListOptimalTrialsRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listOptimalTrials(request), expectedError); - }); - }); - - describe('suggestTrials', () => { - it('invokes suggestTrials without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SuggestTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.suggestTrials = stubLongRunningCall(expectedResponse); - const [operation] = await client.suggestTrials(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes suggestTrials without error using callback', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SuggestTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.suggestTrials = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.suggestTrials( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes suggestTrials with call error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SuggestTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.suggestTrials = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.suggestTrials(request), expectedError); - assert((client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes suggestTrials with LRO error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.SuggestTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.suggestTrials = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.suggestTrials(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkSuggestTrialsProgress without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkSuggestTrialsProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkSuggestTrialsProgress with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkSuggestTrialsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('checkTrialEarlyStoppingState', () => { - it('invokes checkTrialEarlyStoppingState without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateRequest()); - request.trialName = ''; - const expectedHeaderRequestParams = "trial_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(expectedResponse); - const [operation] = await client.checkTrialEarlyStoppingState(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkTrialEarlyStoppingState without error using callback', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateRequest()); - request.trialName = ''; - const expectedHeaderRequestParams = "trial_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.checkTrialEarlyStoppingState( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes checkTrialEarlyStoppingState with call error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateRequest()); - request.trialName = ''; - const expectedHeaderRequestParams = "trial_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.checkTrialEarlyStoppingState(request), expectedError); - assert((client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkTrialEarlyStoppingState with LRO error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateRequest()); - request.trialName = ''; - const expectedHeaderRequestParams = "trial_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.checkTrialEarlyStoppingState(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCheckTrialEarlyStoppingStateProgress without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCheckTrialEarlyStoppingStateProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCheckTrialEarlyStoppingStateProgress with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCheckTrialEarlyStoppingStateProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listStudies', () => { - it('invokes listStudies without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListStudiesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), - ]; - client.innerApiCalls.listStudies = stubSimpleCall(expectedResponse); - const [response] = await client.listStudies(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listStudies as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listStudies without error using callback', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListStudiesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), - ]; - client.innerApiCalls.listStudies = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listStudies( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IStudy[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listStudies as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listStudies with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListStudiesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listStudies = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listStudies(request), expectedError); - assert((client.innerApiCalls.listStudies as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listStudiesStream without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListStudiesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), - ]; - client.descriptors.page.listStudies.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listStudiesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Study[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Study) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listStudies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listStudies, request)); - assert.strictEqual( - (client.descriptors.page.listStudies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listStudiesStream with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListStudiesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listStudies.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listStudiesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Study[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Study) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listStudies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listStudies, request)); - assert.strictEqual( - (client.descriptors.page.listStudies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listStudies without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListStudiesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), - ]; - client.descriptors.page.listStudies.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.IStudy[] = []; - const iterable = client.listStudiesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listStudies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listStudies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listStudies with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListStudiesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listStudies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listStudiesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.IStudy[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listStudies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listStudies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listTrials', () => { - it('invokes listTrials without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), - ]; - client.innerApiCalls.listTrials = stubSimpleCall(expectedResponse); - const [response] = await client.listTrials(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTrials without error using callback', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), - ]; - client.innerApiCalls.listTrials = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTrials( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ITrial[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listTrials with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listTrials = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTrials(request), expectedError); - assert((client.innerApiCalls.listTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTrialsStream without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), - ]; - client.descriptors.page.listTrials.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTrialsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Trial[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Trial) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listTrials.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTrials, request)); - assert.strictEqual( - (client.descriptors.page.listTrials.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listTrialsStream with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listTrials.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTrialsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.Trial[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.Trial) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTrials.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTrials, request)); - assert.strictEqual( - (client.descriptors.page.listTrials.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTrials without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), - ]; - client.descriptors.page.listTrials.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.ITrial[] = []; - const iterable = client.listTrialsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTrials.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTrials.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTrials with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1.ListTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listTrials.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTrialsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.ITrial[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTrials.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTrials.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/tsconfig.json b/owl-bot-staging/v1/tsconfig.json deleted file mode 100644 index c78f1c88..00000000 --- a/owl-bot-staging/v1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/v1/webpack.config.js b/owl-bot-staging/v1/webpack.config.js deleted file mode 100644 index f4947d41..00000000 --- a/owl-bot-staging/v1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 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 -// -// https://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. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'DatasetService', - filename: './dataset-service.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/owl-bot-staging/v1beta1/.eslintignore b/owl-bot-staging/v1beta1/.eslintignore deleted file mode 100644 index cfc348ec..00000000 --- a/owl-bot-staging/v1beta1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/v1beta1/.eslintrc.json b/owl-bot-staging/v1beta1/.eslintrc.json deleted file mode 100644 index 78215349..00000000 --- a/owl-bot-staging/v1beta1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/v1beta1/.gitignore b/owl-bot-staging/v1beta1/.gitignore deleted file mode 100644 index 5d32b237..00000000 --- a/owl-bot-staging/v1beta1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -.coverage -coverage -.nyc_output -docs/ -out/ -build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/v1beta1/.jsdoc.js b/owl-bot-staging/v1beta1/.jsdoc.js deleted file mode 100644 index a5ec80d7..00000000 --- a/owl-bot-staging/v1beta1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2022 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/aiplatform', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/v1beta1/.mocharc.js b/owl-bot-staging/v1beta1/.mocharc.js deleted file mode 100644 index 481c522b..00000000 --- a/owl-bot-staging/v1beta1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/v1beta1/.prettierrc.js b/owl-bot-staging/v1beta1/.prettierrc.js deleted file mode 100644 index 494e1478..00000000 --- a/owl-bot-staging/v1beta1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/v1beta1/README.md b/owl-bot-staging/v1beta1/README.md deleted file mode 100644 index 7f057918..00000000 --- a/owl-bot-staging/v1beta1/README.md +++ /dev/null @@ -1 +0,0 @@ -Aiplatform: Nodejs Client diff --git a/owl-bot-staging/v1beta1/linkinator.config.json b/owl-bot-staging/v1beta1/linkinator.config.json deleted file mode 100644 index befd23c8..00000000 --- a/owl-bot-staging/v1beta1/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io", - "https://console.cloud.google.com/cloudshell", - "https://support.google.com" - ], - "silent": true, - "concurrency": 5, - "retry": true, - "retryErrors": true, - "retryErrorsCount": 5, - "retryErrorsJitter": 3000 -} diff --git a/owl-bot-staging/v1beta1/package.json b/owl-bot-staging/v1beta1/package.json deleted file mode 100644 index b8fe84e8..00000000 --- a/owl-bot-staging/v1beta1/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "@google-cloud/aiplatform", - "version": "0.1.0", - "description": "Aiplatform client for Node.js", - "repository": "googleapis/nodejs-aiplatform", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google aiplatform", - "aiplatform", - "dataset service", - "endpoint service", - "featurestore online serving service", - "featurestore service", - "index endpoint service", - "index service", - "job service", - "metadata service", - "migration service", - "model service", - "pipeline service", - "prediction service", - "specialist pool service", - "tensorboard service", - "vizier service" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^2.29.4" - }, - "devDependencies": { - "@types/mocha": "^9.1.0", - "@types/node": "^16.0.0", - "@types/sinon": "^10.0.8", - "c8": "^7.11.0", - "gts": "^3.1.0", - "jsdoc": "^3.6.7", - "jsdoc-fresh": "^1.1.1", - "jsdoc-region-tag": "^1.3.1", - "linkinator": "^3.0.0", - "mocha": "^9.1.4", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^13.0.0", - "ts-loader": "^9.2.6", - "typescript": "^4.5.5", - "webpack": "^5.67.0", - "webpack-cli": "^4.9.1" - }, - "engines": { - "node": ">=v10.24.0" - } -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto deleted file mode 100644 index af624cb7..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto +++ /dev/null @@ -1,55 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "AcceleratorTypeProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Represents a hardware accelerator type. -enum AcceleratorType { - // Unspecified accelerator type, which means no accelerator. - ACCELERATOR_TYPE_UNSPECIFIED = 0; - - // Nvidia Tesla K80 GPU. - NVIDIA_TESLA_K80 = 1; - - // Nvidia Tesla P100 GPU. - NVIDIA_TESLA_P100 = 2; - - // Nvidia Tesla V100 GPU. - NVIDIA_TESLA_V100 = 3; - - // Nvidia Tesla P4 GPU. - NVIDIA_TESLA_P4 = 4; - - // Nvidia Tesla T4 GPU. - NVIDIA_TESLA_T4 = 5; - - // Nvidia Tesla A100 GPU. - NVIDIA_TESLA_A100 = 8; - - // TPU v2. - TPU_V2 = 6; - - // TPU v3. - TPU_V3 = 7; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation.proto deleted file mode 100644 index e57ab445..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation.proto +++ /dev/null @@ -1,90 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/user_action_reference.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "AnnotationProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Used to assign specific AnnotationSpec to a particular area of a DataItem or -// the whole part of the DataItem. -message Annotation { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Annotation" - pattern: "projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}" - }; - - // Output only. Resource name of the Annotation. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Google Cloud Storage URI points to a YAML file describing [payload][google.cloud.aiplatform.v1beta1.Annotation.payload]. The - // schema is defined as an [OpenAPI 3.0.2 Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - // The schema files that can be used here are found in - // gs://google-cloud-aiplatform/schema/dataset/annotation/, note that the - // chosen schema must be consistent with the parent Dataset's - // [metadata][google.cloud.aiplatform.v1beta1.Dataset.metadata_schema_uri]. - string payload_schema_uri = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The schema of the payload can be found in - // [payload_schema][google.cloud.aiplatform.v1beta1.Annotation.payload_schema_uri]. - google.protobuf.Value payload = 3 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Timestamp when this Annotation was created. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Annotation was last updated. - google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The source of the Annotation. - UserActionReference annotation_source = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The labels with user-defined metadata to organize your Annotations. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one Annotation(System - // labels are excluded). - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. Following system labels exist for each Annotation: - // - // * "aiplatform.googleapis.com/annotation_set_name": - // optional, name of the UI's annotation set this Annotation belongs to. - // If not set, the Annotation is not visible in the UI. - // - // * "aiplatform.googleapis.com/payload_schema": - // output only, its value is the [payload_schema's][google.cloud.aiplatform.v1beta1.Annotation.payload_schema_uri] - // title. - map labels = 6 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto deleted file mode 100644 index 5d4c5664..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto +++ /dev/null @@ -1,55 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "AnnotationSpecProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Identifies a concept with which DataItems may be annotated with. -message AnnotationSpec { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/AnnotationSpec" - pattern: "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}" - }; - - // Output only. Resource name of the AnnotationSpec. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The user-defined name of the AnnotationSpec. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Timestamp when this AnnotationSpec was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when AnnotationSpec was last updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 5 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/artifact.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/artifact.proto deleted file mode 100644 index 378afb3f..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/artifact.proto +++ /dev/null @@ -1,109 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ArtifactProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Instance of a general artifact. -message Artifact { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Artifact" - pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}" - }; - - // Describes the state of the Artifact. - enum State { - // Unspecified state for the Artifact. - STATE_UNSPECIFIED = 0; - - // A state used by systems like Vertex AI Pipelines to indicate that the - // underlying data item represented by this Artifact is being created. - PENDING = 1; - - // A state indicating that the Artifact should exist, unless something - // external to the system deletes it. - LIVE = 2; - } - - // Output only. The resource name of the Artifact. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User provided display name of the Artifact. - // May be up to 128 Unicode characters. - string display_name = 2; - - // The uniform resource identifier of the artifact file. - // May be empty if there is no actual artifact file. - string uri = 6; - - // An eTag used to perform consistent read-modify-write updates. If not set, a - // blind "overwrite" update happens. - string etag = 9; - - // The labels with user-defined metadata to organize your Artifacts. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one Artifact (System - // labels are excluded). - map labels = 10; - - // Output only. Timestamp when this Artifact was created. - google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Artifact was last updated. - google.protobuf.Timestamp update_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The state of this Artifact. This is a property of the Artifact, and does - // not imply or capture any ongoing process. This property is managed by - // clients (such as Vertex AI Pipelines), and the system does not prescribe - // or check the validity of state transitions. - State state = 13; - - // The title of the schema describing the metadata. - // - // Schema title and version is expected to be registered in earlier Create - // Schema calls. And both are used together as unique identifiers to identify - // schemas within the local metadata store. - string schema_title = 14; - - // The version of the schema in schema_name to use. - // - // Schema title and version is expected to be registered in earlier Create - // Schema calls. And both are used together as unique identifiers to identify - // schemas within the local metadata store. - string schema_version = 15; - - // Properties of the Artifact. - // The size of this field should not exceed 200KB. - google.protobuf.Struct metadata = 16; - - // Description of the Artifact - string description = 17; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto deleted file mode 100644 index b50a8feb..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto +++ /dev/null @@ -1,298 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/completion_stats.proto"; -import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1beta1/explanation.proto"; -import "google/cloud/aiplatform/v1beta1/io.proto"; -import "google/cloud/aiplatform/v1beta1/job_state.proto"; -import "google/cloud/aiplatform/v1beta1/machine_resources.proto"; -import "google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto"; -import "google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "BatchPredictionJobProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A job that uses a [Model][google.cloud.aiplatform.v1beta1.BatchPredictionJob.model] to produce predictions -// on multiple [input instances][google.cloud.aiplatform.v1beta1.BatchPredictionJob.input_config]. If -// predictions for significant portion of the instances fail, the job may finish -// without attempting predictions for all remaining instances. -message BatchPredictionJob { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/BatchPredictionJob" - pattern: "projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}" - }; - - // Configures the input to [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob]. - // See [Model.supported_input_storage_formats][google.cloud.aiplatform.v1beta1.Model.supported_input_storage_formats] for Model's supported input - // formats, and how instances should be expressed via any of them. - message InputConfig { - // Required. The source of the input. - oneof source { - // The Cloud Storage location for the input instances. - GcsSource gcs_source = 2; - - // The BigQuery location of the input table. - // The schema of the table should be in the format described by the given - // context OpenAPI Schema, if one is provided. The table may contain - // additional columns that are not described by the schema, and they will - // be ignored. - BigQuerySource bigquery_source = 3; - } - - // Required. The format in which instances are given, must be one of the - // [Model's][google.cloud.aiplatform.v1beta1.BatchPredictionJob.model] - // [supported_input_storage_formats][google.cloud.aiplatform.v1beta1.Model.supported_input_storage_formats]. - string instances_format = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Configures the output of [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob]. - // See [Model.supported_output_storage_formats][google.cloud.aiplatform.v1beta1.Model.supported_output_storage_formats] for supported output - // formats, and how predictions are expressed via any of them. - message OutputConfig { - // Required. The destination of the output. - oneof destination { - // The Cloud Storage location of the directory where the output is - // to be written to. In the given directory a new directory is created. - // Its name is `prediction--`, - // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. - // Inside of it files `predictions_0001.`, - // `predictions_0002.`, ..., `predictions_N.` - // are created where `` depends on chosen - // [predictions_format][google.cloud.aiplatform.v1beta1.BatchPredictionJob.OutputConfig.predictions_format], and N may equal 0001 and depends on the total - // number of successfully predicted instances. - // If the Model has both [instance][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri] - // and [prediction][google.cloud.aiplatform.v1beta1.PredictSchemata.parameters_schema_uri] schemata - // defined then each such file contains predictions as per the - // [predictions_format][google.cloud.aiplatform.v1beta1.BatchPredictionJob.OutputConfig.predictions_format]. - // If prediction for any instance failed (partially or completely), then - // an additional `errors_0001.`, `errors_0002.`,..., - // `errors_N.` files are created (N depends on total number - // of failed predictions). These files contain the failed instances, - // as per their schema, followed by an additional `error` field which as - // value has [google.rpc.Status][google.rpc.Status] - // containing only `code` and `message` fields. - GcsDestination gcs_destination = 2; - - // The BigQuery project or dataset location where the output is to be - // written to. If project is provided, a new dataset is created with name - // `prediction__` - // where is made - // BigQuery-dataset-name compatible (for example, most special characters - // become underscores), and timestamp is in - // YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In the dataset - // two tables will be created, `predictions`, and `errors`. - // If the Model has both [instance][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri] - // and [prediction][google.cloud.aiplatform.v1beta1.PredictSchemata.parameters_schema_uri] schemata - // defined then the tables have columns as follows: The `predictions` - // table contains instances for which the prediction succeeded, it - // has columns as per a concatenation of the Model's instance and - // prediction schemata. The `errors` table contains rows for which the - // prediction has failed, it has instance columns, as per the - // instance schema, followed by a single "errors" column, which as values - // has [google.rpc.Status][google.rpc.Status] - // represented as a STRUCT, and containing only `code` and `message`. - BigQueryDestination bigquery_destination = 3; - } - - // Required. The format in which Vertex AI gives the predictions, must be one of the - // [Model's][google.cloud.aiplatform.v1beta1.BatchPredictionJob.model] - // [supported_output_storage_formats][google.cloud.aiplatform.v1beta1.Model.supported_output_storage_formats]. - string predictions_format = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Further describes this job's output. - // Supplements [output_config][google.cloud.aiplatform.v1beta1.BatchPredictionJob.output_config]. - message OutputInfo { - // The output location into which prediction output is written. - oneof output_location { - // Output only. The full path of the Cloud Storage directory created, into which - // the prediction output is written. - string gcs_output_directory = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The path of the BigQuery dataset created, in - // `bq://projectId.bqDatasetId` - // format, into which the prediction output is written. - string bigquery_output_dataset = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. The name of the BigQuery table created, in - // `predictions_` - // format, into which the prediction output is written. - // Can be used by UI to generate the BigQuery output path, for example. - string bigquery_output_table = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. Resource name of the BatchPredictionJob. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The user-defined name of this BatchPredictionJob. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // The name of the Model resoure that produces the predictions via this job, - // must share the same ancestor Location. - // Starting this job has no impact on any existing deployments of the Model - // and their resources. - // Exactly one of model and unmanaged_container_model must be set. - string model = 3 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - }]; - - // Output only. The version ID of the Model that produces the predictions via this job. - string model_version_id = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Contains model information necessary to perform batch prediction without - // requiring uploading to model registry. - // Exactly one of model and unmanaged_container_model must be set. - UnmanagedContainerModel unmanaged_container_model = 28; - - // Required. Input configuration of the instances on which predictions are performed. - // The schema of any single instance may be specified via - // the [Model's][google.cloud.aiplatform.v1beta1.BatchPredictionJob.model] - // [PredictSchemata's][google.cloud.aiplatform.v1beta1.Model.predict_schemata] - // [instance_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri]. - InputConfig input_config = 4 [(google.api.field_behavior) = REQUIRED]; - - // The parameters that govern the predictions. The schema of the parameters - // may be specified via the [Model's][google.cloud.aiplatform.v1beta1.BatchPredictionJob.model] - // [PredictSchemata's][google.cloud.aiplatform.v1beta1.Model.predict_schemata] - // [parameters_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.parameters_schema_uri]. - google.protobuf.Value model_parameters = 5; - - // Required. The Configuration specifying where output predictions should - // be written. - // The schema of any single prediction may be specified as a concatenation - // of [Model's][google.cloud.aiplatform.v1beta1.BatchPredictionJob.model] - // [PredictSchemata's][google.cloud.aiplatform.v1beta1.Model.predict_schemata] - // [instance_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri] - // and - // [prediction_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.prediction_schema_uri]. - OutputConfig output_config = 6 [(google.api.field_behavior) = REQUIRED]; - - // The config of resources used by the Model during the batch prediction. If - // the Model [supports][google.cloud.aiplatform.v1beta1.Model.supported_deployment_resources_types] - // DEDICATED_RESOURCES this config may be provided (and the job will use these - // resources), if the Model doesn't support AUTOMATIC_RESOURCES, this config - // must be provided. - BatchDedicatedResources dedicated_resources = 7; - - // The service account that the DeployedModel's container runs as. If not - // specified, a system generated one will be used, which - // has minimal permissions and the custom container, if used, may not have - // enough permission to access other GCP resources. - // - // Users deploying the Model must have the `iam.serviceAccounts.actAs` - // permission on this service account. - string service_account = 29; - - // Immutable. Parameters configuring the batch behavior. Currently only applicable when - // [dedicated_resources][google.cloud.aiplatform.v1beta1.BatchPredictionJob.dedicated_resources] are used (in other cases Vertex AI does - // the tuning itself). - ManualBatchTuningParameters manual_batch_tuning_parameters = 8 [(google.api.field_behavior) = IMMUTABLE]; - - // Generate explanation with the batch prediction results. - // - // When set to `true`, the batch prediction output changes based on the - // `predictions_format` field of the - // [BatchPredictionJob.output_config][google.cloud.aiplatform.v1beta1.BatchPredictionJob.output_config] object: - // - // * `bigquery`: output includes a column named `explanation`. The value - // is a struct that conforms to the [Explanation][google.cloud.aiplatform.v1beta1.Explanation] object. - // * `jsonl`: The JSON objects on each line include an additional entry - // keyed `explanation`. The value of the entry is a JSON object that - // conforms to the [Explanation][google.cloud.aiplatform.v1beta1.Explanation] object. - // * `csv`: Generating explanations for CSV format is not supported. - // - // If this field is set to true, either the [Model.explanation_spec][google.cloud.aiplatform.v1beta1.Model.explanation_spec] or - // [explanation_spec][google.cloud.aiplatform.v1beta1.BatchPredictionJob.explanation_spec] must be populated. - bool generate_explanation = 23; - - // Explanation configuration for this BatchPredictionJob. Can be - // specified only if [generate_explanation][google.cloud.aiplatform.v1beta1.BatchPredictionJob.generate_explanation] is set to `true`. - // - // This value overrides the value of [Model.explanation_spec][google.cloud.aiplatform.v1beta1.Model.explanation_spec]. All fields of - // [explanation_spec][google.cloud.aiplatform.v1beta1.BatchPredictionJob.explanation_spec] are optional in the request. If a field of the - // [explanation_spec][google.cloud.aiplatform.v1beta1.BatchPredictionJob.explanation_spec] object is not populated, the corresponding field of - // the [Model.explanation_spec][google.cloud.aiplatform.v1beta1.Model.explanation_spec] object is inherited. - ExplanationSpec explanation_spec = 25; - - // Output only. Information further describing the output of this job. - OutputInfo output_info = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The detailed state of the job. - JobState state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Only populated when the job's state is JOB_STATE_FAILED or - // JOB_STATE_CANCELLED. - google.rpc.Status error = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Partial failures encountered. - // For example, single files that can't be read. - // This field never exceeds 20 entries. - // Status details fields contain standard GCP error details. - repeated google.rpc.Status partial_failures = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Information about resources that had been consumed by this job. - // Provided in real time at best effort basis, as well as a final value - // once the job completes. - // - // Note: This field currently may be not populated for batch predictions that - // use AutoML Models. - ResourcesConsumed resources_consumed = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Statistics on completed and failed prediction instances. - CompletionStats completion_stats = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the BatchPredictionJob was created. - google.protobuf.Timestamp create_time = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the BatchPredictionJob for the first time entered the - // `JOB_STATE_RUNNING` state. - google.protobuf.Timestamp start_time = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the BatchPredictionJob entered any of the following states: - // `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. - google.protobuf.Timestamp end_time = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the BatchPredictionJob was most recently updated. - google.protobuf.Timestamp update_time = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize BatchPredictionJobs. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 19; - - // Customer-managed encryption key options for a BatchPredictionJob. If this - // is set, then all resources created by the BatchPredictionJob will be - // encrypted with the provided encryption key. - EncryptionSpec encryption_spec = 24; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/completion_stats.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/completion_stats.proto deleted file mode 100644 index 7d539d82..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/completion_stats.proto +++ /dev/null @@ -1,44 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "CompletionStatsProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Success and error statistics of processing multiple entities -// (for example, DataItems or structured data rows) in batch. -message CompletionStats { - // Output only. The number of entities that had been processed successfully. - int64 successful_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of entities for which any error was encountered. - int64 failed_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. In cases when enough errors are encountered a job, pipeline, or operation - // may be failed as a whole. Below is the number of entities for which the - // processing had not been finished (either in successful or failed state). - // Set to -1 if the number is unknown (for example, the operation failed - // before the total entity number could be collected). - int64 incomplete_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/context.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/context.proto deleted file mode 100644 index 7f81ce4c..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/context.proto +++ /dev/null @@ -1,94 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ContextProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Instance of a general context. -message Context { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Context" - pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}" - }; - - // Output only. The resource name of the Context. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User provided display name of the Context. - // May be up to 128 Unicode characters. - string display_name = 2; - - // An eTag used to perform consistent read-modify-write updates. If not set, a - // blind "overwrite" update happens. - string etag = 8; - - // The labels with user-defined metadata to organize your Contexts. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one Context (System - // labels are excluded). - map labels = 9; - - // Output only. Timestamp when this Context was created. - google.protobuf.Timestamp create_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Context was last updated. - google.protobuf.Timestamp update_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A list of resource names of Contexts that are parents of this Context. - // A Context may have at most 10 parent_contexts. - repeated string parent_contexts = 12 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - } - ]; - - // The title of the schema describing the metadata. - // - // Schema title and version is expected to be registered in earlier Create - // Schema calls. And both are used together as unique identifiers to identify - // schemas within the local metadata store. - string schema_title = 13; - - // The version of the schema in schema_name to use. - // - // Schema title and version is expected to be registered in earlier Create - // Schema calls. And both are used together as unique identifiers to identify - // schemas within the local metadata store. - string schema_version = 14; - - // Properties of the Context. - // The size of this field should not exceed 200KB. - google.protobuf.Struct metadata = 15; - - // Description of the Context - string description = 16; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto deleted file mode 100644 index d2f1464d..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto +++ /dev/null @@ -1,268 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1beta1/io.proto"; -import "google/cloud/aiplatform/v1beta1/job_state.proto"; -import "google/cloud/aiplatform/v1beta1/machine_resources.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "CustomJobProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Represents a job that runs custom workloads such as a Docker container or a -// Python package. A CustomJob can have multiple worker pools and each worker -// pool can have its own machine and input spec. A CustomJob will be cleaned up -// once the job enters terminal state (failed or succeeded). -message CustomJob { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/CustomJob" - pattern: "projects/{project}/locations/{location}/customJobs/{custom_job}" - }; - - // Output only. Resource name of a CustomJob. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The display name of the CustomJob. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Job spec. - CustomJobSpec job_spec = 4 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The detailed state of the job. - JobState state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the CustomJob was created. - google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the CustomJob for the first time entered the - // `JOB_STATE_RUNNING` state. - google.protobuf.Timestamp start_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the CustomJob entered any of the following states: - // `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. - google.protobuf.Timestamp end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the CustomJob was most recently updated. - google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Only populated when job's state is `JOB_STATE_FAILED` or - // `JOB_STATE_CANCELLED`. - google.rpc.Status error = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize CustomJobs. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 11; - - // Customer-managed encryption key options for a CustomJob. If this is set, - // then all resources created by the CustomJob will be encrypted with the - // provided encryption key. - EncryptionSpec encryption_spec = 12; - - // Output only. URIs for accessing [interactive - // shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) - // (one URI for each training node). Only available if - // [job_spec.enable_web_access][google.cloud.aiplatform.v1beta1.CustomJobSpec.enable_web_access] is `true`. - // - // The keys are names of each node in the training job; for example, - // `workerpool0-0` for the primary node, `workerpool1-0` for the first node in - // the second worker pool, and `workerpool1-1` for the second node in the - // second worker pool. - // - // The values are the URIs for each node's interactive shell. - map web_access_uris = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Represents the spec of a CustomJob. -// Next Id: 14 -message CustomJobSpec { - // Required. The spec of the worker pools including machine type and Docker image. - // All worker pools except the first one are optional and can be skipped by - // providing an empty value. - repeated WorkerPoolSpec worker_pool_specs = 1 [(google.api.field_behavior) = REQUIRED]; - - // Scheduling options for a CustomJob. - Scheduling scheduling = 3; - - // Specifies the service account for workload run-as account. - // Users submitting jobs must have act-as permission on this run-as account. - // If unspecified, the [Vertex AI Custom Code Service - // Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) - // for the CustomJob's project is used. - string service_account = 4; - - // The full name of the Compute Engine - // [network](/compute/docs/networks-and-firewalls#networks) to which the Job - // should be peered. For example, `projects/12345/global/networks/myVPC`. - // [Format](/compute/docs/reference/rest/v1/networks/insert) - // is of the form `projects/{project}/global/networks/{network}`. - // Where {project} is a project number, as in `12345`, and {network} is a - // network name. - // - // To specify this field, you must have already [configured VPC Network - // Peering for Vertex - // AI](https://cloud.google.com/vertex-ai/docs/general/vpc-peering). - // - // If this field is left unspecified, the job is not peered with any network. - string network = 5 [(google.api.resource_reference) = { - type: "compute.googleapis.com/Network" - }]; - - // Optional. A list of names for the reserved ip ranges under the VPC network - // that can be used for this job. - // - // If set, we will deploy the job within the provided ip ranges. Otherwise, - // the job will be deployed to any ip ranges under the provided VPC - // network. - // - // Example: ['vertex-ai-ip-range']. - repeated string reserved_ip_ranges = 13 [(google.api.field_behavior) = OPTIONAL]; - - // The Cloud Storage location to store the output of this CustomJob or - // HyperparameterTuningJob. For HyperparameterTuningJob, - // the baseOutputDirectory of - // each child CustomJob backing a Trial is set to a subdirectory of name - // [id][google.cloud.aiplatform.v1beta1.Trial.id] under its parent HyperparameterTuningJob's - // baseOutputDirectory. - // - // The following Vertex AI environment variables will be passed to - // containers or python modules when this field is set: - // - // For CustomJob: - // - // * AIP_MODEL_DIR = `/model/` - // * AIP_CHECKPOINT_DIR = `/checkpoints/` - // * AIP_TENSORBOARD_LOG_DIR = `/logs/` - // - // For CustomJob backing a Trial of HyperparameterTuningJob: - // - // * AIP_MODEL_DIR = `//model/` - // * AIP_CHECKPOINT_DIR = `//checkpoints/` - // * AIP_TENSORBOARD_LOG_DIR = `//logs/` - GcsDestination base_output_directory = 6; - - // Optional. The name of a Vertex AI [Tensorboard][google.cloud.aiplatform.v1beta1.Tensorboard] resource to which this CustomJob - // will upload Tensorboard logs. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - string tensorboard = 7 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Tensorboard" - } - ]; - - // Optional. Whether you want Vertex AI to enable [interactive shell - // access](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) - // to training containers. - // - // If set to `true`, you can access interactive shells at the URIs given - // by [CustomJob.web_access_uris][google.cloud.aiplatform.v1beta1.CustomJob.web_access_uris] or [Trial.web_access_uris][google.cloud.aiplatform.v1beta1.Trial.web_access_uris] (within - // [HyperparameterTuningJob.trials][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.trials]). - bool enable_web_access = 10 [(google.api.field_behavior) = OPTIONAL]; -} - -// Represents the spec of a worker pool in a job. -message WorkerPoolSpec { - // The custom task to be executed in this worker pool. - oneof task { - // The custom container task. - ContainerSpec container_spec = 6; - - // The Python packaged task. - PythonPackageSpec python_package_spec = 7; - } - - // Optional. Immutable. The specification of a single machine. - MachineSpec machine_spec = 1 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. The number of worker replicas to use for this worker pool. - int64 replica_count = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of NFS mount spec. - repeated NfsMount nfs_mounts = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Disk spec. - DiskSpec disk_spec = 5; -} - -// The spec of a Container. -message ContainerSpec { - // Required. The URI of a container image in the Container Registry that is to be run on - // each worker replica. - string image_uri = 1 [(google.api.field_behavior) = REQUIRED]; - - // The command to be invoked when the container is started. - // It overrides the entrypoint instruction in Dockerfile when provided. - repeated string command = 2; - - // The arguments to be passed when starting the container. - repeated string args = 3; -} - -// The spec of a Python packaged code. -message PythonPackageSpec { - // Required. The URI of a container image in Artifact Registry that will run the - // provided Python package. Vertex AI provides a wide range of executor - // images with pre-installed packages to meet users' various use cases. See - // the list of [pre-built containers for - // training](https://cloud.google.com/vertex-ai/docs/training/pre-built-containers). - // You must use an image from this list. - string executor_image_uri = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Google Cloud Storage location of the Python package files which are - // the training program and its dependent packages. - // The maximum number of package URIs is 100. - repeated string package_uris = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Python module name to run after installing the packages. - string python_module = 3 [(google.api.field_behavior) = REQUIRED]; - - // Command line arguments to be passed to the Python task. - repeated string args = 4; -} - -// All parameters related to queuing and scheduling of custom jobs. -message Scheduling { - // The maximum job running time. The default is 7 days. - google.protobuf.Duration timeout = 1; - - // Restarts the entire CustomJob if a worker gets restarted. - // This feature can be used by distributed training jobs that are not - // resilient to workers leaving and joining a job. - bool restart_job_on_worker_restart = 3; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_item.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_item.proto deleted file mode 100644 index 5c3e443b..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_item.proto +++ /dev/null @@ -1,70 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "DataItemProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A piece of data in a Dataset. Could be an image, a video, a document or plain -// text. -message DataItem { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/DataItem" - pattern: "projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}" - }; - - // Output only. The resource name of the DataItem. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this DataItem was created. - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this DataItem was last updated. - google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The labels with user-defined metadata to organize your DataItems. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one DataItem(System - // labels are excluded). - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. - map labels = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The data that the DataItem represents (for example, an image or a text - // snippet). The schema of the payload is stored in the parent Dataset's - // [metadata schema's][google.cloud.aiplatform.v1beta1.Dataset.metadata_schema_uri] dataItemSchemaUri field. - google.protobuf.Value payload = 4 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 7 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto deleted file mode 100644 index 3a7160a5..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto +++ /dev/null @@ -1,207 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1beta1/job_state.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; -import "google/type/money.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "DataLabelingJobProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// DataLabelingJob is used to trigger a human labeling job on unlabeled data -// from the following Dataset: -message DataLabelingJob { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/DataLabelingJob" - pattern: "projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}" - }; - - // Output only. Resource name of the DataLabelingJob. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The user-defined name of the DataLabelingJob. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - // Display name of a DataLabelingJob. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Dataset resource names. Right now we only support labeling from a single - // Dataset. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}` - repeated string datasets = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - } - ]; - - // Labels to assign to annotations generated by this DataLabelingJob. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. - map annotation_labels = 12; - - // Required. Number of labelers to work on each DataItem. - int32 labeler_count = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Google Cloud Storage location of the instruction pdf. This pdf is - // shared with labelers, and provides detailed description on how to label - // DataItems in Datasets. - string instruction_uri = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. Points to a YAML file stored on Google Cloud Storage describing the - // config for a specific type of DataLabelingJob. - // The schema files that can be used here are found in the - // https://storage.googleapis.com/google-cloud-aiplatform bucket in the - // /schema/datalabelingjob/inputs/ folder. - string inputs_schema_uri = 6 [(google.api.field_behavior) = REQUIRED]; - - // Required. Input config parameters for the DataLabelingJob. - google.protobuf.Value inputs = 7 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The detailed state of the job. - JobState state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Current labeling job progress percentage scaled in interval [0, 100], - // indicating the percentage of DataItems that has been finished. - int32 labeling_progress = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Estimated cost(in US dollars) that the DataLabelingJob has incurred to - // date. - google.type.Money current_spend = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this DataLabelingJob was created. - google.protobuf.Timestamp create_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this DataLabelingJob was updated most recently. - google.protobuf.Timestamp update_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. DataLabelingJob errors. It is only populated when job's state is - // `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`. - google.rpc.Status error = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize your DataLabelingJobs. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. Following system labels exist for each DataLabelingJob: - // - // * "aiplatform.googleapis.com/schema": output only, its value is the - // [inputs_schema][google.cloud.aiplatform.v1beta1.DataLabelingJob.inputs_schema_uri]'s title. - map labels = 11; - - // The SpecialistPools' resource names associated with this job. - repeated string specialist_pools = 16; - - // Customer-managed encryption key spec for a DataLabelingJob. If set, this - // DataLabelingJob will be secured by this key. - // - // Note: Annotations created in the DataLabelingJob are associated with - // the EncryptionSpec of the Dataset they are exported to. - EncryptionSpec encryption_spec = 20; - - // Parameters that configure the active learning pipeline. Active learning - // will label the data incrementally via several iterations. For every - // iteration, it will select a batch of data based on the sampling strategy. - ActiveLearningConfig active_learning_config = 21; -} - -// Parameters that configure the active learning pipeline. Active learning will -// label the data incrementally by several iterations. For every iteration, it -// will select a batch of data based on the sampling strategy. -message ActiveLearningConfig { - // Required. Max human labeling DataItems. The rest part will be labeled by - // machine. - oneof human_labeling_budget { - // Max number of human labeled DataItems. - int64 max_data_item_count = 1; - - // Max percent of total DataItems for human labeling. - int32 max_data_item_percentage = 2; - } - - // Active learning data sampling config. For every active learning labeling - // iteration, it will select a batch of data based on the sampling strategy. - SampleConfig sample_config = 3; - - // CMLE training config. For every active learning labeling iteration, system - // will train a machine learning model on CMLE. The trained model will be used - // by data sampling algorithm to select DataItems. - TrainingConfig training_config = 4; -} - -// Active learning data sampling config. For every active learning labeling -// iteration, it will select a batch of data based on the sampling strategy. -message SampleConfig { - // Sample strategy decides which subset of DataItems should be selected for - // human labeling in every batch. - enum SampleStrategy { - // Default will be treated as UNCERTAINTY. - SAMPLE_STRATEGY_UNSPECIFIED = 0; - - // Sample the most uncertain data to label. - UNCERTAINTY = 1; - } - - // Decides sample size for the initial batch. initial_batch_sample_percentage - // is used by default. - oneof initial_batch_sample_size { - // The percentage of data needed to be labeled in the first batch. - int32 initial_batch_sample_percentage = 1; - } - - // Decides sample size for the following batches. - // following_batch_sample_percentage is used by default. - oneof following_batch_sample_size { - // The percentage of data needed to be labeled in each following batch - // (except the first batch). - int32 following_batch_sample_percentage = 3; - } - - // Field to choose sampling strategy. Sampling strategy will decide which data - // should be selected for human labeling in every batch. - SampleStrategy sample_strategy = 5; -} - -// CMLE training config. For every active learning labeling iteration, system -// will train a machine learning model on CMLE. The trained model will be used -// by data sampling algorithm to select DataItems. -message TrainingConfig { - // The timeout hours for the CMLE training job, expressed in milli hours - // i.e. 1,000 value in this field means 1 hour. - int64 timeout_training_milli_hours = 1; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto deleted file mode 100644 index 5d1f197f..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset.proto +++ /dev/null @@ -1,144 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1beta1/io.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "DatasetProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A collection of DataItems and Annotations on them. -message Dataset { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Dataset" - pattern: "projects/{project}/locations/{location}/datasets/{dataset}" - }; - - // Output only. The resource name of the Dataset. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The user-defined name of the Dataset. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The description of the Dataset. - string description = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Points to a YAML file stored on Google Cloud Storage describing additional - // information about the Dataset. - // The schema is defined as an OpenAPI 3.0.2 Schema Object. - // The schema files that can be used here are found in - // gs://google-cloud-aiplatform/schema/dataset/metadata/. - string metadata_schema_uri = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. Additional information about the Dataset. - google.protobuf.Value metadata = 8 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Timestamp when this Dataset was created. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Dataset was last updated. - google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 6; - - // The labels with user-defined metadata to organize your Datasets. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one Dataset (System - // labels are excluded). - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. Following system labels exist for each Dataset: - // - // * "aiplatform.googleapis.com/dataset_metadata_schema": output only, its - // value is the [metadata_schema's][google.cloud.aiplatform.v1beta1.Dataset.metadata_schema_uri] title. - map labels = 7; - - // Customer-managed encryption key spec for a Dataset. If set, this Dataset - // and all sub-resources of this Dataset will be secured by this key. - EncryptionSpec encryption_spec = 11; -} - -// Describes the location from where we import data into a Dataset, together -// with the labels that will be applied to the DataItems and the Annotations. -message ImportDataConfig { - // The source of the input. - oneof source { - // The Google Cloud Storage location for the input content. - GcsSource gcs_source = 1; - } - - // Labels that will be applied to newly imported DataItems. If an identical - // DataItem as one being imported already exists in the Dataset, then these - // labels will be appended to these of the already existing one, and if labels - // with identical key is imported before, the old label value will be - // overwritten. If two DataItems are identical in the same import data - // operation, the labels will be combined and if key collision happens in this - // case, one of the values will be picked randomly. Two DataItems are - // considered identical if their content bytes are identical (e.g. image bytes - // or pdf bytes). - // These labels will be overridden by Annotation labels specified inside index - // file referenced by [import_schema_uri][google.cloud.aiplatform.v1beta1.ImportDataConfig.import_schema_uri], e.g. jsonl file. - map data_item_labels = 2; - - // Required. Points to a YAML file stored on Google Cloud Storage describing the import - // format. Validation will be done against the schema. The schema is defined - // as an [OpenAPI 3.0.2 Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - string import_schema_uri = 4 [(google.api.field_behavior) = REQUIRED]; -} - -// Describes what part of the Dataset is to be exported, the destination of -// the export and how to export. -message ExportDataConfig { - // The destination of the output. - oneof destination { - // The Google Cloud Storage location where the output is to be written to. - // In the given directory a new directory will be created with name: - // `export-data--` where - // timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export - // output will be written into that directory. Inside that directory, - // annotations with the same schema will be grouped into sub directories - // which are named with the corresponding annotations' schema title. Inside - // these sub directories, a schema.yaml will be created to describe the - // output format. - GcsDestination gcs_destination = 1; - } - - // A filter on Annotations of the Dataset. Only Annotations on to-be-exported - // DataItems(specified by [data_items_filter][]) that match this filter will - // be exported. The filter syntax is the same as in - // [ListAnnotations][google.cloud.aiplatform.v1beta1.DatasetService.ListAnnotations]. - string annotations_filter = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset_service.proto deleted file mode 100644 index 92bb4628..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset_service.proto +++ /dev/null @@ -1,412 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/annotation.proto"; -import "google/cloud/aiplatform/v1beta1/annotation_spec.proto"; -import "google/cloud/aiplatform/v1beta1/data_item.proto"; -import "google/cloud/aiplatform/v1beta1/dataset.proto"; -import "google/cloud/aiplatform/v1beta1/operation.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "DatasetServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// The service that handles the CRUD of Vertex AI Dataset and its child -// resources. -service DatasetService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a Dataset. - rpc CreateDataset(CreateDatasetRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/datasets" - body: "dataset" - }; - option (google.api.method_signature) = "parent,dataset"; - option (google.longrunning.operation_info) = { - response_type: "Dataset" - metadata_type: "CreateDatasetOperationMetadata" - }; - } - - // Gets a Dataset. - rpc GetDataset(GetDatasetRequest) returns (Dataset) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/datasets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a Dataset. - rpc UpdateDataset(UpdateDatasetRequest) returns (Dataset) { - option (google.api.http) = { - patch: "/v1beta1/{dataset.name=projects/*/locations/*/datasets/*}" - body: "dataset" - }; - option (google.api.method_signature) = "dataset,update_mask"; - } - - // Lists Datasets in a Location. - rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/datasets" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a Dataset. - rpc DeleteDataset(DeleteDatasetRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/datasets/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Imports data into a Dataset. - rpc ImportData(ImportDataRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/datasets/*}:import" - body: "*" - }; - option (google.api.method_signature) = "name,import_configs"; - option (google.longrunning.operation_info) = { - response_type: "ImportDataResponse" - metadata_type: "ImportDataOperationMetadata" - }; - } - - // Exports data from a Dataset. - rpc ExportData(ExportDataRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/datasets/*}:export" - body: "*" - }; - option (google.api.method_signature) = "name,export_config"; - option (google.longrunning.operation_info) = { - response_type: "ExportDataResponse" - metadata_type: "ExportDataOperationMetadata" - }; - } - - // Lists DataItems in a Dataset. - rpc ListDataItems(ListDataItemsRequest) returns (ListDataItemsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/datasets/*}/dataItems" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets an AnnotationSpec. - rpc GetAnnotationSpec(GetAnnotationSpecRequest) returns (AnnotationSpec) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Annotations belongs to a dataitem - rpc ListAnnotations(ListAnnotationsRequest) returns (ListAnnotationsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/datasets/*/dataItems/*}/annotations" - }; - option (google.api.method_signature) = "parent"; - } -} - -// Request message for [DatasetService.CreateDataset][google.cloud.aiplatform.v1beta1.DatasetService.CreateDataset]. -message CreateDatasetRequest { - // Required. The resource name of the Location to create the Dataset in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The Dataset to create. - Dataset dataset = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Runtime operation information for [DatasetService.CreateDataset][google.cloud.aiplatform.v1beta1.DatasetService.CreateDataset]. -message CreateDatasetOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [DatasetService.GetDataset][google.cloud.aiplatform.v1beta1.DatasetService.GetDataset]. -message GetDatasetRequest { - // Required. The name of the Dataset resource. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - } - ]; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 2; -} - -// Request message for [DatasetService.UpdateDataset][google.cloud.aiplatform.v1beta1.DatasetService.UpdateDataset]. -message UpdateDatasetRequest { - // Required. The Dataset which replaces the resource on the server. - Dataset dataset = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The update mask applies to the resource. - // For the `FieldMask` definition, see [google.protobuf.FieldMask][google.protobuf.FieldMask]. - // Updatable fields: - // - // * `display_name` - // * `description` - // * `labels` - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [DatasetService.ListDatasets][google.cloud.aiplatform.v1beta1.DatasetService.ListDatasets]. -message ListDatasetsRequest { - // Required. The name of the Dataset's parent resource. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // An expression for filtering the results of the request. For field names - // both snake_case and camelCase are supported. - // - // * `display_name`: supports = and != - // * `metadata_schema_uri`: supports = and != - // * `labels` supports general map functions that is: - // * `labels.key=value` - key:value equality - // * `labels.key:* or labels:key - key existence - // * A key including a space must be quoted. `labels."a key"`. - // - // Some examples: - // * `displayName="myDisplayName"` - // * `labels.myKey="myValue"` - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; - - // A comma-separated list of fields to order by, sorted in ascending order. - // Use "desc" after a field name for descending. - // Supported fields: - // * `display_name` - // * `create_time` - // * `update_time` - string order_by = 6; -} - -// Response message for [DatasetService.ListDatasets][google.cloud.aiplatform.v1beta1.DatasetService.ListDatasets]. -message ListDatasetsResponse { - // A list of Datasets that matches the specified filter in the request. - repeated Dataset datasets = 1; - - // The standard List next-page token. - string next_page_token = 2; -} - -// Request message for [DatasetService.DeleteDataset][google.cloud.aiplatform.v1beta1.DatasetService.DeleteDataset]. -message DeleteDatasetRequest { - // Required. The resource name of the Dataset to delete. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - } - ]; -} - -// Request message for [DatasetService.ImportData][google.cloud.aiplatform.v1beta1.DatasetService.ImportData]. -message ImportDataRequest { - // Required. The name of the Dataset resource. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - } - ]; - - // Required. The desired input locations. The contents of all input locations will be - // imported in one batch. - repeated ImportDataConfig import_configs = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [DatasetService.ImportData][google.cloud.aiplatform.v1beta1.DatasetService.ImportData]. -message ImportDataResponse { - -} - -// Runtime operation information for [DatasetService.ImportData][google.cloud.aiplatform.v1beta1.DatasetService.ImportData]. -message ImportDataOperationMetadata { - // The common part of the operation metadata. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [DatasetService.ExportData][google.cloud.aiplatform.v1beta1.DatasetService.ExportData]. -message ExportDataRequest { - // Required. The name of the Dataset resource. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - } - ]; - - // Required. The desired output location. - ExportDataConfig export_config = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [DatasetService.ExportData][google.cloud.aiplatform.v1beta1.DatasetService.ExportData]. -message ExportDataResponse { - // All of the files that are exported in this export operation. - repeated string exported_files = 1; -} - -// Runtime operation information for [DatasetService.ExportData][google.cloud.aiplatform.v1beta1.DatasetService.ExportData]. -message ExportDataOperationMetadata { - // The common part of the operation metadata. - GenericOperationMetadata generic_metadata = 1; - - // A Google Cloud Storage directory which path ends with '/'. The exported - // data is stored in the directory. - string gcs_output_directory = 2; -} - -// Request message for [DatasetService.ListDataItems][google.cloud.aiplatform.v1beta1.DatasetService.ListDataItems]. -message ListDataItemsRequest { - // Required. The resource name of the Dataset to list DataItems from. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - } - ]; - - // The standard list filter. - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; - - // A comma-separated list of fields to order by, sorted in ascending order. - // Use "desc" after a field name for descending. - string order_by = 6; -} - -// Response message for [DatasetService.ListDataItems][google.cloud.aiplatform.v1beta1.DatasetService.ListDataItems]. -message ListDataItemsResponse { - // A list of DataItems that matches the specified filter in the request. - repeated DataItem data_items = 1; - - // The standard List next-page token. - string next_page_token = 2; -} - -// Request message for [DatasetService.GetAnnotationSpec][google.cloud.aiplatform.v1beta1.DatasetService.GetAnnotationSpec]. -message GetAnnotationSpecRequest { - // Required. The name of the AnnotationSpec resource. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/AnnotationSpec" - } - ]; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 2; -} - -// Request message for [DatasetService.ListAnnotations][google.cloud.aiplatform.v1beta1.DatasetService.ListAnnotations]. -message ListAnnotationsRequest { - // Required. The resource name of the DataItem to list Annotations from. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/DataItem" - } - ]; - - // The standard list filter. - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; - - // A comma-separated list of fields to order by, sorted in ascending order. - // Use "desc" after a field name for descending. - string order_by = 6; -} - -// Response message for [DatasetService.ListAnnotations][google.cloud.aiplatform.v1beta1.DatasetService.ListAnnotations]. -message ListAnnotationsResponse { - // A list of Annotations that matches the specified filter in the request. - repeated Annotation annotations = 1; - - // The standard List next-page token. - string next_page_token = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto deleted file mode 100644 index fd20f4d6..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto +++ /dev/null @@ -1,42 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "DeployedIndexRefProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Points to a DeployedIndex. -message DeployedIndexRef { - // Immutable. A resource name of the IndexEndpoint. - string index_endpoint = 1 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/IndexEndpoint" - } - ]; - - // Immutable. The ID of the DeployedIndex in the above IndexEndpoint. - string deployed_index_id = 2 [(google.api.field_behavior) = IMMUTABLE]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto deleted file mode 100644 index 337ba55e..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto +++ /dev/null @@ -1,42 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "DeployedModelNameProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Points to a DeployedModel. -message DeployedModelRef { - // Immutable. A resource name of an Endpoint. - string endpoint = 1 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Endpoint" - } - ]; - - // Immutable. An ID of a DeployedModel in the above Endpoint. - string deployed_model_id = 2 [(google.api.field_behavior) = IMMUTABLE]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto deleted file mode 100644 index 27e2bade..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto +++ /dev/null @@ -1,38 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "EncryptionSpecProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Represents a customer-managed encryption key spec that can be applied to -// a top-level resource. -message EncryptionSpec { - // Required. The Cloud KMS resource identifier of the customer managed encryption key - // used to protect a resource. Has the form: - // `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. - // The key needs to be in the same region as where the compute resource is - // created. - string kms_key_name = 1 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto deleted file mode 100644 index b2d12694..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto +++ /dev/null @@ -1,252 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1beta1/explanation.proto"; -import "google/cloud/aiplatform/v1beta1/io.proto"; -import "google/cloud/aiplatform/v1beta1/machine_resources.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "EndpointProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Models are deployed into it, and afterwards Endpoint is called to obtain -// predictions and explanations. -message Endpoint { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Endpoint" - pattern: "projects/{project}/locations/{location}/endpoints/{endpoint}" - }; - - // Output only. The resource name of the Endpoint. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The display name of the Endpoint. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // The description of the Endpoint. - string description = 3; - - // Output only. The models deployed in this Endpoint. - // To add or remove DeployedModels use [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel] and - // [EndpointService.UndeployModel][google.cloud.aiplatform.v1beta1.EndpointService.UndeployModel] respectively. - repeated DeployedModel deployed_models = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // A map from a DeployedModel's ID to the percentage of this Endpoint's - // traffic that should be forwarded to that DeployedModel. - // - // If a DeployedModel's ID is not listed in this map, then it receives no - // traffic. - // - // The traffic percentage values must add up to 100, or map must be empty if - // the Endpoint is to not accept any traffic at a moment. - map traffic_split = 5; - - // Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 6; - - // The labels with user-defined metadata to organize your Endpoints. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 7; - - // Output only. Timestamp when this Endpoint was created. - google.protobuf.Timestamp create_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Endpoint was last updated. - google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Customer-managed encryption key spec for an Endpoint. If set, this - // Endpoint and all sub-resources of this Endpoint will be secured by - // this key. - EncryptionSpec encryption_spec = 10; - - // The full name of the Google Compute Engine - // [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks) - // to which the Endpoint should be peered. - // - // Private services access must already be configured for the network. If left - // unspecified, the Endpoint is not peered with any network. - // - // Only one of the fields, [network][google.cloud.aiplatform.v1beta1.Endpoint.network] or - // [enable_private_service_connect][google.cloud.aiplatform.v1beta1.Endpoint.enable_private_service_connect], - // can be set. - // - // [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert): - // `projects/{project}/global/networks/{network}`. - // Where `{project}` is a project number, as in `12345`, and `{network}` is - // network name. - string network = 13 [(google.api.resource_reference) = { - type: "compute.googleapis.com/Network" - }]; - - // Deprecated: If true, expose the Endpoint via private service connect. - // - // Only one of the fields, [network][google.cloud.aiplatform.v1beta1.Endpoint.network] or - // [enable_private_service_connect][google.cloud.aiplatform.v1beta1.Endpoint.enable_private_service_connect], - // can be set. - bool enable_private_service_connect = 17 [deprecated = true]; - - // Output only. Resource name of the Model Monitoring job associated with this Endpoint - // if monitoring is enabled by [CreateModelDeploymentMonitoringJob][]. - // Format: - // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - string model_deployment_monitoring_job = 14 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" - } - ]; - - // Configures the request-response logging for online prediction. - PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; -} - -// A deployment of a Model. Endpoints contain one or more DeployedModels. -message DeployedModel { - // The prediction (for example, the machine) resources that the DeployedModel - // uses. The user is billed for the resources (at least their minimal amount) - // even if the DeployedModel receives no traffic. - // Not all Models support all resources types. See - // [Model.supported_deployment_resources_types][google.cloud.aiplatform.v1beta1.Model.supported_deployment_resources_types]. - oneof prediction_resources { - // A description of resources that are dedicated to the DeployedModel, and - // that need a higher degree of manual configuration. - DedicatedResources dedicated_resources = 7; - - // A description of resources that to large degree are decided by Vertex - // AI, and require only a modest additional configuration. - AutomaticResources automatic_resources = 8; - } - - // Immutable. The ID of the DeployedModel. If not provided upon deployment, Vertex AI - // will generate a value for this ID. - // - // This value should be 1-10 characters, and valid characters are /[0-9]/. - string id = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Required. The name of the Model that this is the deployment of. Note that the Model - // may be in a different location than the DeployedModel's Endpoint. - string model = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - - // Output only. The version ID of the model that is deployed. - string model_version_id = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The display name of the DeployedModel. If not provided upon creation, - // the Model's display_name is used. - string display_name = 3; - - // Output only. Timestamp when the DeployedModel was created. - google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Explanation configuration for this DeployedModel. - // - // When deploying a Model using [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel], this value - // overrides the value of [Model.explanation_spec][google.cloud.aiplatform.v1beta1.Model.explanation_spec]. All fields of - // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] are optional in the request. If a field of - // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] is not populated, the value of the same field of - // [Model.explanation_spec][google.cloud.aiplatform.v1beta1.Model.explanation_spec] is inherited. If the corresponding - // [Model.explanation_spec][google.cloud.aiplatform.v1beta1.Model.explanation_spec] is not populated, all fields of the - // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] will be used for the explanation configuration. - ExplanationSpec explanation_spec = 9; - - // The service account that the DeployedModel's container runs as. Specify the - // email address of the service account. If this service account is not - // specified, the container runs as a service account that doesn't have access - // to the resource project. - // - // Users deploying the Model must have the `iam.serviceAccounts.actAs` - // permission on this service account. - string service_account = 11; - - // If true, the container of the DeployedModel instances will send `stderr` - // and `stdout` streams to Stackdriver Logging. - // - // Only supported for custom-trained Models and AutoML Tabular Models. - bool enable_container_logging = 12; - - // These logs are like standard server access logs, containing - // information like timestamp and latency for each prediction request. - // - // Note that Stackdriver logs may incur a cost, especially if your project - // receives prediction requests at a high queries per second rate (QPS). - // Estimate your costs before enabling this option. - bool enable_access_logging = 13; - - // Output only. Provide paths for users to send predict/explain/health requests directly to - // the deployed model services running on Cloud via private services access. - // This field is populated if [network][google.cloud.aiplatform.v1beta1.Endpoint.network] is configured. - PrivateEndpoints private_endpoints = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// PrivateEndpoints proto is used to provide paths for users to send -// requests privately. -// To send request via private service access, use predict_http_uri, -// explain_http_uri or health_http_uri. To send request via private service -// connect, use service_attachment. -message PrivateEndpoints { - // Output only. Http(s) path to send prediction requests. - string predict_http_uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Http(s) path to send explain requests. - string explain_http_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Http(s) path to send health check requests. - string health_http_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The name of the service attachment resource. Populated if private service - // connect is enabled. - string service_attachment = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Configuration for logging request-response to a BigQuery table. -message PredictRequestResponseLoggingConfig { - // If logging is enabled or not. - bool enabled = 1; - - // Percentage of requests to be logged, expressed as a fraction in - // range(0,1]. - double sampling_rate = 2; - - // BigQuery table for logging. - // If only given a project, a new dataset will be created with name - // `logging__` where - // will be made BigQuery-dataset-name compatible (e.g. - // most special characters will become underscores). If no table name is - // given, a new table will be created with name `request_response_logging` - BigQueryDestination bigquery_destination = 3; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto deleted file mode 100644 index e30077dc..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto +++ /dev/null @@ -1,315 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/endpoint.proto"; -import "google/cloud/aiplatform/v1beta1/operation.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "EndpointServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A service for managing Vertex AI's Endpoints. -service EndpointService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates an Endpoint. - rpc CreateEndpoint(CreateEndpointRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/endpoints" - body: "endpoint" - }; - option (google.api.method_signature) = "parent,endpoint"; - option (google.api.method_signature) = "parent,endpoint,endpoint_id"; - option (google.longrunning.operation_info) = { - response_type: "Endpoint" - metadata_type: "CreateEndpointOperationMetadata" - }; - } - - // Gets an Endpoint. - rpc GetEndpoint(GetEndpointRequest) returns (Endpoint) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/endpoints/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Endpoints in a Location. - rpc ListEndpoints(ListEndpointsRequest) returns (ListEndpointsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/endpoints" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates an Endpoint. - rpc UpdateEndpoint(UpdateEndpointRequest) returns (Endpoint) { - option (google.api.http) = { - patch: "/v1beta1/{endpoint.name=projects/*/locations/*/endpoints/*}" - body: "endpoint" - }; - option (google.api.method_signature) = "endpoint,update_mask"; - } - - // Deletes an Endpoint. - rpc DeleteEndpoint(DeleteEndpointRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/endpoints/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Deploys a Model into this Endpoint, creating a DeployedModel within it. - rpc DeployModel(DeployModelRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:deployModel" - body: "*" - }; - option (google.api.method_signature) = "endpoint,deployed_model,traffic_split"; - option (google.longrunning.operation_info) = { - response_type: "DeployModelResponse" - metadata_type: "DeployModelOperationMetadata" - }; - } - - // Undeploys a Model from an Endpoint, removing a DeployedModel from it, and - // freeing all resources it's using. - rpc UndeployModel(UndeployModelRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:undeployModel" - body: "*" - }; - option (google.api.method_signature) = "endpoint,deployed_model_id,traffic_split"; - option (google.longrunning.operation_info) = { - response_type: "UndeployModelResponse" - metadata_type: "UndeployModelOperationMetadata" - }; - } -} - -// Request message for [EndpointService.CreateEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.CreateEndpoint]. -message CreateEndpointRequest { - // Required. The resource name of the Location to create the Endpoint in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The Endpoint to create. - Endpoint endpoint = 2 [(google.api.field_behavior) = REQUIRED]; - - // Immutable. The ID to use for endpoint, which will become the final - // component of the endpoint resource name. - // If not provided, Vertex AI will generate a value for this ID. - // - // This value should be 1-10 characters, and valid characters are /[0-9]/. - // When using HTTP/JSON, this field is populated based on a query string - // argument, such as `?endpoint_id=12345`. This is the fallback for fields - // that are not included in either the URI or the body. - string endpoint_id = 4 [(google.api.field_behavior) = IMMUTABLE]; -} - -// Runtime operation information for [EndpointService.CreateEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.CreateEndpoint]. -message CreateEndpointOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [EndpointService.GetEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.GetEndpoint] -message GetEndpointRequest { - // Required. The name of the Endpoint resource. - // Format: - // `projects/{project}/locations/{location}/endpoints/{endpoint}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Endpoint" - } - ]; -} - -// Request message for [EndpointService.ListEndpoints][google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints]. -message ListEndpointsRequest { - // Required. The resource name of the Location from which to list the Endpoints. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. An expression for filtering the results of the request. For field names - // both snake_case and camelCase are supported. - // - // * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID, - // i.e. the last segment of the Endpoint's [resource name][google.cloud.aiplatform.v1beta1.Endpoint.name]. - // * `display_name` supports = and, != - // * `labels` supports general map functions that is: - // * `labels.key=value` - key:value equality - // * `labels.key:* or labels:key - key existence - // * A key including a space must be quoted. `labels."a key"`. - // - // Some examples: - // * `endpoint=1` - // * `displayName="myDisplayName"` - // * `labels.myKey="myValue"` - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The standard list page size. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The standard list page token. - // Typically obtained via - // [ListEndpointsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListEndpointsResponse.next_page_token] of the previous - // [EndpointService.ListEndpoints][google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints] call. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for [EndpointService.ListEndpoints][google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints]. -message ListEndpointsResponse { - // List of Endpoints in the requested page. - repeated Endpoint endpoints = 1; - - // A token to retrieve the next page of results. - // Pass to [ListEndpointsRequest.page_token][google.cloud.aiplatform.v1beta1.ListEndpointsRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.UpdateEndpoint]. -message UpdateEndpointRequest { - // Required. The Endpoint which replaces the resource on the server. - Endpoint endpoint = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The update mask applies to the resource. See [google.protobuf.FieldMask][google.protobuf.FieldMask]. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [EndpointService.DeleteEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.DeleteEndpoint]. -message DeleteEndpointRequest { - // Required. The name of the Endpoint resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/endpoints/{endpoint}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Endpoint" - } - ]; -} - -// Request message for [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel]. -message DeployModelRequest { - // Required. The name of the Endpoint resource into which to deploy a Model. - // Format: - // `projects/{project}/locations/{location}/endpoints/{endpoint}` - string endpoint = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Endpoint" - } - ]; - - // Required. The DeployedModel to be created within the Endpoint. Note that - // [Endpoint.traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] must be updated for the DeployedModel to start - // receiving traffic, either as part of this call, or via - // [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.UpdateEndpoint]. - DeployedModel deployed_model = 2 [(google.api.field_behavior) = REQUIRED]; - - // A map from a DeployedModel's ID to the percentage of this Endpoint's - // traffic that should be forwarded to that DeployedModel. - // - // If this field is non-empty, then the Endpoint's - // [traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] will be overwritten with it. - // To refer to the ID of the just being deployed Model, a "0" should be used, - // and the actual ID of the new DeployedModel will be filled in its place by - // this method. The traffic percentage values must add up to 100. - // - // If this field is empty, then the Endpoint's - // [traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] is not updated. - map traffic_split = 3; -} - -// Response message for [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel]. -message DeployModelResponse { - // The DeployedModel that had been deployed in the Endpoint. - DeployedModel deployed_model = 1; -} - -// Runtime operation information for [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel]. -message DeployModelOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [EndpointService.UndeployModel][google.cloud.aiplatform.v1beta1.EndpointService.UndeployModel]. -message UndeployModelRequest { - // Required. The name of the Endpoint resource from which to undeploy a Model. - // Format: - // `projects/{project}/locations/{location}/endpoints/{endpoint}` - string endpoint = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Endpoint" - } - ]; - - // Required. The ID of the DeployedModel to be undeployed from the Endpoint. - string deployed_model_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // If this field is provided, then the Endpoint's - // [traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] will be overwritten with it. If - // last DeployedModel is being undeployed from the Endpoint, the - // [Endpoint.traffic_split] will always end up empty when this call returns. - // A DeployedModel will be successfully undeployed only if it doesn't have - // any traffic assigned to it when this method executes, or if this field - // unassigns any traffic to it. - map traffic_split = 3; -} - -// Response message for [EndpointService.UndeployModel][google.cloud.aiplatform.v1beta1.EndpointService.UndeployModel]. -message UndeployModelResponse { - -} - -// Runtime operation information for [EndpointService.UndeployModel][google.cloud.aiplatform.v1beta1.EndpointService.UndeployModel]. -message UndeployModelOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/entity_type.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/entity_type.proto deleted file mode 100644 index 14f762ba..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/entity_type.proto +++ /dev/null @@ -1,86 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "EntityTypeProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// An entity type is a type of object in a system that needs to be modeled and -// have stored information about. For example, driver is an entity type, and -// driver0 is an instance of an entity type driver. -message EntityType { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/EntityType" - pattern: "projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}" - }; - - // Immutable. Name of the EntityType. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - // - // The last part entity_type is assigned by the client. The entity_type can be - // up to 64 characters long and can consist only of ASCII Latin letters A-Z - // and a-z and underscore(_), and ASCII digits 0-9 starting with a letter. The - // value will be unique given a featurestore. - string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Optional. Description of the EntityType. - string description = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Timestamp when this EntityType was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this EntityType was most recently updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The labels with user-defined metadata to organize your EntityTypes. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information on and examples of labels. - // No more than 64 user labels can be associated with one EntityType (System - // labels are excluded)." - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. - map labels = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Used to perform a consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The default monitoring configuration for all Features with value type - // ([Feature.ValueType][google.cloud.aiplatform.v1beta1.Feature.ValueType]) BOOL, STRING, DOUBLE or INT64 under this - // EntityType. - // - // If this is populated with - // [FeaturestoreMonitoringConfig.monitoring_interval] specified, snapshot - // analysis monitoring is enabled. Otherwise, snapshot analysis monitoring is - // disabled. - FeaturestoreMonitoringConfig monitoring_config = 8 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/env_var.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/env_var.proto deleted file mode 100644 index 5e1d677b..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/env_var.proto +++ /dev/null @@ -1,42 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "EnvVarProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Represents an environment variable present in a Container or Python Module. -message EnvVar { - // Required. Name of the environment variable. Must be a valid C identifier. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Variables that reference a $(VAR_NAME) are expanded - // using the previous defined environment variables in the container and - // any service environment variables. If a variable cannot be resolved, - // the reference in the input string will be unchanged. The $(VAR_NAME) - // syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped - // references will never be expanded, regardless of whether the variable - // exists or not. - string value = 2 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/event.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/event.proto deleted file mode 100644 index 5cbb25c8..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/event.proto +++ /dev/null @@ -1,80 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "EventProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// An edge describing the relationship between an Artifact and an Execution in -// a lineage graph. -message Event { - // Describes whether an Event's Artifact is the Execution's input or output. - enum Type { - // Unspecified whether input or output of the Execution. - TYPE_UNSPECIFIED = 0; - - // An input of the Execution. - INPUT = 1; - - // An output of the Execution. - OUTPUT = 2; - } - - // Required. The relative resource name of the Artifact in the Event. - string artifact = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Artifact" - } - ]; - - // Output only. The relative resource name of the Execution in the Event. - string execution = 2 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Execution" - } - ]; - - // Output only. Time the Event occurred. - google.protobuf.Timestamp event_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The type of the Event. - Type type = 4 [(google.api.field_behavior) = REQUIRED]; - - // The labels with user-defined metadata to annotate Events. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one Event (System - // labels are excluded). - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. - map labels = 5; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/execution.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/execution.proto deleted file mode 100644 index 74395db9..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/execution.proto +++ /dev/null @@ -1,115 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ExecutionProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Instance of a general execution. -message Execution { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Execution" - pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}" - }; - - // Describes the state of the Execution. - enum State { - // Unspecified Execution state - STATE_UNSPECIFIED = 0; - - // The Execution is new - NEW = 1; - - // The Execution is running - RUNNING = 2; - - // The Execution has finished running - COMPLETE = 3; - - // The Execution has failed - FAILED = 4; - - // The Execution completed through Cache hit. - CACHED = 5; - - // The Execution was cancelled. - CANCELLED = 6; - } - - // Output only. The resource name of the Execution. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User provided display name of the Execution. - // May be up to 128 Unicode characters. - string display_name = 2; - - // The state of this Execution. This is a property of the Execution, and does - // not imply or capture any ongoing process. This property is managed by - // clients (such as Vertex AI Pipelines) and the system does not prescribe - // or check the validity of state transitions. - State state = 6; - - // An eTag used to perform consistent read-modify-write updates. If not set, a - // blind "overwrite" update happens. - string etag = 9; - - // The labels with user-defined metadata to organize your Executions. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one Execution (System - // labels are excluded). - map labels = 10; - - // Output only. Timestamp when this Execution was created. - google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Execution was last updated. - google.protobuf.Timestamp update_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The title of the schema describing the metadata. - // - // Schema title and version is expected to be registered in earlier Create - // Schema calls. And both are used together as unique identifiers to identify - // schemas within the local metadata store. - string schema_title = 13; - - // The version of the schema in `schema_title` to use. - // - // Schema title and version is expected to be registered in earlier Create - // Schema calls. And both are used together as unique identifiers to identify - // schemas within the local metadata store. - string schema_version = 14; - - // Properties of the Execution. - // The size of this field should not exceed 200KB. - google.protobuf.Struct metadata = 15; - - // Description of the Execution - string description = 16; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto deleted file mode 100644 index 11e4c6c5..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation.proto +++ /dev/null @@ -1,520 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/cloud/aiplatform/v1beta1/explanation_metadata.proto"; -import "google/cloud/aiplatform/v1beta1/io.proto"; -import "google/protobuf/struct.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ExplanationProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Explanation of a prediction (provided in [PredictResponse.predictions][google.cloud.aiplatform.v1beta1.PredictResponse.predictions]) -// produced by the Model on a given [instance][google.cloud.aiplatform.v1beta1.ExplainRequest.instances]. -message Explanation { - // Output only. Feature attributions grouped by predicted outputs. - // - // For Models that predict only one output, such as regression Models that - // predict only one score, there is only one attibution that explains the - // predicted output. For Models that predict multiple outputs, such as - // multiclass Models that predict multiple classes, each element explains one - // specific item. [Attribution.output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index] can be used to identify which - // output this attribution is explaining. - // - // If users set [ExplanationParameters.top_k][google.cloud.aiplatform.v1beta1.ExplanationParameters.top_k], the attributions are sorted - // by [instance_output_value][Attributions.instance_output_value] in - // descending order. If [ExplanationParameters.output_indices][google.cloud.aiplatform.v1beta1.ExplanationParameters.output_indices] is specified, - // the attributions are stored by [Attribution.output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index] in the same - // order as they appear in the output_indices. - repeated Attribution attributions = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. List of the nearest neighbors for example-based explanations. - // - // For models deployed with the examples explanations feature enabled, the - // attributions field is empty and instead the neighbors field is populated. - repeated Neighbor neighbors = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Aggregated explanation metrics for a Model over a set of instances. -message ModelExplanation { - // Output only. Aggregated attributions explaining the Model's prediction outputs over the - // set of instances. The attributions are grouped by outputs. - // - // For Models that predict only one output, such as regression Models that - // predict only one score, there is only one attibution that explains the - // predicted output. For Models that predict multiple outputs, such as - // multiclass Models that predict multiple classes, each element explains one - // specific item. [Attribution.output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index] can be used to identify which - // output this attribution is explaining. - // - // The [baselineOutputValue][google.cloud.aiplatform.v1beta1.Attribution.baseline_output_value], - // [instanceOutputValue][google.cloud.aiplatform.v1beta1.Attribution.instance_output_value] and - // [featureAttributions][google.cloud.aiplatform.v1beta1.Attribution.feature_attributions] fields are - // averaged over the test data. - // - // NOTE: Currently AutoML tabular classification Models produce only one - // attribution, which averages attributions over all the classes it predicts. - // [Attribution.approximation_error][google.cloud.aiplatform.v1beta1.Attribution.approximation_error] is not populated. - repeated Attribution mean_attributions = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Attribution that explains a particular prediction output. -message Attribution { - // Output only. Model predicted output if the input instance is constructed from the - // baselines of all the features defined in [ExplanationMetadata.inputs][google.cloud.aiplatform.v1beta1.ExplanationMetadata.inputs]. - // The field name of the output is determined by the key in - // [ExplanationMetadata.outputs][google.cloud.aiplatform.v1beta1.ExplanationMetadata.outputs]. - // - // If the Model's predicted output has multiple dimensions (rank > 1), this is - // the value in the output located by [output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index]. - // - // If there are multiple baselines, their output values are averaged. - double baseline_output_value = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Model predicted output on the corresponding [explanation - // instance][ExplainRequest.instances]. The field name of the output is - // determined by the key in [ExplanationMetadata.outputs][google.cloud.aiplatform.v1beta1.ExplanationMetadata.outputs]. - // - // If the Model predicted output has multiple dimensions, this is the value in - // the output located by [output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index]. - double instance_output_value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Attributions of each explained feature. Features are extracted from - // the [prediction instances][google.cloud.aiplatform.v1beta1.ExplainRequest.instances] according to - // [explanation metadata for inputs][google.cloud.aiplatform.v1beta1.ExplanationMetadata.inputs]. - // - // The value is a struct, whose keys are the name of the feature. The values - // are how much the feature in the [instance][google.cloud.aiplatform.v1beta1.ExplainRequest.instances] - // contributed to the predicted result. - // - // The format of the value is determined by the feature's input format: - // - // * If the feature is a scalar value, the attribution value is a - // [floating number][google.protobuf.Value.number_value]. - // - // * If the feature is an array of scalar values, the attribution value is - // an [array][google.protobuf.Value.list_value]. - // - // * If the feature is a struct, the attribution value is a - // [struct][google.protobuf.Value.struct_value]. The keys in the - // attribution value struct are the same as the keys in the feature - // struct. The formats of the values in the attribution struct are - // determined by the formats of the values in the feature struct. - // - // The [ExplanationMetadata.feature_attributions_schema_uri][google.cloud.aiplatform.v1beta1.ExplanationMetadata.feature_attributions_schema_uri] field, - // pointed to by the [ExplanationSpec][google.cloud.aiplatform.v1beta1.ExplanationSpec] field of the - // [Endpoint.deployed_models][google.cloud.aiplatform.v1beta1.Endpoint.deployed_models] object, points to the schema file that - // describes the features and their attribution values (if it is populated). - google.protobuf.Value feature_attributions = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The index that locates the explained prediction output. - // - // If the prediction output is a scalar value, output_index is not populated. - // If the prediction output has multiple dimensions, the length of the - // output_index list is the same as the number of dimensions of the output. - // The i-th element in output_index is the element index of the i-th dimension - // of the output vector. Indices start from 0. - repeated int32 output_index = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The display name of the output identified by [output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index]. For example, - // the predicted class name by a multi-classification Model. - // - // This field is only populated iff the Model predicts display names as a - // separate field along with the explained output. The predicted display name - // must has the same shape of the explained output, and can be located using - // output_index. - string output_display_name = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Error of [feature_attributions][google.cloud.aiplatform.v1beta1.Attribution.feature_attributions] caused by approximation used in the - // explanation method. Lower value means more precise attributions. - // - // * For Sampled Shapley - // [attribution][google.cloud.aiplatform.v1beta1.ExplanationParameters.sampled_shapley_attribution], - // increasing [path_count][google.cloud.aiplatform.v1beta1.SampledShapleyAttribution.path_count] might reduce - // the error. - // * For Integrated Gradients - // [attribution][google.cloud.aiplatform.v1beta1.ExplanationParameters.integrated_gradients_attribution], - // increasing [step_count][google.cloud.aiplatform.v1beta1.IntegratedGradientsAttribution.step_count] might - // reduce the error. - // * For [XRAI attribution][google.cloud.aiplatform.v1beta1.ExplanationParameters.xrai_attribution], - // increasing - // [step_count][google.cloud.aiplatform.v1beta1.XraiAttribution.step_count] might reduce the error. - // - // See [this introduction](/vertex-ai/docs/explainable-ai/overview) - // for more information. - double approximation_error = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the explain output. Specified as the key in - // [ExplanationMetadata.outputs][google.cloud.aiplatform.v1beta1.ExplanationMetadata.outputs]. - string output_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Neighbors for example-based explanations. -message Neighbor { - // Output only. The neighbor id. - string neighbor_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The neighbor distance. - double neighbor_distance = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Specification of Model explanation. -message ExplanationSpec { - // Required. Parameters that configure explaining of the Model's predictions. - ExplanationParameters parameters = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Metadata describing the Model's input and output for explanation. - ExplanationMetadata metadata = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Parameters to configure explaining for Model's predictions. -message ExplanationParameters { - oneof method { - // An attribution method that approximates Shapley values for features that - // contribute to the label being predicted. A sampling strategy is used to - // approximate the value rather than considering all subsets of features. - // Refer to this paper for model details: https://arxiv.org/abs/1306.4265. - SampledShapleyAttribution sampled_shapley_attribution = 1; - - // An attribution method that computes Aumann-Shapley values taking - // advantage of the model's fully differentiable structure. Refer to this - // paper for more details: https://arxiv.org/abs/1703.01365 - IntegratedGradientsAttribution integrated_gradients_attribution = 2; - - // An attribution method that redistributes Integrated Gradients - // attribution to segmented regions, taking advantage of the model's fully - // differentiable structure. Refer to this paper for - // more details: https://arxiv.org/abs/1906.02825 - // - // XRAI currently performs better on natural images, like a picture of a - // house or an animal. If the images are taken in artificial environments, - // like a lab or manufacturing line, or from diagnostic equipment, like - // x-rays or quality-control cameras, use Integrated Gradients instead. - XraiAttribution xrai_attribution = 3; - - // Example-based explanations that returns the nearest neighbors from the - // provided dataset. - Examples examples = 7; - } - - // If populated, returns attributions for top K indices of outputs - // (defaults to 1). Only applies to Models that predicts more than one outputs - // (e,g, multi-class Models). When set to -1, returns explanations for all - // outputs. - int32 top_k = 4; - - // If populated, only returns attributions that have - // [output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index] contained in output_indices. It - // must be an ndarray of integers, with the same shape of the output it's - // explaining. - // - // 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 populated, returns the argmax - // index of the outputs. - // - // Only applicable to Models that predict multiple outputs (e,g, multi-class - // Models that predict multiple classes). - google.protobuf.ListValue output_indices = 5; -} - -// An attribution method that approximates Shapley values for features that -// contribute to the label being predicted. A sampling strategy is used to -// approximate the value rather than considering all subsets of features. -message SampledShapleyAttribution { - // Required. The number of feature permutations to consider when approximating the - // Shapley values. - // - // Valid range of its value is [1, 50], inclusively. - int32 path_count = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// An attribution method that computes the Aumann-Shapley value taking advantage -// of the model's fully differentiable structure. Refer to this paper for -// more details: https://arxiv.org/abs/1703.01365 -message IntegratedGradientsAttribution { - // Required. The number of steps for approximating the path integral. - // A good value to start is 50 and gradually increase until the - // sum to diff property is within the desired error range. - // - // Valid range of its value is [1, 100], inclusively. - int32 step_count = 1 [(google.api.field_behavior) = REQUIRED]; - - // Config for SmoothGrad approximation of gradients. - // - // When enabled, the gradients are approximated by averaging the gradients - // from noisy samples in the vicinity of the inputs. Adding - // noise can help improve the computed gradients. Refer to this paper for more - // details: https://arxiv.org/pdf/1706.03825.pdf - SmoothGradConfig smooth_grad_config = 2; - - // Config for IG with blur baseline. - // - // When enabled, a linear path from the maximally blurred image to the input - // image is created. Using a blurred baseline instead of zero (black image) is - // motivated by the BlurIG approach explained here: - // https://arxiv.org/abs/2004.03383 - BlurBaselineConfig blur_baseline_config = 3; -} - -// An explanation method that redistributes Integrated Gradients -// attributions to segmented regions, taking advantage of the model's fully -// differentiable structure. Refer to this paper for more details: -// https://arxiv.org/abs/1906.02825 -// -// Supported only by image Models. -message XraiAttribution { - // Required. The number of steps for approximating the path integral. - // A good value to start is 50 and gradually increase until the - // sum to diff property is met within the desired error range. - // - // Valid range of its value is [1, 100], inclusively. - int32 step_count = 1 [(google.api.field_behavior) = REQUIRED]; - - // Config for SmoothGrad approximation of gradients. - // - // When enabled, the gradients are approximated by averaging the gradients - // from noisy samples in the vicinity of the inputs. Adding - // noise can help improve the computed gradients. Refer to this paper for more - // details: https://arxiv.org/pdf/1706.03825.pdf - SmoothGradConfig smooth_grad_config = 2; - - // Config for XRAI with blur baseline. - // - // When enabled, a linear path from the maximally blurred image to the input - // image is created. Using a blurred baseline instead of zero (black image) is - // motivated by the BlurIG approach explained here: - // https://arxiv.org/abs/2004.03383 - BlurBaselineConfig blur_baseline_config = 3; -} - -// Config for SmoothGrad approximation of gradients. -// -// When enabled, the gradients are approximated by averaging the gradients from -// noisy samples in the vicinity of the inputs. Adding noise can help improve -// the computed gradients. Refer to this paper for more details: -// https://arxiv.org/pdf/1706.03825.pdf -message SmoothGradConfig { - // Represents the standard deviation of the gaussian kernel - // that will be used to add noise to the interpolated inputs - // prior to computing gradients. - oneof GradientNoiseSigma { - // This is a single float value and will be used to add noise to all the - // features. Use this field when all features are normalized to have the - // same distribution: scale to range [0, 1], [-1, 1] or z-scoring, where - // features are normalized to have 0-mean and 1-variance. Learn more about - // [normalization](https://developers.google.com/machine-learning/data-prep/transform/normalization). - // - // For best results the recommended value is about 10% - 20% of the standard - // deviation of the input feature. Refer to section 3.2 of the SmoothGrad - // paper: https://arxiv.org/pdf/1706.03825.pdf. Defaults to 0.1. - // - // If the distribution is different per feature, set - // [feature_noise_sigma][google.cloud.aiplatform.v1beta1.SmoothGradConfig.feature_noise_sigma] instead - // for each feature. - float noise_sigma = 1; - - // This is similar to [noise_sigma][google.cloud.aiplatform.v1beta1.SmoothGradConfig.noise_sigma], but - // provides additional flexibility. A separate noise sigma can be provided - // for each feature, which is useful if their distributions are different. - // No noise is added to features that are not set. If this field is unset, - // [noise_sigma][google.cloud.aiplatform.v1beta1.SmoothGradConfig.noise_sigma] will be used for all - // features. - FeatureNoiseSigma feature_noise_sigma = 2; - } - - // The number of gradient samples to use for - // approximation. The higher this number, the more accurate the gradient - // is, but the runtime complexity increases by this factor as well. - // Valid range of its value is [1, 50]. Defaults to 3. - int32 noisy_sample_count = 3; -} - -// Noise sigma by features. Noise sigma represents the standard deviation of the -// gaussian kernel that will be used to add noise to interpolated inputs prior -// to computing gradients. -message FeatureNoiseSigma { - // Noise sigma for a single feature. - message NoiseSigmaForFeature { - // The name of the input feature for which noise sigma is provided. The - // features are defined in - // [explanation metadata inputs][google.cloud.aiplatform.v1beta1.ExplanationMetadata.inputs]. - string name = 1; - - // This represents the standard deviation of the Gaussian kernel that will - // be used to add noise to the feature prior to computing gradients. Similar - // to [noise_sigma][google.cloud.aiplatform.v1beta1.SmoothGradConfig.noise_sigma] but represents the - // noise added to the current feature. Defaults to 0.1. - float sigma = 2; - } - - // Noise sigma per feature. No noise is added to features that are not set. - repeated NoiseSigmaForFeature noise_sigma = 1; -} - -// Config for blur baseline. -// -// When enabled, a linear path from the maximally blurred image to the input -// image is created. Using a blurred baseline instead of zero (black image) is -// motivated by the BlurIG approach explained here: -// https://arxiv.org/abs/2004.03383 -message BlurBaselineConfig { - // The standard deviation of the blur kernel for the blurred baseline. The - // same blurring parameter is used for both the height and the width - // dimension. If not set, the method defaults to the zero (i.e. black for - // images) baseline. - float max_blur_sigma = 1; -} - -// Example-based explainability that returns the nearest neighbors from the -// provided dataset. -message Examples { - oneof config { - // The configuration for the generated index, the semantics are the same as - // [metadata][google.cloud.aiplatform.v1beta1.Index.metadata] and should match NearestNeighborSearchConfig. - google.protobuf.Value nearest_neighbor_search_config = 2; - - // Preset config based on the desired query speed-precision trade-off - // and modality - Preset preset = 4; - } - - // The Cloud Storage location for the input instances. - GcsSource gcs_source = 1; - - // The number of neighbors to return. - int32 neighbor_count = 3; -} - -// Preset configuration for example-based explanations -message Preset { - // Preset option controlling parameters for query speed-precision trade-off - enum Query { - // More precise neighbors as a trade-off against slower response. - // This is also the default value (field-number 0). - PRECISE = 0; - - // Faster response as a trade-off against less precise neighbors. - FAST = 1; - } - - // Preset option controlling parameters for different modalities - enum Modality { - // Should not be set. Added as a recommended best practice for enums - MODALITY_UNSPECIFIED = 0; - - // IMAGE modality - IMAGE = 1; - - // TEXT modality - TEXT = 2; - - // TABULAR modality - TABULAR = 3; - } - - // Preset option controlling parameters for query speed-precision trade-off - optional Query query = 1; - - // Preset option controlling parameters for different modalities - Modality modality = 2; -} - -// The [ExplanationSpec][google.cloud.aiplatform.v1beta1.ExplanationSpec] entries that can be overridden at -// [online explanation][google.cloud.aiplatform.v1beta1.PredictionService.Explain] time. -message ExplanationSpecOverride { - // The parameters to be overridden. Note that the - // [method][google.cloud.aiplatform.v1beta1.ExplanationParameters.method] cannot be changed. If not specified, - // no parameter is overridden. - ExplanationParameters parameters = 1; - - // The metadata to be overridden. If not specified, no metadata is overridden. - ExplanationMetadataOverride metadata = 2; - - // The example-based explanations parameter overrides. - ExamplesOverride examples_override = 3; -} - -// The [ExplanationMetadata][google.cloud.aiplatform.v1beta1.ExplanationMetadata] entries that can be overridden at -// [online explanation][google.cloud.aiplatform.v1beta1.PredictionService.Explain] time. -message ExplanationMetadataOverride { - // The [input metadata][google.cloud.aiplatform.v1beta1.ExplanationMetadata.InputMetadata] entries to be - // overridden. - message InputMetadataOverride { - // Baseline inputs for this feature. - // - // This overrides the `input_baseline` field of the - // [ExplanationMetadata.InputMetadata][google.cloud.aiplatform.v1beta1.ExplanationMetadata.InputMetadata] - // object of the corresponding feature's input metadata. If it's not - // specified, the original baselines are not overridden. - repeated google.protobuf.Value input_baselines = 1; - } - - // Required. Overrides the [input metadata][google.cloud.aiplatform.v1beta1.ExplanationMetadata.inputs] of the features. - // The key is the name of the feature to be overridden. The keys specified - // here must exist in the input metadata to be overridden. If a feature is - // not specified here, the corresponding feature's input metadata is not - // overridden. - map inputs = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Overrides for example-based explanations. -message ExamplesOverride { - // Data format enum. - enum DataFormat { - // Unspecified format. Must not be used. - DATA_FORMAT_UNSPECIFIED = 0; - - // Provided data is a set of model inputs. - INSTANCES = 1; - - // Provided data is a set of embeddings. - EMBEDDINGS = 2; - } - - // The number of neighbors to return. - int32 neighbor_count = 1; - - // The number of neighbors to return that have the same crowding tag. - int32 crowding_count = 2; - - // Restrict the resulting nearest neighbors to respect these constraints. - repeated ExamplesRestrictionsNamespace restrictions = 3; - - // If true, return the embeddings instead of neighbors. - bool return_embeddings = 4; - - // The format of the data being provided with each call. - DataFormat data_format = 5; -} - -// Restrictions namespace for example-based explanations overrides. -message ExamplesRestrictionsNamespace { - // The namespace name. - string namespace_name = 1; - - // The list of allowed tags. - repeated string allow = 2; - - // The list of deny tags. - repeated string deny = 3; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto deleted file mode 100644 index ef962a51..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto +++ /dev/null @@ -1,398 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/struct.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ExplanationMetadataProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Metadata describing the Model's input and output for explanation. -message ExplanationMetadata { - // Metadata of the input of a feature. - // - // Fields other than [InputMetadata.input_baselines][google.cloud.aiplatform.v1beta1.ExplanationMetadata.InputMetadata.input_baselines] are applicable only - // for Models that are using Vertex AI-provided images for Tensorflow. - message InputMetadata { - // Domain details of the input feature value. Provides numeric information - // about the feature, such as its range (min, max). If the feature has been - // pre-processed, for example with z-scoring, then it provides information - // about how to recover the original feature. For example, if the input - // feature is an image and it has been pre-processed to obtain 0-mean and - // stddev = 1 values, then original_mean, and original_stddev refer to the - // mean and stddev of the original feature (e.g. image tensor) from which - // input feature (with mean = 0 and stddev = 1) was obtained. - message FeatureValueDomain { - // The minimum permissible value for this feature. - float min_value = 1; - - // The maximum permissible value for this feature. - float max_value = 2; - - // If this input feature has been normalized to a mean value of 0, - // the original_mean specifies the mean value of the domain prior to - // normalization. - float original_mean = 3; - - // If this input feature has been normalized to a standard deviation of - // 1.0, the original_stddev specifies the standard deviation of the domain - // prior to normalization. - float original_stddev = 4; - } - - // Visualization configurations for image explanation. - message Visualization { - // Type of the image visualization. Only applicable to - // [Integrated Gradients attribution][google.cloud.aiplatform.v1beta1.ExplanationParameters.integrated_gradients_attribution]. - enum Type { - // Should not be used. - TYPE_UNSPECIFIED = 0; - - // Shows which pixel contributed to the image prediction. - PIXELS = 1; - - // Shows which region contributed to the image prediction by outlining - // the region. - OUTLINES = 2; - } - - // Whether to only highlight pixels with positive contributions, negative - // or both. Defaults to POSITIVE. - enum Polarity { - // Default value. This is the same as POSITIVE. - POLARITY_UNSPECIFIED = 0; - - // Highlights the pixels/outlines that were most influential to the - // model's prediction. - POSITIVE = 1; - - // Setting polarity to negative highlights areas that does not lead to - // the models's current prediction. - NEGATIVE = 2; - - // Shows both positive and negative attributions. - BOTH = 3; - } - - // The color scheme used for highlighting areas. - enum ColorMap { - // Should not be used. - COLOR_MAP_UNSPECIFIED = 0; - - // Positive: green. Negative: pink. - PINK_GREEN = 1; - - // Viridis color map: A perceptually uniform color mapping which is - // easier to see by those with colorblindness and progresses from yellow - // to green to blue. Positive: yellow. Negative: blue. - VIRIDIS = 2; - - // Positive: red. Negative: red. - RED = 3; - - // Positive: green. Negative: green. - GREEN = 4; - - // Positive: green. Negative: red. - RED_GREEN = 6; - - // PiYG palette. - PINK_WHITE_GREEN = 5; - } - - // How the original image is displayed in the visualization. - enum OverlayType { - // Default value. This is the same as NONE. - OVERLAY_TYPE_UNSPECIFIED = 0; - - // No overlay. - NONE = 1; - - // The attributions are shown on top of the original image. - ORIGINAL = 2; - - // The attributions are shown on top of grayscaled version of the - // original image. - GRAYSCALE = 3; - - // The attributions are used as a mask to reveal predictive parts of - // the image and hide the un-predictive parts. - MASK_BLACK = 4; - } - - // Type of the image visualization. Only applicable to - // [Integrated Gradients attribution][google.cloud.aiplatform.v1beta1.ExplanationParameters.integrated_gradients_attribution]. - // OUTLINES shows regions of attribution, while PIXELS shows per-pixel - // attribution. Defaults to OUTLINES. - Type type = 1; - - // Whether to only highlight pixels with positive contributions, negative - // or both. Defaults to POSITIVE. - Polarity polarity = 2; - - // The color scheme used for the highlighted areas. - // - // Defaults to PINK_GREEN for - // [Integrated Gradients attribution][google.cloud.aiplatform.v1beta1.ExplanationParameters.integrated_gradients_attribution], - // which shows positive attributions in green and negative in pink. - // - // Defaults to VIRIDIS for - // [XRAI attribution][google.cloud.aiplatform.v1beta1.ExplanationParameters.xrai_attribution], which - // highlights the most influential regions in yellow and the least - // influential in blue. - ColorMap color_map = 3; - - // Excludes attributions above the specified percentile from the - // highlighted areas. Using the clip_percent_upperbound and - // clip_percent_lowerbound together can be useful for filtering out noise - // and making it easier to see areas of strong attribution. Defaults to - // 99.9. - float clip_percent_upperbound = 4; - - // Excludes attributions below the specified percentile, from the - // highlighted areas. Defaults to 62. - float clip_percent_lowerbound = 5; - - // How the original image is displayed in the visualization. - // Adjusting the overlay can help increase visual clarity if the original - // image makes it difficult to view the visualization. Defaults to NONE. - OverlayType overlay_type = 6; - } - - // Defines how a feature is encoded. Defaults to IDENTITY. - enum Encoding { - // Default value. This is the same as IDENTITY. - ENCODING_UNSPECIFIED = 0; - - // The tensor represents one feature. - IDENTITY = 1; - - // The tensor represents a bag of features where each index maps to - // a feature. [InputMetadata.index_feature_mapping][google.cloud.aiplatform.v1beta1.ExplanationMetadata.InputMetadata.index_feature_mapping] must be provided for - // this encoding. For example: - // ``` - // input = [27, 6.0, 150] - // index_feature_mapping = ["age", "height", "weight"] - // ``` - BAG_OF_FEATURES = 2; - - // The tensor represents a bag of features where each index maps to a - // feature. Zero values in the tensor indicates feature being - // non-existent. [InputMetadata.index_feature_mapping][google.cloud.aiplatform.v1beta1.ExplanationMetadata.InputMetadata.index_feature_mapping] must be provided - // for this encoding. For example: - // ``` - // input = [2, 0, 5, 0, 1] - // index_feature_mapping = ["a", "b", "c", "d", "e"] - // ``` - BAG_OF_FEATURES_SPARSE = 3; - - // The tensor is a list of binaries representing whether a feature exists - // or not (1 indicates existence). [InputMetadata.index_feature_mapping][google.cloud.aiplatform.v1beta1.ExplanationMetadata.InputMetadata.index_feature_mapping] - // must be provided for this encoding. For example: - // ``` - // input = [1, 0, 1, 0, 1] - // index_feature_mapping = ["a", "b", "c", "d", "e"] - // ``` - INDICATOR = 4; - - // The tensor is encoded into a 1-dimensional array represented by an - // encoded tensor. [InputMetadata.encoded_tensor_name][google.cloud.aiplatform.v1beta1.ExplanationMetadata.InputMetadata.encoded_tensor_name] must be provided - // for this encoding. For example: - // ``` - // input = ["This", "is", "a", "test", "."] - // encoded = [0.1, 0.2, 0.3, 0.4, 0.5] - // ``` - COMBINED_EMBEDDING = 5; - - // Select this encoding when the input tensor is encoded into a - // 2-dimensional array represented by an encoded tensor. - // [InputMetadata.encoded_tensor_name][google.cloud.aiplatform.v1beta1.ExplanationMetadata.InputMetadata.encoded_tensor_name] must be provided for this - // encoding. The first dimension of the encoded tensor's shape is the same - // as the input tensor's shape. For example: - // ``` - // input = ["This", "is", "a", "test", "."] - // encoded = [[0.1, 0.2, 0.3, 0.4, 0.5], - // [0.2, 0.1, 0.4, 0.3, 0.5], - // [0.5, 0.1, 0.3, 0.5, 0.4], - // [0.5, 0.3, 0.1, 0.2, 0.4], - // [0.4, 0.3, 0.2, 0.5, 0.1]] - // ``` - CONCAT_EMBEDDING = 6; - } - - // Baseline inputs for this feature. - // - // If no baseline is specified, Vertex AI chooses the baseline for this - // feature. If multiple baselines are specified, Vertex AI returns the - // average attributions across them in [Attribution.feature_attributions][google.cloud.aiplatform.v1beta1.Attribution.feature_attributions]. - // - // For Vertex AI-provided Tensorflow images (both 1.x and 2.x), the shape - // of each baseline must match the shape of the input tensor. If a scalar is - // provided, we broadcast to the same shape as the input tensor. - // - // For custom images, the element of the baselines must be in the same - // format as the feature's input in the - // [instance][google.cloud.aiplatform.v1beta1.ExplainRequest.instances][]. The schema of any single instance - // may be specified via Endpoint's DeployedModels' - // [Model's][google.cloud.aiplatform.v1beta1.DeployedModel.model] - // [PredictSchemata's][google.cloud.aiplatform.v1beta1.Model.predict_schemata] - // [instance_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri]. - repeated google.protobuf.Value input_baselines = 1; - - // Name of the input tensor for this feature. Required and is only - // applicable to Vertex AI-provided images for Tensorflow. - string input_tensor_name = 2; - - // Defines how the feature is encoded into the input tensor. Defaults to - // IDENTITY. - Encoding encoding = 3; - - // Modality of the feature. Valid values are: numeric, image. Defaults to - // numeric. - string modality = 4; - - // The domain details of the input feature value. Like min/max, original - // mean or standard deviation if normalized. - FeatureValueDomain feature_value_domain = 5; - - // Specifies the index of the values of the input tensor. - // Required when the input tensor is a sparse representation. Refer to - // Tensorflow documentation for more details: - // https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor. - string indices_tensor_name = 6; - - // Specifies the shape of the values of the input if the input is a sparse - // representation. Refer to Tensorflow documentation for more details: - // https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor. - string dense_shape_tensor_name = 7; - - // A list of feature names for each index in the input tensor. - // Required when the input [InputMetadata.encoding][google.cloud.aiplatform.v1beta1.ExplanationMetadata.InputMetadata.encoding] is BAG_OF_FEATURES, - // BAG_OF_FEATURES_SPARSE, INDICATOR. - repeated string index_feature_mapping = 8; - - // Encoded tensor is a transformation of the input tensor. Must be provided - // if choosing - // [Integrated Gradients attribution][google.cloud.aiplatform.v1beta1.ExplanationParameters.integrated_gradients_attribution] - // or [XRAI attribution][google.cloud.aiplatform.v1beta1.ExplanationParameters.xrai_attribution] and the - // input tensor is not differentiable. - // - // An encoded tensor is generated if the input tensor is encoded by a lookup - // table. - string encoded_tensor_name = 9; - - // A list of baselines for the encoded tensor. - // - // The shape of each baseline should match the shape of the encoded tensor. - // If a scalar is provided, Vertex AI broadcasts to the same shape as the - // encoded tensor. - repeated google.protobuf.Value encoded_baselines = 10; - - // Visualization configurations for image explanation. - Visualization visualization = 11; - - // Name of the group that the input belongs to. Features with the same group - // name will be treated as one feature when computing attributions. Features - // grouped together can have different shapes in value. If provided, there - // will be one single attribution generated in - // [Attribution.feature_attributions][google.cloud.aiplatform.v1beta1.Attribution.feature_attributions], keyed by the group name. - string group_name = 12; - } - - // Metadata of the prediction output to be explained. - message OutputMetadata { - // Defines how to map [Attribution.output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index] to - // [Attribution.output_display_name][google.cloud.aiplatform.v1beta1.Attribution.output_display_name]. - // - // If neither of the fields are specified, - // [Attribution.output_display_name][google.cloud.aiplatform.v1beta1.Attribution.output_display_name] will not be populated. - oneof display_name_mapping { - // Static mapping between the index and display name. - // - // Use this if the outputs are a deterministic n-dimensional array, e.g. a - // list of scores of all the classes in a pre-defined order for a - // multi-classification Model. It's not feasible if the outputs are - // non-deterministic, e.g. the Model produces top-k classes or sort the - // outputs by their values. - // - // The shape of the value must be an n-dimensional array of strings. The - // number of dimensions must match that of the outputs to be explained. - // The [Attribution.output_display_name][google.cloud.aiplatform.v1beta1.Attribution.output_display_name] is populated by locating in the - // mapping with [Attribution.output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index]. - google.protobuf.Value index_display_name_mapping = 1; - - // Specify a field name in the prediction to look for the display name. - // - // Use this if the prediction contains the display names for the outputs. - // - // The display names in the prediction must have the same shape of the - // outputs, so that it can be located by [Attribution.output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index] for - // a specific output. - string display_name_mapping_key = 2; - } - - // Name of the output tensor. Required and is only applicable to Vertex - // AI provided images for Tensorflow. - string output_tensor_name = 3; - } - - // Required. Map from feature names to feature input metadata. Keys are the name of the - // features. Values are the specification of the feature. - // - // An empty InputMetadata is valid. It describes a text feature which has the - // name specified as the key in [ExplanationMetadata.inputs][google.cloud.aiplatform.v1beta1.ExplanationMetadata.inputs]. The baseline - // of the empty feature is chosen by Vertex AI. - // - // For Vertex AI-provided Tensorflow images, the key can be any friendly - // name of the feature. Once specified, - // [featureAttributions][google.cloud.aiplatform.v1beta1.Attribution.feature_attributions] are keyed by - // this key (if not grouped with another feature). - // - // For custom images, the key must match with the key in - // [instance][google.cloud.aiplatform.v1beta1.ExplainRequest.instances]. - map inputs = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Map from output names to output metadata. - // - // For Vertex AI-provided Tensorflow images, keys can be any user defined - // string that consists of any UTF-8 characters. - // - // For custom images, keys are the name of the output field in the prediction - // to be explained. - // - // Currently only one key is allowed. - map outputs = 2 [(google.api.field_behavior) = REQUIRED]; - - // Points to a YAML file stored on Google Cloud Storage describing the format - // of the [feature attributions][google.cloud.aiplatform.v1beta1.Attribution.feature_attributions]. - // The schema is defined as an OpenAPI 3.0.2 [Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - // AutoML tabular Models always have this field populated by Vertex AI. - // Note: The URI given on output may be different, including the URI scheme, - // than the one given on input. The output URI will point to a location where - // the user only has a read access. - string feature_attributions_schema_uri = 3; - - // Name of the source to generate embeddings for example based explanations. - string latent_space_source = 5; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto deleted file mode 100644 index cf67cf3e..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature.proto +++ /dev/null @@ -1,178 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto"; -import "google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "FeatureProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Feature Metadata information that describes an attribute of an entity type. -// For example, apple is an entity type, and color is a feature that describes -// apple. -message Feature { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Feature" - pattern: "projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}" - }; - - // A list of historical [Snapshot - // Analysis][FeaturestoreMonitoringConfig.SnapshotAnalysis] or [Import Feature - // Analysis] [FeaturestoreMonitoringConfig.ImportFeatureAnalysis] stats - // requested by user, sorted by [FeatureStatsAnomaly.start_time][google.cloud.aiplatform.v1beta1.FeatureStatsAnomaly.start_time] descending. - message MonitoringStatsAnomaly { - // If the objective in the request is both - // Import Feature Analysis and Snapshot Analysis, this objective could be - // one of them. Otherwise, this objective should be the same as the - // objective in the request. - enum Objective { - // If it's OBJECTIVE_UNSPECIFIED, monitoring_stats will be empty. - OBJECTIVE_UNSPECIFIED = 0; - - // Stats are generated by Import Feature Analysis. - IMPORT_FEATURE_ANALYSIS = 1; - - // Stats are generated by Snapshot Analysis. - SNAPSHOT_ANALYSIS = 2; - } - - // Output only. The objective for each stats. - Objective objective = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The stats and anomalies generated at specific timestamp. - FeatureStatsAnomaly feature_stats_anomaly = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // An enum representing the value type of a feature. - enum ValueType { - // The value type is unspecified. - VALUE_TYPE_UNSPECIFIED = 0; - - // Used for Feature that is a boolean. - BOOL = 1; - - // Used for Feature that is a list of boolean. - BOOL_ARRAY = 2; - - // Used for Feature that is double. - DOUBLE = 3; - - // Used for Feature that is a list of double. - DOUBLE_ARRAY = 4; - - // Used for Feature that is INT64. - INT64 = 9; - - // Used for Feature that is a list of INT64. - INT64_ARRAY = 10; - - // Used for Feature that is string. - STRING = 11; - - // Used for Feature that is a list of String. - STRING_ARRAY = 12; - - // Used for Feature that is bytes. - BYTES = 13; - } - - // Immutable. Name of the Feature. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` - // - // The last part feature is assigned by the client. The feature can be up to - // 64 characters long and can consist only of ASCII Latin letters A-Z and a-z, - // underscore(_), and ASCII digits 0-9 starting with a letter. The value will - // be unique given an entity type. - string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Description of the Feature. - string description = 2; - - // Required. Immutable. Type of Feature value. - ValueType value_type = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Output only. Timestamp when this EntityType was created. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this EntityType was most recently updated. - google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The labels with user-defined metadata to organize your Features. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information on and examples of labels. - // No more than 64 user labels can be associated with one Feature (System - // labels are excluded)." - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. - map labels = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Used to perform a consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 7; - - // Optional. Deprecated: The custom monitoring configuration for this Feature, if not - // set, use the monitoring_config defined for the EntityType this Feature - // belongs to. - // Only Features with type ([Feature.ValueType][google.cloud.aiplatform.v1beta1.Feature.ValueType]) BOOL, STRING, DOUBLE or - // INT64 can enable monitoring. - // - // If this is populated with - // [FeaturestoreMonitoringConfig.disabled][] = true, snapshot analysis - // monitoring is disabled; if - // [FeaturestoreMonitoringConfig.monitoring_interval][] specified, snapshot - // analysis monitoring is enabled. Otherwise, snapshot analysis monitoring - // config is same as the EntityType's this Feature belongs to. - FeaturestoreMonitoringConfig monitoring_config = 9 [ - deprecated = true, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. If not set, use the monitoring_config defined for the EntityType this - // Feature belongs to. - // Only Features with type ([Feature.ValueType][google.cloud.aiplatform.v1beta1.Feature.ValueType]) BOOL, STRING, DOUBLE or - // INT64 can enable monitoring. - // - // If set to true, all types of data monitoring are disabled despite the - // config on EntityType. - bool disable_monitoring = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. A list of historical [Snapshot - // Analysis][FeaturestoreMonitoringConfig.SnapshotAnalysis] - // stats requested by user, sorted by [FeatureStatsAnomaly.start_time][google.cloud.aiplatform.v1beta1.FeatureStatsAnomaly.start_time] - // descending. - repeated FeatureStatsAnomaly monitoring_stats = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The list of historical stats and anomalies with specified objectives. - repeated MonitoringStatsAnomaly monitoring_stats_anomalies = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto deleted file mode 100644 index 30ffbd95..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto +++ /dev/null @@ -1,86 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "FeatureMonitoringStatsProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Stats and Anomaly generated at specific timestamp for specific Feature. -// The start_time and end_time are used to define the time range of the dataset -// that current stats belongs to, e.g. prediction traffic is bucketed into -// prediction datasets by time window. If the Dataset is not defined by time -// window, start_time = end_time. Timestamp of the stats and anomalies always -// refers to end_time. Raw stats and anomalies are stored in stats_uri or -// anomaly_uri in the tensorflow defined protos. Field data_stats contains -// almost identical information with the raw stats in Vertex AI -// defined proto, for UI to display. -message FeatureStatsAnomaly { - // Feature importance score, only populated when cross-feature monitoring is - // enabled. For now only used to represent feature attribution score within - // range [0, 1] for - // [ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_SKEW][google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_SKEW] and - // [ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_DRIFT][google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_DRIFT]. - double score = 1; - - // Path of the stats file for current feature values in Cloud Storage bucket. - // Format: gs:////stats. - // Example: gs://monitoring_bucket/feature_name/stats. - // Stats are stored as binary format with Protobuf message - // [tensorflow.metadata.v0.FeatureNameStatistics](https://github.com/tensorflow/metadata/blob/master/tensorflow_metadata/proto/v0/statistics.proto). - string stats_uri = 3; - - // Path of the anomaly file for current feature values in Cloud Storage - // bucket. - // Format: gs:////anomalies. - // Example: gs://monitoring_bucket/feature_name/anomalies. - // Stats are stored as binary format with Protobuf message - // Anoamlies are stored as binary format with Protobuf message - // [tensorflow.metadata.v0.AnomalyInfo] - // (https://github.com/tensorflow/metadata/blob/master/tensorflow_metadata/proto/v0/anomalies.proto). - string anomaly_uri = 4; - - // Deviation from the current stats to baseline stats. - // 1. For categorical feature, the distribution distance is calculated by - // L-inifinity norm. - // 2. For numerical feature, the distribution distance is calculated by - // Jensen–Shannon divergence. - double distribution_deviation = 5; - - // This is the threshold used when detecting anomalies. - // The threshold can be changed by user, so this one might be different from - // [ThresholdConfig.value][google.cloud.aiplatform.v1beta1.ThresholdConfig.value]. - double anomaly_detection_threshold = 9; - - // The start timestamp of window where stats were generated. - // For objectives where time window doesn't make sense (e.g. Featurestore - // Snapshot Monitoring), start_time is only used to indicate the monitoring - // intervals, so it always equals to (end_time - monitoring_interval). - google.protobuf.Timestamp start_time = 7; - - // The end timestamp of window where stats were generated. - // For objectives where time window doesn't make sense (e.g. Featurestore - // Snapshot Monitoring), end_time indicates the timestamp of the data used to - // generate stats (e.g. timestamp we take snapshots for feature values). - google.protobuf.Timestamp end_time = 8; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_selector.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_selector.proto deleted file mode 100644 index 907f14e2..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/feature_selector.proto +++ /dev/null @@ -1,44 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "FeatureSelectorProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Matcher for Features of an EntityType by Feature ID. -message IdMatcher { - // Required. The following are accepted as `ids`: - // - // * A single-element list containing only `*`, which selects all Features - // in the target EntityType, or - // * A list containing only Feature IDs, which selects only Features with - // those IDs in the target EntityType. - repeated string ids = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Selector for Features of an EntityType. -message FeatureSelector { - // Required. Matches Features based on ID. - IdMatcher id_matcher = 1 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore.proto deleted file mode 100644 index f5ece8f2..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore.proto +++ /dev/null @@ -1,129 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "FeaturestoreProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Vertex AI Feature Store provides a centralized repository for organizing, -// storing, and serving ML features. The Featurestore is a top-level container -// for your features and their values. -message Featurestore { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Featurestore" - pattern: "projects/{project}/locations/{location}/featurestores/{featurestore}" - }; - - // OnlineServingConfig specifies the details for provisioning online serving - // resources. - message OnlineServingConfig { - // Online serving scaling configuration. If min_node_count and - // max_node_count are set to the same value, the cluster will be configured - // with the fixed number of node (no auto-scaling). - message Scaling { - // Required. The minimum number of nodes to scale down to. Must be greater than or - // equal to 1. - int32 min_node_count = 1 [(google.api.field_behavior) = REQUIRED]; - - // The maximum number of nodes to scale up to. Must be greater than - // min_node_count, and less than or equal to 10 times of 'min_node_count'. - int32 max_node_count = 2; - } - - // The number of nodes for the online store. The number of nodes doesn't - // scale automatically, but you can manually update the number of - // nodes. If set to 0, the featurestore will not have an - // online store and cannot be used for online serving. - int32 fixed_node_count = 2; - - // Online serving scaling configuration. - // Only one of `fixed_node_count` and `scaling` can be set. Setting one will - // reset the other. - Scaling scaling = 4; - } - - // Possible states a featurestore can have. - enum State { - // Default value. This value is unused. - STATE_UNSPECIFIED = 0; - - // State when the featurestore configuration is not being updated and the - // fields reflect the current configuration of the featurestore. The - // featurestore is usable in this state. - STABLE = 1; - - // The state of the featurestore configuration when it is being updated. - // During an update, the fields reflect either the original configuration - // or the updated configuration of the featurestore. For example, - // `online_serving_config.fixed_node_count` can take minutes to update. - // While the update is in progress, the featurestore is in the UPDATING - // state, and the value of `fixed_node_count` can be the original value or - // the updated value, depending on the progress of the operation. Until the - // update completes, the actual number of nodes can still be the original - // value of `fixed_node_count`. The featurestore is still usable in this - // state. - UPDATING = 2; - } - - // Output only. Name of the Featurestore. Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}` - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Featurestore was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Featurestore was last updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The labels with user-defined metadata to organize your Featurestore. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information on and examples of labels. - // No more than 64 user labels can be associated with one Featurestore(System - // labels are excluded)." - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. - map labels = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Config for online storage resources. If unset, the featurestore will - // not have an online store and cannot be used for online serving. - OnlineServingConfig online_serving_config = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. State of the featurestore. - State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Customer-managed encryption key spec for data storage. If set, both of the - // online and offline data storage will be secured by this key. - EncryptionSpec encryption_spec = 10 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto deleted file mode 100644 index fefe9e77..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto +++ /dev/null @@ -1,155 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/protobuf/duration.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "FeaturestoreMonitoringProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Configuration of how features in Featurestore are monitored. -message FeaturestoreMonitoringConfig { - // Configuration of the Featurestore's Snapshot Analysis Based Monitoring. - // This type of analysis generates statistics for each Feature based on a - // snapshot of the latest feature value of each entities every - // monitoring_interval. - message SnapshotAnalysis { - // The monitoring schedule for snapshot analysis. - // For EntityType-level config: - // unset / disabled = true indicates disabled by - // default for Features under it; otherwise by default enable snapshot - // analysis monitoring with monitoring_interval for Features under it. - // Feature-level config: - // disabled = true indicates disabled regardless of the EntityType-level - // config; unset monitoring_interval indicates going with EntityType-level - // config; otherwise run snapshot analysis monitoring with - // monitoring_interval regardless of the EntityType-level config. - // Explicitly Disable the snapshot analysis based monitoring. - bool disabled = 1; - - // Configuration of the snapshot analysis based monitoring pipeline running - // interval. The value is rolled up to full day. - google.protobuf.Duration monitoring_interval = 2 [deprecated = true]; - - // Configuration of the snapshot analysis based monitoring pipeline - // running interval. The value indicates number of days. - // If both - // [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days] - // and [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval] - // are set when creating/updating EntityTypes/Features, - // [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days] - // will be used. - int32 monitoring_interval_days = 3; - - // Customized export features time window for snapshot analysis. Unit is one - // day. Default value is 3 weeks. Minimum value is 1 day. Maximum value is - // 4000 days. - int32 staleness_days = 4; - } - - // Configuration of the Featurestore's ImportFeature Analysis Based - // Monitoring. This type of analysis generates statistics for values of each - // Feature imported by every [ImportFeatureValues][] operation. - message ImportFeaturesAnalysis { - // The state defines whether to enable ImportFeature analysis. - enum State { - // Should not be used. - STATE_UNSPECIFIED = 0; - - // The default behavior of whether to enable the monitoring. - // EntityType-level config: disabled. - // Feature-level config: inherited from the configuration of EntityType - // this Feature belongs to. - DEFAULT = 1; - - // Explicitly enables import features analysis. - // EntityType-level config: by default enables import features analysis - // for all Features under it. Feature-level config: enables import - // features analysis regardless of the EntityType-level config. - ENABLED = 2; - - // Explicitly disables import features analysis. - // EntityType-level config: by default disables import features analysis - // for all Features under it. Feature-level config: disables import - // features analysis regardless of the EntityType-level config. - DISABLED = 3; - } - - // Defines the baseline to do anomaly detection for feature values imported - // by each [ImportFeatureValues][] operation. - enum Baseline { - // Should not be used. - BASELINE_UNSPECIFIED = 0; - - // Choose the later one statistics generated by either most recent - // snapshot analysis or previous import features analysis. If non of them - // exists, skip anomaly detection and only generate a statistics. - LATEST_STATS = 1; - - // Use the statistics generated by the most recent snapshot analysis if - // exists. - MOST_RECENT_SNAPSHOT_STATS = 2; - - // Use the statistics generated by the previous import features analysis - // if exists. - PREVIOUS_IMPORT_FEATURES_STATS = 3; - } - - // Whether to enable / disable / inherite default hebavior for import - // features analysis. - State state = 1; - - // The baseline used to do anomaly detection for the statistics generated by - // import features analysis. - Baseline anomaly_detection_baseline = 2; - } - - // The config for Featurestore Monitoring threshold. - message ThresholdConfig { - oneof threshold { - // Specify a threshold value that can trigger the alert. - // 1. For categorical feature, the distribution distance is calculated by - // L-inifinity norm. - // 2. For numerical feature, the distribution distance is calculated by - // Jensen–Shannon divergence. Each feature must have a non-zero threshold - // if they need to be monitored. Otherwise no alert will be triggered for - // that feature. - double value = 1; - } - } - - // The config for Snapshot Analysis Based Feature Monitoring. - SnapshotAnalysis snapshot_analysis = 1; - - // The config for ImportFeatures Analysis Based Feature Monitoring. - ImportFeaturesAnalysis import_features_analysis = 2; - - // Threshold for numerical features of anomaly detection. - // This is shared by all objectives of Featurestore Monitoring for numerical - // features (i.e. Features with type ([Feature.ValueType][google.cloud.aiplatform.v1beta1.Feature.ValueType]) DOUBLE or INT64). - ThresholdConfig numerical_threshold_config = 3; - - // Threshold for categorical features of anomaly detection. - // This is shared by all types of Featurestore Monitoring for categorical - // features (i.e. Features with type ([Feature.ValueType][google.cloud.aiplatform.v1beta1.Feature.ValueType]) BOOL or STRING). - ThresholdConfig categorical_threshold_config = 4; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto deleted file mode 100644 index a8c5e991..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto +++ /dev/null @@ -1,225 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/feature_selector.proto"; -import "google/cloud/aiplatform/v1beta1/types.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "FeaturestoreOnlineServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A service for serving online feature values. -service FeaturestoreOnlineServingService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Reads Feature values of a specific entity of an EntityType. For reading - // feature values of multiple entities of an EntityType, please use - // StreamingReadFeatureValues. - rpc ReadFeatureValues(ReadFeatureValuesRequest) returns (ReadFeatureValuesResponse) { - option (google.api.http) = { - post: "/v1beta1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:readFeatureValues" - body: "*" - }; - option (google.api.method_signature) = "entity_type"; - } - - // Reads Feature values for multiple entities. Depending on their size, data - // for different entities may be broken - // up across multiple responses. - rpc StreamingReadFeatureValues(StreamingReadFeatureValuesRequest) returns (stream ReadFeatureValuesResponse) { - option (google.api.http) = { - post: "/v1beta1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:streamingReadFeatureValues" - body: "*" - }; - option (google.api.method_signature) = "entity_type"; - } -} - -// Request message for [FeaturestoreOnlineServingService.ReadFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.ReadFeatureValues]. -message ReadFeatureValuesRequest { - // Required. The resource name of the EntityType for the entity being read. - // 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`. - string entity_type = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - } - ]; - - // Required. ID for a specific entity. For example, - // for a machine learning model predicting user clicks on a website, an entity - // ID could be `user_123`. - string entity_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Selector choosing Features of the target EntityType. - FeatureSelector feature_selector = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [FeaturestoreOnlineServingService.ReadFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.ReadFeatureValues]. -message ReadFeatureValuesResponse { - // Metadata for requested Features. - message FeatureDescriptor { - // Feature ID. - string id = 1; - } - - // Response header with metadata for the requested - // [ReadFeatureValuesRequest.entity_type][google.cloud.aiplatform.v1beta1.ReadFeatureValuesRequest.entity_type] and Features. - message Header { - // The resource name of the EntityType from the - // [ReadFeatureValuesRequest][google.cloud.aiplatform.v1beta1.ReadFeatureValuesRequest]. Value format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}`. - string entity_type = 1 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - }]; - - // List of Feature metadata corresponding to each piece of - // [ReadFeatureValuesResponse.data][]. - repeated FeatureDescriptor feature_descriptors = 2; - } - - // Entity view with Feature values. - message EntityView { - // Container to hold value(s), successive in time, for one Feature from the - // request. - message Data { - oneof data { - // Feature value if a single value is requested. - FeatureValue value = 1; - - // Feature values list if values, successive in time, are requested. - // If the requested number of values is greater than the number of - // existing Feature values, nonexistent values are omitted instead of - // being returned as empty. - FeatureValueList values = 2; - } - } - - // ID of the requested entity. - string entity_id = 1; - - // Each piece of data holds the k - // requested values for one requested Feature. If no values - // for the requested Feature exist, the corresponding cell will be empty. - // This has the same size and is in the same order as the features from the - // header [ReadFeatureValuesResponse.header][google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse.header]. - repeated Data data = 2; - } - - // Response header. - Header header = 1; - - // Entity view with Feature values. This may be the entity in the - // Featurestore if values for all Features were requested, or a projection - // of the entity in the Featurestore if values for only some Features were - // requested. - EntityView entity_view = 2; -} - -// Request message for -// [FeaturestoreOnlineServingService.StreamingFeatureValuesRead][]. -message StreamingReadFeatureValuesRequest { - // Required. The resource name of the entities' type. - // 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`. - string entity_type = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - } - ]; - - // Required. IDs of entities to read Feature values of. The maximum number of IDs is - // 100. For example, for a machine learning model predicting user clicks on a - // website, an entity ID could be `user_123`. - repeated string entity_ids = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Selector choosing Features of the target EntityType. Feature IDs will be - // deduplicated. - FeatureSelector feature_selector = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Value for a feature. -// (-- NEXT ID: 15 --) -message FeatureValue { - // Metadata of feature value. - message Metadata { - // Feature generation timestamp. Typically, it is provided by user at - // feature ingestion time. If not, feature store - // will use the system timestamp when the data is ingested into feature - // store. For streaming ingestion, the time, aligned by days, must be no - // older than five years (1825 days) and no later than one year (366 days) - // in the future. - google.protobuf.Timestamp generate_time = 1; - } - - // Value for the feature. - oneof value { - // Bool type feature value. - bool bool_value = 1; - - // Double type feature value. - double double_value = 2; - - // Int64 feature value. - int64 int64_value = 5; - - // String feature value. - string string_value = 6; - - // A list of bool type feature value. - BoolArray bool_array_value = 7; - - // A list of double type feature value. - DoubleArray double_array_value = 8; - - // A list of int64 type feature value. - Int64Array int64_array_value = 11; - - // A list of string type feature value. - StringArray string_array_value = 12; - - // Bytes feature value. - bytes bytes_value = 13; - } - - // Metadata of feature value. - Metadata metadata = 14; -} - -// Container for list of values. -message FeatureValueList { - // A list of feature values. All of them should be the same data type. - repeated FeatureValue values = 1; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto deleted file mode 100644 index 0ea0241b..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto +++ /dev/null @@ -1,1225 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/entity_type.proto"; -import "google/cloud/aiplatform/v1beta1/feature.proto"; -import "google/cloud/aiplatform/v1beta1/feature_selector.proto"; -import "google/cloud/aiplatform/v1beta1/featurestore.proto"; -import "google/cloud/aiplatform/v1beta1/io.proto"; -import "google/cloud/aiplatform/v1beta1/operation.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "FeaturestoreServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// The service that handles CRUD and List for resources for Featurestore. -service FeaturestoreService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a new Featurestore in a given project and location. - rpc CreateFeaturestore(CreateFeaturestoreRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/featurestores" - body: "featurestore" - }; - option (google.api.method_signature) = "parent,featurestore"; - option (google.api.method_signature) = "parent,featurestore,featurestore_id"; - option (google.longrunning.operation_info) = { - response_type: "Featurestore" - metadata_type: "CreateFeaturestoreOperationMetadata" - }; - } - - // Gets details of a single Featurestore. - rpc GetFeaturestore(GetFeaturestoreRequest) returns (Featurestore) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/featurestores/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Featurestores in a given project and location. - rpc ListFeaturestores(ListFeaturestoresRequest) returns (ListFeaturestoresResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/featurestores" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates the parameters of a single Featurestore. - rpc UpdateFeaturestore(UpdateFeaturestoreRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1beta1/{featurestore.name=projects/*/locations/*/featurestores/*}" - body: "featurestore" - }; - option (google.api.method_signature) = "featurestore,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Featurestore" - metadata_type: "UpdateFeaturestoreOperationMetadata" - }; - } - - // Deletes a single Featurestore. The Featurestore must not contain any - // EntityTypes or `force` must be set to true for the request to succeed. - rpc DeleteFeaturestore(DeleteFeaturestoreRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/featurestores/*}" - }; - option (google.api.method_signature) = "name"; - option (google.api.method_signature) = "name,force"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Creates a new EntityType in a given Featurestore. - rpc CreateEntityType(CreateEntityTypeRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/featurestores/*}/entityTypes" - body: "entity_type" - }; - option (google.api.method_signature) = "parent,entity_type"; - option (google.api.method_signature) = "parent,entity_type,entity_type_id"; - option (google.longrunning.operation_info) = { - response_type: "EntityType" - metadata_type: "CreateEntityTypeOperationMetadata" - }; - } - - // Gets details of a single EntityType. - rpc GetEntityType(GetEntityTypeRequest) returns (EntityType) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists EntityTypes in a given Featurestore. - rpc ListEntityTypes(ListEntityTypesRequest) returns (ListEntityTypesResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/featurestores/*}/entityTypes" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates the parameters of a single EntityType. - rpc UpdateEntityType(UpdateEntityTypeRequest) returns (EntityType) { - option (google.api.http) = { - patch: "/v1beta1/{entity_type.name=projects/*/locations/*/featurestores/*/entityTypes/*}" - body: "entity_type" - }; - option (google.api.method_signature) = "entity_type,update_mask"; - } - - // Deletes a single EntityType. The EntityType must not have any Features - // or `force` must be set to true for the request to succeed. - rpc DeleteEntityType(DeleteEntityTypeRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}" - }; - option (google.api.method_signature) = "name"; - option (google.api.method_signature) = "name,force"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Creates a new Feature in a given EntityType. - rpc CreateFeature(CreateFeatureRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/featurestores/*/entityTypes/*}/features" - body: "feature" - }; - option (google.api.method_signature) = "parent,feature"; - option (google.api.method_signature) = "parent,feature,feature_id"; - option (google.longrunning.operation_info) = { - response_type: "Feature" - metadata_type: "CreateFeatureOperationMetadata" - }; - } - - // Creates a batch of Features in a given EntityType. - rpc BatchCreateFeatures(BatchCreateFeaturesRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/featurestores/*/entityTypes/*}/features:batchCreate" - body: "*" - }; - option (google.api.method_signature) = "parent,requests"; - option (google.longrunning.operation_info) = { - response_type: "BatchCreateFeaturesResponse" - metadata_type: "BatchCreateFeaturesOperationMetadata" - }; - } - - // Gets details of a single Feature. - rpc GetFeature(GetFeatureRequest) returns (Feature) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Features in a given EntityType. - rpc ListFeatures(ListFeaturesRequest) returns (ListFeaturesResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/featurestores/*/entityTypes/*}/features" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates the parameters of a single Feature. - rpc UpdateFeature(UpdateFeatureRequest) returns (Feature) { - option (google.api.http) = { - patch: "/v1beta1/{feature.name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}" - body: "feature" - }; - option (google.api.method_signature) = "feature,update_mask"; - } - - // Deletes a single Feature. - rpc DeleteFeature(DeleteFeatureRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Imports Feature values into the Featurestore from a source storage. - // - // The progress of the import is tracked by the returned operation. The - // imported features are guaranteed to be visible to subsequent read - // operations after the operation is marked as successfully done. - // - // If an import operation fails, the Feature values returned from - // reads and exports may be inconsistent. If consistency is - // required, the caller must retry the same import request again and wait till - // the new operation returned is marked as successfully done. - // - // There are also scenarios where the caller can cause inconsistency. - // - // - Source data for import contains multiple distinct Feature values for - // the same entity ID and timestamp. - // - Source is modified during an import. This includes adding, updating, or - // removing source data and/or metadata. Examples of updating metadata - // include but are not limited to changing storage location, storage class, - // or retention policy. - // - Online serving cluster is under-provisioned. - rpc ImportFeatureValues(ImportFeatureValuesRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:importFeatureValues" - body: "*" - }; - option (google.api.method_signature) = "entity_type"; - option (google.longrunning.operation_info) = { - response_type: "ImportFeatureValuesResponse" - metadata_type: "ImportFeatureValuesOperationMetadata" - }; - } - - // Batch reads Feature values from a Featurestore. - // - // This API enables batch reading Feature values, where each read - // instance in the batch may read Feature values of entities from one or - // more EntityTypes. Point-in-time correctness is guaranteed for Feature - // values of each read instance as of each instance's read timestamp. - rpc BatchReadFeatureValues(BatchReadFeatureValuesRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{featurestore=projects/*/locations/*/featurestores/*}:batchReadFeatureValues" - body: "*" - }; - option (google.api.method_signature) = "featurestore"; - option (google.longrunning.operation_info) = { - response_type: "BatchReadFeatureValuesResponse" - metadata_type: "BatchReadFeatureValuesOperationMetadata" - }; - } - - // Exports Feature values from all the entities of a target EntityType. - rpc ExportFeatureValues(ExportFeatureValuesRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:exportFeatureValues" - body: "*" - }; - option (google.api.method_signature) = "entity_type"; - option (google.longrunning.operation_info) = { - response_type: "ExportFeatureValuesResponse" - metadata_type: "ExportFeatureValuesOperationMetadata" - }; - } - - // Searches Features matching a query in a given project. - rpc SearchFeatures(SearchFeaturesRequest) returns (SearchFeaturesResponse) { - option (google.api.http) = { - get: "/v1beta1/{location=projects/*/locations/*}/featurestores:searchFeatures" - }; - option (google.api.method_signature) = "location"; - option (google.api.method_signature) = "location,query"; - } -} - -// Request message for [FeaturestoreService.CreateFeaturestore][google.cloud.aiplatform.v1beta1.FeaturestoreService.CreateFeaturestore]. -message CreateFeaturestoreRequest { - // Required. The resource name of the Location to create Featurestores. - // Format: - // `projects/{project}/locations/{location}'` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Featurestore" - } - ]; - - // Required. The Featurestore to create. - Featurestore featurestore = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID to use for this Featurestore, which will become the final component - // of the Featurestore's resource name. - // - // This value may be up to 60 characters, and valid characters are - // `[a-z0-9_]`. The first character cannot be a number. - // - // The value must be unique within the project and location. - string featurestore_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [FeaturestoreService.GetFeaturestore][google.cloud.aiplatform.v1beta1.FeaturestoreService.GetFeaturestore]. -message GetFeaturestoreRequest { - // Required. The name of the Featurestore resource. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Featurestore" - } - ]; -} - -// Request message for [FeaturestoreService.ListFeaturestores][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores]. -message ListFeaturestoresRequest { - // Required. The resource name of the Location to list Featurestores. - // Format: - // `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Featurestore" - } - ]; - - // Lists the featurestores that match the filter expression. The following - // fields are supported: - // - // * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - // Values must be - // in RFC 3339 format. - // * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - // Values must be - // in RFC 3339 format. - // * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, - // `<=`, and `>=` comparisons. - // * `labels`: Supports key-value equality and key presence. - // - // Examples: - // - // * `create_time > "2020-01-01" OR update_time > "2020-01-01"` - // Featurestores created or updated after 2020-01-01. - // * `labels.env = "prod"` - // Featurestores with label "env" set to "prod". - string filter = 2; - - // The maximum number of Featurestores to return. The service may return fewer - // than this value. If unspecified, at most 100 Featurestores will be - // returned. The maximum value is 100; any value greater than 100 will be - // coerced to 100. - int32 page_size = 3; - - // A page token, received from a previous - // [FeaturestoreService.ListFeaturestores][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores] call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [FeaturestoreService.ListFeaturestores][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores] must - // match the call that provided the page token. - string page_token = 4; - - // A comma-separated list of fields to order by, sorted in ascending order. - // Use "desc" after a field name for descending. - // Supported Fields: - // - // * `create_time` - // * `update_time` - // * `online_serving_config.fixed_node_count` - string order_by = 5; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 6; -} - -// Response message for [FeaturestoreService.ListFeaturestores][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores]. -message ListFeaturestoresResponse { - // The Featurestores matching the request. - repeated Featurestore featurestores = 1; - - // A token, which can be sent as [ListFeaturestoresRequest.page_token][google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest.page_token] to - // retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [FeaturestoreService.UpdateFeaturestore][google.cloud.aiplatform.v1beta1.FeaturestoreService.UpdateFeaturestore]. -message UpdateFeaturestoreRequest { - // Required. The Featurestore's `name` field is used to identify the Featurestore to be - // updated. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}` - Featurestore featurestore = 1 [(google.api.field_behavior) = REQUIRED]; - - // Field mask is used to specify the fields to be overwritten in the - // Featurestore resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then only the non-empty fields present in the - // request will be overwritten. Set the update_mask to `*` to override all - // fields. - // - // Updatable fields: - // - // * `labels` - // * `online_serving_config.fixed_node_count` - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for [FeaturestoreService.DeleteFeaturestore][google.cloud.aiplatform.v1beta1.FeaturestoreService.DeleteFeaturestore]. -message DeleteFeaturestoreRequest { - // Required. The name of the Featurestore to be deleted. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Featurestore" - } - ]; - - // If set to true, any EntityTypes and Features for this Featurestore will - // also be deleted. (Otherwise, the request will only work if the Featurestore - // has no EntityTypes.) - bool force = 2; -} - -// Request message for [FeaturestoreService.ImportFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreService.ImportFeatureValues]. -message ImportFeatureValuesRequest { - // Defines the Feature value(s) to import. - message FeatureSpec { - // Required. ID of the Feature to import values of. This Feature must exist in the - // target EntityType, or the request will fail. - string id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Source column to get the Feature values from. If not set, uses the column - // with the same name as the Feature ID. - string source_field = 2; - } - - // Details about the source data, including the location of the storage and - // the format. - oneof source { - AvroSource avro_source = 2; - - BigQuerySource bigquery_source = 3; - - CsvSource csv_source = 4; - } - - // Source of Feature timestamp for all Feature values of each entity. - // Timestamps must be millisecond-aligned. - oneof feature_time_source { - // Source column that holds the Feature timestamp for all Feature - // values in each entity. - string feature_time_field = 6; - - // Single Feature timestamp for all entities being imported. The - // timestamp must not have higher than millisecond precision. - google.protobuf.Timestamp feature_time = 7; - } - - // Required. The resource name of the EntityType grouping the Features for which values - // are being imported. Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}` - string entity_type = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - } - ]; - - // Source column that holds entity IDs. If not provided, entity IDs are - // extracted from the column named `entity_id`. - string entity_id_field = 5; - - // Required. Specifications defining which Feature values to import from the entity. The - // request fails if no feature_specs are provided, and having multiple - // feature_specs for one Feature is not allowed. - repeated FeatureSpec feature_specs = 8 [(google.api.field_behavior) = REQUIRED]; - - // If set, data will not be imported for online serving. This - // is typically used for backfilling, where Feature generation timestamps are - // not in the timestamp range needed for online serving. - bool disable_online_serving = 9; - - // Specifies the number of workers that are used to write data to the - // Featurestore. Consider the online serving capacity that you require to - // achieve the desired import throughput without interfering with online - // serving. The value must be positive, and less than or equal to 100. - // If not set, defaults to using 1 worker. The low count ensures minimal - // impact on online serving performance. - int32 worker_count = 11; - - // If true, API doesn't start ingestion analysis pipeline. - bool disable_ingestion_analysis = 12; -} - -// Response message for [FeaturestoreService.ImportFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreService.ImportFeatureValues]. -message ImportFeatureValuesResponse { - // Number of entities that have been imported by the operation. - int64 imported_entity_count = 1; - - // Number of Feature values that have been imported by the operation. - int64 imported_feature_value_count = 2; - - // The number of rows in input source that weren't imported due to either - // * Not having any featureValues. - // * Having a null entityId. - // * Having a null timestamp. - // * Not being parsable (applicable for CSV sources). - int64 invalid_row_count = 6; -} - -// Request message for [FeaturestoreService.BatchReadFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreService.BatchReadFeatureValues]. -message BatchReadFeatureValuesRequest { - // Describe pass-through fields in read_instance source. - message PassThroughField { - // Required. The name of the field in the CSV header or the name of the column in - // BigQuery table. The naming restriction is the same as [Feature.name][google.cloud.aiplatform.v1beta1.Feature.name]. - string field_name = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Selects Features of an EntityType to read values of and specifies read - // settings. - message EntityTypeSpec { - // Required. ID of the EntityType to select Features. The EntityType id is the - // [entity_type_id][google.cloud.aiplatform.v1beta1.CreateEntityTypeRequest.entity_type_id] specified - // during EntityType creation. - string entity_type_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Selectors choosing which Feature values to read from the EntityType. - FeatureSelector feature_selector = 2 [(google.api.field_behavior) = REQUIRED]; - - // Per-Feature settings for the batch read. - repeated DestinationFeatureSetting settings = 3; - } - - oneof read_option { - // Each read instance consists of exactly one read timestamp and one or more - // entity IDs identifying entities of the corresponding EntityTypes whose - // Features are requested. - // - // Each output instance contains Feature values of requested entities - // concatenated together as of the read time. - // - // An example read instance may be `foo_entity_id, bar_entity_id, - // 2020-01-01T10:00:00.123Z`. - // - // An example output instance may be `foo_entity_id, bar_entity_id, - // 2020-01-01T10:00:00.123Z, foo_entity_feature1_value, - // bar_entity_feature2_value`. - // - // Timestamp in each read instance must be millisecond-aligned. - // - // `csv_read_instances` are read instances stored in a plain-text CSV file. - // The header should be: - // [ENTITY_TYPE_ID1], [ENTITY_TYPE_ID2], ..., timestamp - // - // The columns can be in any order. - // - // Values in the timestamp column must use the RFC 3339 format, e.g. - // `2012-07-30T10:43:17.123Z`. - CsvSource csv_read_instances = 3; - - // Similar to csv_read_instances, but from BigQuery source. - BigQuerySource bigquery_read_instances = 5; - } - - // Required. The resource name of the Featurestore from which to query Feature values. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}` - string featurestore = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Featurestore" - } - ]; - - // Required. Specifies output location and format. - FeatureValueDestination destination = 4 [(google.api.field_behavior) = REQUIRED]; - - // When not empty, the specified fields in the *_read_instances source will be - // joined as-is in the output, in addition to those fields from the - // Featurestore Entity. - // - // For BigQuery source, the type of the pass-through values will be - // automatically inferred. For CSV source, the pass-through values will be - // passed as opaque bytes. - repeated PassThroughField pass_through_fields = 8; - - // Required. Specifies EntityType grouping Features to read values of and settings. - // Each EntityType referenced in - // [BatchReadFeatureValuesRequest.entity_type_specs] must have a column - // specifying entity IDs in the EntityType in - // [BatchReadFeatureValuesRequest.request][] . - repeated EntityTypeSpec entity_type_specs = 7 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [FeaturestoreService.ExportFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreService.ExportFeatureValues]. -message ExportFeatureValuesRequest { - // Describes exporting the latest Feature values of all entities of the - // EntityType between [start_time, snapshot_time]. - message SnapshotExport { - // Exports Feature values as of this timestamp. If not set, - // retrieve values as of now. Timestamp, if present, must not have higher - // than millisecond precision. - google.protobuf.Timestamp snapshot_time = 1; - - // Excludes Feature values with feature generation timestamp before this - // timestamp. If not set, retrieve oldest values kept in Feature Store. - // Timestamp, if present, must not have higher than millisecond precision. - google.protobuf.Timestamp start_time = 2; - } - - // Describes exporting all historical Feature values of all entities of the - // EntityType between [start_time, end_time]. - message FullExport { - // Excludes Feature values with feature generation timestamp before this - // timestamp. If not set, retrieve oldest values kept in Feature Store. - // Timestamp, if present, must not have higher than millisecond precision. - google.protobuf.Timestamp start_time = 2; - - // Exports Feature values as of this timestamp. If not set, - // retrieve values as of now. Timestamp, if present, must not have higher - // than millisecond precision. - google.protobuf.Timestamp end_time = 1; - } - - // Required. The mode in which Feature values are exported. - oneof mode { - // Exports the latest Feature values of all entities of the EntityType - // within a time range. - SnapshotExport snapshot_export = 3; - - // Exports all historical values of all entities of the EntityType within a - // time range - FullExport full_export = 7; - } - - // Required. The resource name of the EntityType from which to export Feature values. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - string entity_type = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - } - ]; - - // Required. Specifies destination location and format. - FeatureValueDestination destination = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. Selects Features to export values of. - FeatureSelector feature_selector = 5 [(google.api.field_behavior) = REQUIRED]; - - // Per-Feature export settings. - repeated DestinationFeatureSetting settings = 6; -} - -message DestinationFeatureSetting { - // Required. The ID of the Feature to apply the setting to. - string feature_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Specify the field name in the export destination. If not specified, - // Feature ID is used. - string destination_field = 2; -} - -// A destination location for Feature values and format. -message FeatureValueDestination { - oneof destination { - // Output in BigQuery format. - // [BigQueryDestination.output_uri][google.cloud.aiplatform.v1beta1.BigQueryDestination.output_uri] in - // [FeatureValueDestination.bigquery_destination][google.cloud.aiplatform.v1beta1.FeatureValueDestination.bigquery_destination] must refer to a table. - BigQueryDestination bigquery_destination = 1; - - // Output in TFRecord format. - // - // Below are the mapping from Feature value type - // in Featurestore to Feature value type in TFRecord: - // - // Value type in Featurestore | Value type in TFRecord - // DOUBLE, DOUBLE_ARRAY | FLOAT_LIST - // INT64, INT64_ARRAY | INT64_LIST - // STRING, STRING_ARRAY, BYTES | BYTES_LIST - // true -> byte_string("true"), false -> byte_string("false") - // BOOL, BOOL_ARRAY (true, false) | BYTES_LIST - TFRecordDestination tfrecord_destination = 2; - - // Output in CSV format. Array Feature value types are not allowed in CSV - // format. - CsvDestination csv_destination = 3; - } -} - -// Response message for [FeaturestoreService.ExportFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreService.ExportFeatureValues]. -message ExportFeatureValuesResponse { - -} - -// Response message for [FeaturestoreService.BatchReadFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreService.BatchReadFeatureValues]. -message BatchReadFeatureValuesResponse { - -} - -// Request message for [FeaturestoreService.CreateEntityType][google.cloud.aiplatform.v1beta1.FeaturestoreService.CreateEntityType]. -message CreateEntityTypeRequest { - // Required. The resource name of the Featurestore to create EntityTypes. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Featurestore" - } - ]; - - // The EntityType to create. - EntityType entity_type = 2; - - // Required. The ID to use for the EntityType, which will become the final component of - // the EntityType's resource name. - // - // This value may be up to 60 characters, and valid characters are - // `[a-z0-9_]`. The first character cannot be a number. - // - // The value must be unique within a featurestore. - string entity_type_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [FeaturestoreService.GetEntityType][google.cloud.aiplatform.v1beta1.FeaturestoreService.GetEntityType]. -message GetEntityTypeRequest { - // Required. The name of the EntityType resource. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - } - ]; -} - -// Request message for [FeaturestoreService.ListEntityTypes][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes]. -message ListEntityTypesRequest { - // Required. The resource name of the Featurestore to list EntityTypes. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/EntityType" - } - ]; - - // Lists the EntityTypes that match the filter expression. The following - // filters are supported: - // - // * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - // Values must be in RFC 3339 format. - // * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - // Values must be in RFC 3339 format. - // * `labels`: Supports key-value equality as well as key presence. - // - // Examples: - // - // * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - // update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - // or updated after 2020-01-31T15:30:00.000000Z. - // * `labels.active = yes AND labels.env = prod` --> EntityTypes having both - // (active: yes) and (env: prod) labels. - // * `labels.env: *` --> Any EntityType which has a label with 'env' as the - // key. - string filter = 2; - - // The maximum number of EntityTypes to return. The service may return fewer - // than this value. If unspecified, at most 1000 EntityTypes will be returned. - // The maximum value is 1000; any value greater than 1000 will be coerced to - // 1000. - int32 page_size = 3; - - // A page token, received from a previous - // [FeaturestoreService.ListEntityTypes][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes] call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [FeaturestoreService.ListEntityTypes][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes] must - // match the call that provided the page token. - string page_token = 4; - - // A comma-separated list of fields to order by, sorted in ascending order. - // Use "desc" after a field name for descending. - // - // Supported fields: - // - // * `entity_type_id` - // * `create_time` - // * `update_time` - string order_by = 5; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 6; -} - -// Response message for [FeaturestoreService.ListEntityTypes][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes]. -message ListEntityTypesResponse { - // The EntityTypes matching the request. - repeated EntityType entity_types = 1; - - // A token, which can be sent as [ListEntityTypesRequest.page_token][google.cloud.aiplatform.v1beta1.ListEntityTypesRequest.page_token] to - // retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [FeaturestoreService.UpdateEntityType][google.cloud.aiplatform.v1beta1.FeaturestoreService.UpdateEntityType]. -message UpdateEntityTypeRequest { - // Required. The EntityType's `name` field is used to identify the EntityType to be - // updated. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - EntityType entity_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Field mask is used to specify the fields to be overwritten in the - // EntityType resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then only the non-empty fields present in the - // request will be overwritten. Set the update_mask to `*` to override all - // fields. - // - // Updatable fields: - // - // * `description` - // * `labels` - // * `monitoring_config.snapshot_analysis.disabled` - // * `monitoring_config.snapshot_analysis.monitoring_interval_days` - // * `monitoring_config.snapshot_analysis.staleness_days` - // * `monitoring_config.import_features_analysis.state` - // * `monitoring_config.import_features_analysis.anomaly_detection_baseline` - // * `monitoring_config.numerical_threshold_config.value` - // * `monitoring_config.categorical_threshold_config.value` - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for [FeaturestoreService.DeleteEntityTypes][]. -message DeleteEntityTypeRequest { - // Required. The name of the EntityType to be deleted. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - } - ]; - - // If set to true, any Features for this EntityType will also be deleted. - // (Otherwise, the request will only work if the EntityType has no Features.) - bool force = 2; -} - -// Request message for [FeaturestoreService.CreateFeature][google.cloud.aiplatform.v1beta1.FeaturestoreService.CreateFeature]. -message CreateFeatureRequest { - // Required. The resource name of the EntityType to create a Feature. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - } - ]; - - // Required. The Feature to create. - Feature feature = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID to use for the Feature, which will become the final component of - // the Feature's resource name. - // - // This value may be up to 60 characters, and valid characters are - // `[a-z0-9_]`. The first character cannot be a number. - // - // The value must be unique within an EntityType. - string feature_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [FeaturestoreService.BatchCreateFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.BatchCreateFeatures]. -message BatchCreateFeaturesRequest { - // Required. The resource name of the EntityType to create the batch of Features under. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - } - ]; - - // Required. The request message specifying the Features to create. All Features must be - // created under the same parent EntityType. The `parent` field in each child - // request message can be omitted. If `parent` is set in a child request, then - // the value must match the `parent` value in this request message. - repeated CreateFeatureRequest requests = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [FeaturestoreService.BatchCreateFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.BatchCreateFeatures]. -message BatchCreateFeaturesResponse { - // The Features created. - repeated Feature features = 1; -} - -// Request message for [FeaturestoreService.GetFeature][google.cloud.aiplatform.v1beta1.FeaturestoreService.GetFeature]. -message GetFeatureRequest { - // Required. The name of the Feature resource. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Feature" - } - ]; -} - -// Request message for [FeaturestoreService.ListFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures]. -message ListFeaturesRequest { - // Required. The resource name of the Location to list Features. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Feature" - } - ]; - - // Lists the Features that match the filter expression. The following - // filters are supported: - // - // * `value_type`: Supports = and != comparisons. - // * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - // be in RFC 3339 format. - // * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - // be in RFC 3339 format. - // * `labels`: Supports key-value equality as well as key presence. - // - // Examples: - // - // * `value_type = DOUBLE` --> Features whose type is DOUBLE. - // * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - // update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - // or updated after 2020-01-31T15:30:00.000000Z. - // * `labels.active = yes AND labels.env = prod` --> Features having both - // (active: yes) and (env: prod) labels. - // * `labels.env: *` --> Any Feature which has a label with 'env' as the - // key. - string filter = 2; - - // The maximum number of Features to return. The service may return fewer - // than this value. If unspecified, at most 1000 Features will be returned. - // The maximum value is 1000; any value greater than 1000 will be coerced to - // 1000. - int32 page_size = 3; - - // A page token, received from a previous - // [FeaturestoreService.ListFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures] call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [FeaturestoreService.ListFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures] must - // match the call that provided the page token. - string page_token = 4; - - // A comma-separated list of fields to order by, sorted in ascending order. - // Use "desc" after a field name for descending. - // Supported fields: - // - // * `feature_id` - // * `value_type` - // * `create_time` - // * `update_time` - string order_by = 5; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 6; - - // If set, return the most recent [ListFeaturesRequest.latest_stats_count][google.cloud.aiplatform.v1beta1.ListFeaturesRequest.latest_stats_count] - // of stats for each Feature in response. Valid value is [0, 10]. If number of - // stats exists < [ListFeaturesRequest.latest_stats_count][google.cloud.aiplatform.v1beta1.ListFeaturesRequest.latest_stats_count], return all - // existing stats. - int32 latest_stats_count = 7; -} - -// Response message for [FeaturestoreService.ListFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures]. -message ListFeaturesResponse { - // The Features matching the request. - repeated Feature features = 1; - - // A token, which can be sent as [ListFeaturesRequest.page_token][google.cloud.aiplatform.v1beta1.ListFeaturesRequest.page_token] to - // retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [FeaturestoreService.SearchFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures]. -message SearchFeaturesRequest { - // Required. The resource name of the Location to search Features. - // Format: - // `projects/{project}/locations/{location}` - string location = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Query string that is a conjunction of field-restricted queries and/or - // field-restricted filters. Field-restricted queries and filters can be - // combined using `AND` to form a conjunction. - // - // A field query is in the form FIELD:QUERY. This implicitly checks if QUERY - // exists as a substring within Feature's FIELD. The QUERY - // and the FIELD are converted to a sequence of words (i.e. tokens) for - // comparison. This is done by: - // - // * Removing leading/trailing whitespace and tokenizing the search value. - // Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore - // `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated - // as a wildcard that matches characters within a token. - // * Ignoring case. - // * Prepending an asterisk to the first and appending an asterisk to the - // last token in QUERY. - // - // A QUERY must be either a singular token or a phrase. A phrase is one or - // multiple words enclosed in double quotation marks ("). With phrases, the - // order of the words is important. Words in the phrase must be matching in - // order and consecutively. - // - // Supported FIELDs for field-restricted queries: - // - // * `feature_id` - // * `description` - // * `entity_type_id` - // - // Examples: - // - // * `feature_id: foo` --> Matches a Feature with ID containing the substring - // `foo` (eg. `foo`, `foofeature`, `barfoo`). - // * `feature_id: foo*feature` --> Matches a Feature with ID containing the - // substring `foo*feature` (eg. `foobarfeature`). - // * `feature_id: foo AND description: bar` --> Matches a Feature with ID - // containing the substring `foo` and description containing the substring - // `bar`. - // - // - // Besides field queries, the following exact-match filters are - // supported. The exact-match filters do not support wildcards. Unlike - // field-restricted queries, exact-match filters are case-sensitive. - // - // * `feature_id`: Supports = comparisons. - // * `description`: Supports = comparisons. Multi-token filters should be - // enclosed in quotes. - // * `entity_type_id`: Supports = comparisons. - // * `value_type`: Supports = and != comparisons. - // * `labels`: Supports key-value equality as well as key presence. - // * `featurestore_id`: Supports = comparisons. - // - // Examples: - // * `description = "foo bar"` --> Any Feature with description exactly equal - // to `foo bar` - // * `value_type = DOUBLE` --> Features whose type is DOUBLE. - // * `labels.active = yes AND labels.env = prod` --> Features having both - // (active: yes) and (env: prod) labels. - // * `labels.env: *` --> Any Feature which has a label with `env` as the - // key. - string query = 3; - - // The maximum number of Features to return. The service may return fewer - // than this value. If unspecified, at most 100 Features will be returned. - // The maximum value is 100; any value greater than 100 will be coerced to - // 100. - int32 page_size = 4; - - // A page token, received from a previous - // [FeaturestoreService.SearchFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures] call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [FeaturestoreService.SearchFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures], except `page_size`, must - // match the call that provided the page token. - string page_token = 5; -} - -// Response message for [FeaturestoreService.SearchFeatures][google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures]. -message SearchFeaturesResponse { - // The Features matching the request. - // - // Fields returned: - // - // * `name` - // * `description` - // * `labels` - // * `create_time` - // * `update_time` - repeated Feature features = 1; - - // A token, which can be sent as [SearchFeaturesRequest.page_token][google.cloud.aiplatform.v1beta1.SearchFeaturesRequest.page_token] to - // retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [FeaturestoreService.UpdateFeature][google.cloud.aiplatform.v1beta1.FeaturestoreService.UpdateFeature]. -message UpdateFeatureRequest { - // Required. The Feature's `name` field is used to identify the Feature to be - // updated. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` - Feature feature = 1 [(google.api.field_behavior) = REQUIRED]; - - // Field mask is used to specify the fields to be overwritten in the - // Features resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then only the non-empty fields present in the - // request will be overwritten. Set the update_mask to `*` to override all - // fields. - // - // Updatable fields: - // - // * `description` - // * `labels` - // * `disable_monitoring` - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for [FeaturestoreService.DeleteFeature][google.cloud.aiplatform.v1beta1.FeaturestoreService.DeleteFeature]. -message DeleteFeatureRequest { - // Required. The name of the Features to be deleted. - // Format: - // `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Feature" - } - ]; -} - -// Details of operations that perform create Featurestore. -message CreateFeaturestoreOperationMetadata { - // Operation metadata for Featurestore. - GenericOperationMetadata generic_metadata = 1; -} - -// Details of operations that perform update Featurestore. -message UpdateFeaturestoreOperationMetadata { - // Operation metadata for Featurestore. - GenericOperationMetadata generic_metadata = 1; -} - -// Details of operations that perform import Feature values. -message ImportFeatureValuesOperationMetadata { - // Operation metadata for Featurestore import Feature values. - GenericOperationMetadata generic_metadata = 1; - - // Number of entities that have been imported by the operation. - int64 imported_entity_count = 2; - - // Number of Feature values that have been imported by the operation. - int64 imported_feature_value_count = 3; - - // The number of rows in input source that weren't imported due to either - // * Not having any featureValues. - // * Having a null entityId. - // * Having a null timestamp. - // * Not being parsable (applicable for CSV sources). - int64 invalid_row_count = 6; -} - -// Details of operations that exports Features values. -message ExportFeatureValuesOperationMetadata { - // Operation metadata for Featurestore export Feature values. - GenericOperationMetadata generic_metadata = 1; -} - -// Details of operations that batch reads Feature values. -message BatchReadFeatureValuesOperationMetadata { - // Operation metadata for Featurestore batch read Features values. - GenericOperationMetadata generic_metadata = 1; -} - -// Details of operations that perform create EntityType. -message CreateEntityTypeOperationMetadata { - // Operation metadata for EntityType. - GenericOperationMetadata generic_metadata = 1; -} - -// Details of operations that perform create Feature. -message CreateFeatureOperationMetadata { - // Operation metadata for Feature. - GenericOperationMetadata generic_metadata = 1; -} - -// Details of operations that perform batch create Features. -message BatchCreateFeaturesOperationMetadata { - // Operation metadata for Feature. - GenericOperationMetadata generic_metadata = 1; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto deleted file mode 100644 index 4e994e1e..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto +++ /dev/null @@ -1,110 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/custom_job.proto"; -import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1beta1/job_state.proto"; -import "google/cloud/aiplatform/v1beta1/study.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "HyperparameterTuningJobProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Represents a HyperparameterTuningJob. A HyperparameterTuningJob -// has a Study specification and multiple CustomJobs with identical -// CustomJob specification. -message HyperparameterTuningJob { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/HyperparameterTuningJob" - pattern: "projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}" - }; - - // Output only. Resource name of the HyperparameterTuningJob. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The display name of the HyperparameterTuningJob. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Study configuration of the HyperparameterTuningJob. - StudySpec study_spec = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. The desired total number of Trials. - int32 max_trial_count = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. The desired number of Trials to run in parallel. - int32 parallel_trial_count = 6 [(google.api.field_behavior) = REQUIRED]; - - // The number of failed Trials that need to be seen before failing - // the HyperparameterTuningJob. - // - // If set to 0, Vertex AI decides how many Trials must fail - // before the whole job fails. - int32 max_failed_trial_count = 7; - - // Required. The spec of a trial job. The same spec applies to the CustomJobs created - // in all the trials. - CustomJobSpec trial_job_spec = 8 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Trials of the HyperparameterTuningJob. - repeated Trial trials = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The detailed state of the job. - JobState state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the HyperparameterTuningJob was created. - google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the HyperparameterTuningJob for the first time entered the - // `JOB_STATE_RUNNING` state. - google.protobuf.Timestamp start_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the HyperparameterTuningJob entered any of the following states: - // `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`. - google.protobuf.Timestamp end_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the HyperparameterTuningJob was most recently updated. - google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Only populated when job's state is JOB_STATE_FAILED or - // JOB_STATE_CANCELLED. - google.rpc.Status error = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize HyperparameterTuningJobs. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 16; - - // Customer-managed encryption key options for a HyperparameterTuningJob. - // If this is set, then all resources created by the HyperparameterTuningJob - // will be encrypted with the provided encryption key. - EncryptionSpec encryption_spec = 17; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index.proto deleted file mode 100644 index ea9bc6d1..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index.proto +++ /dev/null @@ -1,96 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/deployed_index_ref.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "IndexProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A representation of a collection of database items organized in a way that -// allows for approximate nearest neighbor (a.k.a ANN) algorithms search. -message Index { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Index" - pattern: "projects/{project}/locations/{location}/indexes/{index}" - }; - - // Output only. The resource name of the Index. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The display name of the Index. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // The description of the Index. - string description = 3; - - // Immutable. Points to a YAML file stored on Google Cloud Storage describing additional - // information about the Index, that is specific to it. Unset if the Index - // does not have any additional information. - // The schema is defined as an OpenAPI 3.0.2 [Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - // Note: The URI given on output will be immutable and probably different, - // including the URI scheme, than the one given on input. The output URI will - // point to a location where the user only has a read access. - string metadata_schema_uri = 4 [(google.api.field_behavior) = IMMUTABLE]; - - // An additional information about the Index; the schema of the metadata can - // be found in [metadata_schema][google.cloud.aiplatform.v1beta1.Index.metadata_schema_uri]. - google.protobuf.Value metadata = 6; - - // Output only. The pointers to DeployedIndexes created from this Index. - // An Index can be only deleted if all its DeployedIndexes had been undeployed - // first. - repeated DeployedIndexRef deployed_indexes = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 8; - - // The labels with user-defined metadata to organize your Indexes. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 9; - - // Output only. Timestamp when this Index was created. - google.protobuf.Timestamp create_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Index was most recently updated. - // This also includes any update to the contents of the Index. - // Note that Operations working on this Index may have their - // [Operations.metadata.generic_metadata.update_time] - // [google.cloud.aiplatform.v1beta1.GenericOperationMetadata.update_time] a little after the value of this - // timestamp, yet that does not mean their results are not already reflected - // in the Index. Result of any successfully completed Operation on the Index - // is reflected in it. - google.protobuf.Timestamp update_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto deleted file mode 100644 index 3f8fa62b..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto +++ /dev/null @@ -1,245 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/machine_resources.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "IndexEndpointProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Indexes are deployed into it. An IndexEndpoint can have multiple -// DeployedIndexes. -message IndexEndpoint { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/IndexEndpoint" - pattern: "projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}" - }; - - // Output only. The resource name of the IndexEndpoint. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The display name of the IndexEndpoint. - // The name can be up to 128 characters long and can consist of any UTF-8 - // characters. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // The description of the IndexEndpoint. - string description = 3; - - // Output only. The indexes deployed in this endpoint. - repeated DeployedIndex deployed_indexes = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 5; - - // The labels with user-defined metadata to organize your IndexEndpoints. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 6; - - // Output only. Timestamp when this IndexEndpoint was created. - google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this IndexEndpoint was last updated. - // This timestamp is not updated when the endpoint's DeployedIndexes are - // updated, e.g. due to updates of the original Indexes they are the - // deployments of. - google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The full name of the Google Compute Engine - // [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks) - // to which the IndexEndpoint should be peered. - // - // Private services access must already be configured for the network. If left - // unspecified, the Endpoint is not peered with any network. - // - // [network][google.cloud.aiplatform.v1beta1.IndexEndpoint.network] and - // [private_service_connect_config][google.cloud.aiplatform.v1beta1.IndexEndpoint.private_service_connect_config] - // are mutually exclusive. - // - // [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert): - // projects/{project}/global/networks/{network}. - // Where {project} is a project number, as in '12345', and {network} is - // network name. - string network = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Deprecated: If true, expose the IndexEndpoint via private service connect. - // - // Only one of the fields, [network][google.cloud.aiplatform.v1beta1.IndexEndpoint.network] or - // [enable_private_service_connect][google.cloud.aiplatform.v1beta1.IndexEndpoint.enable_private_service_connect], - // can be set. - bool enable_private_service_connect = 10 [ - deprecated = true, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// A deployment of an Index. IndexEndpoints contain one or more DeployedIndexes. -message DeployedIndex { - // Required. The user specified ID of the DeployedIndex. - // The ID can be up to 128 characters long and must start with a letter and - // only contain letters, numbers, and underscores. - // The ID must be unique within the project it is created in. - string id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the Index this is the deployment of. - // We may refer to this Index as the DeployedIndex's "original" Index. - string index = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Index" - } - ]; - - // The display name of the DeployedIndex. If not provided upon creation, - // the Index's display_name is used. - string display_name = 3; - - // Output only. Timestamp when the DeployedIndex was created. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Provides paths for users to send requests directly to the deployed index - // services running on Cloud via private services access. This field is - // populated if [network][google.cloud.aiplatform.v1beta1.IndexEndpoint.network] is configured. - IndexPrivateEndpoints private_endpoints = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The DeployedIndex may depend on various data on its original Index. - // Additionally when certain changes to the original Index are being done - // (e.g. when what the Index contains is being changed) the DeployedIndex may - // be asynchronously updated in the background to reflect this changes. - // If this timestamp's value is at least the [Index.update_time][google.cloud.aiplatform.v1beta1.Index.update_time] of the - // original Index, it means that this DeployedIndex and the original Index are - // in sync. If this timestamp is older, then to see which updates this - // DeployedIndex already contains (and which not), one must - // [list][Operations.ListOperations] [Operations][Operation] - // [working][Operation.name] on the original Index. Only - // the successfully completed Operations with - // [Operations.metadata.generic_metadata.update_time] - // [google.cloud.aiplatform.v1beta1.GenericOperationMetadata.update_time] - // equal or before this sync time are contained in this DeployedIndex. - google.protobuf.Timestamp index_sync_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. A description of resources that the DeployedIndex uses, which to large - // degree are decided by Vertex AI, and optionally allows only a modest - // additional configuration. - // If min_replica_count is not set, the default value is 2 (we don't provide - // SLA when min_replica_count=1). If max_replica_count is not set, the - // default value is min_replica_count. The max allowed replica count is - // 1000. - AutomaticResources automatic_resources = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A description of resources that are dedicated to the DeployedIndex, and - // that need a higher degree of manual configuration. - // If min_replica_count is not set, the default value is 2 (we don't provide - // SLA when min_replica_count=1). If max_replica_count is not set, the - // default value is min_replica_count. The max allowed replica count is - // 1000. - // - // Available machine types: - // n1-standard-16 - // n1-standard-32 - DedicatedResources dedicated_resources = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, private endpoint's access logs are sent to StackDriver Logging. - // - // These logs are like standard server access logs, containing - // information like timestamp and latency for each MatchRequest. - // - // Note that Stackdriver logs may incur a cost, especially if the deployed - // index receives a high queries per second rate (QPS). - // Estimate your costs before enabling this option. - bool enable_access_logging = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the authentication is enabled for the private endpoint. - DeployedIndexAuthConfig deployed_index_auth_config = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A list of reserved ip ranges under the VPC network that can be - // used for this DeployedIndex. - // - // If set, we will deploy the index within the provided ip ranges. Otherwise, - // the index might be deployed to any ip ranges under the provided VPC - // network. - // - // The value sohuld be the name of the address - // (https://cloud.google.com/compute/docs/reference/rest/v1/addresses) - // Example: 'vertex-ai-ip-range'. - repeated string reserved_ip_ranges = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The deployment group can be no longer than 64 characters (eg: - // 'test', 'prod'). If not set, we will use the 'default' deployment group. - // - // Creating `deployment_groups` with `reserved_ip_ranges` is a recommended - // practice when the peered network has multiple peering ranges. This creates - // your deployments from predictable IP spaces for easier traffic - // administration. Also, one deployment_group (except 'default') can only be - // used with the same reserved_ip_ranges which means if the deployment_group - // has been used with reserved_ip_ranges: [a, b, c], using it with [a, b] or - // [d, e] is disallowed. - // - // Note: we only support up to 5 deployment groups(not including 'default'). - string deployment_group = 11 [(google.api.field_behavior) = OPTIONAL]; -} - -// Used to set up the auth on the DeployedIndex's private endpoint. -message DeployedIndexAuthConfig { - // Configuration for an authentication provider, including support for - // [JSON Web Token - // (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). - message AuthProvider { - // The list of JWT - // [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). - // that are allowed to access. A JWT containing any of these audiences will - // be accepted. - repeated string audiences = 1; - - // A list of allowed JWT issuers. Each entry must be a valid Google - // service account, in the following format: - // - // `service-account-name@project-id.iam.gserviceaccount.com` - repeated string allowed_issuers = 2; - } - - // Defines the authentication provider that the DeployedIndex uses. - AuthProvider auth_provider = 1; -} - -// IndexPrivateEndpoints proto is used to provide paths for users to send -// requests via private endpoints (e.g. private service access, private service -// connect). -// To send request via private service access, use match_grpc_address. -// To send request via private service connect, use service_attachment. -message IndexPrivateEndpoints { - // Output only. The ip address used to send match gRPC requests. - string match_grpc_address = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The name of the service attachment resource. Populated if private service - // connect is enabled. - string service_attachment = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto deleted file mode 100644 index c688741f..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto +++ /dev/null @@ -1,335 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/index_endpoint.proto"; -import "google/cloud/aiplatform/v1beta1/operation.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "IndexEndpointServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A service for managing Vertex AI's IndexEndpoints. -service IndexEndpointService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates an IndexEndpoint. - rpc CreateIndexEndpoint(CreateIndexEndpointRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/indexEndpoints" - body: "index_endpoint" - }; - option (google.api.method_signature) = "parent,index_endpoint"; - option (google.longrunning.operation_info) = { - response_type: "IndexEndpoint" - metadata_type: "CreateIndexEndpointOperationMetadata" - }; - } - - // Gets an IndexEndpoint. - rpc GetIndexEndpoint(GetIndexEndpointRequest) returns (IndexEndpoint) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists IndexEndpoints in a Location. - rpc ListIndexEndpoints(ListIndexEndpointsRequest) returns (ListIndexEndpointsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/indexEndpoints" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates an IndexEndpoint. - rpc UpdateIndexEndpoint(UpdateIndexEndpointRequest) returns (IndexEndpoint) { - option (google.api.http) = { - patch: "/v1beta1/{index_endpoint.name=projects/*/locations/*/indexEndpoints/*}" - body: "index_endpoint" - }; - option (google.api.method_signature) = "index_endpoint,update_mask"; - } - - // Deletes an IndexEndpoint. - rpc DeleteIndexEndpoint(DeleteIndexEndpointRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Deploys an Index into this IndexEndpoint, creating a DeployedIndex within - // it. - // Only non-empty Indexes can be deployed. - rpc DeployIndex(DeployIndexRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:deployIndex" - body: "*" - }; - option (google.api.method_signature) = "index_endpoint,deployed_index"; - option (google.longrunning.operation_info) = { - response_type: "DeployIndexResponse" - metadata_type: "DeployIndexOperationMetadata" - }; - } - - // Undeploys an Index from an IndexEndpoint, removing a DeployedIndex from it, - // and freeing all resources it's using. - rpc UndeployIndex(UndeployIndexRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:undeployIndex" - body: "*" - }; - option (google.api.method_signature) = "index_endpoint,deployed_index_id"; - option (google.longrunning.operation_info) = { - response_type: "UndeployIndexResponse" - metadata_type: "UndeployIndexOperationMetadata" - }; - } - - // Update an existing DeployedIndex under an IndexEndpoint. - rpc MutateDeployedIndex(MutateDeployedIndexRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:mutateDeployedIndex" - body: "deployed_index" - }; - option (google.api.method_signature) = "index_endpoint,deployed_index"; - option (google.longrunning.operation_info) = { - response_type: "MutateDeployedIndexResponse" - metadata_type: "MutateDeployedIndexOperationMetadata" - }; - } -} - -// Request message for [IndexEndpointService.CreateIndexEndpoint][google.cloud.aiplatform.v1beta1.IndexEndpointService.CreateIndexEndpoint]. -message CreateIndexEndpointRequest { - // Required. The resource name of the Location to create the IndexEndpoint in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The IndexEndpoint to create. - IndexEndpoint index_endpoint = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Runtime operation information for -// [IndexEndpointService.CreateIndexEndpoint][google.cloud.aiplatform.v1beta1.IndexEndpointService.CreateIndexEndpoint]. -message CreateIndexEndpointOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [IndexEndpointService.GetIndexEndpoint][google.cloud.aiplatform.v1beta1.IndexEndpointService.GetIndexEndpoint] -message GetIndexEndpointRequest { - // Required. The name of the IndexEndpoint resource. - // Format: - // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/IndexEndpoint" - } - ]; -} - -// Request message for [IndexEndpointService.ListIndexEndpoints][google.cloud.aiplatform.v1beta1.IndexEndpointService.ListIndexEndpoints]. -message ListIndexEndpointsRequest { - // Required. The resource name of the Location from which to list the IndexEndpoints. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. An expression for filtering the results of the request. For field names - // both snake_case and camelCase are supported. - // - // * `index_endpoint` supports = and !=. `index_endpoint` represents the - // IndexEndpoint ID, ie. the last segment of the IndexEndpoint's - // [resourcename][google.cloud.aiplatform.v1beta1.IndexEndpoint.name]. - // * `display_name` supports =, != and regex() - // (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) - // * `labels` supports general map functions that is: - // `labels.key=value` - key:value equality - // `labels.key:* or labels:key - key existence - // A key including a space must be quoted. `labels."a key"`. - // - // Some examples: - // * `index_endpoint="1"` - // * `display_name="myDisplayName"` - // * `regex(display_name, "^A") -> The display name starts with an A. - // * `labels.myKey="myValue"` - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The standard list page size. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The standard list page token. - // Typically obtained via - // [ListIndexEndpointsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListIndexEndpointsResponse.next_page_token] of the previous - // [IndexEndpointService.ListIndexEndpoints][google.cloud.aiplatform.v1beta1.IndexEndpointService.ListIndexEndpoints] call. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for [IndexEndpointService.ListIndexEndpoints][google.cloud.aiplatform.v1beta1.IndexEndpointService.ListIndexEndpoints]. -message ListIndexEndpointsResponse { - // List of IndexEndpoints in the requested page. - repeated IndexEndpoint index_endpoints = 1; - - // A token to retrieve next page of results. - // Pass to [ListIndexEndpointsRequest.page_token][google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [IndexEndpointService.UpdateIndexEndpoint][google.cloud.aiplatform.v1beta1.IndexEndpointService.UpdateIndexEndpoint]. -message UpdateIndexEndpointRequest { - // Required. The IndexEndpoint which replaces the resource on the server. - IndexEndpoint index_endpoint = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The update mask applies to the resource. See [google.protobuf.FieldMask][google.protobuf.FieldMask]. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [IndexEndpointService.DeleteIndexEndpoint][google.cloud.aiplatform.v1beta1.IndexEndpointService.DeleteIndexEndpoint]. -message DeleteIndexEndpointRequest { - // Required. The name of the IndexEndpoint resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/IndexEndpoint" - } - ]; -} - -// Request message for [IndexEndpointService.DeployIndex][google.cloud.aiplatform.v1beta1.IndexEndpointService.DeployIndex]. -message DeployIndexRequest { - // Required. The name of the IndexEndpoint resource into which to deploy an Index. - // Format: - // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - string index_endpoint = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/IndexEndpoint" - } - ]; - - // Required. The DeployedIndex to be created within the IndexEndpoint. - DeployedIndex deployed_index = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [IndexEndpointService.DeployIndex][google.cloud.aiplatform.v1beta1.IndexEndpointService.DeployIndex]. -message DeployIndexResponse { - // The DeployedIndex that had been deployed in the IndexEndpoint. - DeployedIndex deployed_index = 1; -} - -// Runtime operation information for [IndexEndpointService.DeployIndex][google.cloud.aiplatform.v1beta1.IndexEndpointService.DeployIndex]. -message DeployIndexOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; - - // The unique index id specified by user - string deployed_index_id = 2; -} - -// Request message for [IndexEndpointService.UndeployIndex][google.cloud.aiplatform.v1beta1.IndexEndpointService.UndeployIndex]. -message UndeployIndexRequest { - // Required. The name of the IndexEndpoint resource from which to undeploy an Index. - // Format: - // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - string index_endpoint = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/IndexEndpoint" - } - ]; - - // Required. The ID of the DeployedIndex to be undeployed from the IndexEndpoint. - string deployed_index_id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [IndexEndpointService.UndeployIndex][google.cloud.aiplatform.v1beta1.IndexEndpointService.UndeployIndex]. -message UndeployIndexResponse { - -} - -// Runtime operation information for [IndexEndpointService.UndeployIndex][google.cloud.aiplatform.v1beta1.IndexEndpointService.UndeployIndex]. -message UndeployIndexOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [IndexEndpointService.MutateDeployedIndex][google.cloud.aiplatform.v1beta1.IndexEndpointService.MutateDeployedIndex]. -message MutateDeployedIndexRequest { - // Required. The name of the IndexEndpoint resource into which to deploy an Index. - // Format: - // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - string index_endpoint = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/IndexEndpoint" - } - ]; - - // Required. The DeployedIndex to be updated within the IndexEndpoint. - // Currently, the updatable fields are [DeployedIndex][automatic_resources] - // and [DeployedIndex][dedicated_resources] - DeployedIndex deployed_index = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [IndexEndpointService.MutateDeployedIndex][google.cloud.aiplatform.v1beta1.IndexEndpointService.MutateDeployedIndex]. -message MutateDeployedIndexResponse { - // The DeployedIndex that had been updated in the IndexEndpoint. - DeployedIndex deployed_index = 1; -} - -// Runtime operation information for -// [IndexEndpointService.MutateDeployedIndex][google.cloud.aiplatform.v1beta1.IndexEndpointService.MutateDeployedIndex]. -message MutateDeployedIndexOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; - - // The unique index id specified by user - string deployed_index_id = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_service.proto deleted file mode 100644 index db6aaaa0..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_service.proto +++ /dev/null @@ -1,277 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/index.proto"; -import "google/cloud/aiplatform/v1beta1/operation.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "IndexServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A service for creating and managing Vertex AI's Index resources. -service IndexService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates an Index. - rpc CreateIndex(CreateIndexRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/indexes" - body: "index" - }; - option (google.api.method_signature) = "parent,index"; - option (google.longrunning.operation_info) = { - response_type: "Index" - metadata_type: "CreateIndexOperationMetadata" - }; - } - - // Gets an Index. - rpc GetIndex(GetIndexRequest) returns (Index) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/indexes/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Indexes in a Location. - rpc ListIndexes(ListIndexesRequest) returns (ListIndexesResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/indexes" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates an Index. - rpc UpdateIndex(UpdateIndexRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1beta1/{index.name=projects/*/locations/*/indexes/*}" - body: "index" - }; - option (google.api.method_signature) = "index,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Index" - metadata_type: "UpdateIndexOperationMetadata" - }; - } - - // Deletes an Index. - // An Index can only be deleted when all its - // [DeployedIndexes][google.cloud.aiplatform.v1beta1.Index.deployed_indexes] had been undeployed. - rpc DeleteIndex(DeleteIndexRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/indexes/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } -} - -// Request message for [IndexService.CreateIndex][google.cloud.aiplatform.v1beta1.IndexService.CreateIndex]. -message CreateIndexRequest { - // Required. The resource name of the Location to create the Index in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The Index to create. - Index index = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Runtime operation information for [IndexService.CreateIndex][google.cloud.aiplatform.v1beta1.IndexService.CreateIndex]. -message CreateIndexOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; - - // The operation metadata with regard to Matching Engine Index operation. - NearestNeighborSearchOperationMetadata nearest_neighbor_search_operation_metadata = 2; -} - -// Request message for [IndexService.GetIndex][google.cloud.aiplatform.v1beta1.IndexService.GetIndex] -message GetIndexRequest { - // Required. The name of the Index resource. - // Format: - // `projects/{project}/locations/{location}/indexes/{index}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Index" - } - ]; -} - -// Request message for [IndexService.ListIndexes][google.cloud.aiplatform.v1beta1.IndexService.ListIndexes]. -message ListIndexesRequest { - // Required. The resource name of the Location from which to list the Indexes. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The standard list filter. - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListIndexesResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListIndexesResponse.next_page_token] of the previous - // [IndexService.ListIndexes][google.cloud.aiplatform.v1beta1.IndexService.ListIndexes] call. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for [IndexService.ListIndexes][google.cloud.aiplatform.v1beta1.IndexService.ListIndexes]. -message ListIndexesResponse { - // List of indexes in the requested page. - repeated Index indexes = 1; - - // A token to retrieve next page of results. - // Pass to [ListIndexesRequest.page_token][google.cloud.aiplatform.v1beta1.ListIndexesRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [IndexService.UpdateIndex][google.cloud.aiplatform.v1beta1.IndexService.UpdateIndex]. -message UpdateIndexRequest { - // Required. The Index which updates the resource on the server. - Index index = 1 [(google.api.field_behavior) = REQUIRED]; - - // The update mask applies to the resource. - // For the `FieldMask` definition, see [google.protobuf.FieldMask][google.protobuf.FieldMask]. - google.protobuf.FieldMask update_mask = 2; -} - -// Runtime operation information for [IndexService.UpdateIndex][google.cloud.aiplatform.v1beta1.IndexService.UpdateIndex]. -message UpdateIndexOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; - - // The operation metadata with regard to Matching Engine Index operation. - NearestNeighborSearchOperationMetadata nearest_neighbor_search_operation_metadata = 2; -} - -// Request message for [IndexService.DeleteIndex][google.cloud.aiplatform.v1beta1.IndexService.DeleteIndex]. -message DeleteIndexRequest { - // Required. The name of the Index resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/indexes/{index}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Index" - } - ]; -} - -// Runtime operation metadata with regard to Matching Engine Index. -message NearestNeighborSearchOperationMetadata { - message RecordError { - enum RecordErrorType { - // Default, shall not be used. - ERROR_TYPE_UNSPECIFIED = 0; - - // The record is empty. - EMPTY_LINE = 1; - - // Invalid json format. - INVALID_JSON_SYNTAX = 2; - - // Invalid csv format. - INVALID_CSV_SYNTAX = 3; - - // Invalid avro format. - INVALID_AVRO_SYNTAX = 4; - - // The embedding id is not valid. - INVALID_EMBEDDING_ID = 5; - - // The size of the embedding vectors does not match with the specified - // dimension. - EMBEDDING_SIZE_MISMATCH = 6; - - // The `namespace` field is missing. - NAMESPACE_MISSING = 7; - } - - // The error type of this record. - RecordErrorType error_type = 1; - - // A human-readable message that is shown to the user to help them fix the - // error. Note that this message may change from time to time, your code - // should check against error_type as the source of truth. - string error_message = 2; - - // Cloud Storage URI pointing to the original file in user's bucket. - string source_gcs_uri = 3; - - // Empty if the embedding id is failed to parse. - string embedding_id = 4; - - // The original content of this record. - string raw_record = 5; - } - - message ContentValidationStats { - // Cloud Storage URI pointing to the original file in user's bucket. - string source_gcs_uri = 1; - - // Number of records in this file that were successfully processed. - int64 valid_record_count = 2; - - // Number of records in this file we skipped due to validate errors. - int64 invalid_record_count = 3; - - // The detail information of the partial failures encountered for those - // invalid records that couldn't be parsed. - // Up to 50 partial errors will be reported. - repeated RecordError partial_errors = 4; - } - - // The validation stats of the content (per file) to be inserted or - // updated on the Matching Engine Index resource. Populated if - // contentsDeltaUri is provided as part of [Index.metadata][google.cloud.aiplatform.v1beta1.Index.metadata]. Please note - // that, currently for those files that are broken or has unsupported file - // format, we will not have the stats for those files. - repeated ContentValidationStats content_validation_stats = 1; - - // The ingested data size in bytes. - int64 data_bytes_count = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/io.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/io.proto deleted file mode 100644 index f571bb62..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/io.proto +++ /dev/null @@ -1,108 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "IoProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// The storage details for Avro input content. -message AvroSource { - // Required. Google Cloud Storage location. - GcsSource gcs_source = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The storage details for CSV input content. -message CsvSource { - // Required. Google Cloud Storage location. - GcsSource gcs_source = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The Google Cloud Storage location for the input content. -message GcsSource { - // Required. Google Cloud Storage URI(-s) to the input file(s). May contain - // wildcards. For more information on wildcards, see - // https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames. - repeated string uris = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The Google Cloud Storage location where the output is to be written to. -message GcsDestination { - // Required. Google Cloud Storage URI to output directory. If the uri doesn't end with - // '/', a '/' will be automatically appended. The directory is created if it - // doesn't exist. - string output_uri_prefix = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The BigQuery location for the input content. -message BigQuerySource { - // Required. BigQuery URI to a table, up to 2000 characters long. - // Accepted forms: - // - // * BigQuery path. For example: `bq://projectId.bqDatasetId.bqTableId`. - string input_uri = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The BigQuery location for the output content. -message BigQueryDestination { - // Required. BigQuery URI to a project or table, up to 2000 characters long. - // - // When only the project is specified, the Dataset and Table is created. - // When the full table reference is specified, the Dataset must exist and - // table must not exist. - // - // Accepted forms: - // - // * BigQuery path. For example: - // `bq://projectId` or `bq://projectId.bqDatasetId` or - // `bq://projectId.bqDatasetId.bqTableId`. - string output_uri = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The storage details for CSV output content. -message CsvDestination { - // Required. Google Cloud Storage location. - GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The storage details for TFRecord output content. -message TFRecordDestination { - // Required. Google Cloud Storage location. - GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The Container Registry location for the container image. -message ContainerRegistryDestination { - // Required. Container Registry URI of a container image. - // Only Google Container Registry and Artifact Registry are supported now. - // Accepted forms: - // - // * Google Container Registry path. For example: - // `gcr.io/projectId/imageName:tag`. - // - // * Artifact Registry path. For example: - // `us-central1-docker.pkg.dev/projectId/repoName/imageName:tag`. - // - // If a tag is not specified, "latest" will be used as the default tag. - string output_uri = 1 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_service.proto deleted file mode 100644 index 6929a1e9..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_service.proto +++ /dev/null @@ -1,1003 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/batch_prediction_job.proto"; -import "google/cloud/aiplatform/v1beta1/custom_job.proto"; -import "google/cloud/aiplatform/v1beta1/data_labeling_job.proto"; -import "google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto"; -import "google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto"; -import "google/cloud/aiplatform/v1beta1/operation.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "JobServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A service for creating and managing Vertex AI's jobs. -service JobService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a CustomJob. A created CustomJob right away - // will be attempted to be run. - rpc CreateCustomJob(CreateCustomJobRequest) returns (CustomJob) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/customJobs" - body: "custom_job" - }; - option (google.api.method_signature) = "parent,custom_job"; - } - - // Gets a CustomJob. - rpc GetCustomJob(GetCustomJobRequest) returns (CustomJob) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/customJobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists CustomJobs in a Location. - rpc ListCustomJobs(ListCustomJobsRequest) returns (ListCustomJobsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/customJobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a CustomJob. - rpc DeleteCustomJob(DeleteCustomJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/customJobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Cancels a CustomJob. - // Starts asynchronous cancellation on the CustomJob. The server - // makes a best effort to cancel the job, but success is not - // guaranteed. Clients can use [JobService.GetCustomJob][google.cloud.aiplatform.v1beta1.JobService.GetCustomJob] or - // other methods to check whether the cancellation succeeded or whether the - // job completed despite cancellation. On successful cancellation, - // the CustomJob is not deleted; instead it becomes a job with - // a [CustomJob.error][google.cloud.aiplatform.v1beta1.CustomJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`, and [CustomJob.state][google.cloud.aiplatform.v1beta1.CustomJob.state] is set to - // `CANCELLED`. - rpc CancelCustomJob(CancelCustomJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/customJobs/*}:cancel" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a DataLabelingJob. - rpc CreateDataLabelingJob(CreateDataLabelingJobRequest) returns (DataLabelingJob) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/dataLabelingJobs" - body: "data_labeling_job" - }; - option (google.api.method_signature) = "parent,data_labeling_job"; - } - - // Gets a DataLabelingJob. - rpc GetDataLabelingJob(GetDataLabelingJobRequest) returns (DataLabelingJob) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists DataLabelingJobs in a Location. - rpc ListDataLabelingJobs(ListDataLabelingJobsRequest) returns (ListDataLabelingJobsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/dataLabelingJobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a DataLabelingJob. - rpc DeleteDataLabelingJob(DeleteDataLabelingJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Cancels a DataLabelingJob. Success of cancellation is not guaranteed. - rpc CancelDataLabelingJob(CancelDataLabelingJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}:cancel" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a HyperparameterTuningJob - rpc CreateHyperparameterTuningJob(CreateHyperparameterTuningJobRequest) returns (HyperparameterTuningJob) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/hyperparameterTuningJobs" - body: "hyperparameter_tuning_job" - }; - option (google.api.method_signature) = "parent,hyperparameter_tuning_job"; - } - - // Gets a HyperparameterTuningJob - rpc GetHyperparameterTuningJob(GetHyperparameterTuningJobRequest) returns (HyperparameterTuningJob) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists HyperparameterTuningJobs in a Location. - rpc ListHyperparameterTuningJobs(ListHyperparameterTuningJobsRequest) returns (ListHyperparameterTuningJobsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/hyperparameterTuningJobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a HyperparameterTuningJob. - rpc DeleteHyperparameterTuningJob(DeleteHyperparameterTuningJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Cancels a HyperparameterTuningJob. - // Starts asynchronous cancellation on the HyperparameterTuningJob. The server - // makes a best effort to cancel the job, but success is not - // guaranteed. Clients can use [JobService.GetHyperparameterTuningJob][google.cloud.aiplatform.v1beta1.JobService.GetHyperparameterTuningJob] or - // other methods to check whether the cancellation succeeded or whether the - // job completed despite cancellation. On successful cancellation, - // the HyperparameterTuningJob is not deleted; instead it becomes a job with - // a [HyperparameterTuningJob.error][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] - // of 1, corresponding to `Code.CANCELLED`, and - // [HyperparameterTuningJob.state][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.state] is set to `CANCELLED`. - rpc CancelHyperparameterTuningJob(CancelHyperparameterTuningJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}:cancel" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a BatchPredictionJob. A BatchPredictionJob once created will - // right away be attempted to start. - rpc CreateBatchPredictionJob(CreateBatchPredictionJobRequest) returns (BatchPredictionJob) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/batchPredictionJobs" - body: "batch_prediction_job" - }; - option (google.api.method_signature) = "parent,batch_prediction_job"; - } - - // Gets a BatchPredictionJob - rpc GetBatchPredictionJob(GetBatchPredictionJobRequest) returns (BatchPredictionJob) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/batchPredictionJobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists BatchPredictionJobs in a Location. - rpc ListBatchPredictionJobs(ListBatchPredictionJobsRequest) returns (ListBatchPredictionJobsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/batchPredictionJobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a BatchPredictionJob. Can only be called on jobs that already - // finished. - rpc DeleteBatchPredictionJob(DeleteBatchPredictionJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/batchPredictionJobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Cancels a BatchPredictionJob. - // - // Starts asynchronous cancellation on the BatchPredictionJob. The server - // makes the best effort to cancel the job, but success is not - // guaranteed. Clients can use [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1beta1.JobService.GetBatchPredictionJob] or - // other methods to check whether the cancellation succeeded or whether the - // job completed despite cancellation. On a successful cancellation, - // the BatchPredictionJob is not deleted;instead its - // [BatchPredictionJob.state][google.cloud.aiplatform.v1beta1.BatchPredictionJob.state] is set to `CANCELLED`. Any files already - // outputted by the job are not deleted. - rpc CancelBatchPredictionJob(CancelBatchPredictionJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/batchPredictionJobs/*}:cancel" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a ModelDeploymentMonitoringJob. It will run periodically on a - // configured interval. - rpc CreateModelDeploymentMonitoringJob(CreateModelDeploymentMonitoringJobRequest) returns (ModelDeploymentMonitoringJob) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/modelDeploymentMonitoringJobs" - body: "model_deployment_monitoring_job" - }; - option (google.api.method_signature) = "parent,model_deployment_monitoring_job"; - } - - // Searches Model Monitoring Statistics generated within a given time window. - rpc SearchModelDeploymentMonitoringStatsAnomalies(SearchModelDeploymentMonitoringStatsAnomaliesRequest) returns (SearchModelDeploymentMonitoringStatsAnomaliesResponse) { - option (google.api.http) = { - post: "/v1beta1/{model_deployment_monitoring_job=projects/*/locations/*/modelDeploymentMonitoringJobs/*}:searchModelDeploymentMonitoringStatsAnomalies" - body: "*" - }; - option (google.api.method_signature) = "model_deployment_monitoring_job,deployed_model_id"; - } - - // Gets a ModelDeploymentMonitoringJob. - rpc GetModelDeploymentMonitoringJob(GetModelDeploymentMonitoringJobRequest) returns (ModelDeploymentMonitoringJob) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists ModelDeploymentMonitoringJobs in a Location. - rpc ListModelDeploymentMonitoringJobs(ListModelDeploymentMonitoringJobsRequest) returns (ListModelDeploymentMonitoringJobsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/modelDeploymentMonitoringJobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates a ModelDeploymentMonitoringJob. - rpc UpdateModelDeploymentMonitoringJob(UpdateModelDeploymentMonitoringJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1beta1/{model_deployment_monitoring_job.name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}" - body: "model_deployment_monitoring_job" - }; - option (google.api.method_signature) = "model_deployment_monitoring_job,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "ModelDeploymentMonitoringJob" - metadata_type: "UpdateModelDeploymentMonitoringJobOperationMetadata" - }; - } - - // Deletes a ModelDeploymentMonitoringJob. - rpc DeleteModelDeploymentMonitoringJob(DeleteModelDeploymentMonitoringJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Pauses a ModelDeploymentMonitoringJob. If the job is running, the server - // makes a best effort to cancel the job. Will mark - // [ModelDeploymentMonitoringJob.state][google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob.state] to 'PAUSED'. - rpc PauseModelDeploymentMonitoringJob(PauseModelDeploymentMonitoringJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}:pause" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Resumes a paused ModelDeploymentMonitoringJob. It will start to run from - // next scheduled time. A deleted ModelDeploymentMonitoringJob can't be - // resumed. - rpc ResumeModelDeploymentMonitoringJob(ResumeModelDeploymentMonitoringJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}:resume" - body: "*" - }; - option (google.api.method_signature) = "name"; - } -} - -// Request message for [JobService.CreateCustomJob][google.cloud.aiplatform.v1beta1.JobService.CreateCustomJob]. -message CreateCustomJobRequest { - // Required. The resource name of the Location to create the CustomJob in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The CustomJob to create. - CustomJob custom_job = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [JobService.GetCustomJob][google.cloud.aiplatform.v1beta1.JobService.GetCustomJob]. -message GetCustomJobRequest { - // Required. The name of the CustomJob resource. - // Format: - // `projects/{project}/locations/{location}/customJobs/{custom_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/CustomJob" - } - ]; -} - -// Request message for [JobService.ListCustomJobs][google.cloud.aiplatform.v1beta1.JobService.ListCustomJobs]. -message ListCustomJobsRequest { - // Required. The resource name of the Location to list the CustomJobs from. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The standard list filter. - // - // Supported fields: - // - // * `display_name` supports = and !=. - // - // * `state` supports = and !=. - // - // Some examples of using the filter are: - // - // * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - // - // * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - // - // * `NOT display_name="my_job"` - // - // * `state="JOB_STATE_FAILED"` - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListCustomJobsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListCustomJobsResponse.next_page_token] of the previous - // [JobService.ListCustomJobs][google.cloud.aiplatform.v1beta1.JobService.ListCustomJobs] call. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for [JobService.ListCustomJobs][google.cloud.aiplatform.v1beta1.JobService.ListCustomJobs] -message ListCustomJobsResponse { - // List of CustomJobs in the requested page. - repeated CustomJob custom_jobs = 1; - - // A token to retrieve the next page of results. - // Pass to [ListCustomJobsRequest.page_token][google.cloud.aiplatform.v1beta1.ListCustomJobsRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [JobService.DeleteCustomJob][google.cloud.aiplatform.v1beta1.JobService.DeleteCustomJob]. -message DeleteCustomJobRequest { - // Required. The name of the CustomJob resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/customJobs/{custom_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/CustomJob" - } - ]; -} - -// Request message for [JobService.CancelCustomJob][google.cloud.aiplatform.v1beta1.JobService.CancelCustomJob]. -message CancelCustomJobRequest { - // Required. The name of the CustomJob to cancel. - // Format: - // `projects/{project}/locations/{location}/customJobs/{custom_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/CustomJob" - } - ]; -} - -// Request message for [JobService.CreateDataLabelingJob][google.cloud.aiplatform.v1beta1.JobService.CreateDataLabelingJob]. -message CreateDataLabelingJobRequest { - // Required. The parent of the DataLabelingJob. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The DataLabelingJob to create. - DataLabelingJob data_labeling_job = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [JobService.GetDataLabelingJob][google.cloud.aiplatform.v1beta1.JobService.GetDataLabelingJob]. -message GetDataLabelingJobRequest { - // Required. The name of the DataLabelingJob. - // Format: - // `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/DataLabelingJob" - } - ]; -} - -// Request message for [JobService.ListDataLabelingJobs][google.cloud.aiplatform.v1beta1.JobService.ListDataLabelingJobs]. -message ListDataLabelingJobsRequest { - // Required. The parent of the DataLabelingJob. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The standard list filter. - // - // Supported fields: - // - // * `display_name` supports = and !=. - // - // * `state` supports = and !=. - // - // Some examples of using the filter are: - // - // * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - // - // * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - // - // * `NOT display_name="my_job"` - // - // * `state="JOB_STATE_FAILED"` - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - string page_token = 4; - - // Mask specifying which fields to read. FieldMask represents a set of - // symbolic field paths. For example, the mask can be `paths: "name"`. The - // "name" here is a field in DataLabelingJob. - // If this field is not set, all fields of the DataLabelingJob are returned. - google.protobuf.FieldMask read_mask = 5; - - // A comma-separated list of fields to order by, sorted in ascending order by - // default. - // Use `desc` after a field name for descending. - string order_by = 6; -} - -// Response message for [JobService.ListDataLabelingJobs][google.cloud.aiplatform.v1beta1.JobService.ListDataLabelingJobs]. -message ListDataLabelingJobsResponse { - // A list of DataLabelingJobs that matches the specified filter in the - // request. - repeated DataLabelingJob data_labeling_jobs = 1; - - // The standard List next-page token. - string next_page_token = 2; -} - -// Request message for [JobService.DeleteDataLabelingJob][google.cloud.aiplatform.v1beta1.JobService.DeleteDataLabelingJob]. -message DeleteDataLabelingJobRequest { - // Required. The name of the DataLabelingJob to be deleted. - // Format: - // `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/DataLabelingJob" - } - ]; -} - -// Request message for [JobService.CancelDataLabelingJob][google.cloud.aiplatform.v1beta1.JobService.CancelDataLabelingJob]. -message CancelDataLabelingJobRequest { - // Required. The name of the DataLabelingJob. - // Format: - // `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/DataLabelingJob" - } - ]; -} - -// Request message for [JobService.CreateHyperparameterTuningJob][google.cloud.aiplatform.v1beta1.JobService.CreateHyperparameterTuningJob]. -message CreateHyperparameterTuningJobRequest { - // Required. The resource name of the Location to create the HyperparameterTuningJob in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The HyperparameterTuningJob to create. - HyperparameterTuningJob hyperparameter_tuning_job = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [JobService.GetHyperparameterTuningJob][google.cloud.aiplatform.v1beta1.JobService.GetHyperparameterTuningJob]. -message GetHyperparameterTuningJobRequest { - // Required. The name of the HyperparameterTuningJob resource. - // Format: - // `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/HyperparameterTuningJob" - } - ]; -} - -// Request message for [JobService.ListHyperparameterTuningJobs][google.cloud.aiplatform.v1beta1.JobService.ListHyperparameterTuningJobs]. -message ListHyperparameterTuningJobsRequest { - // Required. The resource name of the Location to list the HyperparameterTuningJobs - // from. Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The standard list filter. - // - // Supported fields: - // - // * `display_name` supports = and !=. - // - // * `state` supports = and !=. - // - // Some examples of using the filter are: - // - // * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - // - // * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - // - // * `NOT display_name="my_job"` - // - // * `state="JOB_STATE_FAILED"` - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListHyperparameterTuningJobsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsResponse.next_page_token] of the previous - // [JobService.ListHyperparameterTuningJobs][google.cloud.aiplatform.v1beta1.JobService.ListHyperparameterTuningJobs] call. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for [JobService.ListHyperparameterTuningJobs][google.cloud.aiplatform.v1beta1.JobService.ListHyperparameterTuningJobs] -message ListHyperparameterTuningJobsResponse { - // List of HyperparameterTuningJobs in the requested page. - // [HyperparameterTuningJob.trials][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.trials] of the jobs will be not be returned. - repeated HyperparameterTuningJob hyperparameter_tuning_jobs = 1; - - // A token to retrieve the next page of results. - // Pass to [ListHyperparameterTuningJobsRequest.page_token][google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest.page_token] to obtain that - // page. - string next_page_token = 2; -} - -// Request message for [JobService.DeleteHyperparameterTuningJob][google.cloud.aiplatform.v1beta1.JobService.DeleteHyperparameterTuningJob]. -message DeleteHyperparameterTuningJobRequest { - // Required. The name of the HyperparameterTuningJob resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/HyperparameterTuningJob" - } - ]; -} - -// Request message for [JobService.CancelHyperparameterTuningJob][google.cloud.aiplatform.v1beta1.JobService.CancelHyperparameterTuningJob]. -message CancelHyperparameterTuningJobRequest { - // Required. The name of the HyperparameterTuningJob to cancel. - // Format: - // `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/HyperparameterTuningJob" - } - ]; -} - -// Request message for [JobService.CreateBatchPredictionJob][google.cloud.aiplatform.v1beta1.JobService.CreateBatchPredictionJob]. -message CreateBatchPredictionJobRequest { - // Required. The resource name of the Location to create the BatchPredictionJob in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The BatchPredictionJob to create. - BatchPredictionJob batch_prediction_job = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1beta1.JobService.GetBatchPredictionJob]. -message GetBatchPredictionJobRequest { - // Required. The name of the BatchPredictionJob resource. - // Format: - // `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/BatchPredictionJob" - } - ]; -} - -// Request message for [JobService.ListBatchPredictionJobs][google.cloud.aiplatform.v1beta1.JobService.ListBatchPredictionJobs]. -message ListBatchPredictionJobsRequest { - // Required. The resource name of the Location to list the BatchPredictionJobs - // from. Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The standard list filter. - // - // Supported fields: - // - // * `display_name` supports = and !=. - // - // * `state` supports = and !=. - // - // * `model_display_name` supports = and != - // - // Some examples of using the filter are: - // - // * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - // - // * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - // - // * `NOT display_name="my_job"` - // - // * `state="JOB_STATE_FAILED"` - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListBatchPredictionJobsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsResponse.next_page_token] of the previous - // [JobService.ListBatchPredictionJobs][google.cloud.aiplatform.v1beta1.JobService.ListBatchPredictionJobs] call. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for [JobService.ListBatchPredictionJobs][google.cloud.aiplatform.v1beta1.JobService.ListBatchPredictionJobs] -message ListBatchPredictionJobsResponse { - // List of BatchPredictionJobs in the requested page. - repeated BatchPredictionJob batch_prediction_jobs = 1; - - // A token to retrieve the next page of results. - // Pass to [ListBatchPredictionJobsRequest.page_token][google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest.page_token] to obtain that - // page. - string next_page_token = 2; -} - -// Request message for [JobService.DeleteBatchPredictionJob][google.cloud.aiplatform.v1beta1.JobService.DeleteBatchPredictionJob]. -message DeleteBatchPredictionJobRequest { - // Required. The name of the BatchPredictionJob resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/BatchPredictionJob" - } - ]; -} - -// Request message for [JobService.CancelBatchPredictionJob][google.cloud.aiplatform.v1beta1.JobService.CancelBatchPredictionJob]. -message CancelBatchPredictionJobRequest { - // Required. The name of the BatchPredictionJob to cancel. - // Format: - // `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/BatchPredictionJob" - } - ]; -} - -// Request message for -// [JobService.CreateModelDeploymentMonitoringJob][google.cloud.aiplatform.v1beta1.JobService.CreateModelDeploymentMonitoringJob]. -message CreateModelDeploymentMonitoringJobRequest { - // Required. The parent of the ModelDeploymentMonitoringJob. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The ModelDeploymentMonitoringJob to create - ModelDeploymentMonitoringJob model_deployment_monitoring_job = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [JobService.SearchModelDeploymentMonitoringStatsAnomalies][google.cloud.aiplatform.v1beta1.JobService.SearchModelDeploymentMonitoringStatsAnomalies]. -message SearchModelDeploymentMonitoringStatsAnomaliesRequest { - // Stats requested for specific objective. - message StatsAnomaliesObjective { - ModelDeploymentMonitoringObjectiveType type = 1; - - // If set, all attribution scores between - // [SearchModelDeploymentMonitoringStatsAnomaliesRequest.start_time][google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest.start_time] and - // [SearchModelDeploymentMonitoringStatsAnomaliesRequest.end_time][google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest.end_time] are - // fetched, and page token doesn't take affect in this case. - // Only used to retrieve attribution score for the top Features which has - // the highest attribution score in the latest monitoring run. - int32 top_feature_count = 4; - } - - // Required. ModelDeploymentMonitoring Job resource name. - // Format: - // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - string model_deployment_monitoring_job = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" - } - ]; - - // Required. The DeployedModel ID of the - // [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. - string deployed_model_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // The feature display name. If specified, only return the stats belonging to - // this feature. Format: - // [ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name][google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name], - // example: "user_destination". - string feature_display_name = 3; - - // Required. Objectives of the stats to retrieve. - repeated StatsAnomaliesObjective objectives = 4 [(google.api.field_behavior) = REQUIRED]; - - // The standard list page size. - int32 page_size = 5; - - // A page token received from a previous - // [JobService.SearchModelDeploymentMonitoringStatsAnomalies][google.cloud.aiplatform.v1beta1.JobService.SearchModelDeploymentMonitoringStatsAnomalies] - // call. - string page_token = 6; - - // The earliest timestamp of stats being generated. - // If not set, indicates fetching stats till the earliest possible one. - google.protobuf.Timestamp start_time = 7; - - // The latest timestamp of stats being generated. - // If not set, indicates feching stats till the latest possible one. - google.protobuf.Timestamp end_time = 8; -} - -// Response message for -// [JobService.SearchModelDeploymentMonitoringStatsAnomalies][google.cloud.aiplatform.v1beta1.JobService.SearchModelDeploymentMonitoringStatsAnomalies]. -message SearchModelDeploymentMonitoringStatsAnomaliesResponse { - // Stats retrieved for requested objectives. - // There are at most 1000 - // [ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.prediction_stats][google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.prediction_stats] - // in the response. - repeated ModelMonitoringStatsAnomalies monitoring_stats = 1; - - // The page token that can be used by the next - // [JobService.SearchModelDeploymentMonitoringStatsAnomalies][google.cloud.aiplatform.v1beta1.JobService.SearchModelDeploymentMonitoringStatsAnomalies] - // call. - string next_page_token = 2; -} - -// Request message for -// [JobService.GetModelDeploymentMonitoringJob][google.cloud.aiplatform.v1beta1.JobService.GetModelDeploymentMonitoringJob]. -message GetModelDeploymentMonitoringJobRequest { - // Required. The resource name of the ModelDeploymentMonitoringJob. - // Format: - // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" - } - ]; -} - -// Request message for -// [JobService.ListModelDeploymentMonitoringJobs][google.cloud.aiplatform.v1beta1.JobService.ListModelDeploymentMonitoringJobs]. -message ListModelDeploymentMonitoringJobsRequest { - // Required. The parent of the ModelDeploymentMonitoringJob. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The standard list filter. - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - string page_token = 4; - - // Mask specifying which fields to read - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for -// [JobService.ListModelDeploymentMonitoringJobs][google.cloud.aiplatform.v1beta1.JobService.ListModelDeploymentMonitoringJobs]. -message ListModelDeploymentMonitoringJobsResponse { - // A list of ModelDeploymentMonitoringJobs that matches the specified filter - // in the request. - repeated ModelDeploymentMonitoringJob model_deployment_monitoring_jobs = 1; - - // The standard List next-page token. - string next_page_token = 2; -} - -// Request message for -// [JobService.UpdateModelDeploymentMonitoringJob][google.cloud.aiplatform.v1beta1.JobService.UpdateModelDeploymentMonitoringJob]. -message UpdateModelDeploymentMonitoringJobRequest { - // Required. The model monitoring configuration which replaces the resource on the - // server. - ModelDeploymentMonitoringJob model_deployment_monitoring_job = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The update mask is used to specify the fields to be overwritten in the - // ModelDeploymentMonitoringJob resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then only the non-empty fields present in the - // request will be overwritten. Set the update_mask to `*` to override all - // fields. - // For the objective config, the user can either provide the update mask for - // model_deployment_monitoring_objective_configs or any combination of its - // nested fields, such as: - // model_deployment_monitoring_objective_configs.objective_config.training_dataset. - // - // Updatable fields: - // - // * `display_name` - // * `model_deployment_monitoring_schedule_config` - // * `model_monitoring_alert_config` - // * `logging_sampling_strategy` - // * `labels` - // * `log_ttl` - // * `enable_monitoring_pipeline_logs` - // . and - // * `model_deployment_monitoring_objective_configs` - // . or - // * `model_deployment_monitoring_objective_configs.objective_config.training_dataset` - // * `model_deployment_monitoring_objective_configs.objective_config.training_prediction_skew_detection_config` - // * `model_deployment_monitoring_objective_configs.objective_config.prediction_drift_detection_config` - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [JobService.DeleteModelDeploymentMonitoringJob][google.cloud.aiplatform.v1beta1.JobService.DeleteModelDeploymentMonitoringJob]. -message DeleteModelDeploymentMonitoringJobRequest { - // Required. The resource name of the model monitoring job to delete. - // Format: - // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" - } - ]; -} - -// Request message for -// [JobService.PauseModelDeploymentMonitoringJob][google.cloud.aiplatform.v1beta1.JobService.PauseModelDeploymentMonitoringJob]. -message PauseModelDeploymentMonitoringJobRequest { - // Required. The resource name of the ModelDeploymentMonitoringJob to pause. - // Format: - // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" - } - ]; -} - -// Request message for -// [JobService.ResumeModelDeploymentMonitoringJob][google.cloud.aiplatform.v1beta1.JobService.ResumeModelDeploymentMonitoringJob]. -message ResumeModelDeploymentMonitoringJobRequest { - // Required. The resource name of the ModelDeploymentMonitoringJob to resume. - // Format: - // `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" - } - ]; -} - -// Runtime operation information for -// [JobService.UpdateModelDeploymentMonitoringJob][google.cloud.aiplatform.v1beta1.JobService.UpdateModelDeploymentMonitoringJob]. -message UpdateModelDeploymentMonitoringJobOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_state.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_state.proto deleted file mode 100644 index 14458e2e..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_state.proto +++ /dev/null @@ -1,66 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "JobStateProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Describes the state of a job. -enum JobState { - // The job state is unspecified. - JOB_STATE_UNSPECIFIED = 0; - - // The job has been just created or resumed and processing has not yet begun. - JOB_STATE_QUEUED = 1; - - // The service is preparing to run the job. - JOB_STATE_PENDING = 2; - - // The job is in progress. - JOB_STATE_RUNNING = 3; - - // The job completed successfully. - JOB_STATE_SUCCEEDED = 4; - - // The job failed. - JOB_STATE_FAILED = 5; - - // The job is being cancelled. From this state the job may only go to - // either `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`. - JOB_STATE_CANCELLING = 6; - - // The job has been cancelled. - JOB_STATE_CANCELLED = 7; - - // The job has been stopped, and can be resumed. - JOB_STATE_PAUSED = 8; - - // The job has expired. - JOB_STATE_EXPIRED = 9; - - // The job is being updated. The job is only able to be updated at RUNNING - // state; if the update operation succeeds, job goes back to RUNNING state; if - // the update operation fails, the job goes back to RUNNING state with error - // messages written to [ModelDeploymentMonitoringJob.partial_errors][] field - // if it is a ModelDeploymentMonitoringJob. - JOB_STATE_UPDATING = 10; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto deleted file mode 100644 index ce279717..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto +++ /dev/null @@ -1,42 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/cloud/aiplatform/v1beta1/artifact.proto"; -import "google/cloud/aiplatform/v1beta1/event.proto"; -import "google/cloud/aiplatform/v1beta1/execution.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "LineageSubgraphProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A subgraph of the overall lineage graph. Event edges connect Artifact and -// Execution nodes. -message LineageSubgraph { - // The Artifact nodes in the subgraph. - repeated Artifact artifacts = 1; - - // The Execution nodes in the subgraph. - repeated Execution executions = 2; - - // The Event edges between Artifacts and Executions in the subgraph. - repeated Event events = 3; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto deleted file mode 100644 index fa1d1faa..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto +++ /dev/null @@ -1,204 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/cloud/aiplatform/v1beta1/accelerator_type.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "MachineResourcesProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Specification of a single machine. -message MachineSpec { - // Immutable. The type of the machine. - // - // See the [list of machine types supported for - // prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types) - // - // See the [list of machine types supported for custom - // training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types). - // - // For [DeployedModel][google.cloud.aiplatform.v1beta1.DeployedModel] this field is optional, and the default - // value is `n1-standard-2`. For [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob] or as part of - // [WorkerPoolSpec][google.cloud.aiplatform.v1beta1.WorkerPoolSpec] this field is required. - string machine_type = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. The type of accelerator(s) that may be attached to the machine as per - // [accelerator_count][google.cloud.aiplatform.v1beta1.MachineSpec.accelerator_count]. - AcceleratorType accelerator_type = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // The number of accelerators to attach to the machine. - int32 accelerator_count = 3; -} - -// A description of resources that are dedicated to a DeployedModel, and -// that need a higher degree of manual configuration. -message DedicatedResources { - // Required. Immutable. The specification of a single machine used by the prediction. - MachineSpec machine_spec = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Required. Immutable. The minimum number of machine replicas this DeployedModel will be always - // deployed on. This value must be greater than or equal to 1. - // - // If traffic against the DeployedModel increases, it may dynamically be - // deployed onto more replicas, and as traffic decreases, some of these extra - // replicas may be freed. - int32 min_replica_count = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Immutable. The maximum number of replicas this DeployedModel may be deployed on when - // the traffic against it increases. If the requested value is too large, - // the deployment will error, but if deployment succeeds then the ability - // to scale the model to that many replicas is guaranteed (barring service - // outages). If traffic against the DeployedModel increases beyond what its - // replicas at maximum may handle, a portion of the traffic will be dropped. - // If this value is not provided, will use [min_replica_count][google.cloud.aiplatform.v1beta1.DedicatedResources.min_replica_count] as the - // default value. - // - // The value of this field impacts the charge against Vertex CPU and GPU - // quotas. Specifically, you will be charged for (max_replica_count * - // number of cores in the selected machine type) and (max_replica_count * - // number of GPUs per replica in the selected machine type). - int32 max_replica_count = 3 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. The metric specifications that overrides a resource - // utilization metric (CPU utilization, accelerator's duty cycle, and so on) - // target value (default to 60 if not set). At most one entry is allowed per - // metric. - // - // If [machine_spec.accelerator_count][google.cloud.aiplatform.v1beta1.MachineSpec.accelerator_count] is - // above 0, the autoscaling will be based on both CPU utilization and - // accelerator's duty cycle metrics and scale up when either metrics exceeds - // its target value while scale down if both metrics are under their target - // value. The default target value is 60 for both metrics. - // - // If [machine_spec.accelerator_count][google.cloud.aiplatform.v1beta1.MachineSpec.accelerator_count] is - // 0, the autoscaling will be based on CPU utilization metric only with - // default target value 60 if not explicitly set. - // - // For example, in the case of Online Prediction, if you want to override - // target CPU utilization to 80, you should set - // [autoscaling_metric_specs.metric_name][google.cloud.aiplatform.v1beta1.AutoscalingMetricSpec.metric_name] - // to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and - // [autoscaling_metric_specs.target][google.cloud.aiplatform.v1beta1.AutoscalingMetricSpec.target] to `80`. - repeated AutoscalingMetricSpec autoscaling_metric_specs = 4 [(google.api.field_behavior) = IMMUTABLE]; -} - -// A description of resources that to large degree are decided by Vertex AI, -// and require only a modest additional configuration. -// Each Model supporting these resources documents its specific guidelines. -message AutomaticResources { - // Immutable. The minimum number of replicas this DeployedModel will be always deployed - // on. If traffic against it increases, it may dynamically be deployed onto - // more replicas up to [max_replica_count][google.cloud.aiplatform.v1beta1.AutomaticResources.max_replica_count], and as traffic decreases, some - // of these extra replicas may be freed. - // If the requested value is too large, the deployment will error. - int32 min_replica_count = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. The maximum number of replicas this DeployedModel may be deployed on when - // the traffic against it increases. If the requested value is too large, - // the deployment will error, but if deployment succeeds then the ability - // to scale the model to that many replicas is guaranteed (barring service - // outages). If traffic against the DeployedModel increases beyond what its - // replicas at maximum may handle, a portion of the traffic will be dropped. - // If this value is not provided, a no upper bound for scaling under heavy - // traffic will be assume, though Vertex AI may be unable to scale beyond - // certain replica number. - int32 max_replica_count = 2 [(google.api.field_behavior) = IMMUTABLE]; -} - -// A description of resources that are used for performing batch operations, are -// dedicated to a Model, and need manual configuration. -message BatchDedicatedResources { - // Required. Immutable. The specification of a single machine. - MachineSpec machine_spec = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Immutable. The number of machine replicas used at the start of the batch operation. - // If not set, Vertex AI decides starting number, not greater than - // [max_replica_count][google.cloud.aiplatform.v1beta1.BatchDedicatedResources.max_replica_count] - int32 starting_replica_count = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. The maximum number of machine replicas the batch operation may be scaled - // to. The default value is 10. - int32 max_replica_count = 3 [(google.api.field_behavior) = IMMUTABLE]; -} - -// Statistics information about resource consumption. -message ResourcesConsumed { - // Output only. The number of replica hours used. Note that many replicas may run in - // parallel, and additionally any given work may be queued for some time. - // Therefore this value is not strictly related to wall time. - double replica_hours = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Represents the spec of disk options. -message DiskSpec { - // Type of the boot disk (default is "pd-ssd"). - // Valid values: "pd-ssd" (Persistent Disk Solid State Drive) or - // "pd-standard" (Persistent Disk Hard Disk Drive). - string boot_disk_type = 1; - - // Size in GB of the boot disk (default is 100GB). - int32 boot_disk_size_gb = 2; -} - -// Represents a mount configuration for Network File System (NFS) to mount. -message NfsMount { - // Required. IP address of the NFS server. - string server = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Source path exported from NFS server. - // Has to start with '/', and combined with the ip address, it indicates - // the source mount path in the form of `server:path` - string path = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Destination mount path. The NFS will be mounted for the user under - // /mnt/nfs/ - string mount_point = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The metric specification that defines the target resource utilization -// (CPU utilization, accelerator's duty cycle, and so on) for calculating the -// desired replica count. -message AutoscalingMetricSpec { - // Required. The resource metric name. - // Supported metrics: - // - // * For Online Prediction: - // * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle` - // * `aiplatform.googleapis.com/prediction/online/cpu/utilization` - string metric_name = 1 [(google.api.field_behavior) = REQUIRED]; - - // The target resource utilization in percentage (1% - 100%) for the given - // metric; once the real usage deviates from the target by a certain - // percentage, the machine replicas change. The default value is 60 - // (representing 60%) if not provided. - int32 target = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto deleted file mode 100644 index f8f75fdc..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto +++ /dev/null @@ -1,39 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ManualBatchTuningParametersProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Manual batch tuning parameters. -message ManualBatchTuningParameters { - // Immutable. The number of the records (e.g. instances) of the operation given in - // each batch to a machine replica. Machine type, and size of a single - // record should be considered when setting this parameter, higher value - // speeds up the batch operation's execution, but too high value will result - // in a whole batch not fitting in a machine's memory, and the whole - // operation will fail. - // The default value is 4. - int32 batch_size = 1 [(google.api.field_behavior) = IMMUTABLE]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto deleted file mode 100644 index 0623a3ee..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto +++ /dev/null @@ -1,79 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "MetadataSchemaProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Instance of a general MetadataSchema. -message MetadataSchema { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/MetadataSchema" - pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}" - }; - - // Describes the type of the MetadataSchema. - enum MetadataSchemaType { - // Unspecified type for the MetadataSchema. - METADATA_SCHEMA_TYPE_UNSPECIFIED = 0; - - // A type indicating that the MetadataSchema will be used by Artifacts. - ARTIFACT_TYPE = 1; - - // A typee indicating that the MetadataSchema will be used by Executions. - EXECUTION_TYPE = 2; - - // A state indicating that the MetadataSchema will be used by Contexts. - CONTEXT_TYPE = 3; - } - - // Output only. The resource name of the MetadataSchema. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The version of the MetadataSchema. The version's format must match - // the following regular expression: `^[0-9]+[.][0-9]+[.][0-9]+$`, which would - // allow to order/compare different versions. Example: 1.0.0, 1.0.1, etc. - string schema_version = 2; - - // Required. The raw YAML string representation of the MetadataSchema. The combination - // of [MetadataSchema.version] and the schema name given by `title` in - // [MetadataSchema.schema] must be unique within a MetadataStore. - // - // The schema is defined as an OpenAPI 3.0.2 - // [MetadataSchema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject) - string schema = 3 [(google.api.field_behavior) = REQUIRED]; - - // The type of the MetadataSchema. This is a property that identifies which - // metadata types will use the MetadataSchema. - MetadataSchemaType schema_type = 4; - - // Output only. Timestamp when this MetadataSchema was created. - google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Description of the Metadata Schema - string description = 6; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto deleted file mode 100644 index afcf68d0..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_service.proto +++ /dev/null @@ -1,1257 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/artifact.proto"; -import "google/cloud/aiplatform/v1beta1/context.proto"; -import "google/cloud/aiplatform/v1beta1/event.proto"; -import "google/cloud/aiplatform/v1beta1/execution.proto"; -import "google/cloud/aiplatform/v1beta1/lineage_subgraph.proto"; -import "google/cloud/aiplatform/v1beta1/metadata_schema.proto"; -import "google/cloud/aiplatform/v1beta1/metadata_store.proto"; -import "google/cloud/aiplatform/v1beta1/operation.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "MetadataServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Service for reading and writing metadata entries. -service MetadataService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Initializes a MetadataStore, including allocation of resources. - rpc CreateMetadataStore(CreateMetadataStoreRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/metadataStores" - body: "metadata_store" - }; - option (google.api.method_signature) = "parent,metadata_store,metadata_store_id"; - option (google.longrunning.operation_info) = { - response_type: "MetadataStore" - metadata_type: "CreateMetadataStoreOperationMetadata" - }; - } - - // Retrieves a specific MetadataStore. - rpc GetMetadataStore(GetMetadataStoreRequest) returns (MetadataStore) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/metadataStores/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists MetadataStores for a Location. - rpc ListMetadataStores(ListMetadataStoresRequest) returns (ListMetadataStoresResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/metadataStores" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a single MetadataStore and all its child resources (Artifacts, - // Executions, and Contexts). - rpc DeleteMetadataStore(DeleteMetadataStoreRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/metadataStores/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteMetadataStoreOperationMetadata" - }; - } - - // Creates an Artifact associated with a MetadataStore. - rpc CreateArtifact(CreateArtifactRequest) returns (Artifact) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/artifacts" - body: "artifact" - }; - option (google.api.method_signature) = "parent,artifact,artifact_id"; - } - - // Retrieves a specific Artifact. - rpc GetArtifact(GetArtifactRequest) returns (Artifact) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Artifacts in the MetadataStore. - rpc ListArtifacts(ListArtifactsRequest) returns (ListArtifactsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/artifacts" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates a stored Artifact. - rpc UpdateArtifact(UpdateArtifactRequest) returns (Artifact) { - option (google.api.http) = { - patch: "/v1beta1/{artifact.name=projects/*/locations/*/metadataStores/*/artifacts/*}" - body: "artifact" - }; - option (google.api.method_signature) = "artifact,update_mask"; - } - - // Deletes an Artifact. - rpc DeleteArtifact(DeleteArtifactRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Purges Artifacts. - rpc PurgeArtifacts(PurgeArtifactsRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/artifacts:purge" - body: "*" - }; - option (google.api.method_signature) = "parent"; - option (google.longrunning.operation_info) = { - response_type: "PurgeArtifactsResponse" - metadata_type: "PurgeArtifactsMetadata" - }; - } - - // Creates a Context associated with a MetadataStore. - rpc CreateContext(CreateContextRequest) returns (Context) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/contexts" - body: "context" - }; - option (google.api.method_signature) = "parent,context,context_id"; - } - - // Retrieves a specific Context. - rpc GetContext(GetContextRequest) returns (Context) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Contexts on the MetadataStore. - rpc ListContexts(ListContextsRequest) returns (ListContextsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/contexts" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates a stored Context. - rpc UpdateContext(UpdateContextRequest) returns (Context) { - option (google.api.http) = { - patch: "/v1beta1/{context.name=projects/*/locations/*/metadataStores/*/contexts/*}" - body: "context" - }; - option (google.api.method_signature) = "context,update_mask"; - } - - // Deletes a stored Context. - rpc DeleteContext(DeleteContextRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Purges Contexts. - rpc PurgeContexts(PurgeContextsRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/contexts:purge" - body: "*" - }; - option (google.api.method_signature) = "parent"; - option (google.longrunning.operation_info) = { - response_type: "PurgeContextsResponse" - metadata_type: "PurgeContextsMetadata" - }; - } - - // Adds a set of Artifacts and Executions to a Context. If any of the - // Artifacts or Executions have already been added to a Context, they are - // simply skipped. - rpc AddContextArtifactsAndExecutions(AddContextArtifactsAndExecutionsRequest) returns (AddContextArtifactsAndExecutionsResponse) { - option (google.api.http) = { - post: "/v1beta1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:addContextArtifactsAndExecutions" - body: "*" - }; - option (google.api.method_signature) = "context,artifacts,executions"; - } - - // Adds a set of Contexts as children to a parent Context. If any of the - // child Contexts have already been added to the parent Context, they are - // simply skipped. If this call would create a cycle or cause any Context to - // have more than 10 parents, the request will fail with an INVALID_ARGUMENT - // error. - rpc AddContextChildren(AddContextChildrenRequest) returns (AddContextChildrenResponse) { - option (google.api.http) = { - post: "/v1beta1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:addContextChildren" - body: "*" - }; - option (google.api.method_signature) = "context,child_contexts"; - } - - // Retrieves Artifacts and Executions within the specified Context, connected - // by Event edges and returned as a LineageSubgraph. - rpc QueryContextLineageSubgraph(QueryContextLineageSubgraphRequest) returns (LineageSubgraph) { - option (google.api.http) = { - get: "/v1beta1/{context=projects/*/locations/*/metadataStores/*/contexts/*}:queryContextLineageSubgraph" - }; - option (google.api.method_signature) = "context"; - } - - // Creates an Execution associated with a MetadataStore. - rpc CreateExecution(CreateExecutionRequest) returns (Execution) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/executions" - body: "execution" - }; - option (google.api.method_signature) = "parent,execution,execution_id"; - } - - // Retrieves a specific Execution. - rpc GetExecution(GetExecutionRequest) returns (Execution) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Executions in the MetadataStore. - rpc ListExecutions(ListExecutionsRequest) returns (ListExecutionsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/executions" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates a stored Execution. - rpc UpdateExecution(UpdateExecutionRequest) returns (Execution) { - option (google.api.http) = { - patch: "/v1beta1/{execution.name=projects/*/locations/*/metadataStores/*/executions/*}" - body: "execution" - }; - option (google.api.method_signature) = "execution,update_mask"; - } - - // Deletes an Execution. - rpc DeleteExecution(DeleteExecutionRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Purges Executions. - rpc PurgeExecutions(PurgeExecutionsRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/executions:purge" - body: "*" - }; - option (google.api.method_signature) = "parent"; - option (google.longrunning.operation_info) = { - response_type: "PurgeExecutionsResponse" - metadata_type: "PurgeExecutionsMetadata" - }; - } - - // Adds Events to the specified Execution. An Event indicates whether an - // Artifact was used as an input or output for an Execution. If an Event - // already exists between the Execution and the Artifact, the Event is - // skipped. - rpc AddExecutionEvents(AddExecutionEventsRequest) returns (AddExecutionEventsResponse) { - option (google.api.http) = { - post: "/v1beta1/{execution=projects/*/locations/*/metadataStores/*/executions/*}:addExecutionEvents" - body: "*" - }; - option (google.api.method_signature) = "execution,events"; - } - - // Obtains the set of input and output Artifacts for this Execution, in the - // form of LineageSubgraph that also contains the Execution and connecting - // Events. - rpc QueryExecutionInputsAndOutputs(QueryExecutionInputsAndOutputsRequest) returns (LineageSubgraph) { - option (google.api.http) = { - get: "/v1beta1/{execution=projects/*/locations/*/metadataStores/*/executions/*}:queryExecutionInputsAndOutputs" - }; - option (google.api.method_signature) = "execution"; - } - - // Creates a MetadataSchema. - rpc CreateMetadataSchema(CreateMetadataSchemaRequest) returns (MetadataSchema) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/metadataSchemas" - body: "metadata_schema" - }; - option (google.api.method_signature) = "parent,metadata_schema,metadata_schema_id"; - } - - // Retrieves a specific MetadataSchema. - rpc GetMetadataSchema(GetMetadataSchemaRequest) returns (MetadataSchema) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/metadataStores/*/metadataSchemas/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists MetadataSchemas. - rpc ListMetadataSchemas(ListMetadataSchemasRequest) returns (ListMetadataSchemasResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/metadataStores/*}/metadataSchemas" - }; - option (google.api.method_signature) = "parent"; - } - - // Retrieves lineage of an Artifact represented through Artifacts and - // Executions connected by Event edges and returned as a LineageSubgraph. - rpc QueryArtifactLineageSubgraph(QueryArtifactLineageSubgraphRequest) returns (LineageSubgraph) { - option (google.api.http) = { - get: "/v1beta1/{artifact=projects/*/locations/*/metadataStores/*/artifacts/*}:queryArtifactLineageSubgraph" - }; - option (google.api.method_signature) = "artifact"; - } -} - -// Request message for [MetadataService.CreateMetadataStore][google.cloud.aiplatform.v1beta1.MetadataService.CreateMetadataStore]. -message CreateMetadataStoreRequest { - // Required. The resource name of the Location where the MetadataStore should - // be created. - // Format: `projects/{project}/locations/{location}/` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The MetadataStore to create. - MetadataStore metadata_store = 2 [(google.api.field_behavior) = REQUIRED]; - - // The {metadatastore} portion of the resource name with the format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - // If not provided, the MetadataStore's ID will be a UUID generated by the - // service. - // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. - // Must be unique across all MetadataStores in the parent Location. - // (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED - // if the caller can't view the preexisting MetadataStore.) - string metadata_store_id = 3; -} - -// Details of operations that perform [MetadataService.CreateMetadataStore][google.cloud.aiplatform.v1beta1.MetadataService.CreateMetadataStore]. -message CreateMetadataStoreOperationMetadata { - // Operation metadata for creating a MetadataStore. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [MetadataService.GetMetadataStore][google.cloud.aiplatform.v1beta1.MetadataService.GetMetadataStore]. -message GetMetadataStoreRequest { - // Required. The resource name of the MetadataStore to retrieve. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/MetadataStore" - } - ]; -} - -// Request message for [MetadataService.ListMetadataStores][google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataStores]. -message ListMetadataStoresRequest { - // Required. The Location whose MetadataStores should be listed. - // Format: - // `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The maximum number of Metadata Stores to return. The service may return - // fewer. - // Must be in range 1-1000, inclusive. Defaults to 100. - int32 page_size = 2; - - // A page token, received from a previous - // [MetadataService.ListMetadataStores][google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataStores] call. Provide this to retrieve the - // subsequent page. - // - // When paginating, all other provided parameters must match the call that - // provided the page token. (Otherwise the request will fail with - // INVALID_ARGUMENT error.) - string page_token = 3; -} - -// Response message for [MetadataService.ListMetadataStores][google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataStores]. -message ListMetadataStoresResponse { - // The MetadataStores found for the Location. - repeated MetadataStore metadata_stores = 1; - - // A token, which can be sent as - // [ListMetadataStoresRequest.page_token][google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest.page_token] to retrieve the next - // page. If this field is not populated, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [MetadataService.DeleteMetadataStore][google.cloud.aiplatform.v1beta1.MetadataService.DeleteMetadataStore]. -message DeleteMetadataStoreRequest { - // Required. The resource name of the MetadataStore to delete. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/MetadataStore" - } - ]; - - // Deprecated: Field is no longer supported. - bool force = 2 [deprecated = true]; -} - -// Details of operations that perform [MetadataService.DeleteMetadataStore][google.cloud.aiplatform.v1beta1.MetadataService.DeleteMetadataStore]. -message DeleteMetadataStoreOperationMetadata { - // Operation metadata for deleting a MetadataStore. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [MetadataService.CreateArtifact][google.cloud.aiplatform.v1beta1.MetadataService.CreateArtifact]. -message CreateArtifactRequest { - // Required. The resource name of the MetadataStore where the Artifact should - // be created. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/MetadataStore" - } - ]; - - // Required. The Artifact to create. - Artifact artifact = 2 [(google.api.field_behavior) = REQUIRED]; - - // The {artifact} portion of the resource name with the format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - // If not provided, the Artifact's ID will be a UUID generated by the service. - // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. - // Must be unique across all Artifacts in the parent MetadataStore. (Otherwise - // the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the - // caller can't view the preexisting Artifact.) - string artifact_id = 3; -} - -// Request message for [MetadataService.GetArtifact][google.cloud.aiplatform.v1beta1.MetadataService.GetArtifact]. -message GetArtifactRequest { - // Required. The resource name of the Artifact to retrieve. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Artifact" - } - ]; -} - -// Request message for [MetadataService.ListArtifacts][google.cloud.aiplatform.v1beta1.MetadataService.ListArtifacts]. -message ListArtifactsRequest { - // Required. The MetadataStore whose Artifacts should be listed. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Artifact" - } - ]; - - // The maximum number of Artifacts to return. The service may return fewer. - // Must be in range 1-1000, inclusive. Defaults to 100. - int32 page_size = 2; - - // A page token, received from a previous [MetadataService.ListArtifacts][google.cloud.aiplatform.v1beta1.MetadataService.ListArtifacts] - // call. Provide this to retrieve the subsequent page. - // - // When paginating, all other provided parameters must match the call that - // provided the page token. (Otherwise the request will fail with - // INVALID_ARGUMENT error.) - string page_token = 3; - - // Filter specifying the boolean condition for the Artifacts to satisfy in - // order to be part of the result set. - // The syntax to define filter query is based on https://google.aip.dev/160. - // The supported set of filters include the following: - // - // * **Attribute filtering**: - // For example: `display_name = "test"`. - // Supported fields include: `name`, `display_name`, `uri`, `state`, - // `schema_title`, `create_time`, and `update_time`. - // Time fields, such as `create_time` and `update_time`, require values - // specified in RFC-3339 format. - // For example: `create_time = "2020-11-19T11:30:00-04:00"` - // * **Metadata field**: - // To filter on metadata fields use traversal operation as follows: - // `metadata..`. - // For example: `metadata.field_1.number_value = 10.0` - // * **Context based filtering**: - // To filter Artifacts based on the contexts to which they belong, use the - // function operator with the full resource name - // `in_context()`. - // For example: - // `in_context("projects//locations//metadataStores//contexts/")` - // - // Each of the above supported filter types can be combined together using - // logical operators (`AND` & `OR`). - // - // For example: `display_name = "test" AND metadata.field1.bool_value = true`. - string filter = 4; -} - -// Response message for [MetadataService.ListArtifacts][google.cloud.aiplatform.v1beta1.MetadataService.ListArtifacts]. -message ListArtifactsResponse { - // The Artifacts retrieved from the MetadataStore. - repeated Artifact artifacts = 1; - - // A token, which can be sent as [ListArtifactsRequest.page_token][google.cloud.aiplatform.v1beta1.ListArtifactsRequest.page_token] - // to retrieve the next page. - // If this field is not populated, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [MetadataService.UpdateArtifact][google.cloud.aiplatform.v1beta1.MetadataService.UpdateArtifact]. -message UpdateArtifactRequest { - // Required. The Artifact containing updates. - // The Artifact's [Artifact.name][google.cloud.aiplatform.v1beta1.Artifact.name] field is used to identify the Artifact to - // be updated. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - Artifact artifact = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A FieldMask indicating which fields should be updated. - // Functionality of this field is not yet supported. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; - - // If set to true, and the [Artifact][google.cloud.aiplatform.v1beta1.Artifact] is not found, a new [Artifact][google.cloud.aiplatform.v1beta1.Artifact] is - // created. - bool allow_missing = 3; -} - -// Request message for [MetadataService.DeleteArtifact][google.cloud.aiplatform.v1beta1.MetadataService.DeleteArtifact]. -message DeleteArtifactRequest { - // Required. The resource name of the Artifact to delete. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Artifact" - } - ]; - - // Optional. The etag of the Artifact to delete. - // If this is provided, it must match the server's etag. Otherwise, the - // request will fail with a FAILED_PRECONDITION. - string etag = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for [MetadataService.PurgeArtifacts][google.cloud.aiplatform.v1beta1.MetadataService.PurgeArtifacts]. -message PurgeArtifactsRequest { - // Required. The metadata store to purge Artifacts from. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Artifact" - } - ]; - - // Required. A required filter matching the Artifacts to be purged. - // E.g., `update_time <= 2020-11-19T11:30:00-04:00`. - string filter = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Flag to indicate to actually perform the purge. - // If `force` is set to false, the method will return a sample of - // Artifact names that would be deleted. - bool force = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for [MetadataService.PurgeArtifacts][google.cloud.aiplatform.v1beta1.MetadataService.PurgeArtifacts]. -message PurgeArtifactsResponse { - // The number of Artifacts that this request deleted (or, if `force` is false, - // the number of Artifacts that will be deleted). This can be an estimate. - int64 purge_count = 1; - - // A sample of the Artifact names that will be deleted. - // Only populated if `force` is set to false. The maximum number of samples is - // 100 (it is possible to return fewer). - repeated string purge_sample = 2 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Artifact" - }]; -} - -// Details of operations that perform [MetadataService.PurgeArtifacts][google.cloud.aiplatform.v1beta1.MetadataService.PurgeArtifacts]. -message PurgeArtifactsMetadata { - // Operation metadata for purging Artifacts. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [MetadataService.CreateContext][google.cloud.aiplatform.v1beta1.MetadataService.CreateContext]. -message CreateContextRequest { - // Required. The resource name of the MetadataStore where the Context should be - // created. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/MetadataStore" - } - ]; - - // Required. The Context to create. - Context context = 2 [(google.api.field_behavior) = REQUIRED]; - - // The {context} portion of the resource name with the format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`. - // If not provided, the Context's ID will be a UUID generated by the service. - // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. - // Must be unique across all Contexts in the parent MetadataStore. (Otherwise - // the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the - // caller can't view the preexisting Context.) - string context_id = 3; -} - -// Request message for [MetadataService.GetContext][google.cloud.aiplatform.v1beta1.MetadataService.GetContext]. -message GetContextRequest { - // Required. The resource name of the Context to retrieve. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - } - ]; -} - -// Request message for [MetadataService.ListContexts][google.cloud.aiplatform.v1beta1.MetadataService.ListContexts] -message ListContextsRequest { - // Required. The MetadataStore whose Contexts should be listed. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Context" - } - ]; - - // The maximum number of Contexts to return. The service may return fewer. - // Must be in range 1-1000, inclusive. Defaults to 100. - int32 page_size = 2; - - // A page token, received from a previous [MetadataService.ListContexts][google.cloud.aiplatform.v1beta1.MetadataService.ListContexts] - // call. Provide this to retrieve the subsequent page. - // - // When paginating, all other provided parameters must match the call that - // provided the page token. (Otherwise the request will fail with - // INVALID_ARGUMENT error.) - string page_token = 3; - - // Filter specifying the boolean condition for the Contexts to satisfy in - // order to be part of the result set. - // The syntax to define filter query is based on https://google.aip.dev/160. - // Following are the supported set of filters: - // - // * **Attribute filtering**: - // For example: `display_name = "test"`. - // Supported fields include: `name`, `display_name`, `schema_title`, - // `create_time`, and `update_time`. - // Time fields, such as `create_time` and `update_time`, require values - // specified in RFC-3339 format. - // For example: `create_time = "2020-11-19T11:30:00-04:00"`. - // * **Metadata field**: - // To filter on metadata fields use traversal operation as follows: - // `metadata..`. - // For example: `metadata.field_1.number_value = 10.0`. - // * **Parent Child filtering**: - // To filter Contexts based on parent-child relationship use the HAS - // operator as follows: - // - // ``` - // parent_contexts: - // "projects//locations//metadataStores//contexts/" - // child_contexts: - // "projects//locations//metadataStores//contexts/" - // ``` - // - // Each of the above supported filters can be combined together using - // logical operators (`AND` & `OR`). - // - // For example: `display_name = "test" AND metadata.field1.bool_value = true`. - string filter = 4; -} - -// Response message for [MetadataService.ListContexts][google.cloud.aiplatform.v1beta1.MetadataService.ListContexts]. -message ListContextsResponse { - // The Contexts retrieved from the MetadataStore. - repeated Context contexts = 1; - - // A token, which can be sent as [ListContextsRequest.page_token][google.cloud.aiplatform.v1beta1.ListContextsRequest.page_token] - // to retrieve the next page. - // If this field is not populated, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [MetadataService.UpdateContext][google.cloud.aiplatform.v1beta1.MetadataService.UpdateContext]. -message UpdateContextRequest { - // Required. The Context containing updates. - // The Context's [Context.name][google.cloud.aiplatform.v1beta1.Context.name] field is used to identify the Context to be - // updated. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - Context context = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A FieldMask indicating which fields should be updated. - // Functionality of this field is not yet supported. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; - - // If set to true, and the [Context][google.cloud.aiplatform.v1beta1.Context] is not found, a new [Context][google.cloud.aiplatform.v1beta1.Context] is - // created. - bool allow_missing = 3; -} - -// Request message for [MetadataService.DeleteContext][google.cloud.aiplatform.v1beta1.MetadataService.DeleteContext]. -message DeleteContextRequest { - // Required. The resource name of the Context to delete. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - } - ]; - - // The force deletion semantics is still undefined. - // Users should not use this field. - bool force = 2; - - // Optional. The etag of the Context to delete. - // If this is provided, it must match the server's etag. Otherwise, the - // request will fail with a FAILED_PRECONDITION. - string etag = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for [MetadataService.PurgeContexts][google.cloud.aiplatform.v1beta1.MetadataService.PurgeContexts]. -message PurgeContextsRequest { - // Required. The metadata store to purge Contexts from. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Context" - } - ]; - - // Required. A required filter matching the Contexts to be purged. - // E.g., `update_time <= 2020-11-19T11:30:00-04:00`. - string filter = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Flag to indicate to actually perform the purge. - // If `force` is set to false, the method will return a sample of - // Context names that would be deleted. - bool force = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for [MetadataService.PurgeContexts][google.cloud.aiplatform.v1beta1.MetadataService.PurgeContexts]. -message PurgeContextsResponse { - // The number of Contexts that this request deleted (or, if `force` is false, - // the number of Contexts that will be deleted). This can be an estimate. - int64 purge_count = 1; - - // A sample of the Context names that will be deleted. - // Only populated if `force` is set to false. The maximum number of samples is - // 100 (it is possible to return fewer). - repeated string purge_sample = 2 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - }]; -} - -// Details of operations that perform [MetadataService.PurgeContexts][google.cloud.aiplatform.v1beta1.MetadataService.PurgeContexts]. -message PurgeContextsMetadata { - // Operation metadata for purging Contexts. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [MetadataService.AddContextArtifactsAndExecutions][google.cloud.aiplatform.v1beta1.MetadataService.AddContextArtifactsAndExecutions]. -message AddContextArtifactsAndExecutionsRequest { - // Required. The resource name of the Context that the Artifacts and Executions - // belong to. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - string context = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - } - ]; - - // The resource names of the Artifacts to attribute to the Context. - // - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - repeated string artifacts = 2 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Artifact" - }]; - - // The resource names of the Executions to associate with the - // Context. - // - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - repeated string executions = 3 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Execution" - }]; -} - -// Response message for [MetadataService.AddContextArtifactsAndExecutions][google.cloud.aiplatform.v1beta1.MetadataService.AddContextArtifactsAndExecutions]. -message AddContextArtifactsAndExecutionsResponse { - -} - -// Request message for [MetadataService.AddContextChildren][google.cloud.aiplatform.v1beta1.MetadataService.AddContextChildren]. -message AddContextChildrenRequest { - // Required. The resource name of the parent Context. - // - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - string context = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - } - ]; - - // The resource names of the child Contexts. - repeated string child_contexts = 2 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - }]; -} - -// Response message for [MetadataService.AddContextChildren][google.cloud.aiplatform.v1beta1.MetadataService.AddContextChildren]. -message AddContextChildrenResponse { - -} - -// Request message for [MetadataService.QueryContextLineageSubgraph][google.cloud.aiplatform.v1beta1.MetadataService.QueryContextLineageSubgraph]. -message QueryContextLineageSubgraphRequest { - // Required. The resource name of the Context whose Artifacts and Executions - // should be retrieved as a LineageSubgraph. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - // - // The request may error with FAILED_PRECONDITION if the number of Artifacts, - // the number of Executions, or the number of Events that would be returned - // for the Context exceeds 1000. - string context = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Context" - } - ]; -} - -// Request message for [MetadataService.CreateExecution][google.cloud.aiplatform.v1beta1.MetadataService.CreateExecution]. -message CreateExecutionRequest { - // Required. The resource name of the MetadataStore where the Execution should - // be created. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/MetadataStore" - } - ]; - - // Required. The Execution to create. - Execution execution = 2 [(google.api.field_behavior) = REQUIRED]; - - // The {execution} portion of the resource name with the format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - // If not provided, the Execution's ID will be a UUID generated by the - // service. - // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. - // Must be unique across all Executions in the parent MetadataStore. - // (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED - // if the caller can't view the preexisting Execution.) - string execution_id = 3; -} - -// Request message for [MetadataService.GetExecution][google.cloud.aiplatform.v1beta1.MetadataService.GetExecution]. -message GetExecutionRequest { - // Required. The resource name of the Execution to retrieve. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Execution" - } - ]; -} - -// Request message for [MetadataService.ListExecutions][google.cloud.aiplatform.v1beta1.MetadataService.ListExecutions]. -message ListExecutionsRequest { - // Required. The MetadataStore whose Executions should be listed. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Execution" - } - ]; - - // The maximum number of Executions to return. The service may return fewer. - // Must be in range 1-1000, inclusive. Defaults to 100. - int32 page_size = 2; - - // A page token, received from a previous [MetadataService.ListExecutions][google.cloud.aiplatform.v1beta1.MetadataService.ListExecutions] - // call. Provide this to retrieve the subsequent page. - // - // When paginating, all other provided parameters must match the call that - // provided the page token. (Otherwise the request will fail with an - // INVALID_ARGUMENT error.) - string page_token = 3; - - // Filter specifying the boolean condition for the Executions to satisfy in - // order to be part of the result set. - // The syntax to define filter query is based on https://google.aip.dev/160. - // Following are the supported set of filters: - // - // * **Attribute filtering**: - // For example: `display_name = "test"`. - // Supported fields include: `name`, `display_name`, `state`, - // `schema_title`, `create_time`, and `update_time`. - // Time fields, such as `create_time` and `update_time`, require values - // specified in RFC-3339 format. - // For example: `create_time = "2020-11-19T11:30:00-04:00"`. - // * **Metadata field**: - // To filter on metadata fields use traversal operation as follows: - // `metadata..` - // For example: `metadata.field_1.number_value = 10.0` - // * **Context based filtering**: - // To filter Executions based on the contexts to which they belong use - // the function operator with the full resource name: - // `in_context()`. - // For example: - // `in_context("projects//locations//metadataStores//contexts/")` - // - // Each of the above supported filters can be combined together using - // logical operators (`AND` & `OR`). - // For example: `display_name = "test" AND metadata.field1.bool_value = true`. - string filter = 4; -} - -// Response message for [MetadataService.ListExecutions][google.cloud.aiplatform.v1beta1.MetadataService.ListExecutions]. -message ListExecutionsResponse { - // The Executions retrieved from the MetadataStore. - repeated Execution executions = 1; - - // A token, which can be sent as [ListExecutionsRequest.page_token][google.cloud.aiplatform.v1beta1.ListExecutionsRequest.page_token] - // to retrieve the next page. - // If this field is not populated, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [MetadataService.UpdateExecution][google.cloud.aiplatform.v1beta1.MetadataService.UpdateExecution]. -message UpdateExecutionRequest { - // Required. The Execution containing updates. - // The Execution's [Execution.name][google.cloud.aiplatform.v1beta1.Execution.name] field is used to identify the Execution - // to be updated. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - Execution execution = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A FieldMask indicating which fields should be updated. - // Functionality of this field is not yet supported. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; - - // If set to true, and the [Execution][google.cloud.aiplatform.v1beta1.Execution] is not found, a new [Execution][google.cloud.aiplatform.v1beta1.Execution] - // is created. - bool allow_missing = 3; -} - -// Request message for [MetadataService.DeleteExecution][google.cloud.aiplatform.v1beta1.MetadataService.DeleteExecution]. -message DeleteExecutionRequest { - // Required. The resource name of the Execution to delete. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Execution" - } - ]; - - // Optional. The etag of the Execution to delete. - // If this is provided, it must match the server's etag. Otherwise, the - // request will fail with a FAILED_PRECONDITION. - string etag = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for [MetadataService.PurgeExecutions][google.cloud.aiplatform.v1beta1.MetadataService.PurgeExecutions]. -message PurgeExecutionsRequest { - // Required. The metadata store to purge Executions from. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Execution" - } - ]; - - // Required. A required filter matching the Executions to be purged. - // E.g., `update_time <= 2020-11-19T11:30:00-04:00`. - string filter = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Flag to indicate to actually perform the purge. - // If `force` is set to false, the method will return a sample of - // Execution names that would be deleted. - bool force = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for [MetadataService.PurgeExecutions][google.cloud.aiplatform.v1beta1.MetadataService.PurgeExecutions]. -message PurgeExecutionsResponse { - // The number of Executions that this request deleted (or, if `force` is - // false, the number of Executions that will be deleted). This can be an - // estimate. - int64 purge_count = 1; - - // A sample of the Execution names that will be deleted. - // Only populated if `force` is set to false. The maximum number of samples is - // 100 (it is possible to return fewer). - repeated string purge_sample = 2 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Execution" - }]; -} - -// Details of operations that perform [MetadataService.PurgeExecutions][google.cloud.aiplatform.v1beta1.MetadataService.PurgeExecutions]. -message PurgeExecutionsMetadata { - // Operation metadata for purging Executions. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [MetadataService.AddExecutionEvents][google.cloud.aiplatform.v1beta1.MetadataService.AddExecutionEvents]. -message AddExecutionEventsRequest { - // Required. The resource name of the Execution that the Events connect - // Artifacts with. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - string execution = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Execution" - } - ]; - - // The Events to create and add. - repeated Event events = 2; -} - -// Response message for [MetadataService.AddExecutionEvents][google.cloud.aiplatform.v1beta1.MetadataService.AddExecutionEvents]. -message AddExecutionEventsResponse { - -} - -// Request message for [MetadataService.QueryExecutionInputsAndOutputs][google.cloud.aiplatform.v1beta1.MetadataService.QueryExecutionInputsAndOutputs]. -message QueryExecutionInputsAndOutputsRequest { - // Required. The resource name of the Execution whose input and output Artifacts should - // be retrieved as a LineageSubgraph. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - string execution = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Execution" - } - ]; -} - -// Request message for [MetadataService.CreateMetadataSchema][google.cloud.aiplatform.v1beta1.MetadataService.CreateMetadataSchema]. -message CreateMetadataSchemaRequest { - // Required. The resource name of the MetadataStore where the MetadataSchema should - // be created. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/MetadataStore" - } - ]; - - // Required. The MetadataSchema to create. - MetadataSchema metadata_schema = 2 [(google.api.field_behavior) = REQUIRED]; - - // The {metadata_schema} portion of the resource name with the format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` - // If not provided, the MetadataStore's ID will be a UUID generated by the - // service. - // Must be 4-128 characters in length. Valid characters are `/[a-z][0-9]-/`. - // Must be unique across all MetadataSchemas in the parent Location. - // (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED - // if the caller can't view the preexisting MetadataSchema.) - string metadata_schema_id = 3; -} - -// Request message for [MetadataService.GetMetadataSchema][google.cloud.aiplatform.v1beta1.MetadataService.GetMetadataSchema]. -message GetMetadataSchemaRequest { - // Required. The resource name of the MetadataSchema to retrieve. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/MetadataSchema" - } - ]; -} - -// Request message for [MetadataService.ListMetadataSchemas][google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataSchemas]. -message ListMetadataSchemasRequest { - // Required. The MetadataStore whose MetadataSchemas should be listed. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/MetadataSchema" - } - ]; - - // The maximum number of MetadataSchemas to return. The service may return - // fewer. - // Must be in range 1-1000, inclusive. Defaults to 100. - int32 page_size = 2; - - // A page token, received from a previous - // [MetadataService.ListMetadataSchemas][google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataSchemas] call. Provide this to retrieve the - // next page. - // - // When paginating, all other provided parameters must match the call that - // provided the page token. (Otherwise the request will fail with - // INVALID_ARGUMENT error.) - string page_token = 3; - - // A query to filter available MetadataSchemas for matching results. - string filter = 4; -} - -// Response message for [MetadataService.ListMetadataSchemas][google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataSchemas]. -message ListMetadataSchemasResponse { - // The MetadataSchemas found for the MetadataStore. - repeated MetadataSchema metadata_schemas = 1; - - // A token, which can be sent as - // [ListMetadataSchemasRequest.page_token][google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest.page_token] to retrieve the next - // page. If this field is not populated, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [MetadataService.QueryArtifactLineageSubgraph][google.cloud.aiplatform.v1beta1.MetadataService.QueryArtifactLineageSubgraph]. -message QueryArtifactLineageSubgraphRequest { - // Required. The resource name of the Artifact whose Lineage needs to be retrieved as a - // LineageSubgraph. - // Format: - // `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - // - // The request may error with FAILED_PRECONDITION if the number of Artifacts, - // the number of Executions, or the number of Events that would be returned - // for the Context exceeds 1000. - string artifact = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Artifact" - } - ]; - - // Specifies the size of the lineage graph in terms of number of hops from the - // specified artifact. - // Negative Value: INVALID_ARGUMENT error is returned - // 0: Only input artifact is returned. - // No value: Transitive closure is performed to return the complete graph. - int32 max_hops = 2; - - // Filter specifying the boolean condition for the Artifacts to satisfy in - // order to be part of the Lineage Subgraph. - // The syntax to define filter query is based on https://google.aip.dev/160. - // The supported set of filters include the following: - // - // * **Attribute filtering**: - // For example: `display_name = "test"` - // Supported fields include: `name`, `display_name`, `uri`, `state`, - // `schema_title`, `create_time`, and `update_time`. - // Time fields, such as `create_time` and `update_time`, require values - // specified in RFC-3339 format. - // For example: `create_time = "2020-11-19T11:30:00-04:00"` - // * **Metadata field**: - // To filter on metadata fields use traversal operation as follows: - // `metadata..`. - // For example: `metadata.field_1.number_value = 10.0` - // - // Each of the above supported filter types can be combined together using - // logical operators (`AND` & `OR`). - // - // For example: `display_name = "test" AND metadata.field1.bool_value = true`. - string filter = 3; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_store.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_store.proto deleted file mode 100644 index 2d8a19d3..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/metadata_store.proto +++ /dev/null @@ -1,65 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "MetadataProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Instance of a metadata store. Contains a set of metadata that can be -// queried. -message MetadataStore { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/MetadataStore" - pattern: "projects/{project}/locations/{location}/metadataStores/{metadata_store}" - }; - - // Represents state information for a MetadataStore. - message MetadataStoreState { - // The disk utilization of the MetadataStore in bytes. - int64 disk_utilization_bytes = 1; - } - - // Output only. The resource name of the MetadataStore instance. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this MetadataStore was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this MetadataStore was last updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Customer-managed encryption key spec for a Metadata Store. If set, this - // Metadata Store and all sub-resources of this Metadata Store are secured - // using this key. - EncryptionSpec encryption_spec = 5; - - // Description of the MetadataStore. - string description = 6; - - // Output only. State information of the MetadataStore. - MetadataStoreState state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto deleted file mode 100644 index bd8aa730..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto +++ /dev/null @@ -1,150 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "MigratableResourceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; -option (google.api.resource_definition) = { - type: "ml.googleapis.com/Version" - pattern: "projects/{project}/models/{model}/versions/{version}" -}; -option (google.api.resource_definition) = { - type: "automl.googleapis.com/Model" - pattern: "projects/{project}/locations/{location}/models/{model}" -}; -option (google.api.resource_definition) = { - type: "automl.googleapis.com/Dataset" - pattern: "projects/{project}/locations/{location}/datasets/{dataset}" -}; -option (google.api.resource_definition) = { - type: "datalabeling.googleapis.com/Dataset" - pattern: "projects/{project}/datasets/{dataset}" -}; -option (google.api.resource_definition) = { - type: "datalabeling.googleapis.com/AnnotatedDataset" - pattern: "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}" -}; - -// Represents one resource that exists in automl.googleapis.com, -// datalabeling.googleapis.com or ml.googleapis.com. -message MigratableResource { - // Represents one model Version in ml.googleapis.com. - message MlEngineModelVersion { - // The ml.googleapis.com endpoint that this model Version currently lives - // in. - // Example values: - // - // * ml.googleapis.com - // * us-centrall-ml.googleapis.com - // * europe-west4-ml.googleapis.com - // * asia-east1-ml.googleapis.com - string endpoint = 1; - - // Full resource name of ml engine model Version. - // Format: `projects/{project}/models/{model}/versions/{version}`. - string version = 2 [(google.api.resource_reference) = { - type: "ml.googleapis.com/Version" - }]; - } - - // Represents one Model in automl.googleapis.com. - message AutomlModel { - // Full resource name of automl Model. - // Format: - // `projects/{project}/locations/{location}/models/{model}`. - string model = 1 [(google.api.resource_reference) = { - type: "automl.googleapis.com/Model" - }]; - - // The Model's display name in automl.googleapis.com. - string model_display_name = 3; - } - - // Represents one Dataset in automl.googleapis.com. - message AutomlDataset { - // Full resource name of automl Dataset. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}`. - string dataset = 1 [(google.api.resource_reference) = { - type: "automl.googleapis.com/Dataset" - }]; - - // The Dataset's display name in automl.googleapis.com. - string dataset_display_name = 4; - } - - // Represents one Dataset in datalabeling.googleapis.com. - message DataLabelingDataset { - // Represents one AnnotatedDataset in datalabeling.googleapis.com. - message DataLabelingAnnotatedDataset { - // Full resource name of data labeling AnnotatedDataset. - // Format: - // `projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}`. - string annotated_dataset = 1 [(google.api.resource_reference) = { - type: "datalabeling.googleapis.com/AnnotatedDataset" - }]; - - // The AnnotatedDataset's display name in datalabeling.googleapis.com. - string annotated_dataset_display_name = 3; - } - - // Full resource name of data labeling Dataset. - // Format: - // `projects/{project}/datasets/{dataset}`. - string dataset = 1 [(google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Dataset" - }]; - - // The Dataset's display name in datalabeling.googleapis.com. - string dataset_display_name = 4; - - // The migratable AnnotatedDataset in datalabeling.googleapis.com belongs to - // the data labeling Dataset. - repeated DataLabelingAnnotatedDataset data_labeling_annotated_datasets = 3; - } - - oneof resource { - // Output only. Represents one Version in ml.googleapis.com. - MlEngineModelVersion ml_engine_model_version = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents one Model in automl.googleapis.com. - AutomlModel automl_model = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents one Dataset in automl.googleapis.com. - AutomlDataset automl_dataset = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents one Dataset in datalabeling.googleapis.com. - DataLabelingDataset data_labeling_dataset = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. Timestamp when the last migration attempt on this MigratableResource - // started. Will not be set if there's no migration attempt on this - // MigratableResource. - google.protobuf.Timestamp last_migrate_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this MigratableResource was last updated. - google.protobuf.Timestamp last_update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/migration_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/migration_service.proto deleted file mode 100644 index f08ad889..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/migration_service.proto +++ /dev/null @@ -1,314 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/migratable_resource.proto"; -import "google/cloud/aiplatform/v1beta1/operation.proto"; -import "google/longrunning/operations.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "MigrationServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A service that migrates resources from automl.googleapis.com, -// datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. -service MigrationService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Searches all of the resources in automl.googleapis.com, - // datalabeling.googleapis.com and ml.googleapis.com that can be migrated to - // Vertex AI's given location. - rpc SearchMigratableResources(SearchMigratableResourcesRequest) returns (SearchMigratableResourcesResponse) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/migratableResources:search" - body: "*" - }; - option (google.api.method_signature) = "parent"; - } - - // Batch migrates resources from ml.googleapis.com, automl.googleapis.com, - // and datalabeling.googleapis.com to Vertex AI. - rpc BatchMigrateResources(BatchMigrateResourcesRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/migratableResources:batchMigrate" - body: "*" - }; - option (google.api.method_signature) = "parent,migrate_resource_requests"; - option (google.longrunning.operation_info) = { - response_type: "BatchMigrateResourcesResponse" - metadata_type: "BatchMigrateResourcesOperationMetadata" - }; - } -} - -// Request message for [MigrationService.SearchMigratableResources][google.cloud.aiplatform.v1beta1.MigrationService.SearchMigratableResources]. -message SearchMigratableResourcesRequest { - // Required. The location that the migratable resources should be searched from. - // It's the Vertex AI location that the resources can be migrated to, not - // the resources' original location. - // Format: - // `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The standard page size. - // The default and maximum value is 100. - int32 page_size = 2; - - // The standard page token. - string page_token = 3; - - // A filter for your search. You can use the following types of filters: - // - // * Resource type filters. The following strings filter for a specific type - // of [MigratableResource][google.cloud.aiplatform.v1beta1.MigratableResource]: - // * `ml_engine_model_version:*` - // * `automl_model:*` - // * `automl_dataset:*` - // * `data_labeling_dataset:*` - // * "Migrated or not" filters. The following strings filter for resources - // that either have or have not already been migrated: - // * `last_migrate_time:*` filters for migrated resources. - // * `NOT last_migrate_time:*` filters for not yet migrated resources. - string filter = 4; -} - -// Response message for [MigrationService.SearchMigratableResources][google.cloud.aiplatform.v1beta1.MigrationService.SearchMigratableResources]. -message SearchMigratableResourcesResponse { - // All migratable resources that can be migrated to the - // location specified in the request. - repeated MigratableResource migratable_resources = 1; - - // The standard next-page token. - // The migratable_resources may not fill page_size in - // SearchMigratableResourcesRequest even when there are subsequent pages. - string next_page_token = 2; -} - -// Request message for [MigrationService.BatchMigrateResources][google.cloud.aiplatform.v1beta1.MigrationService.BatchMigrateResources]. -message BatchMigrateResourcesRequest { - // Required. The location of the migrated resource will live in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The request messages specifying the resources to migrate. - // They must be in the same location as the destination. - // Up to 50 resources can be migrated in one batch. - repeated MigrateResourceRequest migrate_resource_requests = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Config of migrating one resource from automl.googleapis.com, -// datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. -message MigrateResourceRequest { - // Config for migrating version in ml.googleapis.com to Vertex AI's Model. - message MigrateMlEngineModelVersionConfig { - // Required. The ml.googleapis.com endpoint that this model version should be migrated - // from. - // Example values: - // - // * ml.googleapis.com - // - // * us-centrall-ml.googleapis.com - // - // * europe-west4-ml.googleapis.com - // - // * asia-east1-ml.googleapis.com - string endpoint = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Full resource name of ml engine model version. - // Format: `projects/{project}/models/{model}/versions/{version}`. - string model_version = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "ml.googleapis.com/Version" - } - ]; - - // Required. Display name of the model in Vertex AI. - // System will pick a display name if unspecified. - string model_display_name = 3 [(google.api.field_behavior) = REQUIRED]; - } - - // Config for migrating Model in automl.googleapis.com to Vertex AI's Model. - message MigrateAutomlModelConfig { - // Required. Full resource name of automl Model. - // Format: - // `projects/{project}/locations/{location}/models/{model}`. - string model = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "automl.googleapis.com/Model" - } - ]; - - // Optional. Display name of the model in Vertex AI. - // System will pick a display name if unspecified. - string model_display_name = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Config for migrating Dataset in automl.googleapis.com to Vertex AI's - // Dataset. - message MigrateAutomlDatasetConfig { - // Required. Full resource name of automl Dataset. - // Format: - // `projects/{project}/locations/{location}/datasets/{dataset}`. - string dataset = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "automl.googleapis.com/Dataset" - } - ]; - - // Required. Display name of the Dataset in Vertex AI. - // System will pick a display name if unspecified. - string dataset_display_name = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Config for migrating Dataset in datalabeling.googleapis.com to Vertex - // AI's Dataset. - message MigrateDataLabelingDatasetConfig { - // Config for migrating AnnotatedDataset in datalabeling.googleapis.com to - // Vertex AI's SavedQuery. - message MigrateDataLabelingAnnotatedDatasetConfig { - // Required. Full resource name of data labeling AnnotatedDataset. - // Format: - // `projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}`. - string annotated_dataset = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/AnnotatedDataset" - } - ]; - } - - // Required. Full resource name of data labeling Dataset. - // Format: - // `projects/{project}/datasets/{dataset}`. - string dataset = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Dataset" - } - ]; - - // Optional. Display name of the Dataset in Vertex AI. - // System will pick a display name if unspecified. - string dataset_display_name = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Configs for migrating AnnotatedDataset in datalabeling.googleapis.com to - // Vertex AI's SavedQuery. The specified AnnotatedDatasets have to belong - // to the datalabeling Dataset. - repeated MigrateDataLabelingAnnotatedDatasetConfig migrate_data_labeling_annotated_dataset_configs = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - oneof request { - // Config for migrating Version in ml.googleapis.com to Vertex AI's Model. - MigrateMlEngineModelVersionConfig migrate_ml_engine_model_version_config = 1; - - // Config for migrating Model in automl.googleapis.com to Vertex AI's - // Model. - MigrateAutomlModelConfig migrate_automl_model_config = 2; - - // Config for migrating Dataset in automl.googleapis.com to Vertex AI's - // Dataset. - MigrateAutomlDatasetConfig migrate_automl_dataset_config = 3; - - // Config for migrating Dataset in datalabeling.googleapis.com to - // Vertex AI's Dataset. - MigrateDataLabelingDatasetConfig migrate_data_labeling_dataset_config = 4; - } -} - -// Response message for [MigrationService.BatchMigrateResources][google.cloud.aiplatform.v1beta1.MigrationService.BatchMigrateResources]. -message BatchMigrateResourcesResponse { - // Successfully migrated resources. - repeated MigrateResourceResponse migrate_resource_responses = 1; -} - -// Describes a successfully migrated resource. -message MigrateResourceResponse { - // After migration, the resource name in Vertex AI. - oneof migrated_resource { - // Migrated Dataset's resource name. - string dataset = 1 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - }]; - - // Migrated Model's resource name. - string model = 2 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - }]; - } - - // Before migration, the identifier in ml.googleapis.com, - // automl.googleapis.com or datalabeling.googleapis.com. - MigratableResource migratable_resource = 3; -} - -// Runtime operation information for [MigrationService.BatchMigrateResources][google.cloud.aiplatform.v1beta1.MigrationService.BatchMigrateResources]. -message BatchMigrateResourcesOperationMetadata { - // Represents a partial result in batch migration operation for one - // [MigrateResourceRequest][google.cloud.aiplatform.v1beta1.MigrateResourceRequest]. - message PartialResult { - // If the resource's migration is ongoing, none of the result will be set. - // If the resource's migration is finished, either error or one of the - // migrated resource name will be filled. - oneof result { - // The error result of the migration request in case of failure. - google.rpc.Status error = 2; - - // Migrated model resource name. - string model = 3 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - }]; - - // Migrated dataset resource name. - string dataset = 4 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - }]; - } - - // It's the same as the value in - // [MigrateResourceRequest.migrate_resource_requests][]. - MigrateResourceRequest request = 1; - } - - // The common part of the operation metadata. - GenericOperationMetadata generic_metadata = 1; - - // Partial results that reflect the latest migration operation progress. - repeated PartialResult partial_results = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto deleted file mode 100644 index d17275bb..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto +++ /dev/null @@ -1,588 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/deployed_model_ref.proto"; -import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1beta1/env_var.proto"; -import "google/cloud/aiplatform/v1beta1/explanation.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ModelProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A trained machine learning Model. -message Model { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Model" - pattern: "projects/{project}/locations/{location}/models/{model}" - }; - - // Represents export format supported by the Model. - // All formats export to Google Cloud Storage. - message ExportFormat { - // The Model content that can be exported. - enum ExportableContent { - // Should not be used. - EXPORTABLE_CONTENT_UNSPECIFIED = 0; - - // Model artifact and any of its supported files. Will be exported to the - // location specified by the `artifactDestination` field of the - // [ExportModelRequest.output_config][google.cloud.aiplatform.v1beta1.ExportModelRequest.output_config] object. - ARTIFACT = 1; - - // The container image that is to be used when deploying this Model. Will - // be exported to the location specified by the `imageDestination` field - // of the [ExportModelRequest.output_config][google.cloud.aiplatform.v1beta1.ExportModelRequest.output_config] object. - IMAGE = 2; - } - - // Output only. The ID of the export format. - // The possible format IDs are: - // - // * `tflite` - // Used for Android mobile devices. - // - // * `edgetpu-tflite` - // Used for [Edge TPU](https://cloud.google.com/edge-tpu/) devices. - // - // * `tf-saved-model` - // A tensorflow model in SavedModel format. - // - // * `tf-js` - // A [TensorFlow.js](https://www.tensorflow.org/js) model that can be used - // in the browser and in Node.js using JavaScript. - // - // * `core-ml` - // Used for iOS mobile devices. - // - // * `custom-trained` - // A Model that was uploaded or trained by custom code. - string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The content of this Model that may be exported. - repeated ExportableContent exportable_contents = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Identifies a type of Model's prediction resources. - enum DeploymentResourcesType { - // Should not be used. - DEPLOYMENT_RESOURCES_TYPE_UNSPECIFIED = 0; - - // Resources that are dedicated to the [DeployedModel][google.cloud.aiplatform.v1beta1.DeployedModel], and that need a - // higher degree of manual configuration. - DEDICATED_RESOURCES = 1; - - // Resources that to large degree are decided by Vertex AI, and require - // only a modest additional configuration. - AUTOMATIC_RESOURCES = 2; - } - - // The resource name of the Model. - string name = 1; - - // Output only. Immutable. The version ID of the model. - // A new version is committed when a new model version is uploaded or - // trained under an existing model id. It is an auto-incrementing decimal - // number in string representation. - string version_id = 28 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // User provided version aliases so that a model version can be referenced via - // alias (i.e. - // projects/{project}/locations/{location}/models/{model_id}@{version_alias} - // instead of auto-generated version id (i.e. - // projects/{project}/locations/{location}/models/{model_id}@{version_id}). - // The format is [a-z][a-zA-Z0-9-]{0,126}[a-z0-9] to distinguish from - // version_id. A default version alias will be created for the first version - // of the model, and there must be exactly one default version alias for a - // model. - repeated string version_aliases = 29; - - // Output only. Timestamp when this version was created. - google.protobuf.Timestamp version_create_time = 31 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this version was most recently updated. - google.protobuf.Timestamp version_update_time = 32 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The display name of the Model. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // The description of the Model. - string description = 3; - - // The description of this version. - string version_description = 30; - - // The schemata that describe formats of the Model's predictions and - // explanations as given and returned via - // [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict] and [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain]. - PredictSchemata predict_schemata = 4; - - // Immutable. Points to a YAML file stored on Google Cloud Storage describing additional - // information about the Model, that is specific to it. Unset if the Model - // does not have any additional information. - // The schema is defined as an OpenAPI 3.0.2 [Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - // AutoML Models always have this field populated by Vertex AI, if no - // additional metadata is needed, this field is set to an empty string. - // Note: The URI given on output will be immutable and probably different, - // including the URI scheme, than the one given on input. The output URI will - // point to a location where the user only has a read access. - string metadata_schema_uri = 5 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. An additional information about the Model; the schema of the metadata can - // be found in [metadata_schema][google.cloud.aiplatform.v1beta1.Model.metadata_schema_uri]. - // Unset if the Model does not have any additional information. - google.protobuf.Value metadata = 6 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. The formats in which this Model may be exported. If empty, this Model is - // not available for export. - repeated ExportFormat supported_export_formats = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The resource name of the TrainingPipeline that uploaded this Model, if - // any. - string training_pipeline = 7 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TrainingPipeline" - } - ]; - - // Input only. The specification of the container that is to be used when deploying - // this Model. The specification is ingested upon - // [ModelService.UploadModel][google.cloud.aiplatform.v1beta1.ModelService.UploadModel], and all binaries it contains are copied - // and stored internally by Vertex AI. - // Not present for AutoML Models. - ModelContainerSpec container_spec = 9 [(google.api.field_behavior) = INPUT_ONLY]; - - // Immutable. The path to the directory containing the Model artifact and any of its - // supporting files. - // Not present for AutoML Models. - string artifact_uri = 26 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. When this Model is deployed, its prediction resources are described by the - // `prediction_resources` field of the [Endpoint.deployed_models][google.cloud.aiplatform.v1beta1.Endpoint.deployed_models] object. - // Because not all Models support all resource configuration types, the - // configuration types this Model supports are listed here. If no - // configuration types are listed, the Model cannot be deployed to an - // [Endpoint][google.cloud.aiplatform.v1beta1.Endpoint] and does not support - // online predictions ([PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict] or - // [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain]). Such a Model can serve predictions by - // using a [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob], if it has at least one entry each in - // [supported_input_storage_formats][google.cloud.aiplatform.v1beta1.Model.supported_input_storage_formats] and - // [supported_output_storage_formats][google.cloud.aiplatform.v1beta1.Model.supported_output_storage_formats]. - repeated DeploymentResourcesType supported_deployment_resources_types = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The formats this Model supports in - // [BatchPredictionJob.input_config][google.cloud.aiplatform.v1beta1.BatchPredictionJob.input_config]. If - // [PredictSchemata.instance_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri] exists, the instances - // should be given as per that schema. - // - // The possible formats are: - // - // * `jsonl` - // The JSON Lines format, where each instance is a single line. Uses - // [GcsSource][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig.gcs_source]. - // - // * `csv` - // The CSV format, where each instance is a single comma-separated line. - // The first line in the file is the header, containing comma-separated field - // names. Uses [GcsSource][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig.gcs_source]. - // - // * `tf-record` - // The TFRecord format, where each instance is a single record in tfrecord - // syntax. Uses [GcsSource][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig.gcs_source]. - // - // * `tf-record-gzip` - // Similar to `tf-record`, but the file is gzipped. Uses - // [GcsSource][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig.gcs_source]. - // - // * `bigquery` - // Each instance is a single row in BigQuery. Uses - // [BigQuerySource][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig.bigquery_source]. - // - // * `file-list` - // Each line of the file is the location of an instance to process, uses - // `gcs_source` field of the - // [InputConfig][google.cloud.aiplatform.v1beta1.BatchPredictionJob.InputConfig] object. - // - // - // If this Model doesn't support any of these formats it means it cannot be - // used with a [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob]. However, if it has - // [supported_deployment_resources_types][google.cloud.aiplatform.v1beta1.Model.supported_deployment_resources_types], it could serve online - // predictions by using [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict] or - // [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain]. - repeated string supported_input_storage_formats = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The formats this Model supports in - // [BatchPredictionJob.output_config][google.cloud.aiplatform.v1beta1.BatchPredictionJob.output_config]. If both - // [PredictSchemata.instance_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri] and - // [PredictSchemata.prediction_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.prediction_schema_uri] exist, the predictions - // are returned together with their instances. In other words, the - // prediction has the original instance data first, followed - // by the actual prediction content (as per the schema). - // - // The possible formats are: - // - // * `jsonl` - // The JSON Lines format, where each prediction is a single line. Uses - // [GcsDestination][google.cloud.aiplatform.v1beta1.BatchPredictionJob.OutputConfig.gcs_destination]. - // - // * `csv` - // The CSV format, where each prediction is a single comma-separated line. - // The first line in the file is the header, containing comma-separated field - // names. Uses - // [GcsDestination][google.cloud.aiplatform.v1beta1.BatchPredictionJob.OutputConfig.gcs_destination]. - // - // * `bigquery` - // Each prediction is a single row in a BigQuery table, uses - // [BigQueryDestination][google.cloud.aiplatform.v1beta1.BatchPredictionJob.OutputConfig.bigquery_destination] - // . - // - // - // If this Model doesn't support any of these formats it means it cannot be - // used with a [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob]. However, if it has - // [supported_deployment_resources_types][google.cloud.aiplatform.v1beta1.Model.supported_deployment_resources_types], it could serve online - // predictions by using [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict] or - // [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain]. - repeated string supported_output_storage_formats = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Model was uploaded into Vertex AI. - google.protobuf.Timestamp create_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Model was most recently updated. - google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The pointers to DeployedModels created from this Model. Note that - // Model could have been deployed to Endpoints in different Locations. - repeated DeployedModelRef deployed_models = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The default explanation specification for this Model. - // - // The Model can be used for [requesting - // explanation][PredictionService.Explain] after being - // [deployed][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel] if it is populated. - // The Model can be used for [batch - // explanation][BatchPredictionJob.generate_explanation] if it is populated. - // - // All fields of the explanation_spec can be overridden by - // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] of - // [DeployModelRequest.deployed_model][google.cloud.aiplatform.v1beta1.DeployModelRequest.deployed_model], or - // [explanation_spec][google.cloud.aiplatform.v1beta1.BatchPredictionJob.explanation_spec] of - // [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob]. - // - // If the default explanation specification is not set for this Model, this - // Model can still be used for [requesting - // explanation][PredictionService.Explain] by setting - // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] of - // [DeployModelRequest.deployed_model][google.cloud.aiplatform.v1beta1.DeployModelRequest.deployed_model] and for [batch - // explanation][BatchPredictionJob.generate_explanation] by setting - // [explanation_spec][google.cloud.aiplatform.v1beta1.BatchPredictionJob.explanation_spec] of - // [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob]. - ExplanationSpec explanation_spec = 23; - - // Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 16; - - // The labels with user-defined metadata to organize your Models. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 17; - - // Customer-managed encryption key spec for a Model. If set, this - // Model and all sub-resources of this Model will be secured by this key. - EncryptionSpec encryption_spec = 24; -} - -// Contains the schemata used in Model's predictions and explanations via -// [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict], [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain] and -// [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob]. -message PredictSchemata { - // Immutable. Points to a YAML file stored on Google Cloud Storage describing the format - // of a single instance, which are used in [PredictRequest.instances][google.cloud.aiplatform.v1beta1.PredictRequest.instances], - // [ExplainRequest.instances][google.cloud.aiplatform.v1beta1.ExplainRequest.instances] and - // [BatchPredictionJob.input_config][google.cloud.aiplatform.v1beta1.BatchPredictionJob.input_config]. - // The schema is defined as an OpenAPI 3.0.2 [Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - // AutoML Models always have this field populated by Vertex AI. - // Note: The URI given on output will be immutable and probably different, - // including the URI scheme, than the one given on input. The output URI will - // point to a location where the user only has a read access. - string instance_schema_uri = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. Points to a YAML file stored on Google Cloud Storage describing the - // parameters of prediction and explanation via - // [PredictRequest.parameters][google.cloud.aiplatform.v1beta1.PredictRequest.parameters], [ExplainRequest.parameters][google.cloud.aiplatform.v1beta1.ExplainRequest.parameters] and - // [BatchPredictionJob.model_parameters][google.cloud.aiplatform.v1beta1.BatchPredictionJob.model_parameters]. - // The schema is defined as an OpenAPI 3.0.2 [Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - // AutoML Models always have this field populated by Vertex AI, if no - // parameters are supported, then it is set to an empty string. - // Note: The URI given on output will be immutable and probably different, - // including the URI scheme, than the one given on input. The output URI will - // point to a location where the user only has a read access. - string parameters_schema_uri = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. Points to a YAML file stored on Google Cloud Storage describing the format - // of a single prediction produced by this Model, which are returned via - // [PredictResponse.predictions][google.cloud.aiplatform.v1beta1.PredictResponse.predictions], [ExplainResponse.explanations][google.cloud.aiplatform.v1beta1.ExplainResponse.explanations], and - // [BatchPredictionJob.output_config][google.cloud.aiplatform.v1beta1.BatchPredictionJob.output_config]. - // The schema is defined as an OpenAPI 3.0.2 [Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - // AutoML Models always have this field populated by Vertex AI. - // Note: The URI given on output will be immutable and probably different, - // including the URI scheme, than the one given on input. The output URI will - // point to a location where the user only has a read access. - string prediction_schema_uri = 3 [(google.api.field_behavior) = IMMUTABLE]; -} - -// Specification of a container for serving predictions. Some fields in this -// message correspond to fields in the [Kubernetes Container v1 core -// specification](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). -message ModelContainerSpec { - // Required. Immutable. URI of the Docker image to be used as the custom container for serving - // predictions. This URI must identify an image in Artifact Registry or - // Container Registry. Learn more about the [container publishing - // requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#publishing), - // including permissions requirements for the Vertex AI Service Agent. - // - // The container image is ingested upon [ModelService.UploadModel][google.cloud.aiplatform.v1beta1.ModelService.UploadModel], stored - // internally, and this original path is afterwards not used. - // - // To learn about the requirements for the Docker image itself, see - // [Custom container - // requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#). - // - // You can use the URI to one of Vertex AI's [pre-built container images for - // prediction](https://cloud.google.com/vertex-ai/docs/predictions/pre-built-containers) - // in this field. - string image_uri = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Immutable. Specifies the command that runs when the container starts. This overrides - // the container's - // [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint). - // Specify this field as an array of executable and arguments, similar to a - // Docker `ENTRYPOINT`'s "exec" form, not its "shell" form. - // - // If you do not specify this field, then the container's `ENTRYPOINT` runs, - // in conjunction with the [args][google.cloud.aiplatform.v1beta1.ModelContainerSpec.args] field or the - // container's [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd), - // if either exists. If this field is not specified and the container does not - // have an `ENTRYPOINT`, then refer to the Docker documentation about [how - // `CMD` and `ENTRYPOINT` - // interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). - // - // If you specify this field, then you can also specify the `args` field to - // provide additional arguments for this command. However, if you specify this - // field, then the container's `CMD` is ignored. See the - // [Kubernetes documentation about how the - // `command` and `args` fields interact with a container's `ENTRYPOINT` and - // `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). - // - // In this field, you can reference [environment variables set by Vertex - // AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) - // and environment variables set in the [env][google.cloud.aiplatform.v1beta1.ModelContainerSpec.env] field. - // You cannot reference environment variables set in the Docker image. In - // order for environment variables to be expanded, reference them by using the - // following syntax: - // $(VARIABLE_NAME) - // Note that this differs from Bash variable expansion, which does not use - // parentheses. If a variable cannot be resolved, the reference in the input - // string is used unchanged. To avoid variable expansion, you can escape this - // syntax with `$$`; for example: - // $$(VARIABLE_NAME) - // This field corresponds to the `command` field of the Kubernetes Containers - // [v1 core - // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). - repeated string command = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. Specifies arguments for the command that runs when the container starts. - // This overrides the container's - // [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd). Specify - // this field as an array of executable and arguments, similar to a Docker - // `CMD`'s "default parameters" form. - // - // If you don't specify this field but do specify the - // [command][google.cloud.aiplatform.v1beta1.ModelContainerSpec.command] field, then the command from the - // `command` field runs without any additional arguments. See the - // [Kubernetes documentation about how the - // `command` and `args` fields interact with a container's `ENTRYPOINT` and - // `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes). - // - // If you don't specify this field and don't specify the `command` field, - // then the container's - // [`ENTRYPOINT`](https://docs.docker.com/engine/reference/builder/#cmd) and - // `CMD` determine what runs based on their default behavior. See the Docker - // documentation about [how `CMD` and `ENTRYPOINT` - // interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact). - // - // In this field, you can reference [environment variables - // set by Vertex - // AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables) - // and environment variables set in the [env][google.cloud.aiplatform.v1beta1.ModelContainerSpec.env] field. - // You cannot reference environment variables set in the Docker image. In - // order for environment variables to be expanded, reference them by using the - // following syntax: - // $(VARIABLE_NAME) - // Note that this differs from Bash variable expansion, which does not use - // parentheses. If a variable cannot be resolved, the reference in the input - // string is used unchanged. To avoid variable expansion, you can escape this - // syntax with `$$`; for example: - // $$(VARIABLE_NAME) - // This field corresponds to the `args` field of the Kubernetes Containers - // [v1 core - // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). - repeated string args = 3 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. List of environment variables to set in the container. After the container - // starts running, code running in the container can read these environment - // variables. - // - // Additionally, the [command][google.cloud.aiplatform.v1beta1.ModelContainerSpec.command] and - // [args][google.cloud.aiplatform.v1beta1.ModelContainerSpec.args] fields can reference these variables. Later - // entries in this list can also reference earlier entries. For example, the - // following example sets the variable `VAR_2` to have the value `foo bar`: - // - // ```json - // [ - // { - // "name": "VAR_1", - // "value": "foo" - // }, - // { - // "name": "VAR_2", - // "value": "$(VAR_1) bar" - // } - // ] - // ``` - // - // If you switch the order of the variables in the example, then the expansion - // does not occur. - // - // This field corresponds to the `env` field of the Kubernetes Containers - // [v1 core - // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). - repeated EnvVar env = 4 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. List of ports to expose from the container. Vertex AI sends any - // prediction requests that it receives to the first port on this list. Vertex - // AI also sends - // [liveness and health - // checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#liveness) - // to this port. - // - // If you do not specify this field, it defaults to following value: - // - // ```json - // [ - // { - // "containerPort": 8080 - // } - // ] - // ``` - // - // Vertex AI does not use ports other than the first one listed. This field - // corresponds to the `ports` field of the Kubernetes Containers - // [v1 core - // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core). - repeated Port ports = 5 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. HTTP path on the container to send prediction requests to. Vertex AI - // forwards requests sent using - // [projects.locations.endpoints.predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict] to this - // path on the container's IP address and port. Vertex AI then returns the - // container's response in the API response. - // - // For example, if you set this field to `/foo`, then when Vertex AI - // receives a prediction request, it forwards the request body in a POST - // request to the `/foo` path on the port of your container specified by the - // first value of this `ModelContainerSpec`'s - // [ports][google.cloud.aiplatform.v1beta1.ModelContainerSpec.ports] field. - // - // If you don't specify this field, it defaults to the following value when - // you [deploy this Model to an Endpoint][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel]: - // /v1/endpoints/ENDPOINT/deployedModels/DEPLOYED_MODEL:predict - // The placeholders in this value are replaced as follows: - // - // * ENDPOINT: The last segment (following `endpoints/`)of the - // Endpoint.name][] field of the Endpoint where this Model has been - // deployed. (Vertex AI makes this value available to your container code - // as the [`AIP_ENDPOINT_ID` environment - // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) - // - // * DEPLOYED_MODEL: [DeployedModel.id][google.cloud.aiplatform.v1beta1.DeployedModel.id] of the `DeployedModel`. - // (Vertex AI makes this value available to your container code - // as the [`AIP_DEPLOYED_MODEL_ID` environment - // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) - string predict_route = 6 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. HTTP path on the container to send health checks to. Vertex AI - // intermittently sends GET requests to this path on the container's IP - // address and port to check that the container is healthy. Read more about - // [health - // checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#health). - // - // For example, if you set this field to `/bar`, then Vertex AI - // intermittently sends a GET request to the `/bar` path on the port of your - // container specified by the first value of this `ModelContainerSpec`'s - // [ports][google.cloud.aiplatform.v1beta1.ModelContainerSpec.ports] field. - // - // If you don't specify this field, it defaults to the following value when - // you [deploy this Model to an Endpoint][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel]: - // /v1/endpoints/ENDPOINT/deployedModels/DEPLOYED_MODEL:predict - // The placeholders in this value are replaced as follows: - // - // * ENDPOINT: The last segment (following `endpoints/`)of the - // Endpoint.name][] field of the Endpoint where this Model has been - // deployed. (Vertex AI makes this value available to your container code - // as the [`AIP_ENDPOINT_ID` environment - // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) - // - // * DEPLOYED_MODEL: [DeployedModel.id][google.cloud.aiplatform.v1beta1.DeployedModel.id] of the `DeployedModel`. - // (Vertex AI makes this value available to your container code as the - // [`AIP_DEPLOYED_MODEL_ID` environment - // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).) - string health_route = 7 [(google.api.field_behavior) = IMMUTABLE]; -} - -// Represents a network port in a container. -message Port { - // The number of the port to expose on the pod's IP address. - // Must be a valid port number, between 1 and 65535 inclusive. - int32 container_port = 3; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto deleted file mode 100644 index 014f42f5..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto +++ /dev/null @@ -1,300 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto"; -import "google/cloud/aiplatform/v1beta1/io.proto"; -import "google/cloud/aiplatform/v1beta1/job_state.proto"; -import "google/cloud/aiplatform/v1beta1/model_monitoring.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ModelDeploymentMonitoringJobProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// The Model Monitoring Objective types. -enum ModelDeploymentMonitoringObjectiveType { - // Default value, should not be set. - MODEL_DEPLOYMENT_MONITORING_OBJECTIVE_TYPE_UNSPECIFIED = 0; - - // Raw feature values' stats to detect skew between Training-Prediction - // datasets. - RAW_FEATURE_SKEW = 1; - - // Raw feature values' stats to detect drift between Serving-Prediction - // datasets. - RAW_FEATURE_DRIFT = 2; - - // Feature attribution scores to detect skew between Training-Prediction - // datasets. - FEATURE_ATTRIBUTION_SKEW = 3; - - // Feature attribution scores to detect skew between Prediction datasets - // collected within different time windows. - FEATURE_ATTRIBUTION_DRIFT = 4; -} - -// Represents a job that runs periodically to monitor the deployed models in an -// endpoint. It will analyze the logged training & prediction data to detect any -// abnormal behaviors. -message ModelDeploymentMonitoringJob { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/ModelDeploymentMonitoringJob" - pattern: "projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}" - }; - - // All metadata of most recent monitoring pipelines. - message LatestMonitoringPipelineMetadata { - // The time that most recent monitoring pipelines that is related to this - // run. - google.protobuf.Timestamp run_time = 1; - - // The status of the most recent monitoring pipeline. - google.rpc.Status status = 2; - } - - // The state to Specify the monitoring pipeline. - enum MonitoringScheduleState { - // Unspecified state. - MONITORING_SCHEDULE_STATE_UNSPECIFIED = 0; - - // The pipeline is picked up and wait to run. - PENDING = 1; - - // The pipeline is offline and will be scheduled for next run. - OFFLINE = 2; - - // The pipeline is running. - RUNNING = 3; - } - - // Output only. Resource name of a ModelDeploymentMonitoringJob. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The user-defined name of the ModelDeploymentMonitoringJob. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - // Display name of a ModelDeploymentMonitoringJob. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Endpoint resource name. - // Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` - string endpoint = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Endpoint" - } - ]; - - // Output only. The detailed state of the monitoring job. - // When the job is still creating, the state will be 'PENDING'. - // Once the job is successfully created, the state will be 'RUNNING'. - // Pause the job, the state will be 'PAUSED'. - // Resume the job, the state will return to 'RUNNING'. - JobState state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Schedule state when the monitoring job is in Running state. - MonitoringScheduleState schedule_state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Latest triggered monitoring pipeline metadata. - LatestMonitoringPipelineMetadata latest_monitoring_pipeline_metadata = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The config for monitoring objectives. This is a per DeployedModel config. - // Each DeployedModel needs to be configured separately. - repeated ModelDeploymentMonitoringObjectiveConfig model_deployment_monitoring_objective_configs = 6 [(google.api.field_behavior) = REQUIRED]; - - // Required. Schedule config for running the monitoring job. - ModelDeploymentMonitoringScheduleConfig model_deployment_monitoring_schedule_config = 7 [(google.api.field_behavior) = REQUIRED]; - - // Required. Sample Strategy for logging. - SamplingStrategy logging_sampling_strategy = 8 [(google.api.field_behavior) = REQUIRED]; - - // Alert config for model monitoring. - ModelMonitoringAlertConfig model_monitoring_alert_config = 15; - - // YAML schema file uri describing the format of a single instance, - // which are given to format this Endpoint's prediction (and explanation). - // If not set, we will generate predict schema from collected predict - // requests. - string predict_instance_schema_uri = 9; - - // Sample Predict instance, same format as [PredictRequest.instances][google.cloud.aiplatform.v1beta1.PredictRequest.instances], - // this can be set as a replacement of - // [ModelDeploymentMonitoringJob.predict_instance_schema_uri][google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob.predict_instance_schema_uri]. If not set, - // we will generate predict schema from collected predict requests. - google.protobuf.Value sample_predict_instance = 19; - - // YAML schema file uri describing the format of a single instance that you - // want Tensorflow Data Validation (TFDV) to analyze. - // - // If this field is empty, all the feature data types are inferred from - // [predict_instance_schema_uri][google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob.predict_instance_schema_uri], - // meaning that TFDV will use the data in the exact format(data type) as - // prediction request/response. - // If there are any data type differences between predict instance and TFDV - // instance, this field can be used to override the schema. - // For models trained with Vertex AI, this field must be set as all the - // fields in predict instance formatted as string. - string analysis_instance_schema_uri = 16; - - // Output only. The created bigquery tables for the job under customer project. Customer - // could do their own query & analysis. There could be 4 log tables in - // maximum: - // 1. Training data logging predict request/response - // 2. Serving data logging predict request/response - repeated ModelDeploymentMonitoringBigQueryTable bigquery_tables = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The TTL of BigQuery tables in user projects which stores logs. - // A day is the basic unit of the TTL and we take the ceil of TTL/86400(a - // day). e.g. { second: 3600} indicates ttl = 1 day. - google.protobuf.Duration log_ttl = 17; - - // The labels with user-defined metadata to organize your - // ModelDeploymentMonitoringJob. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 11; - - // Output only. Timestamp when this ModelDeploymentMonitoringJob was created. - google.protobuf.Timestamp create_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this ModelDeploymentMonitoringJob was updated most recently. - google.protobuf.Timestamp update_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this monitoring pipeline will be scheduled to run for the - // next round. - google.protobuf.Timestamp next_schedule_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Stats anomalies base folder path. - GcsDestination stats_anomalies_base_directory = 20; - - // Customer-managed encryption key spec for a ModelDeploymentMonitoringJob. If - // set, this ModelDeploymentMonitoringJob and all sub-resources of this - // ModelDeploymentMonitoringJob will be secured by this key. - EncryptionSpec encryption_spec = 21; - - // If true, the scheduled monitoring pipeline logs are sent to - // Google Cloud Logging, including pipeline status and anomalies detected. - // Please note the logs incur cost, which are subject to [Cloud Logging - // pricing](https://cloud.google.com/logging#pricing). - bool enable_monitoring_pipeline_logs = 22; - - // Output only. Only populated when the job's state is `JOB_STATE_FAILED` or - // `JOB_STATE_CANCELLED`. - google.rpc.Status error = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// ModelDeploymentMonitoringBigQueryTable specifies the BigQuery table name -// as well as some information of the logs stored in this table. -message ModelDeploymentMonitoringBigQueryTable { - // Indicates where does the log come from. - enum LogSource { - // Unspecified source. - LOG_SOURCE_UNSPECIFIED = 0; - - // Logs coming from Training dataset. - TRAINING = 1; - - // Logs coming from Serving traffic. - SERVING = 2; - } - - // Indicates what type of traffic does the log belong to. - enum LogType { - // Unspecified type. - LOG_TYPE_UNSPECIFIED = 0; - - // Predict logs. - PREDICT = 1; - - // Explain logs. - EXPLAIN = 2; - } - - // The source of log. - LogSource log_source = 1; - - // The type of log. - LogType log_type = 2; - - // The created BigQuery table to store logs. Customer could do their own query - // & analysis. Format: - // `bq://.model_deployment_monitoring_._` - string bigquery_table_path = 3; -} - -// ModelDeploymentMonitoringObjectiveConfig contains the pair of -// deployed_model_id to ModelMonitoringObjectiveConfig. -message ModelDeploymentMonitoringObjectiveConfig { - // The DeployedModel ID of the objective config. - string deployed_model_id = 1; - - // The objective config of for the modelmonitoring job of this deployed model. - ModelMonitoringObjectiveConfig objective_config = 2; -} - -// The config for scheduling monitoring job. -message ModelDeploymentMonitoringScheduleConfig { - // Required. The model monitoring job scheduling interval. It will be rounded up to next - // full hour. This defines how often the monitoring jobs are triggered. - google.protobuf.Duration monitor_interval = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Statistics and anomalies generated by Model Monitoring. -message ModelMonitoringStatsAnomalies { - // Historical Stats (and Anomalies) for a specific Feature. - message FeatureHistoricStatsAnomalies { - // Display Name of the Feature. - string feature_display_name = 1; - - // Threshold for anomaly detection. - ThresholdConfig threshold = 3; - - // Stats calculated for the Training Dataset. - FeatureStatsAnomaly training_stats = 4; - - // A list of historical stats generated by different time window's - // Prediction Dataset. - repeated FeatureStatsAnomaly prediction_stats = 5; - } - - // Model Monitoring Objective those stats and anomalies belonging to. - ModelDeploymentMonitoringObjectiveType objective = 1; - - // Deployed Model ID. - string deployed_model_id = 2; - - // Number of anomalies within all stats. - int32 anomaly_count = 3; - - // A list of historical Stats and Anomalies generated for all Features. - repeated FeatureHistoricStatsAnomalies feature_stats = 4; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto deleted file mode 100644 index 4e2c903e..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto +++ /dev/null @@ -1,94 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/explanation.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ModelEvaluationProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A collection of metrics calculated by comparing Model's predictions on all of -// the test data against annotations from the test data. -message ModelEvaluation { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/ModelEvaluation" - pattern: "projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}" - }; - - message ModelEvaluationExplanationSpec { - // Explanation type. - // - // For AutoML Image Classification models, possible values are: - // - // * `image-integrated-gradients` - // * `image-xrai` - string explanation_type = 1; - - // Explanation spec details. - ExplanationSpec explanation_spec = 2; - } - - // Output only. The resource name of the ModelEvaluation. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The display name of the ModelEvaluation. - string display_name = 10; - - // Points to a YAML file stored on Google Cloud Storage describing the - // [metrics][google.cloud.aiplatform.v1beta1.ModelEvaluation.metrics] of this ModelEvaluation. The schema is - // defined as an OpenAPI 3.0.2 [Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - string metrics_schema_uri = 2; - - // Evaluation metrics of the Model. The schema of the metrics is stored in - // [metrics_schema_uri][google.cloud.aiplatform.v1beta1.ModelEvaluation.metrics_schema_uri] - google.protobuf.Value metrics = 3; - - // Output only. Timestamp when this ModelEvaluation was created. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // All possible [dimensions][ModelEvaluationSlice.slice.dimension] of - // ModelEvaluationSlices. The dimensions can be used as the filter of the - // [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluationSlices] request, in the form of - // `slice.dimension = `. - repeated string slice_dimensions = 5; - - // Aggregated explanation metrics for the Model's prediction output over the - // data this ModelEvaluation uses. This field is populated only if the Model - // is evaluated with explanations, and only for AutoML tabular Models. - // - ModelExplanation model_explanation = 8; - - // Describes the values of [ExplanationSpec][google.cloud.aiplatform.v1beta1.ExplanationSpec] that are used for explaining - // the predicted values on the evaluated data. - repeated ModelEvaluationExplanationSpec explanation_specs = 9; - - // The metadata of the ModelEvaluation. - // For the ModelEvaluation uploaded from Managed Pipeline, metadata contains a - // structured value with keys of "pipeline_job_id", "evaluation_dataset_type", - // "evaluation_dataset_path". - google.protobuf.Value metadata = 11; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto deleted file mode 100644 index aa39f111..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto +++ /dev/null @@ -1,71 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ModelEvaluationSliceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A collection of metrics calculated by comparing Model's predictions on a -// slice of the test data against ground truth annotations. -message ModelEvaluationSlice { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/ModelEvaluationSlice" - pattern: "projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}" - }; - - // Definition of a slice. - message Slice { - // Output only. The dimension of the slice. - // Well-known dimensions are: - // * `annotationSpec`: This slice is on the test data that has either - // ground truth or prediction with [AnnotationSpec.display_name][google.cloud.aiplatform.v1beta1.AnnotationSpec.display_name] - // equals to [value][google.cloud.aiplatform.v1beta1.ModelEvaluationSlice.Slice.value]. - string dimension = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The value of the dimension in this slice. - string value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. The resource name of the ModelEvaluationSlice. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The slice of the test data that is used to evaluate the Model. - Slice slice = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Points to a YAML file stored on Google Cloud Storage describing the - // [metrics][google.cloud.aiplatform.v1beta1.ModelEvaluationSlice.metrics] of this ModelEvaluationSlice. The - // schema is defined as an OpenAPI 3.0.2 [Schema - // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - string metrics_schema_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Sliced evaluation metrics of the Model. The schema of the metrics is stored - // in [metrics_schema_uri][google.cloud.aiplatform.v1beta1.ModelEvaluationSlice.metrics_schema_uri] - google.protobuf.Value metrics = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this ModelEvaluationSlice was created. - google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto deleted file mode 100644 index 49676251..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto +++ /dev/null @@ -1,202 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/io.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ModelMonitoringProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Next ID: 8 -message ModelMonitoringObjectiveConfig { - // Training Dataset information. - message TrainingDataset { - oneof data_source { - // The resource name of the Dataset used to train this Model. - string dataset = 3 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Dataset" - }]; - - // The Google Cloud Storage uri of the unmanaged Dataset used to train - // this Model. - GcsSource gcs_source = 4; - - // The BigQuery table of the unmanaged Dataset used to train this - // Model. - BigQuerySource bigquery_source = 5; - } - - // Data format of the dataset, only applicable if the input is from - // Google Cloud Storage. - // The possible formats are: - // - // "tf-record" - // The source file is a TFRecord file. - // - // "csv" - // The source file is a CSV file. - string data_format = 2; - - // The target field name the model is to predict. - // This field will be excluded when doing Predict and (or) Explain for the - // training data. - string target_field = 6; - - // Strategy to sample data from Training Dataset. - // If not set, we process the whole dataset. - SamplingStrategy logging_sampling_strategy = 7; - } - - // The config for Training & Prediction data skew detection. It specifies the - // training dataset sources and the skew detection parameters. - message TrainingPredictionSkewDetectionConfig { - // Key is the feature name and value is the threshold. If a feature needs to - // be monitored for skew, a value threshold must be configured for that - // feature. The threshold here is against feature distribution distance - // between the training and prediction feature. - map skew_thresholds = 1; - - // Key is the feature name and value is the threshold. The threshold here is - // against attribution score distance between the training and prediction - // feature. - map attribution_score_skew_thresholds = 2; - } - - // The config for Prediction data drift detection. - message PredictionDriftDetectionConfig { - // Key is the feature name and value is the threshold. If a feature needs to - // be monitored for drift, a value threshold must be configured for that - // feature. The threshold here is against feature distribution distance - // between different time windws. - map drift_thresholds = 1; - - // Key is the feature name and value is the threshold. The threshold here is - // against attribution score distance between different time windows. - map attribution_score_drift_thresholds = 2; - } - - // The config for integrating with Vertex Explainable AI. Only applicable if - // the Model has explanation_spec populated. - message ExplanationConfig { - // Output from [BatchPredictionJob][google.cloud.aiplatform.v1beta1.BatchPredictionJob] for Model Monitoring baseline dataset, - // which can be used to generate baseline attribution scores. - message ExplanationBaseline { - // The storage format of the predictions generated BatchPrediction job. - enum PredictionFormat { - // Should not be set. - PREDICTION_FORMAT_UNSPECIFIED = 0; - - // Predictions are in JSONL files. - JSONL = 2; - - // Predictions are in BigQuery. - BIGQUERY = 3; - } - - // The configuration specifying of BatchExplain job output. This can be - // used to generate the baseline of feature attribution scores. - oneof destination { - // Cloud Storage location for BatchExplain output. - GcsDestination gcs = 2; - - // BigQuery location for BatchExplain output. - BigQueryDestination bigquery = 3; - } - - // The storage format of the predictions generated BatchPrediction job. - PredictionFormat prediction_format = 1; - } - - // If want to analyze the Vertex Explainable AI feature attribute scores or - // not. If set to true, Vertex AI will log the feature attributions from - // explain response and do the skew/drift detection for them. - bool enable_feature_attributes = 1; - - // Predictions generated by the BatchPredictionJob using baseline dataset. - ExplanationBaseline explanation_baseline = 2; - } - - // Training dataset for models. This field has to be set only if - // TrainingPredictionSkewDetectionConfig is specified. - TrainingDataset training_dataset = 1; - - // The config for skew between training data and prediction data. - TrainingPredictionSkewDetectionConfig training_prediction_skew_detection_config = 2; - - // The config for drift of prediction data. - PredictionDriftDetectionConfig prediction_drift_detection_config = 3; - - // The config for integrating with Vertex Explainable AI. - ExplanationConfig explanation_config = 5; -} - -// Next ID: 3 -message ModelMonitoringAlertConfig { - // The config for email alert. - message EmailAlertConfig { - // The email addresses to send the alert. - repeated string user_emails = 1; - } - - oneof alert { - // Email alert config. - EmailAlertConfig email_alert_config = 1; - } - - // Dump the anomalies to Cloud Logging. The anomalies will be put to json - // payload encoded from proto - // [google.cloud.aiplatform.logging.ModelMonitoringAnomaliesLogEntry][]. - // This can be further sinked to Pub/Sub or any other services supported - // by Cloud Logging. - bool enable_logging = 2; -} - -// The config for feature monitoring threshold. -// Next ID: 3 -message ThresholdConfig { - oneof threshold { - // Specify a threshold value that can trigger the alert. - // If this threshold config is for feature distribution distance: - // 1. For categorical feature, the distribution distance is calculated by - // L-inifinity norm. - // 2. For numerical feature, the distribution distance is calculated by - // Jensen–Shannon divergence. - // Each feature must have a non-zero threshold if they need to be monitored. - // Otherwise no alert will be triggered for that feature. - double value = 1; - } -} - -// Sampling Strategy for logging, can be for both training and prediction -// dataset. -// Next ID: 2 -message SamplingStrategy { - // Requests are randomly selected. - message RandomSampleConfig { - // Sample rate (0, 1] - double sample_rate = 1; - } - - // Random sample config. Will support more sampling strategies later. - RandomSampleConfig random_sample_config = 1; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto deleted file mode 100644 index 273718e0..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto +++ /dev/null @@ -1,660 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/explanation.proto"; -import "google/cloud/aiplatform/v1beta1/io.proto"; -import "google/cloud/aiplatform/v1beta1/model.proto"; -import "google/cloud/aiplatform/v1beta1/model_evaluation.proto"; -import "google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto"; -import "google/cloud/aiplatform/v1beta1/operation.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "ModelServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A service for managing Vertex AI's machine learning Models. -service ModelService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Uploads a Model artifact into Vertex AI. - rpc UploadModel(UploadModelRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/models:upload" - body: "*" - }; - option (google.api.method_signature) = "parent,model"; - option (google.longrunning.operation_info) = { - response_type: "UploadModelResponse" - metadata_type: "UploadModelOperationMetadata" - }; - } - - // Gets a Model. - rpc GetModel(GetModelRequest) returns (Model) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/models/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Models in a Location. - rpc ListModels(ListModelsRequest) returns (ListModelsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/models" - }; - option (google.api.method_signature) = "parent"; - } - - // Lists versions of the specified model. - rpc ListModelVersions(ListModelVersionsRequest) returns (ListModelVersionsResponse) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/models/*}:listVersions" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a Model. - rpc UpdateModel(UpdateModelRequest) returns (Model) { - option (google.api.http) = { - patch: "/v1beta1/{model.name=projects/*/locations/*/models/*}" - body: "model" - }; - option (google.api.method_signature) = "model,update_mask"; - } - - // Incremental update the dataset used for a examples model. - rpc UpdateExplanationDataset(UpdateExplanationDatasetRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{model=projects/*/locations/*/models/*}:updateExplanationDataset" - body: "*" - }; - option (google.api.method_signature) = "model"; - option (google.longrunning.operation_info) = { - response_type: "UpdateExplanationDatasetResponse" - metadata_type: "UpdateExplanationDatasetOperationMetadata" - }; - } - - // Deletes a Model. - // - // A model cannot be deleted if any [Endpoint][google.cloud.aiplatform.v1beta1.Endpoint] resource has a - // [DeployedModel][google.cloud.aiplatform.v1beta1.DeployedModel] based on the model in its - // [deployed_models][google.cloud.aiplatform.v1beta1.Endpoint.deployed_models] field. - rpc DeleteModel(DeleteModelRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/models/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Deletes a Model version. - // - // Model version can only be deleted if there are no [DeployedModels][] - // created from it. Deleting the only version in the Model is not allowed. Use - // [DeleteModel][google.cloud.aiplatform.v1beta1.ModelService.DeleteModel] for deleting the Model instead. - rpc DeleteModelVersion(DeleteModelVersionRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/models/*}:deleteVersion" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Merges a set of aliases for a Model version. - rpc MergeVersionAliases(MergeVersionAliasesRequest) returns (Model) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/models/*}:mergeVersionAliases" - body: "*" - }; - option (google.api.method_signature) = "name,version_aliases"; - } - - // Exports a trained, exportable Model to a location specified by the - // user. A Model is considered to be exportable if it has at least one - // [supported export format][google.cloud.aiplatform.v1beta1.Model.supported_export_formats]. - rpc ExportModel(ExportModelRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/models/*}:export" - body: "*" - }; - option (google.api.method_signature) = "name,output_config"; - option (google.longrunning.operation_info) = { - response_type: "ExportModelResponse" - metadata_type: "ExportModelOperationMetadata" - }; - } - - // Imports an externally generated ModelEvaluation. - rpc ImportModelEvaluation(ImportModelEvaluationRequest) returns (ModelEvaluation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/models/*}/evaluations:import" - body: "*" - }; - option (google.api.method_signature) = "parent,model_evaluation"; - } - - // Gets a ModelEvaluation. - rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists ModelEvaluations in a Model. - rpc ListModelEvaluations(ListModelEvaluationsRequest) returns (ListModelEvaluationsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/models/*}/evaluations" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets a ModelEvaluationSlice. - rpc GetModelEvaluationSlice(GetModelEvaluationSliceRequest) returns (ModelEvaluationSlice) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/slices/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists ModelEvaluationSlices in a ModelEvaluation. - rpc ListModelEvaluationSlices(ListModelEvaluationSlicesRequest) returns (ListModelEvaluationSlicesResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/models/*/evaluations/*}/slices" - }; - option (google.api.method_signature) = "parent"; - } -} - -// Request message for [ModelService.UploadModel][google.cloud.aiplatform.v1beta1.ModelService.UploadModel]. -message UploadModelRequest { - // Required. The resource name of the Location into which to upload the Model. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. The resource name of the model into which to upload the version. Only - // specify this field when uploading a new version. - string parent_model = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The ID to use for the uploaded Model, which will become the final - // component of the model resource name. - // - // This value may be up to 63 characters, and valid characters are - // `[a-z0-9_-]`. The first character cannot be a number or hyphen. - string model_id = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The Model to create. - Model model = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Details of [ModelService.UploadModel][google.cloud.aiplatform.v1beta1.ModelService.UploadModel] operation. -message UploadModelOperationMetadata { - // The common part of the operation metadata. - GenericOperationMetadata generic_metadata = 1; -} - -// Response message of [ModelService.UploadModel][google.cloud.aiplatform.v1beta1.ModelService.UploadModel] operation. -message UploadModelResponse { - // The name of the uploaded Model resource. - // Format: `projects/{project}/locations/{location}/models/{model}` - string model = 1 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - }]; - - // Output only. The version ID of the model that is uploaded. - string model_version_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request message for [ModelService.GetModel][google.cloud.aiplatform.v1beta1.ModelService.GetModel]. -message GetModelRequest { - // Required. The name of the Model resource. - // Format: `projects/{project}/locations/{location}/models/{model}` - // - // In order to retrieve a specific version of the model, also provide - // the version ID or version alias. - // Example: projects/{project}/locations/{location}/models/{model}@2 - // or - // projects/{project}/locations/{location}/models/{model}@golden - // If no version ID or alias is specified, the "default" version will be - // returned. The "default" version alias is created for the first version of - // the model, and can be moved to other versions later on. There will be - // exactly one default version. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; -} - -// Request message for [ModelService.ListModels][google.cloud.aiplatform.v1beta1.ModelService.ListModels]. -message ListModelsRequest { - // Required. The resource name of the Location to list the Models from. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // An expression for filtering the results of the request. For field names - // both snake_case and camelCase are supported. - // - // * `model` supports = and !=. `model` represents the Model ID, - // i.e. the last segment of the Model's [resource name][google.cloud.aiplatform.v1beta1.Model.name]. - // * `display_name` supports = and != - // * `labels` supports general map functions that is: - // * `labels.key=value` - key:value equality - // * `labels.key:* or labels:key - key existence - // * A key including a space must be quoted. `labels."a key"`. - // - // Some examples: - // * `model=1234` - // * `displayName="myDisplayName"` - // * `labels.myKey="myValue"` - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListModelsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListModelsResponse.next_page_token] of the previous - // [ModelService.ListModels][google.cloud.aiplatform.v1beta1.ModelService.ListModels] call. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for [ModelService.ListModels][google.cloud.aiplatform.v1beta1.ModelService.ListModels] -message ListModelsResponse { - // List of Models in the requested page. - repeated Model models = 1; - - // A token to retrieve next page of results. - // Pass to [ListModelsRequest.page_token][google.cloud.aiplatform.v1beta1.ListModelsRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [ModelService.ListModelVersions][google.cloud.aiplatform.v1beta1.ModelService.ListModelVersions]. -message ListModelVersionsRequest { - // Required. The name of the model to list versions for. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - - // The standard list page size. - int32 page_size = 2; - - // The standard list page token. - // Typically obtained via - // [ListModelVersionsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token] of the previous - // [ModelService.ListModelversions][] call. - string page_token = 3; - - // An expression for filtering the results of the request. For field names - // both snake_case and camelCase are supported. - // - // * `labels` supports general map functions that is: - // * `labels.key=value` - key:value equality - // * `labels.key:* or labels:key - key existence - // * A key including a space must be quoted. `labels."a key"`. - // - // Some examples: - // * `labels.myKey="myValue"` - string filter = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for [ModelService.ListModelVersions][google.cloud.aiplatform.v1beta1.ModelService.ListModelVersions] -message ListModelVersionsResponse { - // List of Model versions in the requested page. - // In the returned Model name field, version ID instead of regvision tag will - // be included. - repeated Model models = 1; - - // A token to retrieve the next page of results. - // Pass to [ListModelVersionsRequest.page_token][google.cloud.aiplatform.v1beta1.ListModelVersionsRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [ModelService.UpdateModel][google.cloud.aiplatform.v1beta1.ModelService.UpdateModel]. -message UpdateModelRequest { - // Required. The Model which replaces the resource on the server. - // When Model Versioning is enabled, the model.name will be used to determine - // whether to update the model or model version. - // 1. model.name with the @ value, e.g. models/123@1, refers to a version - // specific update. - // 2. model.name without the @ value, e.g. models/123, refers to a model - // update. - // 3. model.name with @-, e.g. models/123@-, refers to a model update. - // 4. Supported model fields: display_name, description; supported - // version-specific fields: version_description. Labels are supported in both - // scenarios. Both the model labels and the version labels are merged when a - // model is returned. When updating labels, if the request is for - // model-specific update, model label gets updated. Otherwise, version labels - // get updated. - // 5. A model name or model version name fields update mismatch will cause a - // precondition error. - // 6. One request cannot update both the model and the version fields. You - // must update them separately. - Model model = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The update mask applies to the resource. - // For the `FieldMask` definition, see [google.protobuf.FieldMask][google.protobuf.FieldMask]. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [ModelService.UpdateExplanationDataset][google.cloud.aiplatform.v1beta1.ModelService.UpdateExplanationDataset]. -message UpdateExplanationDatasetRequest { - // Required. The resource name of the Model to update. - // Format: `projects/{project}/locations/{location}/models/{model}` - string model = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - - // The example config containing the location of the dataset. - Examples examples = 2; -} - -// Runtime operation information for -// [ModelService.UpdateExplanationDataset][google.cloud.aiplatform.v1beta1.ModelService.UpdateExplanationDataset]. -message UpdateExplanationDatasetOperationMetadata { - // The common part of the operation metadata. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [ModelService.DeleteModel][google.cloud.aiplatform.v1beta1.ModelService.DeleteModel]. -message DeleteModelRequest { - // Required. The name of the Model resource to be deleted. - // Format: `projects/{project}/locations/{location}/models/{model}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; -} - -// Request message for [ModelService.DeleteModelVersion][google.cloud.aiplatform.v1beta1.ModelService.DeleteModelVersion]. -message DeleteModelVersionRequest { - // Required. The name of the model version to be deleted, with a version ID explicitly - // included. - // - // Example: `projects/{project}/locations/{location}/models/{model}@1234` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; -} - -// Request message for [ModelService.MergeVersionAliases][google.cloud.aiplatform.v1beta1.ModelService.MergeVersionAliases]. -message MergeVersionAliasesRequest { - // Required. The name of the model version to merge aliases, with a version ID - // explicitly included. - // - // Example: `projects/{project}/locations/{location}/models/{model}@1234` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - - // 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. - // - // There is NO ordering in aliases, which means - // 1) The aliases returned from GetModel API might not have the exactly same - // order from this MergeVersionAliases API. 2) Adding and deleting the same - // alias in the request is not recommended, and the 2 operations will be - // cancelled out. - repeated string version_aliases = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [ModelService.ExportModel][google.cloud.aiplatform.v1beta1.ModelService.ExportModel]. -message ExportModelRequest { - // Output configuration for the Model export. - message OutputConfig { - // The ID of the format in which the Model must be exported. Each Model - // lists the [export formats it supports][google.cloud.aiplatform.v1beta1.Model.supported_export_formats]. - // If no value is provided here, then the first from the list of the Model's - // supported formats is used by default. - string export_format_id = 1; - - // The Cloud Storage location where the Model artifact is to be - // written to. Under the directory given as the destination a new one with - // name "`model-export--`", - // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, - // will be created. Inside, the Model and any of its supporting files - // will be written. - // This field should only be set when the `exportableContent` field of the - // [Model.supported_export_formats] object contains `ARTIFACT`. - GcsDestination artifact_destination = 3; - - // The Google Container Registry or Artifact Registry uri where the - // Model container image will be copied to. - // This field should only be set when the `exportableContent` field of the - // [Model.supported_export_formats] object contains `IMAGE`. - ContainerRegistryDestination image_destination = 4; - } - - // Required. The resource name of the Model to export. - // The resource name may contain version id or version alias to specify the - // version, if no version is specified, the default version will be exported. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - - // Required. The desired output location and configuration. - OutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Details of [ModelService.ExportModel][google.cloud.aiplatform.v1beta1.ModelService.ExportModel] operation. -message ExportModelOperationMetadata { - // Further describes the output of the ExportModel. Supplements - // [ExportModelRequest.OutputConfig][google.cloud.aiplatform.v1beta1.ExportModelRequest.OutputConfig]. - message OutputInfo { - // Output only. If the Model artifact is being exported to Google Cloud Storage this is - // the full path of the directory created, into which the Model files are - // being written to. - string artifact_output_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If the Model image is being exported to Google Container Registry or - // Artifact Registry this is the full path of the image created. - string image_output_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // The common part of the operation metadata. - GenericOperationMetadata generic_metadata = 1; - - // Output only. Information further describing the output of this Model export. - OutputInfo output_info = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Response message of [ModelService.UpdateExplanationDataset][google.cloud.aiplatform.v1beta1.ModelService.UpdateExplanationDataset] operation. -message UpdateExplanationDatasetResponse { - -} - -// Response message of [ModelService.ExportModel][google.cloud.aiplatform.v1beta1.ModelService.ExportModel] operation. -message ExportModelResponse { - -} - -// Request message for [ModelService.ImportModelEvaluation][google.cloud.aiplatform.v1beta1.ModelService.ImportModelEvaluation] -message ImportModelEvaluationRequest { - // Required. The name of the parent model resource. - // Format: `projects/{project}/locations/{location}/models/{model}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - - // Required. Model evaluation resource to be imported. - ModelEvaluation model_evaluation = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [ModelService.GetModelEvaluation][google.cloud.aiplatform.v1beta1.ModelService.GetModelEvaluation]. -message GetModelEvaluationRequest { - // Required. The name of the ModelEvaluation resource. - // Format: - // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelEvaluation" - } - ]; -} - -// Request message for [ModelService.ListModelEvaluations][google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluations]. -message ListModelEvaluationsRequest { - // Required. The resource name of the Model to list the ModelEvaluations from. - // Format: `projects/{project}/locations/{location}/models/{model}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - - // The standard list filter. - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListModelEvaluationsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListModelEvaluationsResponse.next_page_token] of the previous - // [ModelService.ListModelEvaluations][google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluations] call. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for [ModelService.ListModelEvaluations][google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluations]. -message ListModelEvaluationsResponse { - // List of ModelEvaluations in the requested page. - repeated ModelEvaluation model_evaluations = 1; - - // A token to retrieve next page of results. - // Pass to [ListModelEvaluationsRequest.page_token][google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [ModelService.GetModelEvaluationSlice][google.cloud.aiplatform.v1beta1.ModelService.GetModelEvaluationSlice]. -message GetModelEvaluationSliceRequest { - // Required. The name of the ModelEvaluationSlice resource. - // Format: - // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelEvaluationSlice" - } - ]; -} - -// Request message for [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluationSlices]. -message ListModelEvaluationSlicesRequest { - // Required. The resource name of the ModelEvaluation to list the ModelEvaluationSlices - // from. Format: - // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/ModelEvaluation" - } - ]; - - // The standard list filter. - // - // * `slice.dimension` - for =. - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListModelEvaluationSlicesResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesResponse.next_page_token] of the previous - // [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluationSlices] call. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluationSlices]. -message ListModelEvaluationSlicesResponse { - // List of ModelEvaluations in the requested page. - repeated ModelEvaluationSlice model_evaluation_slices = 1; - - // A token to retrieve next page of results. - // Pass to [ListModelEvaluationSlicesRequest.page_token][google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest.page_token] to obtain that - // page. - string next_page_token = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/operation.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/operation.proto deleted file mode 100644 index 04e04b20..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/operation.proto +++ /dev/null @@ -1,52 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "OperationProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Generic Metadata shared by all operations. -message GenericOperationMetadata { - // Output only. Partial failures encountered. - // E.g. single files that couldn't be read. - // This field should never exceed 20 entries. - // Status details field will contain standard GCP error details. - repeated google.rpc.Status partial_failures = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the operation was created. - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the operation was updated for the last time. - // If the operation has finished (successfully or not), this is the finish - // time. - google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Details of operations that perform deletes of any entities. -message DeleteOperationMetadata { - // The common part of the operation metadata. - GenericOperationMetadata generic_metadata = 1; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto deleted file mode 100644 index 3e5b5ea0..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto +++ /dev/null @@ -1,340 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/artifact.proto"; -import "google/cloud/aiplatform/v1beta1/context.proto"; -import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1beta1/execution.proto"; -import "google/cloud/aiplatform/v1beta1/pipeline_state.proto"; -import "google/cloud/aiplatform/v1beta1/value.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "Pipeline"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; -option (google.api.resource_definition) = { - type: "compute.googleapis.com/Network" - pattern: "projects/{project}/global/networks/{network}" -}; - -// An instance of a machine learning PipelineJob. -message PipelineJob { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/PipelineJob" - pattern: "projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}" - }; - - // The runtime config of a PipelineJob. - message RuntimeConfig { - // Deprecated. Use [RuntimeConfig.parameter_values][google.cloud.aiplatform.v1beta1.PipelineJob.RuntimeConfig.parameter_values] instead. The runtime - // parameters of the PipelineJob. The parameters will be passed into - // [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1beta1.PipelineJob.pipeline_spec] to replace the placeholders at runtime. - // This field is used by pipelines built using - // `PipelineJob.pipeline_spec.schema_version` 2.0.0 or lower, such as - // pipelines built using Kubeflow Pipelines SDK 1.8 or lower. - map parameters = 1 [deprecated = true]; - - // Required. A path in a Cloud Storage bucket, which will be treated as the root - // output directory of the pipeline. It is used by the system to - // generate the paths of output artifacts. The artifact paths are generated - // with a sub-path pattern `{job_id}/{task_id}/{output_key}` under the - // specified output directory. The service account specified in this - // pipeline must have the `storage.objects.get` and `storage.objects.create` - // permissions for this bucket. - string gcs_output_directory = 2 [(google.api.field_behavior) = REQUIRED]; - - // The runtime parameters of the PipelineJob. The parameters will be - // passed into [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1beta1.PipelineJob.pipeline_spec] to replace the placeholders - // at runtime. This field is used by pipelines built using - // `PipelineJob.pipeline_spec.schema_version` 2.1.0, such as pipelines built - // using Kubeflow Pipelines SDK 1.9 or higher and the v2 DSL. - map parameter_values = 3; - } - - // Output only. The resource name of the PipelineJob. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The display name of the Pipeline. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - string display_name = 2; - - // Output only. Pipeline creation time. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Pipeline start time. - google.protobuf.Timestamp start_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Pipeline end time. - google.protobuf.Timestamp end_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this PipelineJob was most recently updated. - google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The spec of the pipeline. - google.protobuf.Struct pipeline_spec = 7; - - // Output only. The detailed state of the job. - PipelineState state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The details of pipeline run. Not available in the list view. - PipelineJobDetail job_detail = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The error that occurred during pipeline execution. - // Only populated when the pipeline's state is FAILED or CANCELLED. - google.rpc.Status error = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize PipelineJob. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 11; - - // Runtime config of the pipeline. - RuntimeConfig runtime_config = 12; - - // Customer-managed encryption key spec for a pipelineJob. If set, this - // PipelineJob and all of its sub-resources will be secured by this key. - EncryptionSpec encryption_spec = 16; - - // The service account that the pipeline workload runs as. - // If not specified, the Compute Engine default service account in the project - // will be used. - // See - // https://cloud.google.com/compute/docs/access/service-accounts#default_service_account - // - // Users starting the pipeline must have the `iam.serviceAccounts.actAs` - // permission on this service account. - string service_account = 17; - - // The full name of the Compute Engine - // [network](/compute/docs/networks-and-firewalls#networks) to which the - // Pipeline Job's workload should be peered. For example, - // `projects/12345/global/networks/myVPC`. - // [Format](/compute/docs/reference/rest/v1/networks/insert) - // is of the form `projects/{project}/global/networks/{network}`. - // Where {project} is a project number, as in `12345`, and {network} is a - // network name. - // - // Private services access must already be configured for the network. - // Pipeline job will apply the network configuration to the GCP resources - // being launched, if applied, such as Vertex AI - // Training or Dataflow job. If left unspecified, the workload is not peered - // with any network. - string network = 18 [(google.api.resource_reference) = { - type: "compute.googleapis.com/Network" - }]; - - // A template uri from where the [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1beta1.PipelineJob.pipeline_spec], if empty, will - // be downloaded. - string template_uri = 19; - - // Output only. Pipeline template metadata. Will fill up fields if - // [PipelineJob.template_uri][google.cloud.aiplatform.v1beta1.PipelineJob.template_uri] is from supported template registry. - PipelineTemplateMetadata template_metadata = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Pipeline template metadata if [PipelineJob.template_uri][google.cloud.aiplatform.v1beta1.PipelineJob.template_uri] is from supported -// template registry. Currently, the only supported registry is Artifact -// Registry. -message PipelineTemplateMetadata { - // The version_name in artifact registry. - // - // Will always be presented in output if the [PipelineJob.template_uri][google.cloud.aiplatform.v1beta1.PipelineJob.template_uri] is - // from supported template registry. - // - // Format is "sha256:abcdef123456...". - string version = 3; -} - -// The runtime detail of PipelineJob. -message PipelineJobDetail { - // Output only. The context of the pipeline. - Context pipeline_context = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The context of the current pipeline run. - Context pipeline_run_context = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The runtime details of the tasks under the pipeline. - repeated PipelineTaskDetail task_details = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The runtime detail of a task execution. -message PipelineTaskDetail { - // A single record of the task status. - message PipelineTaskStatus { - // Output only. Update time of this status. - google.protobuf.Timestamp update_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The state of the task. - State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The error that occurred during the state. May be set when the state is - // any of the non-final state (PENDING/RUNNING/CANCELLING) or FAILED state. - // If the state is FAILED, the error here is final and not going to be - // retried. - // If the state is a non-final state, the error indicates a system-error - // being retried. - google.rpc.Status error = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // A list of artifact metadata. - message ArtifactList { - // Output only. A list of artifact metadata. - repeated Artifact artifacts = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Specifies state of TaskExecution - enum State { - // Unspecified. - STATE_UNSPECIFIED = 0; - - // Specifies pending state for the task. - PENDING = 1; - - // Specifies task is being executed. - RUNNING = 2; - - // Specifies task completed successfully. - SUCCEEDED = 3; - - // Specifies Task cancel is in pending state. - CANCEL_PENDING = 4; - - // Specifies task is being cancelled. - CANCELLING = 5; - - // Specifies task was cancelled. - CANCELLED = 6; - - // Specifies task failed. - FAILED = 7; - - // Specifies task was skipped due to cache hit. - SKIPPED = 8; - - // Specifies that the task was not triggered because the task's trigger - // policy is not satisfied. The trigger policy is specified in the - // `condition` field of [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1beta1.PipelineJob.pipeline_spec]. - NOT_TRIGGERED = 9; - } - - // Output only. The system generated ID of the task. - int64 task_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The id of the parent task if the task is within a component scope. - // Empty if the task is at the root level. - int64 parent_task_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The user specified name of the task that is defined in - // [PipelineJob.spec][]. - string task_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Task create time. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Task start time. - google.protobuf.Timestamp start_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Task end time. - google.protobuf.Timestamp end_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The detailed execution info. - PipelineTaskExecutorDetail executor_detail = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. State of the task. - State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The execution metadata of the task. - Execution execution = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The error that occurred during task execution. - // Only populated when the task's state is FAILED or CANCELLED. - google.rpc.Status error = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A list of task status. This field keeps a record of task status evolving - // over time. - repeated PipelineTaskStatus pipeline_task_status = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The runtime input artifacts of the task. - map inputs = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The runtime output artifacts of the task. - map outputs = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The runtime detail of a pipeline executor. -message PipelineTaskExecutorDetail { - // The detail of a container execution. It contains the job names of the - // lifecycle of a container execution. - message ContainerDetail { - // Output only. The name of the [CustomJob][google.cloud.aiplatform.v1beta1.CustomJob] for the main container execution. - string main_job = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/CustomJob" - } - ]; - - // Output only. The name of the [CustomJob][google.cloud.aiplatform.v1beta1.CustomJob] for the pre-caching-check container - // execution. This job will be available if the - // [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1beta1.PipelineJob.pipeline_spec] specifies the `pre_caching_check` hook in - // the lifecycle events. - string pre_caching_check_job = 2 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/CustomJob" - } - ]; - } - - // The detailed info for a custom job executor. - message CustomJobDetail { - option deprecated = true; - - // Output only. The name of the [CustomJob][google.cloud.aiplatform.v1beta1.CustomJob]. - string job = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/CustomJob" - } - ]; - } - - oneof details { - // Output only. The detailed info for a container executor. - ContainerDetail container_detail = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The detailed info for a custom job executor. - CustomJobDetail custom_job_detail = 2 [ - deprecated = true, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - } -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto deleted file mode 100644 index 56123e65..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto +++ /dev/null @@ -1,403 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/pipeline_job.proto"; -import "google/cloud/aiplatform/v1beta1/training_pipeline.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "PipelineServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A service for creating and managing Vertex AI's pipelines. This includes both -// `TrainingPipeline` resources (used for AutoML and custom training) and -// `PipelineJob` resources (used for Vertex AI Pipelines). -service PipelineService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a TrainingPipeline. A created TrainingPipeline right away will be - // attempted to be run. - rpc CreateTrainingPipeline(CreateTrainingPipelineRequest) returns (TrainingPipeline) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/trainingPipelines" - body: "training_pipeline" - }; - option (google.api.method_signature) = "parent,training_pipeline"; - } - - // Gets a TrainingPipeline. - rpc GetTrainingPipeline(GetTrainingPipelineRequest) returns (TrainingPipeline) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists TrainingPipelines in a Location. - rpc ListTrainingPipelines(ListTrainingPipelinesRequest) returns (ListTrainingPipelinesResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/trainingPipelines" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a TrainingPipeline. - rpc DeleteTrainingPipeline(DeleteTrainingPipelineRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Cancels a TrainingPipeline. - // Starts asynchronous cancellation on the TrainingPipeline. The server - // makes a best effort to cancel the pipeline, but success is not - // guaranteed. Clients can use [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1beta1.PipelineService.GetTrainingPipeline] or - // other methods to check whether the cancellation succeeded or whether the - // pipeline completed despite cancellation. On successful cancellation, - // the TrainingPipeline is not deleted; instead it becomes a pipeline with - // a [TrainingPipeline.error][google.cloud.aiplatform.v1beta1.TrainingPipeline.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`, and [TrainingPipeline.state][google.cloud.aiplatform.v1beta1.TrainingPipeline.state] is set to - // `CANCELLED`. - rpc CancelTrainingPipeline(CancelTrainingPipelineRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}:cancel" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a PipelineJob. A PipelineJob will run immediately when created. - rpc CreatePipelineJob(CreatePipelineJobRequest) returns (PipelineJob) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/pipelineJobs" - body: "pipeline_job" - }; - option (google.api.method_signature) = "parent,pipeline_job,pipeline_job_id"; - } - - // Gets a PipelineJob. - rpc GetPipelineJob(GetPipelineJobRequest) returns (PipelineJob) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists PipelineJobs in a Location. - rpc ListPipelineJobs(ListPipelineJobsRequest) returns (ListPipelineJobsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/pipelineJobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a PipelineJob. - rpc DeletePipelineJob(DeletePipelineJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Cancels a PipelineJob. - // Starts asynchronous cancellation on the PipelineJob. The server - // makes a best effort to cancel the pipeline, but success is not - // guaranteed. Clients can use [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1beta1.PipelineService.GetPipelineJob] or - // other methods to check whether the cancellation succeeded or whether the - // pipeline completed despite cancellation. On successful cancellation, - // the PipelineJob is not deleted; instead it becomes a pipeline with - // a [PipelineJob.error][google.cloud.aiplatform.v1beta1.PipelineJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`, and [PipelineJob.state][google.cloud.aiplatform.v1beta1.PipelineJob.state] is set to - // `CANCELLED`. - rpc CancelPipelineJob(CancelPipelineJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}:cancel" - body: "*" - }; - option (google.api.method_signature) = "name"; - } -} - -// Request message for [PipelineService.CreateTrainingPipeline][google.cloud.aiplatform.v1beta1.PipelineService.CreateTrainingPipeline]. -message CreateTrainingPipelineRequest { - // Required. The resource name of the Location to create the TrainingPipeline in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The TrainingPipeline to create. - TrainingPipeline training_pipeline = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1beta1.PipelineService.GetTrainingPipeline]. -message GetTrainingPipelineRequest { - // Required. The name of the TrainingPipeline resource. - // Format: - // `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TrainingPipeline" - } - ]; -} - -// Request message for [PipelineService.ListTrainingPipelines][google.cloud.aiplatform.v1beta1.PipelineService.ListTrainingPipelines]. -message ListTrainingPipelinesRequest { - // Required. The resource name of the Location to list the TrainingPipelines from. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The standard list filter. - // Supported fields: - // - // * `display_name` supports = and !=. - // - // * `state` supports = and !=. - // - // Some examples of using the filter are: - // - // * `state="PIPELINE_STATE_SUCCEEDED" AND display_name="my_pipeline"` - // - // * `state="PIPELINE_STATE_RUNNING" OR display_name="my_pipeline"` - // - // * `NOT display_name="my_pipeline"` - // - // * `state="PIPELINE_STATE_FAILED"` - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListTrainingPipelinesResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListTrainingPipelinesResponse.next_page_token] of the previous - // [PipelineService.ListTrainingPipelines][google.cloud.aiplatform.v1beta1.PipelineService.ListTrainingPipelines] call. - string page_token = 4; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 5; -} - -// Response message for [PipelineService.ListTrainingPipelines][google.cloud.aiplatform.v1beta1.PipelineService.ListTrainingPipelines] -message ListTrainingPipelinesResponse { - // List of TrainingPipelines in the requested page. - repeated TrainingPipeline training_pipelines = 1; - - // A token to retrieve the next page of results. - // Pass to [ListTrainingPipelinesRequest.page_token][google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [PipelineService.DeleteTrainingPipeline][google.cloud.aiplatform.v1beta1.PipelineService.DeleteTrainingPipeline]. -message DeleteTrainingPipelineRequest { - // Required. The name of the TrainingPipeline resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TrainingPipeline" - } - ]; -} - -// Request message for [PipelineService.CancelTrainingPipeline][google.cloud.aiplatform.v1beta1.PipelineService.CancelTrainingPipeline]. -message CancelTrainingPipelineRequest { - // Required. The name of the TrainingPipeline to cancel. - // Format: - // `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TrainingPipeline" - } - ]; -} - -// Request message for [PipelineService.CreatePipelineJob][google.cloud.aiplatform.v1beta1.PipelineService.CreatePipelineJob]. -message CreatePipelineJobRequest { - // Required. The resource name of the Location to create the PipelineJob in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The PipelineJob to create. - PipelineJob pipeline_job = 2 [(google.api.field_behavior) = REQUIRED]; - - // The ID to use for the PipelineJob, which will become the final component of - // the PipelineJob name. If not provided, an ID will be automatically - // generated. - // - // This value should be less than 128 characters, and valid characters - // are /[a-z][0-9]-/. - string pipeline_job_id = 3; -} - -// Request message for [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1beta1.PipelineService.GetPipelineJob]. -message GetPipelineJobRequest { - // Required. The name of the PipelineJob resource. - // Format: - // `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/PipelineJob" - } - ]; -} - -// Request message for [PipelineService.ListPipelineJobs][google.cloud.aiplatform.v1beta1.PipelineService.ListPipelineJobs]. -message ListPipelineJobsRequest { - // Required. The resource name of the Location to list the PipelineJobs from. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Lists the PipelineJobs that match the filter expression. The following - // fields are supported: - // - // * `pipeline_name`: Supports `=` and `!=` comparisons. - // * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. - // * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. - // for example, can check if pipeline's display_name contains *step* by doing - // display_name:\"*step*\" - // * `state`: Supports `=` and `!=` comparisons. - // * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - // Values must be in RFC 3339 format. - // * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - // Values must be in RFC 3339 format. - // * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - // Values must be in RFC 3339 format. - // * `labels`: Supports key-value equality and key presence. - // * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. - // * `template_metadata.version_name`: Supports `=`, `!=` comparisons, and `:` - // wildcard. - // - // Filter expressions can be combined together using logical operators - // (`AND` & `OR`). - // For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. - // - // The syntax to define filter expression is based on - // https://google.aip.dev/160. - // - // Examples: - // - // * `create_time>"2021-05-18T00:00:00Z" OR - // update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated - // after 2020-05-18 00:00:00 UTC. - // * `labels.env = "prod"` - // PipelineJobs with label "env" set to "prod". - string filter = 2; - - // The standard list page size. - int32 page_size = 3; - - // The standard list page token. - // Typically obtained via - // [ListPipelineJobsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListPipelineJobsResponse.next_page_token] of the previous - // [PipelineService.ListPipelineJobs][google.cloud.aiplatform.v1beta1.PipelineService.ListPipelineJobs] call. - string page_token = 4; - - // A comma-separated list of fields to order by. The default sort order is in - // ascending order. Use "desc" after a field name for descending. You can have - // multiple order_by fields provided e.g. "create_time desc, end_time", - // "end_time, start_time, update_time" For example, using "create_time desc, - // end_time" will order results by create time in descending order, and if - // there are multiple jobs having the same create time, order them by the end - // time in ascending order. if order_by is not specified, it will order by - // default order is create time in descending order. Supported fields: - // * `create_time` - // * `update_time` - // * `end_time` - // * `start_time` - string order_by = 6; -} - -// Response message for [PipelineService.ListPipelineJobs][google.cloud.aiplatform.v1beta1.PipelineService.ListPipelineJobs] -message ListPipelineJobsResponse { - // List of PipelineJobs in the requested page. - repeated PipelineJob pipeline_jobs = 1; - - // A token to retrieve the next page of results. - // Pass to [ListPipelineJobsRequest.page_token][google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [PipelineService.DeletePipelineJob][google.cloud.aiplatform.v1beta1.PipelineService.DeletePipelineJob]. -message DeletePipelineJobRequest { - // Required. The name of the PipelineJob resource to be deleted. - // Format: - // `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/PipelineJob" - } - ]; -} - -// Request message for [PipelineService.CancelPipelineJob][google.cloud.aiplatform.v1beta1.PipelineService.CancelPipelineJob]. -message CancelPipelineJobRequest { - // Required. The name of the PipelineJob to cancel. - // Format: - // `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/PipelineJob" - } - ]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto deleted file mode 100644 index 41f2fb6a..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto +++ /dev/null @@ -1,58 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "PipelineStateProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Describes the state of a pipeline. -enum PipelineState { - // The pipeline state is unspecified. - PIPELINE_STATE_UNSPECIFIED = 0; - - // The pipeline has been created or resumed, and processing has not yet - // begun. - PIPELINE_STATE_QUEUED = 1; - - // The service is preparing to run the pipeline. - PIPELINE_STATE_PENDING = 2; - - // The pipeline is in progress. - PIPELINE_STATE_RUNNING = 3; - - // The pipeline completed successfully. - PIPELINE_STATE_SUCCEEDED = 4; - - // The pipeline failed. - PIPELINE_STATE_FAILED = 5; - - // The pipeline is being cancelled. From this state, the pipeline may only go - // to either PIPELINE_STATE_SUCCEEDED, PIPELINE_STATE_FAILED or - // PIPELINE_STATE_CANCELLED. - PIPELINE_STATE_CANCELLING = 6; - - // The pipeline has been cancelled. - PIPELINE_STATE_CANCELLED = 7; - - // The pipeline has been stopped, and can be resumed. - PIPELINE_STATE_PAUSED = 8; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto deleted file mode 100644 index e2452420..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto +++ /dev/null @@ -1,231 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/httpbody.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/explanation.proto"; -import "google/protobuf/struct.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "PredictionServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A service for online predictions and explanations. -service PredictionService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Perform an online prediction. - rpc Predict(PredictRequest) returns (PredictResponse) { - option (google.api.http) = { - post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:predict" - body: "*" - }; - option (google.api.method_signature) = "endpoint,instances,parameters"; - } - - // Perform an online prediction with an arbitrary HTTP payload. - // - // The response includes the following HTTP headers: - // - // * `X-Vertex-AI-Endpoint-Id`: ID of the [Endpoint][google.cloud.aiplatform.v1beta1.Endpoint] that served this - // prediction. - // - // * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's [DeployedModel][google.cloud.aiplatform.v1beta1.DeployedModel] - // that served this prediction. - rpc RawPredict(RawPredictRequest) returns (google.api.HttpBody) { - option (google.api.http) = { - post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:rawPredict" - body: "*" - }; - option (google.api.method_signature) = "endpoint,http_body"; - } - - // Perform an online explanation. - // - // If [deployed_model_id][google.cloud.aiplatform.v1beta1.ExplainRequest.deployed_model_id] is specified, - // the corresponding DeployModel must have - // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] - // populated. If [deployed_model_id][google.cloud.aiplatform.v1beta1.ExplainRequest.deployed_model_id] - // is not specified, all DeployedModels must have - // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] - // populated. Only deployed AutoML tabular Models have - // explanation_spec. - rpc Explain(ExplainRequest) returns (ExplainResponse) { - option (google.api.http) = { - post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:explain" - body: "*" - }; - option (google.api.method_signature) = "endpoint,instances,parameters,deployed_model_id"; - } -} - -// Request message for [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict]. -message PredictRequest { - // Required. The name of the Endpoint requested to serve the prediction. - // Format: - // `projects/{project}/locations/{location}/endpoints/{endpoint}` - string endpoint = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Endpoint" - } - ]; - - // Required. The instances that are the input to the prediction call. - // A DeployedModel may have an upper limit on the number of instances it - // supports per request, and when it is exceeded the prediction call errors - // in case of AutoML Models, or, in case of customer created Models, the - // behaviour is as documented by that Model. - // The schema of any single instance may be specified via Endpoint's - // DeployedModels' [Model's][google.cloud.aiplatform.v1beta1.DeployedModel.model] - // [PredictSchemata's][google.cloud.aiplatform.v1beta1.Model.predict_schemata] - // [instance_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri]. - repeated google.protobuf.Value instances = 2 [(google.api.field_behavior) = REQUIRED]; - - // The parameters that govern the prediction. The schema of the parameters may - // be specified via Endpoint's DeployedModels' [Model's ][google.cloud.aiplatform.v1beta1.DeployedModel.model] - // [PredictSchemata's][google.cloud.aiplatform.v1beta1.Model.predict_schemata] - // [parameters_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.parameters_schema_uri]. - google.protobuf.Value parameters = 3; -} - -// Response message for [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict]. -message PredictResponse { - // The predictions that are the output of the predictions call. - // The schema of any single prediction may be specified via Endpoint's - // DeployedModels' [Model's ][google.cloud.aiplatform.v1beta1.DeployedModel.model] - // [PredictSchemata's][google.cloud.aiplatform.v1beta1.Model.predict_schemata] - // [prediction_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.prediction_schema_uri]. - repeated google.protobuf.Value predictions = 1; - - // ID of the Endpoint's DeployedModel that served this prediction. - string deployed_model_id = 2; - - // Output only. The resource name of the Model which is deployed as the DeployedModel that - // this prediction hits. - string model = 3 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Model" - } - ]; - - // Output only. The version ID of the Model which is deployed as the DeployedModel that - // this prediction hits. - string model_version_id = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The [display name][google.cloud.aiplatform.v1beta1.Model.display_name] of the Model which is deployed as - // the DeployedModel that this prediction hits. - string model_display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request message for [PredictionService.RawPredict][google.cloud.aiplatform.v1beta1.PredictionService.RawPredict]. -message RawPredictRequest { - // Required. The name of the Endpoint requested to serve the prediction. - // Format: - // `projects/{project}/locations/{location}/endpoints/{endpoint}` - string endpoint = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Endpoint" - } - ]; - - // The prediction input. Supports HTTP headers and arbitrary data payload. - // - // A [DeployedModel][google.cloud.aiplatform.v1beta1.DeployedModel] may have an upper limit on the number of instances it - // supports per request. When this limit it is exceeded for an AutoML model, - // the [RawPredict][google.cloud.aiplatform.v1beta1.PredictionService.RawPredict] method returns an error. - // When this limit is exceeded for a custom-trained model, the behavior varies - // depending on the model. - // - // You can specify the schema for each instance in the - // [predict_schemata.instance_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri] - // field when you create a [Model][google.cloud.aiplatform.v1beta1.Model]. This schema applies when you deploy the - // `Model` as a `DeployedModel` to an [Endpoint][google.cloud.aiplatform.v1beta1.Endpoint] and use the `RawPredict` - // method. - google.api.HttpBody http_body = 2; -} - -// Request message for [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain]. -message ExplainRequest { - // Required. The name of the Endpoint requested to serve the explanation. - // Format: - // `projects/{project}/locations/{location}/endpoints/{endpoint}` - string endpoint = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Endpoint" - } - ]; - - // Required. The instances that are the input to the explanation call. - // A DeployedModel may have an upper limit on the number of instances it - // supports per request, and when it is exceeded the explanation call errors - // in case of AutoML Models, or, in case of customer created Models, the - // behaviour is as documented by that Model. - // The schema of any single instance may be specified via Endpoint's - // DeployedModels' [Model's][google.cloud.aiplatform.v1beta1.DeployedModel.model] - // [PredictSchemata's][google.cloud.aiplatform.v1beta1.Model.predict_schemata] - // [instance_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri]. - repeated google.protobuf.Value instances = 2 [(google.api.field_behavior) = REQUIRED]; - - // The parameters that govern the prediction. The schema of the parameters may - // be specified via Endpoint's DeployedModels' [Model's ][google.cloud.aiplatform.v1beta1.DeployedModel.model] - // [PredictSchemata's][google.cloud.aiplatform.v1beta1.Model.predict_schemata] - // [parameters_schema_uri][google.cloud.aiplatform.v1beta1.PredictSchemata.parameters_schema_uri]. - google.protobuf.Value parameters = 4; - - // If specified, overrides the - // [explanation_spec][google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec] of the DeployedModel. - // Can be used for explaining prediction results with different - // configurations, such as: - // - Explaining top-5 predictions results as opposed to top-1; - // - Increasing path count or step count of the attribution methods to reduce - // approximate errors; - // - Using different baselines for explaining the prediction results. - ExplanationSpecOverride explanation_spec_override = 5; - - // If specified, this ExplainRequest will be served by the chosen - // DeployedModel, overriding [Endpoint.traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split]. - string deployed_model_id = 3; -} - -// Response message for [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain]. -message ExplainResponse { - // The explanations of the Model's [PredictResponse.predictions][google.cloud.aiplatform.v1beta1.PredictResponse.predictions]. - // - // It has the same number of elements as [instances][google.cloud.aiplatform.v1beta1.ExplainRequest.instances] - // to be explained. - repeated Explanation explanations = 1; - - // ID of the Endpoint's DeployedModel that served this explanation. - string deployed_model_id = 2; - - // The predictions that are the output of the predictions call. - // Same as [PredictResponse.predictions][google.cloud.aiplatform.v1beta1.PredictResponse.predictions]. - repeated google.protobuf.Value predictions = 3; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto deleted file mode 100644 index 384e92c6..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema; - -import "google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto"; -import "google/cloud/aiplatform/v1beta1/schema/geometry.proto"; -import "google/protobuf/duration.proto"; -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema;schema"; -option java_multiple_files = true; -option java_outer_classname = "AnnotationPayloadProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema"; - -// Annotation details specific to image classification. -message ImageClassificationAnnotation { - // The resource Id of the AnnotationSpec that this Annotation pertains to. - string annotation_spec_id = 1; - - // The display name of the AnnotationSpec that this Annotation pertains to. - string display_name = 2; -} - -// Annotation details specific to image object detection. -message ImageBoundingBoxAnnotation { - // The resource Id of the AnnotationSpec that this Annotation pertains to. - string annotation_spec_id = 1; - - // The display name of the AnnotationSpec that this Annotation pertains to. - string display_name = 2; - - // The leftmost coordinate of the bounding box. - double x_min = 3; - - // The rightmost coordinate of the bounding box. - double x_max = 4; - - // The topmost coordinate of the bounding box. - double y_min = 5; - - // The bottommost coordinate of the bounding box. - double y_max = 6; -} - -// Annotation details specific to image segmentation. -message ImageSegmentationAnnotation { - // The mask based segmentation annotation. - message MaskAnnotation { - // Google Cloud Storage URI that points to the mask image. The image must be - // in PNG format. It must have the same size as the DataItem's image. Each - // pixel in the image mask represents the AnnotationSpec which the pixel in - // the image DataItem belong to. Each color is mapped to one AnnotationSpec - // based on annotation_spec_colors. - string mask_gcs_uri = 1; - - // The mapping between color and AnnotationSpec for this Annotation. - repeated AnnotationSpecColor annotation_spec_colors = 2; - } - - // Represents a polygon in image. - message PolygonAnnotation { - // The vertexes are connected one by one and the last vertex is connected to - // the first one to represent a polygon. - repeated Vertex vertexes = 1; - - // The resource Id of the AnnotationSpec that this Annotation pertains to. - string annotation_spec_id = 2; - - // The display name of the AnnotationSpec that this Annotation pertains to. - string display_name = 3; - } - - // Represents a polyline in image. - message PolylineAnnotation { - // The vertexes are connected one by one and the last vertex in not - // connected to the first one. - repeated Vertex vertexes = 1; - - // The resource Id of the AnnotationSpec that this Annotation pertains to. - string annotation_spec_id = 2; - - // The display name of the AnnotationSpec that this Annotation pertains to. - string display_name = 3; - } - - oneof annotation { - // Mask based segmentation annotation. Only one mask annotation can exist - // for one image. - MaskAnnotation mask_annotation = 3; - - // Polygon annotation. - PolygonAnnotation polygon_annotation = 4; - - // Polyline annotation. - PolylineAnnotation polyline_annotation = 5; - } -} - -// Annotation details specific to text classification. -message TextClassificationAnnotation { - // The resource Id of the AnnotationSpec that this Annotation pertains to. - string annotation_spec_id = 1; - - // The display name of the AnnotationSpec that this Annotation pertains to. - string display_name = 2; -} - -// Annotation details specific to text extraction. -message TextExtractionAnnotation { - // The segment of the text content. - TextSegment text_segment = 1; - - // The resource Id of the AnnotationSpec that this Annotation pertains to. - string annotation_spec_id = 2; - - // The display name of the AnnotationSpec that this Annotation pertains to. - string display_name = 3; -} - -// The text segment inside of DataItem. -message TextSegment { - // Zero-based character index of the first character of the text - // segment (counting characters from the beginning of the text). - uint64 start_offset = 1; - - // Zero-based character index of the first character past the end of - // the text segment (counting character from the beginning of the text). - // The character at the end_offset is NOT included in the text segment. - uint64 end_offset = 2; - - // The text content in the segment for output only. - string content = 3; -} - -// Annotation details specific to text sentiment. -message TextSentimentAnnotation { - // The sentiment score for text. - int32 sentiment = 1; - - // The sentiment max score for text. - int32 sentiment_max = 2; - - // The resource Id of the AnnotationSpec that this Annotation pertains to. - string annotation_spec_id = 3; - - // The display name of the AnnotationSpec that this Annotation pertains to. - string display_name = 4; -} - -// Annotation details specific to video classification. -message VideoClassificationAnnotation { - // This Annotation applies to the time period represented by the TimeSegment. - // If it's not set, the Annotation applies to the whole video. - TimeSegment time_segment = 1; - - // The resource Id of the AnnotationSpec that this Annotation pertains to. - string annotation_spec_id = 2; - - // The display name of the AnnotationSpec that this Annotation pertains to. - string display_name = 3; -} - -// A time period inside of a DataItem that has a time dimension (e.g. video). -message TimeSegment { - // Start of the time segment (inclusive), represented as the duration since - // the start of the DataItem. - google.protobuf.Duration start_time_offset = 1; - - // End of the time segment (exclusive), represented as the duration since the - // start of the DataItem. - google.protobuf.Duration end_time_offset = 2; -} - -// Annotation details specific to video object tracking. -message VideoObjectTrackingAnnotation { - // A time (frame) of a video to which this annotation pertains. - // Represented as the duration since the video's start. - google.protobuf.Duration time_offset = 1; - - // The leftmost coordinate of the bounding box. - double x_min = 2; - - // The rightmost coordinate of the bounding box. - double x_max = 3; - - // The topmost coordinate of the bounding box. - double y_min = 4; - - // The bottommost coordinate of the bounding box. - double y_max = 5; - - // The instance of the object, expressed as a positive integer. Used to track - // the same object across different frames. - int64 instance_id = 6; - - // The resource Id of the AnnotationSpec that this Annotation pertains to. - string annotation_spec_id = 7; - - // The display name of the AnnotationSpec that this Annotation pertains to. - string display_name = 8; -} - -// Annotation details specific to video action recognition. -message VideoActionRecognitionAnnotation { - // This Annotation applies to the time period represented by the TimeSegment. - // If it's not set, the Annotation applies to the whole video. - TimeSegment time_segment = 1; - - // The resource Id of the AnnotationSpec that this Annotation pertains to. - string annotation_spec_id = 2; - - // The display name of the AnnotationSpec that this Annotation pertains to. - string display_name = 3; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto deleted file mode 100644 index 1f53d4de..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema; - -import "google/type/color.proto"; -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema;schema"; -option java_multiple_files = true; -option java_outer_classname = "AnnotationSpecColorProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema"; - -// An entry of mapping between color and AnnotationSpec. The mapping is used in -// segmentation mask. -message AnnotationSpecColor { - // The color of the AnnotationSpec in a segmentation mask. - google.type.Color color = 1; - - // The display name of the AnnotationSpec represented by the color in the - // segmentation mask. - string display_name = 2; - - // The ID of the AnnotationSpec represented by the color in the segmentation - // mask. - string id = 3; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto deleted file mode 100644 index 164aacef..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema; - -import "google/api/field_behavior.proto"; -import "google/protobuf/duration.proto"; -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema;schema"; -option java_multiple_files = true; -option java_outer_classname = "DataItemPayloadProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema"; - -// Payload of Image DataItem. -message ImageDataItem { - // Required. Google Cloud Storage URI points to the original image in user's bucket. - // The image is up to 30MB in size. - string gcs_uri = 1 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The mime type of the content of the image. Only the images in below listed - // mime types are supported. - // - image/jpeg - // - image/gif - // - image/png - // - image/webp - // - image/bmp - // - image/tiff - // - image/vnd.microsoft.icon - string mime_type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Payload of Video DataItem. -message VideoDataItem { - // Required. Google Cloud Storage URI points to the original video in user's bucket. - // The video is up to 50 GB in size and up to 3 hour in duration. - string gcs_uri = 1 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The mime type of the content of the video. Only the videos in below listed - // mime types are supported. - // Supported mime_type: - // - video/mp4 - // - video/avi - // - video/quicktime - string mime_type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Payload of Text DataItem. -message TextDataItem { - // Output only. Google Cloud Storage URI points to the original text in user's bucket. - // The text file is up to 10MB in size. - string gcs_uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto deleted file mode 100644 index 2a0ed121..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema;schema"; -option java_multiple_files = true; -option java_outer_classname = "DatasetMetadataProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema"; - -// The metadata of Datasets that contain Image DataItems. -message ImageDatasetMetadata { - // Points to a YAML file stored on Google Cloud Storage describing payload of - // the Image DataItems that belong to this Dataset. - string data_item_schema_uri = 1; - - // Google Cloud Storage Bucket name that contains the blob data of this - // Dataset. - string gcs_bucket = 2; -} - -// The metadata of Datasets that contain Text DataItems. -message TextDatasetMetadata { - // Points to a YAML file stored on Google Cloud Storage describing payload of - // the Text DataItems that belong to this Dataset. - string data_item_schema_uri = 1; - - // Google Cloud Storage Bucket name that contains the blob data of this - // Dataset. - string gcs_bucket = 2; -} - -// The metadata of Datasets that contain Video DataItems. -message VideoDatasetMetadata { - // Points to a YAML file stored on Google Cloud Storage describing payload of - // the Video DataItems that belong to this Dataset. - string data_item_schema_uri = 1; - - // Google Cloud Storage Bucket name that contains the blob data of this - // Dataset. - string gcs_bucket = 2; -} - -// The metadata of Datasets that contain tables data. -message TablesDatasetMetadata { - // The tables Dataset's data source. The Dataset doesn't store the data - // directly, but only pointer(s) to its data. - message InputConfig { - oneof source { - GcsSource gcs_source = 1; - - BigQuerySource bigquery_source = 2; - } - } - - message GcsSource { - // Cloud Storage URI of one or more files. Only CSV files are supported. - // The first line of the CSV file is used as the header. - // If there are multiple files, the header is the first line of - // the lexicographically first file, the other files must either - // contain the exact same header or omit the header. - repeated string uri = 1; - } - - message BigQuerySource { - // The URI of a BigQuery table. - // e.g. bq://projectId.bqDatasetId.bqTableId - string uri = 1; - } - - InputConfig input_config = 1; -} - -// The metadata of Datasets that contain time series data. -message TimeSeriesDatasetMetadata { - // The time series Dataset's data source. The Dataset doesn't store the data - // directly, but only pointer(s) to its data. - message InputConfig { - oneof source { - GcsSource gcs_source = 1; - - BigQuerySource bigquery_source = 2; - } - } - - message GcsSource { - // Cloud Storage URI of one or more files. Only CSV files are supported. - // The first line of the CSV file is used as the header. - // If there are multiple files, the header is the first line of - // the lexicographically first file, the other files must either - // contain the exact same header or omit the header. - repeated string uri = 1; - } - - message BigQuerySource { - // The URI of a BigQuery table. - string uri = 1; - } - - InputConfig input_config = 1; - - // The column name of the time series identifier column that identifies the - // time series. - string time_series_identifier_column = 2; - - // The column name of the time column that identifies time order in the time - // series. - string time_column = 3; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto deleted file mode 100644 index dc53d2d7..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema;schema"; -option java_multiple_files = true; -option java_outer_classname = "GeometryProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema"; - -// A vertex represents a 2D point in the image. -// NOTE: the normalized vertex coordinates are relative to the original image -// and range from 0 to 1. -message Vertex { - // X coordinate. - double x = 1; - - // Y coordinate. - double y = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto deleted file mode 100644 index 572886a8..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.instance; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Instance"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/instance;instance"; -option java_multiple_files = true; -option java_outer_classname = "ImageClassificationPredictionInstanceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.instance"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Instance"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Instance"; - -// Prediction input format for Image Classification. -message ImageClassificationPredictionInstance { - // The image bytes or Cloud Storage URI to make the prediction on. - string content = 1; - - // The MIME type of the content of the image. Only the images in below listed - // MIME types are supported. - // - image/jpeg - // - image/gif - // - image/png - // - image/webp - // - image/bmp - // - image/tiff - // - image/vnd.microsoft.icon - string mime_type = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto deleted file mode 100644 index 41eb7a6a..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.instance; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Instance"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/instance;instance"; -option java_multiple_files = true; -option java_outer_classname = "ImageObjectDetectionPredictionInstanceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.instance"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Instance"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Instance"; - -// Prediction input format for Image Object Detection. -message ImageObjectDetectionPredictionInstance { - // The image bytes or Cloud Storage URI to make the prediction on. - string content = 1; - - // The MIME type of the content of the image. Only the images in below listed - // MIME types are supported. - // - image/jpeg - // - image/gif - // - image/png - // - image/webp - // - image/bmp - // - image/tiff - // - image/vnd.microsoft.icon - string mime_type = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto deleted file mode 100644 index 9da318e5..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2020 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.instance; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Instance"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/instance;instance"; -option java_multiple_files = true; -option java_outer_classname = "ImageSegmentationPredictionInstanceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.instance"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Instance"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Instance"; - -// Prediction input format for Image Segmentation. -message ImageSegmentationPredictionInstance { - // The image bytes to make the predictions on. - string content = 1; - - // The MIME type of the content of the image. Only the images in below listed - // MIME types are supported. - // - image/jpeg - // - image/png - string mime_type = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto deleted file mode 100644 index 68bf6c10..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.instance; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Instance"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/instance;instance"; -option java_multiple_files = true; -option java_outer_classname = "TextClassificationPredictionInstanceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.instance"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Instance"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Instance"; - -// Prediction input format for Text Classification. -message TextClassificationPredictionInstance { - // The text snippet to make the predictions on. - string content = 1; - - // The MIME type of the text snippet. The supported MIME types are listed - // below. - // - text/plain - string mime_type = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto deleted file mode 100644 index 9b629213..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.instance; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Instance"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/instance;instance"; -option java_multiple_files = true; -option java_outer_classname = "TextExtractionPredictionInstanceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.instance"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Instance"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Instance"; - -// Prediction input format for Text Extraction. -message TextExtractionPredictionInstance { - // The text snippet to make the predictions on. - string content = 1; - - // The MIME type of the text snippet. The supported MIME types are listed - // below. - // - text/plain - string mime_type = 2; - - // This field is only used for batch prediction. If a key is provided, the - // batch prediction result will by mapped to this key. If omitted, then the - // batch prediction result will contain the entire input instance. Vertex AI - // will not check if keys in the request are duplicates, so it is up to the - // caller to ensure the keys are unique. - string key = 3; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto deleted file mode 100644 index e312e865..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.instance; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Instance"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/instance;instance"; -option java_multiple_files = true; -option java_outer_classname = "TextSentimentPredictionInstanceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.instance"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Instance"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Instance"; - -// Prediction input format for Text Sentiment. -message TextSentimentPredictionInstance { - // The text snippet to make the predictions on. - string content = 1; - - // The MIME type of the text snippet. The supported MIME types are listed - // below. - // - text/plain - string mime_type = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto deleted file mode 100644 index 810a4112..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.instance; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Instance"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/instance;instance"; -option java_multiple_files = true; -option java_outer_classname = "VideoActionRecognitionPredictionInstanceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.instance"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Instance"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Instance"; - -// Prediction input format for Video Action Recognition. -message VideoActionRecognitionPredictionInstance { - // The Google Cloud Storage location of the video on which to perform the - // prediction. - string content = 1; - - // The MIME type of the content of the video. Only the following are - // supported: video/mp4 video/avi video/quicktime - string mime_type = 2; - - // The beginning, inclusive, of the video's time segment on which to perform - // the prediction. Expressed as a number of seconds as measured from the - // start of the video, with "s" appended at the end. Fractions are allowed, - // up to a microsecond precision. - string time_segment_start = 3; - - // The end, exclusive, of the video's time segment on which to perform - // the prediction. Expressed as a number of seconds as measured from the - // start of the video, with "s" appended at the end. Fractions are allowed, - // up to a microsecond precision, and "inf" or "Infinity" is allowed, which - // means the end of the video. - string time_segment_end = 4; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto deleted file mode 100644 index edc61a69..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.instance; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Instance"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/instance;instance"; -option java_multiple_files = true; -option java_outer_classname = "VideoClassificationPredictionInstanceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.instance"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Instance"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Instance"; - -// Prediction input format for Video Classification. -message VideoClassificationPredictionInstance { - // The Google Cloud Storage location of the video on which to perform the - // prediction. - string content = 1; - - // The MIME type of the content of the video. Only the following are - // supported: video/mp4 video/avi video/quicktime - string mime_type = 2; - - // The beginning, inclusive, of the video's time segment on which to perform - // the prediction. Expressed as a number of seconds as measured from the - // start of the video, with "s" appended at the end. Fractions are allowed, - // up to a microsecond precision. - string time_segment_start = 3; - - // The end, exclusive, of the video's time segment on which to perform - // the prediction. Expressed as a number of seconds as measured from the - // start of the video, with "s" appended at the end. Fractions are allowed, - // up to a microsecond precision, and "inf" or "Infinity" is allowed, which - // means the end of the video. - string time_segment_end = 4; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto deleted file mode 100644 index 119e0c9b..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.instance; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Instance"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/instance;instance"; -option java_multiple_files = true; -option java_outer_classname = "VideoObjectTrackingPredictionInstanceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.instance"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Instance"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Instance"; - -// Prediction input format for Video Object Tracking. -message VideoObjectTrackingPredictionInstance { - // The Google Cloud Storage location of the video on which to perform the - // prediction. - string content = 1; - - // The MIME type of the content of the video. Only the following are - // supported: video/mp4 video/avi video/quicktime - string mime_type = 2; - - // The beginning, inclusive, of the video's time segment on which to perform - // the prediction. Expressed as a number of seconds as measured from the - // start of the video, with "s" appended at the end. Fractions are allowed, - // up to a microsecond precision. - string time_segment_start = 3; - - // The end, exclusive, of the video's time segment on which to perform - // the prediction. Expressed as a number of seconds as measured from the - // start of the video, with "s" appended at the end. Fractions are allowed, - // up to a microsecond precision, and "inf" or "Infinity" is allowed, which - // means the end of the video. - string time_segment_end = 4; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto deleted file mode 100644 index a637e4a7..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.params; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Params"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/params;params"; -option java_multiple_files = true; -option java_outer_classname = "ImageClassificationPredictionParamsProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.params"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Params"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Params"; - -// Prediction model parameters for Image Classification. -message ImageClassificationPredictionParams { - // The Model only returns predictions with at least this confidence score. - // Default value is 0.0 - float confidence_threshold = 1; - - // The Model only returns up to that many top, by confidence score, - // predictions per instance. If this number is very high, the Model may return - // fewer predictions. Default value is 10. - int32 max_predictions = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto deleted file mode 100644 index 35856e6c..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.params; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Params"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/params;params"; -option java_multiple_files = true; -option java_outer_classname = "ImageObjectDetectionPredictionParamsProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.params"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Params"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Params"; - -// Prediction model parameters for Image Object Detection. -message ImageObjectDetectionPredictionParams { - // The Model only returns predictions with at least this confidence score. - // Default value is 0.0 - float confidence_threshold = 1; - - // The Model only returns up to that many top, by confidence score, - // predictions per instance. Note that number of returned predictions is also - // limited by metadata's predictionsLimit. Default value is 10. - int32 max_predictions = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto deleted file mode 100644 index ee18a880..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2020 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.params; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Params"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/params;params"; -option java_multiple_files = true; -option java_outer_classname = "ImageSegmentationPredictionParamsProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.params"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Params"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Params"; - -// Prediction model parameters for Image Segmentation. -message ImageSegmentationPredictionParams { - // When the model predicts category of pixels of the image, it will only - // provide predictions for pixels that it is at least this much confident - // about. All other pixels will be classified as background. Default value is - // 0.5. - float confidence_threshold = 1; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto deleted file mode 100644 index 8cd1d47c..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.params; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Params"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/params;params"; -option java_multiple_files = true; -option java_outer_classname = "VideoActionRecognitionPredictionParamsProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.params"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Params"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Params"; - -// Prediction model parameters for Video Action Recognition. -message VideoActionRecognitionPredictionParams { - // The Model only returns predictions with at least this confidence score. - // Default value is 0.0 - float confidence_threshold = 1; - - // The model only returns up to that many top, by confidence score, - // predictions per frame of the video. If this number is very high, the - // Model may return fewer predictions per frame. Default value is 50. - int32 max_predictions = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto deleted file mode 100644 index 856869cd..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.params; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Params"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/params;params"; -option java_multiple_files = true; -option java_outer_classname = "VideoClassificationPredictionParamsProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.params"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Params"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Params"; - -// Prediction model parameters for Video Classification. -message VideoClassificationPredictionParams { - // The Model only returns predictions with at least this confidence score. - // Default value is 0.0 - float confidence_threshold = 1; - - // The Model only returns up to that many top, by confidence score, - // predictions per instance. If this number is very high, the Model may return - // fewer predictions. Default value is 10,000. - int32 max_predictions = 2; - - // Set to true to request segment-level classification. Vertex AI returns - // labels and their confidence scores for the entire time segment of the - // video that user specified in the input instance. - // Default value is true - bool segment_classification = 3; - - // Set to true to request shot-level classification. Vertex AI determines - // the boundaries for each camera shot in the entire time segment of the - // video that user specified in the input instance. Vertex AI then - // returns labels and their confidence scores for each detected shot, along - // with the start and end time of the shot. - // WARNING: Model evaluation is not done for this classification type, - // the quality of it depends on the training data, but there are no metrics - // provided to describe that quality. - // Default value is false - bool shot_classification = 4; - - // Set to true to request classification for a video at one-second intervals. - // Vertex AI returns labels and their confidence scores for each second of - // the entire time segment of the video that user specified in the input - // WARNING: Model evaluation is not done for this classification type, the - // quality of it depends on the training data, but there are no metrics - // provided to describe that quality. Default value is false - bool one_sec_interval_classification = 5; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto deleted file mode 100644 index 8fc616cd..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.params; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Params"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/params;params"; -option java_multiple_files = true; -option java_outer_classname = "VideoObjectTrackingPredictionParamsProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.params"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Params"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Params"; - -// Prediction model parameters for Video Object Tracking. -message VideoObjectTrackingPredictionParams { - // The Model only returns predictions with at least this confidence score. - // Default value is 0.0 - float confidence_threshold = 1; - - // The model only returns up to that many top, by confidence score, - // predictions per frame of the video. If this number is very high, the - // Model may return fewer predictions per frame. Default value is 50. - int32 max_predictions = 2; - - // Only bounding boxes with shortest edge at least that long as a relative - // value of video frame size are returned. Default value is 0.0. - float min_bounding_box_size = 3; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto deleted file mode 100644 index 0a77a247..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.prediction; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "ClassificationPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; - -// Prediction output format for Image and Text Classification. -message ClassificationPredictionResult { - // The resource IDs of the AnnotationSpecs that had been identified. - repeated int64 ids = 1; - - // The display names of the AnnotationSpecs that had been identified, order - // matches the IDs. - repeated string display_names = 2; - - // The Model's confidences in correctness of the predicted IDs, higher value - // means higher confidence. Order matches the Ids. - repeated float confidences = 3; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto deleted file mode 100644 index 3df5d1e4..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.prediction; - -import "google/protobuf/struct.proto"; -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "ImageObjectDetectionPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; - -// Prediction output format for Image Object Detection. -message ImageObjectDetectionPredictionResult { - // The resource IDs of the AnnotationSpecs that had been identified, ordered - // by the confidence score descendingly. - repeated int64 ids = 1; - - // The display names of the AnnotationSpecs that had been identified, order - // matches the IDs. - repeated string display_names = 2; - - // The Model's confidences in correctness of the predicted IDs, higher value - // means higher confidence. Order matches the Ids. - repeated float confidences = 3; - - // Bounding boxes, i.e. the rectangles over the image, that pinpoint - // the found AnnotationSpecs. Given in order that matches the IDs. Each - // bounding box is an array of 4 numbers `xMin`, `xMax`, `yMin`, and - // `yMax`, which represent the extremal coordinates of the box. They are - // relative to the image size, and the point 0,0 is in the top left - // of the image. - repeated google.protobuf.ListValue bboxes = 4; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto deleted file mode 100644 index db998c63..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2020 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.prediction; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "ImageSegmentationPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; - -// Prediction output format for Image Segmentation. -message ImageSegmentationPredictionResult { - // A PNG image where each pixel in the mask represents the category in which - // the pixel in the original image was predicted to belong to. The size of - // this image will be the same as the original image. The mapping between the - // AnntoationSpec and the color can be found in model's metadata. The model - // will choose the most likely category and if none of the categories reach - // the confidence threshold, the pixel will be marked as background. - string category_mask = 1; - - // A one channel image which is encoded as an 8bit lossless PNG. The size of - // the image will be the same as the original image. For a specific pixel, - // darker color means less confidence in correctness of the cateogry in the - // categoryMask for the corresponding pixel. Black means no confidence and - // white means complete confidence. - string confidence_mask = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto deleted file mode 100644 index fde1fae6..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.prediction; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "TabularClassificationPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; - -// Prediction output format for Tabular Classification. -message TabularClassificationPredictionResult { - // The name of the classes being classified, contains all possible values of - // the target column. - repeated string classes = 1; - - // The model's confidence in each class being correct, higher - // value means higher confidence. The N-th score corresponds to - // the N-th class in classes. - repeated float scores = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto deleted file mode 100644 index 7e8de866..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.prediction; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "TabularRegressionPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; - -// Prediction output format for Tabular Regression. -message TabularRegressionPredictionResult { - // The regression value. - float value = 1; - - // The lower bound of the prediction interval. - float lower_bound = 2; - - // The upper bound of the prediction interval. - float upper_bound = 3; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto deleted file mode 100644 index cce7b068..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.prediction; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "TextExtractionPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; - -// Prediction output format for Text Extraction. -message TextExtractionPredictionResult { - // The resource IDs of the AnnotationSpecs that had been identified, - // ordered by the confidence score descendingly. - repeated int64 ids = 1; - - // The display names of the AnnotationSpecs that had been identified, - // order matches the IDs. - repeated string display_names = 2; - - // The start offsets, inclusive, of the text segment in which the - // AnnotationSpec has been identified. Expressed as a zero-based number - // of characters as measured from the start of the text snippet. - repeated int64 text_segment_start_offsets = 3; - - // The end offsets, inclusive, of the text segment in which the - // AnnotationSpec has been identified. Expressed as a zero-based number - // of characters as measured from the start of the text snippet. - repeated int64 text_segment_end_offsets = 4; - - // The Model's confidences in correctness of the predicted IDs, higher - // value means higher confidence. Order matches the Ids. - repeated float confidences = 5; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto deleted file mode 100644 index faefeb19..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.prediction; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "TextSentimentPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; - -// Prediction output format for Text Sentiment -message TextSentimentPredictionResult { - // The integer sentiment labels between 0 (inclusive) and sentimentMax label - // (inclusive), while 0 maps to the least positive sentiment and - // sentimentMax maps to the most positive one. The higher the score is, the - // more positive the sentiment in the text snippet is. Note: sentimentMax is - // an integer value between 1 (inclusive) and 10 (inclusive). - int32 sentiment = 1; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto deleted file mode 100644 index d1517b4a..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.prediction; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "TimeSeriesForecastingPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; - -// Prediction output format for Time Series Forecasting. -message TimeSeriesForecastingPredictionResult { - // The regression value. - float value = 1; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto deleted file mode 100644 index 5a03f70d..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.prediction; - -import "google/protobuf/duration.proto"; -import "google/protobuf/wrappers.proto"; -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "VideoActionRecognitionPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; - -// Prediction output format for Video Action Recognition. -message VideoActionRecognitionPredictionResult { - // The resource ID of the AnnotationSpec that had been identified. - string id = 1; - - // The display name of the AnnotationSpec that had been identified. - string display_name = 2; - - // The beginning, inclusive, of the video's time segment in which the - // AnnotationSpec has been identified. Expressed as a number of seconds as - // measured from the start of the video, with fractions up to a microsecond - // precision, and with "s" appended at the end. - google.protobuf.Duration time_segment_start = 4; - - // The end, exclusive, of the video's time segment in which the - // AnnotationSpec has been identified. Expressed as a number of seconds as - // measured from the start of the video, with fractions up to a microsecond - // precision, and with "s" appended at the end. - google.protobuf.Duration time_segment_end = 5; - - // The Model's confidence in correction of this prediction, higher - // value means higher confidence. - google.protobuf.FloatValue confidence = 6; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto deleted file mode 100644 index bc5c5c37..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.prediction; - -import "google/protobuf/duration.proto"; -import "google/protobuf/wrappers.proto"; -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "VideoClassificationPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; - -// Prediction output format for Video Classification. -message VideoClassificationPredictionResult { - // The resource ID of the AnnotationSpec that had been identified. - string id = 1; - - // The display name of the AnnotationSpec that had been identified. - string display_name = 2; - - // The type of the prediction. The requested types can be configured - // via parameters. This will be one of - // - segment-classification - // - shot-classification - // - one-sec-interval-classification - string type = 3; - - // The beginning, inclusive, of the video's time segment in which the - // AnnotationSpec has been identified. Expressed as a number of seconds as - // measured from the start of the video, with fractions up to a microsecond - // precision, and with "s" appended at the end. Note that for - // 'segment-classification' prediction type, this equals the original - // 'timeSegmentStart' from the input instance, for other types it is the - // start of a shot or a 1 second interval respectively. - google.protobuf.Duration time_segment_start = 4; - - // The end, exclusive, of the video's time segment in which the - // AnnotationSpec has been identified. Expressed as a number of seconds as - // measured from the start of the video, with fractions up to a microsecond - // precision, and with "s" appended at the end. Note that for - // 'segment-classification' prediction type, this equals the original - // 'timeSegmentEnd' from the input instance, for other types it is the end - // of a shot or a 1 second interval respectively. - google.protobuf.Duration time_segment_end = 5; - - // The Model's confidence in correction of this prediction, higher - // value means higher confidence. - google.protobuf.FloatValue confidence = 6; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto deleted file mode 100644 index fcfbff92..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.predict.prediction; - -import "google/protobuf/duration.proto"; -import "google/protobuf/wrappers.proto"; -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.Predict.Prediction"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/predict/prediction;prediction"; -option java_multiple_files = true; -option java_outer_classname = "VideoObjectTrackingPredictionResultProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.predict.prediction"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\Predict\\Prediction"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::Predict::Prediction"; - -// Prediction output format for Video Object Tracking. -message VideoObjectTrackingPredictionResult { - // The fields `xMin`, `xMax`, `yMin`, and `yMax` refer to a bounding box, - // i.e. the rectangle over the video frame pinpointing the found - // AnnotationSpec. The coordinates are relative to the frame size, and the - // point 0,0 is in the top left of the frame. - message Frame { - // A time (frame) of a video in which the object has been detected. - // Expressed as a number of seconds as measured from the - // start of the video, with fractions up to a microsecond precision, and - // with "s" appended at the end. - google.protobuf.Duration time_offset = 1; - - // The leftmost coordinate of the bounding box. - google.protobuf.FloatValue x_min = 2; - - // The rightmost coordinate of the bounding box. - google.protobuf.FloatValue x_max = 3; - - // The topmost coordinate of the bounding box. - google.protobuf.FloatValue y_min = 4; - - // The bottommost coordinate of the bounding box. - google.protobuf.FloatValue y_max = 5; - } - - // The resource ID of the AnnotationSpec that had been identified. - string id = 1; - - // The display name of the AnnotationSpec that had been identified. - string display_name = 2; - - // The beginning, inclusive, of the video's time segment in which the - // object instance has been detected. Expressed as a number of seconds as - // measured from the start of the video, with fractions up to a microsecond - // precision, and with "s" appended at the end. - google.protobuf.Duration time_segment_start = 3; - - // The end, inclusive, of the video's time segment in which the - // object instance has been detected. Expressed as a number of seconds as - // measured from the start of the video, with fractions up to a microsecond - // precision, and with "s" appended at the end. - google.protobuf.Duration time_segment_end = 4; - - // The Model's confidence in correction of this prediction, higher - // value means higher confidence. - google.protobuf.FloatValue confidence = 5; - - // All of the frames of the video in which a single object instance has been - // detected. The bounding boxes in the frames identify the same object. - repeated Frame frames = 6; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto deleted file mode 100644 index 53ead626..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLImageClassificationProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Image Classification Model. -message AutoMlImageClassification { - // The input parameters of this TrainingJob. - AutoMlImageClassificationInputs inputs = 1; - - // The metadata information. - AutoMlImageClassificationMetadata metadata = 2; -} - -message AutoMlImageClassificationInputs { - enum ModelType { - // Should not be set. - MODEL_TYPE_UNSPECIFIED = 0; - - // A Model best tailored to be used within Google Cloud, and which cannot - // be exported. - // Default. - CLOUD = 1; - - // A model that, in addition to being available within Google - // Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow - // or Core ML model and used on a mobile or edge device afterwards. - // Expected to have low latency, but may have lower prediction - // quality than other mobile models. - MOBILE_TF_LOW_LATENCY_1 = 2; - - // A model that, in addition to being available within Google - // Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow - // or Core ML model and used on a mobile or edge device with afterwards. - MOBILE_TF_VERSATILE_1 = 3; - - // A model that, in addition to being available within Google - // Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow - // or Core ML model and used on a mobile or edge device afterwards. - // Expected to have a higher latency, but should also have a higher - // prediction quality than other mobile models. - MOBILE_TF_HIGH_ACCURACY_1 = 4; - } - - ModelType model_type = 1; - - // The ID of the `base` model. If it is specified, the new model will be - // trained based on the `base` model. Otherwise, the new model will be - // trained from scratch. The `base` model must be in the same - // Project and Location as the new Model to train, and have the same - // modelType. - string base_model_id = 2; - - // The training budget of creating this model, expressed in milli node - // hours i.e. 1,000 value in this field means 1 node hour. The actual - // metadata.costMilliNodeHours will be equal or less than this value. - // If further model training ceases to provide any improvements, it will - // stop without using the full budget and the metadata.successfulStopReason - // will be `model-converged`. - // Note, node_hour = actual_hour * number_of_nodes_involved. - // For modelType `cloud`(default), the budget must be between 8,000 - // and 800,000 milli node hours, inclusive. The default value is 192,000 - // which represents one day in wall time, considering 8 nodes are used. - // For model types `mobile-tf-low-latency-1`, `mobile-tf-versatile-1`, - // `mobile-tf-high-accuracy-1`, the training budget must be between - // 1,000 and 100,000 milli node hours, inclusive. - // The default value is 24,000 which represents one day in wall time on a - // single node that is used. - int64 budget_milli_node_hours = 3; - - // Use the entire training budget. This disables the early stopping feature. - // When false the early stopping feature is enabled, which means that - // AutoML Image Classification might stop training before the entire - // training budget has been used. - bool disable_early_stopping = 4; - - // If false, a single-label (multi-class) Model will be trained (i.e. - // assuming that for each image just up to one annotation may be - // applicable). If true, a multi-label Model will be trained (i.e. - // assuming that for each image multiple annotations may be applicable). - bool multi_label = 5; -} - -message AutoMlImageClassificationMetadata { - enum SuccessfulStopReason { - // Should not be set. - SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0; - - // The inputs.budgetMilliNodeHours had been reached. - BUDGET_REACHED = 1; - - // Further training of the Model ceased to increase its quality, since it - // already has converged. - MODEL_CONVERGED = 2; - } - - // The actual training cost of creating this model, expressed in - // milli node hours, i.e. 1,000 value in this field means 1 node hour. - // Guaranteed to not exceed inputs.budgetMilliNodeHours. - int64 cost_milli_node_hours = 1; - - // For successful job completions, this is the reason why the job has - // finished. - SuccessfulStopReason successful_stop_reason = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto deleted file mode 100644 index 4c006644..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLImageObjectDetectionProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Image Object Detection Model. -message AutoMlImageObjectDetection { - // The input parameters of this TrainingJob. - AutoMlImageObjectDetectionInputs inputs = 1; - - // The metadata information - AutoMlImageObjectDetectionMetadata metadata = 2; -} - -message AutoMlImageObjectDetectionInputs { - enum ModelType { - // Should not be set. - MODEL_TYPE_UNSPECIFIED = 0; - - // A model best tailored to be used within Google Cloud, and which cannot - // be exported. Expected to have a higher latency, but should also have a - // higher prediction quality than other cloud models. - CLOUD_HIGH_ACCURACY_1 = 1; - - // A model best tailored to be used within Google Cloud, and which cannot - // be exported. Expected to have a low latency, but may have lower - // prediction quality than other cloud models. - CLOUD_LOW_LATENCY_1 = 2; - - // A model that, in addition to being available within Google - // Cloud can also be exported (see ModelService.ExportModel) and - // used on a mobile or edge device with TensorFlow afterwards. - // Expected to have low latency, but may have lower prediction - // quality than other mobile models. - MOBILE_TF_LOW_LATENCY_1 = 3; - - // A model that, in addition to being available within Google - // Cloud can also be exported (see ModelService.ExportModel) and - // used on a mobile or edge device with TensorFlow afterwards. - MOBILE_TF_VERSATILE_1 = 4; - - // A model that, in addition to being available within Google - // Cloud, can also be exported (see ModelService.ExportModel) and - // used on a mobile or edge device with TensorFlow afterwards. - // Expected to have a higher latency, but should also have a higher - // prediction quality than other mobile models. - MOBILE_TF_HIGH_ACCURACY_1 = 5; - } - - ModelType model_type = 1; - - // The training budget of creating this model, expressed in milli node - // hours i.e. 1,000 value in this field means 1 node hour. The actual - // metadata.costMilliNodeHours will be equal or less than this value. - // If further model training ceases to provide any improvements, it will - // stop without using the full budget and the metadata.successfulStopReason - // will be `model-converged`. - // Note, node_hour = actual_hour * number_of_nodes_involved. - // For modelType `cloud`(default), the budget must be between 20,000 - // and 900,000 milli node hours, inclusive. The default value is 216,000 - // which represents one day in wall time, considering 9 nodes are used. - // For model types `mobile-tf-low-latency-1`, `mobile-tf-versatile-1`, - // `mobile-tf-high-accuracy-1` - // the training budget must be between 1,000 and 100,000 milli node hours, - // inclusive. The default value is 24,000 which represents one day in - // wall time on a single node that is used. - int64 budget_milli_node_hours = 2; - - // Use the entire training budget. This disables the early stopping feature. - // When false the early stopping feature is enabled, which means that AutoML - // Image Object Detection might stop training before the entire training - // budget has been used. - bool disable_early_stopping = 3; -} - -message AutoMlImageObjectDetectionMetadata { - enum SuccessfulStopReason { - // Should not be set. - SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0; - - // The inputs.budgetMilliNodeHours had been reached. - BUDGET_REACHED = 1; - - // Further training of the Model ceased to increase its quality, since it - // already has converged. - MODEL_CONVERGED = 2; - } - - // The actual training cost of creating this model, expressed in - // milli node hours, i.e. 1,000 value in this field means 1 node hour. - // Guaranteed to not exceed inputs.budgetMilliNodeHours. - int64 cost_milli_node_hours = 1; - - // For successful job completions, this is the reason why the job has - // finished. - SuccessfulStopReason successful_stop_reason = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto deleted file mode 100644 index c16721da..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2020 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLImageSegmentationProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Image Segmentation Model. -message AutoMlImageSegmentation { - // The input parameters of this TrainingJob. - AutoMlImageSegmentationInputs inputs = 1; - - // The metadata information. - AutoMlImageSegmentationMetadata metadata = 2; -} - -message AutoMlImageSegmentationInputs { - enum ModelType { - // Should not be set. - MODEL_TYPE_UNSPECIFIED = 0; - - // A model to be used via prediction calls to uCAIP API. Expected - // to have a higher latency, but should also have a higher prediction - // quality than other models. - CLOUD_HIGH_ACCURACY_1 = 1; - - // A model to be used via prediction calls to uCAIP API. Expected - // to have a lower latency but relatively lower prediction quality. - CLOUD_LOW_ACCURACY_1 = 2; - - // A model that, in addition to being available within Google - // Cloud, can also be exported (see ModelService.ExportModel) as TensorFlow - // model and used on a mobile or edge device afterwards. - // Expected to have low latency, but may have lower prediction - // quality than other mobile models. - MOBILE_TF_LOW_LATENCY_1 = 3; - } - - ModelType model_type = 1; - - // The training budget of creating this model, expressed in milli node - // hours i.e. 1,000 value in this field means 1 node hour. The actual - // metadata.costMilliNodeHours will be equal or less than this value. - // If further model training ceases to provide any improvements, it will - // stop without using the full budget and the metadata.successfulStopReason - // will be `model-converged`. - // Note, node_hour = actual_hour * number_of_nodes_involved. Or - // actaul_wall_clock_hours = train_budget_milli_node_hours / - // (number_of_nodes_involved * 1000) - // For modelType `cloud-high-accuracy-1`(default), the budget must be between - // 20,000 and 2,000,000 milli node hours, inclusive. The default value is - // 192,000 which represents one day in wall time - // (1000 milli * 24 hours * 8 nodes). - int64 budget_milli_node_hours = 2; - - // The ID of the `base` model. If it is specified, the new model will be - // trained based on the `base` model. Otherwise, the new model will be - // trained from scratch. The `base` model must be in the same - // Project and Location as the new Model to train, and have the same - // modelType. - string base_model_id = 3; -} - -message AutoMlImageSegmentationMetadata { - enum SuccessfulStopReason { - // Should not be set. - SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0; - - // The inputs.budgetMilliNodeHours had been reached. - BUDGET_REACHED = 1; - - // Further training of the Model ceased to increase its quality, since it - // already has converged. - MODEL_CONVERGED = 2; - } - - // The actual training cost of creating this model, expressed in - // milli node hours, i.e. 1,000 value in this field means 1 node hour. - // Guaranteed to not exceed inputs.budgetMilliNodeHours. - int64 cost_milli_node_hours = 1; - - // For successful job completions, this is the reason why the job has - // finished. - SuccessfulStopReason successful_stop_reason = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto deleted file mode 100644 index 29d8d80a..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto +++ /dev/null @@ -1,284 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; - -import "google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto"; -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLTablesProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Tables Model. -message AutoMlTables { - // The input parameters of this TrainingJob. - AutoMlTablesInputs inputs = 1; - - // The metadata information. - AutoMlTablesMetadata metadata = 2; -} - -message AutoMlTablesInputs { - message Transformation { - // Training pipeline will infer the proper transformation based on the - // statistic of dataset. - message AutoTransformation { - string column_name = 1; - } - - // Training pipeline will perform following transformation functions. - // * The value converted to float32. - // * The z_score of the value. - // * log(value+1) when the value is greater than or equal to 0. Otherwise, - // this transformation is not applied and the value is considered a - // missing value. - // * z_score of log(value+1) when the value is greater than or equal to 0. - // Otherwise, this transformation is not applied and the value is - // considered a missing value. - // * A boolean value that indicates whether the value is valid. - message NumericTransformation { - string column_name = 1; - - // If invalid values is allowed, the training pipeline will create a - // boolean feature that indicated whether the value is valid. - // Otherwise, the training pipeline will discard the input row from - // trainining data. - bool invalid_values_allowed = 2; - } - - // Training pipeline will perform following transformation functions. - // * The categorical string as is--no change to case, punctuation, - // spelling, - // tense, and so on. - // * Convert the category name to a dictionary lookup index and generate an - // embedding for each index. - // * Categories that appear less than 5 times in the training dataset are - // treated as the "unknown" category. The "unknown" category gets its own - // special lookup index and resulting embedding. - message CategoricalTransformation { - string column_name = 1; - } - - // Training pipeline will perform following transformation functions. - // * Apply the transformation functions for Numerical columns. - // * Determine the year, month, day,and weekday. Treat each value from the - // * timestamp as a Categorical column. - // * Invalid numerical values (for example, values that fall outside of a - // typical timestamp range, or are extreme values) receive no special - // treatment and are not removed. - message TimestampTransformation { - string column_name = 1; - - // The format in which that time field is expressed. The time_format must - // either be one of: - // * `unix-seconds` - // * `unix-milliseconds` - // * `unix-microseconds` - // * `unix-nanoseconds` - // (for respectively number of seconds, milliseconds, microseconds and - // nanoseconds since start of the Unix epoch); - // or be written in `strftime` syntax. If time_format is not set, then the - // default format is RFC 3339 `date-time` format, where - // `time-offset` = `"Z"` (e.g. 1985-04-12T23:20:50.52Z) - string time_format = 2; - - // If invalid values is allowed, the training pipeline will create a - // boolean feature that indicated whether the value is valid. - // Otherwise, the training pipeline will discard the input row from - // trainining data. - bool invalid_values_allowed = 3; - } - - // Training pipeline will perform following transformation functions. - // * The text as is--no change to case, punctuation, spelling, tense, and - // so - // on. - // * Tokenize text to words. Convert each words to a dictionary lookup - // index - // and generate an embedding for each index. Combine the embedding of all - // elements into a single embedding using the mean. - // * Tokenization is based on unicode script boundaries. - // * Missing values get their own lookup index and resulting embedding. - // * Stop-words receive no special treatment and are not removed. - message TextTransformation { - string column_name = 1; - } - - // Treats the column as numerical array and performs following - // transformation functions. - // * All transformations for Numerical types applied to the average of the - // all elements. - // * The average of empty arrays is treated as zero. - message NumericArrayTransformation { - string column_name = 1; - - // If invalid values is allowed, the training pipeline will create a - // boolean feature that indicated whether the value is valid. - // Otherwise, the training pipeline will discard the input row from - // trainining data. - bool invalid_values_allowed = 2; - } - - // Treats the column as categorical array and performs following - // transformation functions. - // * For each element in the array, convert the category name to a - // dictionary - // lookup index and generate an embedding for each index. - // Combine the embedding of all elements into a single embedding using - // the mean. - // * Empty arrays treated as an embedding of zeroes. - message CategoricalArrayTransformation { - string column_name = 1; - } - - // Treats the column as text array and performs following transformation - // functions. - // * Concatenate all text values in the array into a single text value - // using - // a space (" ") as a delimiter, and then treat the result as a single - // text value. Apply the transformations for Text columns. - // * Empty arrays treated as an empty text. - message TextArrayTransformation { - string column_name = 1; - } - - // The transformation that the training pipeline will apply to the input - // columns. - oneof transformation_detail { - AutoTransformation auto = 1; - - NumericTransformation numeric = 2; - - CategoricalTransformation categorical = 3; - - TimestampTransformation timestamp = 4; - - TextTransformation text = 5; - - NumericArrayTransformation repeated_numeric = 6; - - CategoricalArrayTransformation repeated_categorical = 7; - - TextArrayTransformation repeated_text = 8; - } - } - - // Additional optimization objective configuration. Required for - // `maximize-precision-at-recall` and `maximize-recall-at-precision`, - // otherwise unused. - oneof additional_optimization_objective_config { - // Required when optimization_objective is "maximize-precision-at-recall". - // Must be between 0 and 1, inclusive. - float optimization_objective_recall_value = 5; - - // Required when optimization_objective is "maximize-recall-at-precision". - // Must be between 0 and 1, inclusive. - float optimization_objective_precision_value = 6; - } - - // The type of prediction the Model is to produce. - // "classification" - Predict one out of multiple target values is - // picked for each row. - // "regression" - Predict a value based on its relation to other values. - // This type is available only to columns that contain - // semantically numeric values, i.e. integers or floating - // point number, even if stored as e.g. strings. - string prediction_type = 1; - - // The column name of the target column that the model is to predict. - string target_column = 2; - - // Each transformation will apply transform function to given input column. - // And the result will be used for training. - // When creating transformation for BigQuery Struct column, the column should - // be flattened using "." as the delimiter. - repeated Transformation transformations = 3; - - // Objective function the model is optimizing towards. The training process - // creates a model that maximizes/minimizes the value of the objective - // function over the validation set. - // - // The supported optimization objectives depend on the prediction type. - // If the field is not set, a default objective function is used. - // - // classification (binary): - // "maximize-au-roc" (default) - Maximize the area under the receiver - // operating characteristic (ROC) curve. - // "minimize-log-loss" - Minimize log loss. - // "maximize-au-prc" - Maximize the area under the precision-recall curve. - // "maximize-precision-at-recall" - Maximize precision for a specified - // recall value. - // "maximize-recall-at-precision" - Maximize recall for a specified - // precision value. - // - // classification (multi-class): - // "minimize-log-loss" (default) - Minimize log loss. - // - // regression: - // "minimize-rmse" (default) - Minimize root-mean-squared error (RMSE). - // "minimize-mae" - Minimize mean-absolute error (MAE). - // "minimize-rmsle" - Minimize root-mean-squared log error (RMSLE). - string optimization_objective = 4; - - // Required. The train budget of creating this model, expressed in milli node - // hours i.e. 1,000 value in this field means 1 node hour. - // - // The training cost of the model will not exceed this budget. The final cost - // will be attempted to be close to the budget, though may end up being (even) - // noticeably smaller - at the backend's discretion. This especially may - // happen when further model training ceases to provide any improvements. - // - // If the budget is set to a value known to be insufficient to train a - // model for the given dataset, the training won't be attempted and - // will error. - // - // The train budget must be between 1,000 and 72,000 milli node hours, - // inclusive. - int64 train_budget_milli_node_hours = 7; - - // Use the entire training budget. This disables the early stopping feature. - // By default, the early stopping feature is enabled, which means that AutoML - // Tables might stop training before the entire training budget has been used. - bool disable_early_stopping = 8; - - // Column name that should be used as the weight column. - // Higher values in this column give more importance to the row - // during model training. The column must have numeric values between 0 and - // 10000 inclusively; 0 means the row is ignored for training. If weight - // column field is not set, then all rows are assumed to have equal weight - // of 1. - string weight_column_name = 9; - - // Configuration for exporting test set predictions to a BigQuery table. If - // this configuration is absent, then the export is not performed. - ExportEvaluatedDataItemsConfig export_evaluated_data_items_config = 10; - - // Additional experiment flags for the Tables training pipeline. - repeated string additional_experiments = 11; -} - -// Model metadata specific to AutoML Tables. -message AutoMlTablesMetadata { - // Output only. The actual training cost of the model, expressed in milli - // node hours, i.e. 1,000 value in this field means 1 node hour. Guaranteed - // to not exceed the train budget. - int64 train_cost_milli_node_hours = 1; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto deleted file mode 100644 index 6a2c93dd..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLTextClassificationProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Text Classification Model. -message AutoMlTextClassification { - // The input parameters of this TrainingJob. - AutoMlTextClassificationInputs inputs = 1; -} - -message AutoMlTextClassificationInputs { - bool multi_label = 1; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto deleted file mode 100644 index 6b172764..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLTextExtractionProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Text Extraction Model. -message AutoMlTextExtraction { - // The input parameters of this TrainingJob. - AutoMlTextExtractionInputs inputs = 1; -} - -message AutoMlTextExtractionInputs { - -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto deleted file mode 100644 index 18e42dce..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLTextSentimentProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Text Sentiment Model. -message AutoMlTextSentiment { - // The input parameters of this TrainingJob. - AutoMlTextSentimentInputs inputs = 1; -} - -message AutoMlTextSentimentInputs { - // A sentiment is expressed as an integer ordinal, where higher value - // means a more positive sentiment. The range of sentiments that will be used - // is between 0 and sentimentMax (inclusive on both ends), and all the values - // in the range must be represented in the dataset before a model can be - // created. - // Only the Annotations with this sentimentMax will be used for training. - // sentimentMax value must be between 1 and 10 (inclusive). - int32 sentiment_max = 1; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto deleted file mode 100644 index fdae0f0d..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto +++ /dev/null @@ -1,287 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; - -import "google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto"; -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLForecastingProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Forecasting Model. -message AutoMlForecasting { - // The input parameters of this TrainingJob. - AutoMlForecastingInputs inputs = 1; - - // The metadata information. - AutoMlForecastingMetadata metadata = 2; -} - -message AutoMlForecastingInputs { - message Transformation { - // Training pipeline will infer the proper transformation based on the - // statistic of dataset. - message AutoTransformation { - string column_name = 1; - } - - // Training pipeline will perform following transformation functions. - // - // * The value converted to float32. - // - // * The z_score of the value. - // - // * log(value+1) when the value is greater than or equal to 0. Otherwise, - // this transformation is not applied and the value is considered a - // missing value. - // - // * z_score of log(value+1) when the value is greater than or equal to 0. - // Otherwise, this transformation is not applied and the value is - // considered a missing value. - // - // * A boolean value that indicates whether the value is valid. - message NumericTransformation { - string column_name = 1; - } - - // Training pipeline will perform following transformation functions. - // - // * The categorical string as is--no change to case, punctuation, - // spelling, tense, and so on. - // - // * Convert the category name to a dictionary lookup index and generate an - // embedding for each index. - // - // * Categories that appear less than 5 times in the training dataset are - // treated as the "unknown" category. The "unknown" category gets its own - // special lookup index and resulting embedding. - message CategoricalTransformation { - string column_name = 1; - } - - // Training pipeline will perform following transformation functions. - // - // * Apply the transformation functions for Numerical columns. - // - // * Determine the year, month, day,and weekday. Treat each value from the - // timestamp as a Categorical column. - // - // * Invalid numerical values (for example, values that fall outside of a - // typical timestamp range, or are extreme values) receive no special - // treatment and are not removed. - message TimestampTransformation { - string column_name = 1; - - // The format in which that time field is expressed. The time_format must - // either be one of: - // - // * `unix-seconds` - // - // * `unix-milliseconds` - // - // * `unix-microseconds` - // - // * `unix-nanoseconds` - // - // (for respectively number of seconds, milliseconds, microseconds and - // nanoseconds since start of the Unix epoch); - // - // or be written in `strftime` syntax. - // - // If time_format is not set, then the - // default format is RFC 3339 `date-time` format, where - // `time-offset` = `"Z"` (e.g. 1985-04-12T23:20:50.52Z) - string time_format = 2; - } - - // Training pipeline will perform following transformation functions. - // - // * The text as is--no change to case, punctuation, spelling, tense, and - // so on. - // - // * Convert the category name to a dictionary lookup index and generate an - // embedding for each index. - message TextTransformation { - string column_name = 1; - } - - // The transformation that the training pipeline will apply to the input - // columns. - oneof transformation_detail { - AutoTransformation auto = 1; - - NumericTransformation numeric = 2; - - CategoricalTransformation categorical = 3; - - TimestampTransformation timestamp = 4; - - TextTransformation text = 5; - } - } - - // A duration of time expressed in time granularity units. - message Granularity { - // The time granularity unit of this time period. - // The supported units are: - // - // * "minute" - // - // * "hour" - // - // * "day" - // - // * "week" - // - // * "month" - // - // * "year" - string unit = 1; - - // The number of granularity_units between data points in the training - // data. If `granularity_unit` is `minute`, - // can be 1, 5, 10, 15, or 30. For all other values of `granularity_unit`, - // must be 1. - int64 quantity = 2; - } - - // The name of the column that the model is to predict. - string target_column = 1; - - // The name of the column that identifies the time series. - string time_series_identifier_column = 2; - - // The name of the column that identifies time order in the time series. - string time_column = 3; - - // Each transformation will apply transform function to given input column. - // And the result will be used for training. - // When creating transformation for BigQuery Struct column, the column should - // be flattened using "." as the delimiter. - repeated Transformation transformations = 4; - - // Objective function the model is optimizing towards. The training process - // creates a model that optimizes the value of the objective - // function over the validation set. - // - // The supported optimization objectives: - // - // * "minimize-rmse" (default) - Minimize root-mean-squared error (RMSE). - // - // * "minimize-mae" - Minimize mean-absolute error (MAE). - // - // * "minimize-rmsle" - Minimize root-mean-squared log error (RMSLE). - // - // * "minimize-rmspe" - Minimize root-mean-squared percentage error (RMSPE). - // - // * "minimize-wape-mae" - Minimize the combination of weighted absolute - // percentage error (WAPE) and mean-absolute-error (MAE). - // - // * "minimize-quantile-loss" - Minimize the quantile loss at the quantiles - // defined in `quantiles`. - string optimization_objective = 5; - - // Required. The train budget of creating this model, expressed in milli node - // hours i.e. 1,000 value in this field means 1 node hour. - // - // The training cost of the model will not exceed this budget. The final cost - // will be attempted to be close to the budget, though may end up being (even) - // noticeably smaller - at the backend's discretion. This especially may - // happen when further model training ceases to provide any improvements. - // - // If the budget is set to a value known to be insufficient to train a - // model for the given dataset, the training won't be attempted and - // will error. - // - // The train budget must be between 1,000 and 72,000 milli node hours, - // inclusive. - int64 train_budget_milli_node_hours = 6; - - // Column name that should be used as the weight column. - // Higher values in this column give more importance to the row - // during model training. The column must have numeric values between 0 and - // 10000 inclusively; 0 means the row is ignored for training. If weight - // column field is not set, then all rows are assumed to have equal weight - // of 1. - string weight_column = 7; - - // Column names that should be used as attribute columns. - // The value of these columns does not vary as a function of time. - // For example, store ID or item color. - repeated string time_series_attribute_columns = 19; - - // Names of columns that are unavailable when a forecast is requested. - // This column contains information for the given entity (identified - // by the time_series_identifier_column) that is unknown before the forecast - // For example, actual weather on a given day. - repeated string unavailable_at_forecast_columns = 20; - - // Names of columns that are available and provided when a forecast - // is requested. These columns - // contain information for the given entity (identified by the - // time_series_identifier_column column) that is known at forecast. - // For example, predicted weather for a specific day. - repeated string available_at_forecast_columns = 21; - - // Expected difference in time granularity between rows in the data. - Granularity data_granularity = 22; - - // The amount of time into the future for which forecasted values for the - // target are returned. Expressed in number of units defined by the - // `data_granularity` field. - int64 forecast_horizon = 23; - - // The amount of time into the past training and prediction data is used - // for model training and prediction respectively. Expressed in number of - // units defined by the `data_granularity` field. - int64 context_window = 24; - - // Configuration for exporting test set predictions to a BigQuery table. If - // this configuration is absent, then the export is not performed. - ExportEvaluatedDataItemsConfig export_evaluated_data_items_config = 15; - - // Quantiles to use for minimize-quantile-loss `optimization_objective`. Up to - // 5 quantiles are allowed of values between 0 and 1, exclusive. Required if - // the value of optimization_objective is minimize-quantile-loss. Represents - // the percent quantiles to use for that objective. Quantiles must be unique. - repeated double quantiles = 16; - - // Validation options for the data validation component. The available options - // are: - // - // * "fail-pipeline" - default, will validate against the validation and - // fail the pipeline if it fails. - // - // * "ignore-validation" - ignore the results of the validation and continue - string validation_options = 17; - - // Additional experiment flags for the time series forcasting training. - repeated string additional_experiments = 25; -} - -// Model metadata specific to AutoML Forecasting. -message AutoMlForecastingMetadata { - // Output only. The actual training cost of the model, expressed in milli - // node hours, i.e. 1,000 value in this field means 1 node hour. Guaranteed - // to not exceed the train budget. - int64 train_cost_milli_node_hours = 1; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto deleted file mode 100644 index 4a16d658..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLVideoActionRecognitionProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Video Action Recognition -// Model. -message AutoMlVideoActionRecognition { - // The input parameters of this TrainingJob. - AutoMlVideoActionRecognitionInputs inputs = 1; -} - -message AutoMlVideoActionRecognitionInputs { - enum ModelType { - // Should not be set. - MODEL_TYPE_UNSPECIFIED = 0; - - // A model best tailored to be used within Google Cloud, and which c annot - // be exported. Default. - CLOUD = 1; - - // A model that, in addition to being available within Google Cloud, can - // also be exported (see ModelService.ExportModel) as a TensorFlow or - // TensorFlow Lite model and used on a mobile or edge device afterwards. - MOBILE_VERSATILE_1 = 2; - - // A model that, in addition to being available within Google Cloud, can - // also be exported (see ModelService.ExportModel) to a Jetson device - // afterwards. - MOBILE_JETSON_VERSATILE_1 = 3; - - // A model that, in addition to being available within Google Cloud, can - // also be exported (see ModelService.ExportModel) as a TensorFlow or - // TensorFlow Lite model and used on a Coral device afterwards. - MOBILE_CORAL_VERSATILE_1 = 4; - } - - ModelType model_type = 1; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto deleted file mode 100644 index 020ef526..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLVideoClassificationProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Video Classification Model. -message AutoMlVideoClassification { - // The input parameters of this TrainingJob. - AutoMlVideoClassificationInputs inputs = 1; -} - -message AutoMlVideoClassificationInputs { - enum ModelType { - // Should not be set. - MODEL_TYPE_UNSPECIFIED = 0; - - // A model best tailored to be used within Google Cloud, and which cannot - // be exported. Default. - CLOUD = 1; - - // A model that, in addition to being available within Google Cloud, can - // also be exported (see ModelService.ExportModel) as a TensorFlow or - // TensorFlow Lite model and used on a mobile or edge device afterwards. - MOBILE_VERSATILE_1 = 2; - - // A model that, in addition to being available within Google Cloud, can - // also be exported (see ModelService.ExportModel) to a Jetson device - // afterwards. - MOBILE_JETSON_VERSATILE_1 = 3; - } - - ModelType model_type = 1; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto deleted file mode 100644 index 9858eafc..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "AutoMLVideoObjectTrackingProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; - -// A TrainingJob that trains and uploads an AutoML Video ObjectTracking Model. -message AutoMlVideoObjectTracking { - // The input parameters of this TrainingJob. - AutoMlVideoObjectTrackingInputs inputs = 1; -} - -message AutoMlVideoObjectTrackingInputs { - enum ModelType { - // Should not be set. - MODEL_TYPE_UNSPECIFIED = 0; - - // A model best tailored to be used within Google Cloud, and which c annot - // be exported. Default. - CLOUD = 1; - - // A model that, in addition to being available within Google Cloud, can - // also be exported (see ModelService.ExportModel) as a TensorFlow or - // TensorFlow Lite model and used on a mobile or edge device afterwards. - MOBILE_VERSATILE_1 = 2; - - // A versatile model that is meant to be exported (see - // ModelService.ExportModel) and used on a Google Coral device. - MOBILE_CORAL_VERSATILE_1 = 3; - - // A model that trades off quality for low latency, to be exported (see - // ModelService.ExportModel) and used on a Google Coral device. - MOBILE_CORAL_LOW_LATENCY_1 = 4; - - // A versatile model that is meant to be exported (see - // ModelService.ExportModel) and used on an NVIDIA Jetson device. - MOBILE_JETSON_VERSATILE_1 = 5; - - // A model that trades off quality for low latency, to be exported (see - // ModelService.ExportModel) and used on an NVIDIA Jetson device. - MOBILE_JETSON_LOW_LATENCY_1 = 6; - } - - ModelType model_type = 1; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto deleted file mode 100644 index 80385668..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2021 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1.schema.trainingjob.definition; - -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1.Schema.TrainingJob.Definition"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1/schema/trainingjob/definition;definition"; -option java_multiple_files = true; -option java_outer_classname = "ExportEvaluatedDataItemsConfigProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1\\Schema\\TrainingJob\\Definition"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1::Schema::TrainingJob::Definition"; - -// Configuration for exporting test set predictions to a BigQuery table. -message ExportEvaluatedDataItemsConfig { - // URI of desired destination BigQuery table. Expected format: - // bq://::
include:samples/generated/v1/dataset_service.get_dataset.jsinclude:samples/generated/v1/dataset_service.update_dataset.jsinclude:samples/generated/v1/dataset_service.get_annotation_spec.jsinclude:samples/generated/v1/dataset_service.create_dataset.jsinclude:samples/generated/v1/dataset_service.create_dataset.jsinclude:samples/generated/v1/dataset_service.delete_dataset.jsinclude:samples/generated/v1/dataset_service.delete_dataset.jsinclude:samples/generated/v1/dataset_service.import_data.jsinclude:samples/generated/v1/dataset_service.import_data.jsinclude:samples/generated/v1/dataset_service.export_data.jsinclude:samples/generated/v1/dataset_service.export_data.jsinclude:samples/generated/v1/dataset_service.list_datasets.jsinclude:samples/generated/v1/dataset_service.list_data_items.jsinclude:samples/generated/v1/dataset_service.list_annotations.jsinclude:samples/generated/v1/endpoint_service.get_endpoint.jsinclude:samples/generated/v1/endpoint_service.update_endpoint.jsinclude:samples/generated/v1/endpoint_service.create_endpoint.jsinclude:samples/generated/v1/endpoint_service.create_endpoint.jsinclude:samples/generated/v1/endpoint_service.delete_endpoint.jsinclude:samples/generated/v1/endpoint_service.delete_endpoint.jsinclude:samples/generated/v1/endpoint_service.deploy_model.jsinclude:samples/generated/v1/endpoint_service.deploy_model.jsinclude:samples/generated/v1/endpoint_service.undeploy_model.jsinclude:samples/generated/v1/endpoint_service.undeploy_model.jsinclude:samples/generated/v1/endpoint_service.list_endpoints.jsinclude:samples/generated/v1/featurestore_online_serving_service.read_feature_values.jsinclude:samples/generated/v1/featurestore_online_serving_service.streaming_read_feature_values.jsinclude:samples/generated/v1/featurestore_service.get_featurestore.jsinclude:samples/generated/v1/featurestore_service.get_entity_type.jsinclude:samples/generated/v1/featurestore_service.update_entity_type.jsinclude:samples/generated/v1/featurestore_service.get_feature.jsinclude:samples/generated/v1/featurestore_service.update_feature.jsinclude:samples/generated/v1/featurestore_service.create_featurestore.jsinclude:samples/generated/v1/featurestore_service.create_featurestore.jsinclude:samples/generated/v1/featurestore_service.update_featurestore.jsinclude:samples/generated/v1/featurestore_service.update_featurestore.jsinclude:samples/generated/v1/featurestore_service.delete_featurestore.jsinclude:samples/generated/v1/featurestore_service.delete_featurestore.jsinclude:samples/generated/v1/featurestore_service.create_entity_type.jsinclude:samples/generated/v1/featurestore_service.create_entity_type.jsinclude:samples/generated/v1/featurestore_service.delete_entity_type.jsinclude:samples/generated/v1/featurestore_service.delete_entity_type.jsinclude:samples/generated/v1/featurestore_service.create_feature.jsinclude:samples/generated/v1/featurestore_service.create_feature.jsinclude:samples/generated/v1/featurestore_service.batch_create_features.jsinclude:samples/generated/v1/featurestore_service.batch_create_features.jsinclude:samples/generated/v1/featurestore_service.delete_feature.jsinclude:samples/generated/v1/featurestore_service.delete_feature.jsinclude:samples/generated/v1/featurestore_service.import_feature_values.jsinclude:samples/generated/v1/featurestore_service.import_feature_values.jsinclude:samples/generated/v1/featurestore_service.batch_read_feature_values.jsinclude:samples/generated/v1/featurestore_service.batch_read_feature_values.jsinclude:samples/generated/v1/featurestore_service.export_feature_values.jsinclude:samples/generated/v1/featurestore_service.export_feature_values.jsinclude:samples/generated/v1/featurestore_service.list_featurestores.jsinclude:samples/generated/v1/featurestore_service.list_entity_types.jsinclude:samples/generated/v1/featurestore_service.list_features.jsinclude:samples/generated/v1/featurestore_service.search_features.jsinclude:samples/generated/v1/index_endpoint_service.get_index_endpoint.jsinclude:samples/generated/v1/index_endpoint_service.update_index_endpoint.jsinclude:samples/generated/v1/index_endpoint_service.create_index_endpoint.jsinclude:samples/generated/v1/index_endpoint_service.create_index_endpoint.jsinclude:samples/generated/v1/index_endpoint_service.delete_index_endpoint.jsinclude:samples/generated/v1/index_endpoint_service.delete_index_endpoint.jsinclude:samples/generated/v1/index_endpoint_service.deploy_index.jsinclude:samples/generated/v1/index_endpoint_service.deploy_index.jsinclude:samples/generated/v1/index_endpoint_service.undeploy_index.jsinclude:samples/generated/v1/index_endpoint_service.undeploy_index.jsinclude:samples/generated/v1/index_endpoint_service.mutate_deployed_index.jsinclude:samples/generated/v1/index_endpoint_service.mutate_deployed_index.jsinclude:samples/generated/v1/index_endpoint_service.list_index_endpoints.jsinclude:samples/generated/v1/index_service.get_index.jsinclude:samples/generated/v1/index_service.create_index.jsinclude:samples/generated/v1/index_service.create_index.jsinclude:samples/generated/v1/index_service.update_index.jsinclude:samples/generated/v1/index_service.update_index.jsinclude:samples/generated/v1/index_service.delete_index.jsinclude:samples/generated/v1/index_service.delete_index.jsinclude:samples/generated/v1/index_service.list_indexes.jsinclude:samples/generated/v1/job_service.create_custom_job.jsinclude:samples/generated/v1/job_service.get_custom_job.jsinclude:samples/generated/v1/job_service.cancel_custom_job.jsinclude:samples/generated/v1/job_service.create_data_labeling_job.jsinclude:samples/generated/v1/job_service.get_data_labeling_job.jsinclude:samples/generated/v1/job_service.cancel_data_labeling_job.jsinclude:samples/generated/v1/job_service.create_hyperparameter_tuning_job.jsinclude:samples/generated/v1/job_service.get_hyperparameter_tuning_job.jsinclude:samples/generated/v1/job_service.cancel_hyperparameter_tuning_job.jsinclude:samples/generated/v1/job_service.create_batch_prediction_job.jsinclude:samples/generated/v1/job_service.get_batch_prediction_job.jsinclude:samples/generated/v1/job_service.cancel_batch_prediction_job.jsinclude:samples/generated/v1/job_service.create_model_deployment_monitoring_job.jsinclude:samples/generated/v1/job_service.get_model_deployment_monitoring_job.jsinclude:samples/generated/v1/job_service.pause_model_deployment_monitoring_job.jsinclude:samples/generated/v1/job_service.resume_model_deployment_monitoring_job.jsinclude:samples/generated/v1/job_service.delete_custom_job.jsinclude:samples/generated/v1/job_service.delete_custom_job.jsinclude:samples/generated/v1/job_service.delete_data_labeling_job.jsinclude:samples/generated/v1/job_service.delete_data_labeling_job.jsinclude:samples/generated/v1/job_service.delete_hyperparameter_tuning_job.jsinclude:samples/generated/v1/job_service.delete_hyperparameter_tuning_job.jsinclude:samples/generated/v1/job_service.delete_batch_prediction_job.jsinclude:samples/generated/v1/job_service.delete_batch_prediction_job.jsinclude:samples/generated/v1/job_service.update_model_deployment_monitoring_job.jsinclude:samples/generated/v1/job_service.update_model_deployment_monitoring_job.jsinclude:samples/generated/v1/job_service.delete_model_deployment_monitoring_job.jsinclude:samples/generated/v1/job_service.delete_model_deployment_monitoring_job.jsinclude:samples/generated/v1/job_service.list_custom_jobs.jsinclude:samples/generated/v1/job_service.list_data_labeling_jobs.jsinclude:samples/generated/v1/job_service.list_hyperparameter_tuning_jobs.jsinclude:samples/generated/v1/job_service.list_batch_prediction_jobs.jsinclude:samples/generated/v1/job_service.search_model_deployment_monitoring_stats_anomalies.jsinclude:samples/generated/v1/job_service.list_model_deployment_monitoring_jobs.jsinclude:samples/generated/v1/metadata_service.get_metadata_store.jsinclude:samples/generated/v1/metadata_service.create_artifact.jsinclude:samples/generated/v1/metadata_service.get_artifact.jsinclude:samples/generated/v1/metadata_service.update_artifact.jsinclude:samples/generated/v1/metadata_service.create_context.jsinclude:samples/generated/v1/metadata_service.get_context.jsinclude:samples/generated/v1/metadata_service.update_context.jsinclude:samples/generated/v1/metadata_service.add_context_artifacts_and_executions.jsinclude:samples/generated/v1/metadata_service.add_context_children.jsinclude:samples/generated/v1/metadata_service.query_context_lineage_subgraph.jsinclude:samples/generated/v1/metadata_service.create_execution.jsinclude:samples/generated/v1/metadata_service.get_execution.jsinclude:samples/generated/v1/metadata_service.update_execution.jsinclude:samples/generated/v1/metadata_service.add_execution_events.jsinclude:samples/generated/v1/metadata_service.query_execution_inputs_and_outputs.jsinclude:samples/generated/v1/metadata_service.create_metadata_schema.jsinclude:samples/generated/v1/metadata_service.get_metadata_schema.jsinclude:samples/generated/v1/metadata_service.query_artifact_lineage_subgraph.jsinclude:samples/generated/v1/metadata_service.create_metadata_store.jsinclude:samples/generated/v1/metadata_service.create_metadata_store.jsinclude:samples/generated/v1/metadata_service.delete_metadata_store.jsinclude:samples/generated/v1/metadata_service.delete_metadata_store.jsinclude:samples/generated/v1/metadata_service.delete_artifact.jsinclude:samples/generated/v1/metadata_service.delete_artifact.jsinclude:samples/generated/v1/metadata_service.purge_artifacts.jsinclude:samples/generated/v1/metadata_service.purge_artifacts.jsinclude:samples/generated/v1/metadata_service.delete_context.jsinclude:samples/generated/v1/metadata_service.delete_context.jsinclude:samples/generated/v1/metadata_service.purge_contexts.jsinclude:samples/generated/v1/metadata_service.purge_contexts.jsinclude:samples/generated/v1/metadata_service.delete_execution.jsinclude:samples/generated/v1/metadata_service.delete_execution.jsinclude:samples/generated/v1/metadata_service.purge_executions.jsinclude:samples/generated/v1/metadata_service.purge_executions.jsinclude:samples/generated/v1/metadata_service.list_metadata_stores.jsinclude:samples/generated/v1/metadata_service.list_artifacts.jsinclude:samples/generated/v1/metadata_service.list_contexts.jsinclude:samples/generated/v1/metadata_service.list_executions.jsinclude:samples/generated/v1/metadata_service.list_metadata_schemas.jsinclude:samples/generated/v1/migration_service.batch_migrate_resources.jsinclude:samples/generated/v1/migration_service.batch_migrate_resources.jsinclude:samples/generated/v1/migration_service.search_migratable_resources.jsinclude:samples/generated/v1/model_service.get_model.jsinclude:samples/generated/v1/model_service.update_model.jsinclude:samples/generated/v1/model_service.import_model_evaluation.jsinclude:samples/generated/v1/model_service.get_model_evaluation.jsinclude:samples/generated/v1/model_service.get_model_evaluation_slice.jsinclude:samples/generated/v1/model_service.upload_model.jsinclude:samples/generated/v1/model_service.upload_model.jsinclude:samples/generated/v1/model_service.delete_model.jsinclude:samples/generated/v1/model_service.delete_model.jsinclude:samples/generated/v1/model_service.export_model.jsinclude:samples/generated/v1/model_service.export_model.jsinclude:samples/generated/v1/model_service.list_models.jsinclude:samples/generated/v1/model_service.list_model_evaluations.jsinclude:samples/generated/v1/model_service.list_model_evaluation_slices.jsinclude:samples/generated/v1/pipeline_service.create_training_pipeline.jsinclude:samples/generated/v1/pipeline_service.get_training_pipeline.jsinclude:samples/generated/v1/pipeline_service.cancel_training_pipeline.jsinclude:samples/generated/v1/pipeline_service.create_pipeline_job.jsinclude:samples/generated/v1/pipeline_service.get_pipeline_job.jsinclude:samples/generated/v1/pipeline_service.cancel_pipeline_job.jsinclude:samples/generated/v1/pipeline_service.delete_training_pipeline.jsinclude:samples/generated/v1/pipeline_service.delete_training_pipeline.jsinclude:samples/generated/v1/pipeline_service.delete_pipeline_job.jsinclude:samples/generated/v1/pipeline_service.delete_pipeline_job.jsinclude:samples/generated/v1/pipeline_service.list_training_pipelines.jsinclude:samples/generated/v1/pipeline_service.list_pipeline_jobs.jsinclude:samples/generated/v1/prediction_service.predict.jsinclude:samples/generated/v1/prediction_service.raw_predict.jsinclude:samples/generated/v1/prediction_service.explain.jsinclude:samples/generated/v1/specialist_pool_service.get_specialist_pool.jsinclude:samples/generated/v1/specialist_pool_service.create_specialist_pool.jsinclude:samples/generated/v1/specialist_pool_service.create_specialist_pool.jsinclude:samples/generated/v1/specialist_pool_service.delete_specialist_pool.jsinclude:samples/generated/v1/specialist_pool_service.delete_specialist_pool.jsinclude:samples/generated/v1/specialist_pool_service.update_specialist_pool.jsinclude:samples/generated/v1/specialist_pool_service.update_specialist_pool.jsinclude:samples/generated/v1/specialist_pool_service.list_specialist_pools.jsinclude:samples/generated/v1/tensorboard_service.get_tensorboard.jsinclude:samples/generated/v1/tensorboard_service.create_tensorboard_experiment.jsinclude:samples/generated/v1/tensorboard_service.get_tensorboard_experiment.jsinclude:samples/generated/v1/tensorboard_service.update_tensorboard_experiment.jsinclude:samples/generated/v1/tensorboard_service.create_tensorboard_run.jsinclude:samples/generated/v1/tensorboard_service.batch_create_tensorboard_runs.jsinclude:samples/generated/v1/tensorboard_service.get_tensorboard_run.jsinclude:samples/generated/v1/tensorboard_service.update_tensorboard_run.jsinclude:samples/generated/v1/tensorboard_service.batch_create_tensorboard_time_series.jsinclude:samples/generated/v1/tensorboard_service.create_tensorboard_time_series.jsinclude:samples/generated/v1/tensorboard_service.get_tensorboard_time_series.jsinclude:samples/generated/v1/tensorboard_service.update_tensorboard_time_series.jsinclude:samples/generated/v1/tensorboard_service.batch_read_tensorboard_time_series_data.jsinclude:samples/generated/v1/tensorboard_service.read_tensorboard_time_series_data.jsinclude:samples/generated/v1/tensorboard_service.write_tensorboard_experiment_data.jsinclude:samples/generated/v1/tensorboard_service.write_tensorboard_run_data.jsinclude:samples/generated/v1/tensorboard_service.read_tensorboard_blob_data.jsinclude:samples/generated/v1/tensorboard_service.create_tensorboard.jsinclude:samples/generated/v1/tensorboard_service.create_tensorboard.jsinclude:samples/generated/v1/tensorboard_service.update_tensorboard.jsinclude:samples/generated/v1/tensorboard_service.update_tensorboard.jsinclude:samples/generated/v1/tensorboard_service.delete_tensorboard.jsinclude:samples/generated/v1/tensorboard_service.delete_tensorboard.jsinclude:samples/generated/v1/tensorboard_service.delete_tensorboard_experiment.jsinclude:samples/generated/v1/tensorboard_service.delete_tensorboard_experiment.jsinclude:samples/generated/v1/tensorboard_service.delete_tensorboard_run.jsinclude:samples/generated/v1/tensorboard_service.delete_tensorboard_run.jsinclude:samples/generated/v1/tensorboard_service.delete_tensorboard_time_series.jsinclude:samples/generated/v1/tensorboard_service.delete_tensorboard_time_series.jsinclude:samples/generated/v1/tensorboard_service.list_tensorboards.jsinclude:samples/generated/v1/tensorboard_service.list_tensorboard_experiments.jsinclude:samples/generated/v1/tensorboard_service.list_tensorboard_runs.jsinclude:samples/generated/v1/tensorboard_service.list_tensorboard_time_series.jsinclude:samples/generated/v1/tensorboard_service.export_tensorboard_time_series_data.jsinclude:samples/generated/v1/vizier_service.create_study.jsinclude:samples/generated/v1/vizier_service.get_study.jsinclude:samples/generated/v1/vizier_service.delete_study.jsinclude:samples/generated/v1/vizier_service.lookup_study.jsinclude:samples/generated/v1/vizier_service.create_trial.jsinclude:samples/generated/v1/vizier_service.get_trial.jsinclude:samples/generated/v1/vizier_service.add_trial_measurement.jsinclude:samples/generated/v1/vizier_service.complete_trial.jsinclude:samples/generated/v1/vizier_service.delete_trial.jsinclude:samples/generated/v1/vizier_service.stop_trial.jsinclude:samples/generated/v1/vizier_service.list_optimal_trials.jsinclude:samples/generated/v1/vizier_service.suggest_trials.jsinclude:samples/generated/v1/vizier_service.suggest_trials.jsinclude:samples/generated/v1/vizier_service.check_trial_early_stopping_state.jsinclude:samples/generated/v1/vizier_service.check_trial_early_stopping_state.jsinclude:samples/generated/v1/vizier_service.list_studies.jsinclude:samples/generated/v1/vizier_service.list_trials.js
- // - // If not specified, then results are exported to the following auto-created - // BigQuery table: - // :export_evaluated_examples__.evaluated_examples - string destination_bigquery_uri = 1; - - // If true and an export destination is specified, then the contents of the - // destination are overwritten. Otherwise, if the export destination already - // exists, then the export operation fails. - bool override_existing_table = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto deleted file mode 100644 index 49be7b79..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto +++ /dev/null @@ -1,62 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "SpecialistPoolProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// SpecialistPool represents customers' own workforce to work on their data -// labeling jobs. It includes a group of specialist managers and workers. -// Managers are responsible for managing the workers in this pool as well as -// customers' data labeling jobs associated with this pool. Customers create -// specialist pool as well as start data labeling jobs on Cloud, managers and -// workers handle the jobs using CrowdCompute console. -message SpecialistPool { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/SpecialistPool" - pattern: "projects/{project}/locations/{location}/specialistPools/{specialist_pool}" - }; - - // Required. The resource name of the SpecialistPool. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The user-defined name of the SpecialistPool. - // The name can be up to 128 characters long and can be consist of any UTF-8 - // characters. - // This field should be unique on project-level. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The number of managers in this SpecialistPool. - int32 specialist_managers_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The email addresses of the managers in the SpecialistPool. - repeated string specialist_manager_emails = 4; - - // Output only. The resource name of the pending data labeling jobs. - repeated string pending_data_labeling_jobs = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The email addresses of workers in the SpecialistPool. - repeated string specialist_worker_emails = 7; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto deleted file mode 100644 index a110b9cb..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto +++ /dev/null @@ -1,210 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/operation.proto"; -import "google/cloud/aiplatform/v1beta1/specialist_pool.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "SpecialistPoolServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A service for creating and managing Customer SpecialistPools. -// When customers start Data Labeling jobs, they can reuse/create Specialist -// Pools to bring their own Specialists to label the data. -// Customers can add/remove Managers for the Specialist Pool on Cloud console, -// then Managers will get email notifications to manage Specialists and tasks on -// CrowdCompute console. -service SpecialistPoolService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a SpecialistPool. - rpc CreateSpecialistPool(CreateSpecialistPoolRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/specialistPools" - body: "specialist_pool" - }; - option (google.api.method_signature) = "parent,specialist_pool"; - option (google.longrunning.operation_info) = { - response_type: "SpecialistPool" - metadata_type: "CreateSpecialistPoolOperationMetadata" - }; - } - - // Gets a SpecialistPool. - rpc GetSpecialistPool(GetSpecialistPoolRequest) returns (SpecialistPool) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/specialistPools/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists SpecialistPools in a Location. - rpc ListSpecialistPools(ListSpecialistPoolsRequest) returns (ListSpecialistPoolsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/specialistPools" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a SpecialistPool as well as all Specialists in the pool. - rpc DeleteSpecialistPool(DeleteSpecialistPoolRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/specialistPools/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Updates a SpecialistPool. - rpc UpdateSpecialistPool(UpdateSpecialistPoolRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1beta1/{specialist_pool.name=projects/*/locations/*/specialistPools/*}" - body: "specialist_pool" - }; - option (google.api.method_signature) = "specialist_pool,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "SpecialistPool" - metadata_type: "UpdateSpecialistPoolOperationMetadata" - }; - } -} - -// Request message for [SpecialistPoolService.CreateSpecialistPool][google.cloud.aiplatform.v1beta1.SpecialistPoolService.CreateSpecialistPool]. -message CreateSpecialistPoolRequest { - // Required. The parent Project name for the new SpecialistPool. - // The form is `projects/{project}/locations/{location}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The SpecialistPool to create. - SpecialistPool specialist_pool = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Runtime operation information for -// [SpecialistPoolService.CreateSpecialistPool][google.cloud.aiplatform.v1beta1.SpecialistPoolService.CreateSpecialistPool]. -message CreateSpecialistPoolOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for [SpecialistPoolService.GetSpecialistPool][google.cloud.aiplatform.v1beta1.SpecialistPoolService.GetSpecialistPool]. -message GetSpecialistPoolRequest { - // Required. The name of the SpecialistPool resource. - // The form is - // `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/SpecialistPool" - } - ]; -} - -// Request message for [SpecialistPoolService.ListSpecialistPools][google.cloud.aiplatform.v1beta1.SpecialistPoolService.ListSpecialistPools]. -message ListSpecialistPoolsRequest { - // Required. The name of the SpecialistPool's parent resource. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The standard list page size. - int32 page_size = 2; - - // The standard list page token. - // Typically obtained by [ListSpecialistPoolsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListSpecialistPoolsResponse.next_page_token] of - // the previous [SpecialistPoolService.ListSpecialistPools][google.cloud.aiplatform.v1beta1.SpecialistPoolService.ListSpecialistPools] call. Return - // first page if empty. - string page_token = 3; - - // Mask specifying which fields to read. FieldMask represents a set of - google.protobuf.FieldMask read_mask = 4; -} - -// Response message for [SpecialistPoolService.ListSpecialistPools][google.cloud.aiplatform.v1beta1.SpecialistPoolService.ListSpecialistPools]. -message ListSpecialistPoolsResponse { - // A list of SpecialistPools that matches the specified filter in the request. - repeated SpecialistPool specialist_pools = 1; - - // The standard List next-page token. - string next_page_token = 2; -} - -// Request message for [SpecialistPoolService.DeleteSpecialistPool][google.cloud.aiplatform.v1beta1.SpecialistPoolService.DeleteSpecialistPool]. -message DeleteSpecialistPoolRequest { - // Required. The resource name of the SpecialistPool to delete. Format: - // `projects/{project}/locations/{location}/specialistPools/{specialist_pool}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/SpecialistPool" - } - ]; - - // If set to true, any specialist managers in this SpecialistPool will also be - // deleted. (Otherwise, the request will only work if the SpecialistPool has - // no specialist managers.) - bool force = 2; -} - -// Request message for [SpecialistPoolService.UpdateSpecialistPool][google.cloud.aiplatform.v1beta1.SpecialistPoolService.UpdateSpecialistPool]. -message UpdateSpecialistPoolRequest { - // Required. The SpecialistPool which replaces the resource on the server. - SpecialistPool specialist_pool = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The update mask applies to the resource. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Runtime operation metadata for -// [SpecialistPoolService.UpdateSpecialistPool][google.cloud.aiplatform.v1beta1.SpecialistPoolService.UpdateSpecialistPool]. -message UpdateSpecialistPoolOperationMetadata { - // Output only. The name of the SpecialistPool to which the specialists are being added. - // Format: - // `projects/{project_id}/locations/{location_id}/specialistPools/{specialist_pool}` - string specialist_pool = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/SpecialistPool" - } - ]; - - // The operation generic information. - GenericOperationMetadata generic_metadata = 2; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/study.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/study.proto deleted file mode 100644 index d0642d18..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/study.proto +++ /dev/null @@ -1,602 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "StudyProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A message representing a Study. -message Study { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Study" - pattern: "projects/{project}/locations/{location}/studies/{study}" - }; - - // Describes the Study state. - enum State { - // The study state is unspecified. - STATE_UNSPECIFIED = 0; - - // The study is active. - ACTIVE = 1; - - // The study is stopped due to an internal error. - INACTIVE = 2; - - // The study is done when the service exhausts the parameter search space - // or max_trial_count is reached. - COMPLETED = 3; - } - - // Output only. The name of a study. The study's globally unique identifier. - // Format: `projects/{project}/locations/{location}/studies/{study}` - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Describes the Study, default value is empty string. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Configuration of the Study. - StudySpec study_spec = 3 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The detailed state of a Study. - State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time at which the study was created. - google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A human readable reason why the Study is inactive. - // This should be empty if a study is ACTIVE or COMPLETED. - string inactive_reason = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A message representing a Trial. A Trial contains a unique set of Parameters -// that has been or will be evaluated, along with the objective metrics got by -// running the Trial. -message Trial { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Trial" - pattern: "projects/{project}/locations/{location}/studies/{study}/trials/{trial}" - }; - - // A message representing a parameter to be tuned. - message Parameter { - // Output only. The ID of the parameter. The parameter should be defined in - // [StudySpec's Parameters][google.cloud.aiplatform.v1beta1.StudySpec.parameters]. - string parameter_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The value of the parameter. - // `number_value` will be set if a parameter defined in StudySpec is - // in type 'INTEGER', 'DOUBLE' or 'DISCRETE'. - // `string_value` will be set if a parameter defined in StudySpec is - // in type 'CATEGORICAL'. - google.protobuf.Value value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Describes a Trial state. - enum State { - // The Trial state is unspecified. - STATE_UNSPECIFIED = 0; - - // Indicates that a specific Trial has been requested, but it has not yet - // been suggested by the service. - REQUESTED = 1; - - // Indicates that the Trial has been suggested. - ACTIVE = 2; - - // Indicates that the Trial should stop according to the service. - STOPPING = 3; - - // Indicates that the Trial is completed successfully. - SUCCEEDED = 4; - - // Indicates that the Trial should not be attempted again. - // The service will set a Trial to INFEASIBLE when it's done but missing - // the final_measurement. - INFEASIBLE = 5; - } - - // Output only. Resource name of the Trial assigned by the service. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The identifier of the Trial assigned by the service. - string id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The detailed state of the Trial. - State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The parameters of the Trial. - repeated Parameter parameters = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The final measurement containing the objective value. - Measurement final_measurement = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A list of measurements that are strictly lexicographically - // ordered by their induced tuples (steps, elapsed_duration). - // These are used for early stopping computations. - repeated Measurement measurements = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the Trial was started. - google.protobuf.Timestamp start_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the Trial's status changed to `SUCCEEDED` or `INFEASIBLE`. - google.protobuf.Timestamp end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The identifier of the client that originally requested this Trial. - // Each client is identified by a unique client_id. When a client - // asks for a suggestion, Vertex AI Vizier will assign it a Trial. The client - // should evaluate the Trial, complete it, and report back to Vertex AI - // Vizier. If suggestion is asked again by same client_id before the Trial is - // completed, the same Trial will be returned. Multiple clients with - // different client_ids can ask for suggestions simultaneously, each of them - // will get their own Trial. - string client_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A human readable string describing why the Trial is - // infeasible. This is set only if Trial state is `INFEASIBLE`. - string infeasible_reason = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The CustomJob name linked to the Trial. - // It's set for a HyperparameterTuningJob's Trial. - string custom_job = 11 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/CustomJob" - } - ]; - - // Output only. URIs for accessing [interactive - // shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) - // (one URI for each training node). Only available if this trial is part of - // a [HyperparameterTuningJob][google.cloud.aiplatform.v1beta1.HyperparameterTuningJob] and the job's - // [trial_job_spec.enable_web_access][google.cloud.aiplatform.v1beta1.CustomJobSpec.enable_web_access] field - // is `true`. - // - // The keys are names of each node used for the trial; for example, - // `workerpool0-0` for the primary node, `workerpool1-0` for the first node in - // the second worker pool, and `workerpool1-1` for the second node in the - // second worker pool. - // - // The values are the URIs for each node's interactive shell. - map web_access_uris = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Represents specification of a Study. -message StudySpec { - // Represents a metric to optimize. - message MetricSpec { - // The available types of optimization goals. - enum GoalType { - // Goal Type will default to maximize. - GOAL_TYPE_UNSPECIFIED = 0; - - // Maximize the goal metric. - MAXIMIZE = 1; - - // Minimize the goal metric. - MINIMIZE = 2; - } - - // Required. The ID of the metric. Must not contain whitespaces and must be unique - // amongst all MetricSpecs. - string metric_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The optimization goal of the metric. - GoalType goal = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Represents a single parameter to optimize. - message ParameterSpec { - // Value specification for a parameter in `DOUBLE` type. - message DoubleValueSpec { - // Required. Inclusive minimum value of the parameter. - double min_value = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Inclusive maximum value of the parameter. - double max_value = 2 [(google.api.field_behavior) = REQUIRED]; - - // A default value for a `DOUBLE` parameter that is assumed to be a - // relatively good starting point. Unset value signals that there is no - // offered starting point. - // - // Currently only supported by the Vertex AI Vizier service. Not supported - // by HyperparamterTuningJob or TrainingPipeline. - optional double default_value = 4; - } - - // Value specification for a parameter in `INTEGER` type. - message IntegerValueSpec { - // Required. Inclusive minimum value of the parameter. - int64 min_value = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Inclusive maximum value of the parameter. - int64 max_value = 2 [(google.api.field_behavior) = REQUIRED]; - - // A default value for an `INTEGER` parameter that is assumed to be a - // relatively good starting point. Unset value signals that there is no - // offered starting point. - // - // Currently only supported by the Vertex AI Vizier service. Not supported - // by HyperparamterTuningJob or TrainingPipeline. - optional int64 default_value = 4; - } - - // Value specification for a parameter in `CATEGORICAL` type. - message CategoricalValueSpec { - // Required. The list of possible categories. - repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; - - // A default value for a `CATEGORICAL` parameter that is assumed to be a - // relatively good starting point. Unset value signals that there is no - // offered starting point. - // - // Currently only supported by the Vizier service. Not supported by - // HyperparamterTuningJob or TrainingPipeline. - optional string default_value = 3; - } - - // Value specification for a parameter in `DISCRETE` type. - message DiscreteValueSpec { - // Required. A list of possible values. - // The list should be in increasing order and at least 1e-10 apart. - // For instance, this parameter might have possible settings of 1.5, 2.5, - // and 4.0. This list should not contain more than 1,000 values. - repeated double values = 1 [(google.api.field_behavior) = REQUIRED]; - - // A default value for a `DISCRETE` parameter that is assumed to be a - // relatively good starting point. Unset value signals that there is no - // offered starting point. It automatically rounds to the - // nearest feasible discrete point. - // - // Currently only supported by the Vizier service. Not supported by - // HyperparamterTuningJob or TrainingPipeline. - optional double default_value = 3; - } - - // Represents a parameter spec with condition from its parent parameter. - message ConditionalParameterSpec { - // Represents the spec to match discrete values from parent parameter. - message DiscreteValueCondition { - // Required. Matches values of the parent parameter of 'DISCRETE' type. - // All values must exist in `discrete_value_spec` of parent parameter. - // - // The Epsilon of the value matching is 1e-10. - repeated double values = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Represents the spec to match integer values from parent parameter. - message IntValueCondition { - // Required. Matches values of the parent parameter of 'INTEGER' type. - // All values must lie in `integer_value_spec` of parent parameter. - repeated int64 values = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Represents the spec to match categorical values from parent parameter. - message CategoricalValueCondition { - // Required. Matches values of the parent parameter of 'CATEGORICAL' type. - // All values must exist in `categorical_value_spec` of parent - // parameter. - repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // A set of parameter values from the parent ParameterSpec's feasible - // space. - oneof parent_value_condition { - // The spec for matching values from a parent parameter of - // `DISCRETE` type. - DiscreteValueCondition parent_discrete_values = 2; - - // The spec for matching values from a parent parameter of `INTEGER` - // type. - IntValueCondition parent_int_values = 3; - - // The spec for matching values from a parent parameter of - // `CATEGORICAL` type. - CategoricalValueCondition parent_categorical_values = 4; - } - - // Required. The spec for a conditional parameter. - ParameterSpec parameter_spec = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // The type of scaling that should be applied to this parameter. - enum ScaleType { - // By default, no scaling is applied. - SCALE_TYPE_UNSPECIFIED = 0; - - // Scales the feasible space to (0, 1) linearly. - UNIT_LINEAR_SCALE = 1; - - // Scales the feasible space logarithmically to (0, 1). The entire - // feasible space must be strictly positive. - UNIT_LOG_SCALE = 2; - - // Scales the feasible space "reverse" logarithmically to (0, 1). The - // result is that values close to the top of the feasible space are spread - // out more than points near the bottom. The entire feasible space must be - // strictly positive. - UNIT_REVERSE_LOG_SCALE = 3; - } - - oneof parameter_value_spec { - // The value spec for a 'DOUBLE' parameter. - DoubleValueSpec double_value_spec = 2; - - // The value spec for an 'INTEGER' parameter. - IntegerValueSpec integer_value_spec = 3; - - // The value spec for a 'CATEGORICAL' parameter. - CategoricalValueSpec categorical_value_spec = 4; - - // The value spec for a 'DISCRETE' parameter. - DiscreteValueSpec discrete_value_spec = 5; - } - - // Required. The ID of the parameter. Must not contain whitespaces and must be unique - // amongst all ParameterSpecs. - string parameter_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // How the parameter should be scaled. - // Leave unset for `CATEGORICAL` parameters. - ScaleType scale_type = 6; - - // A conditional parameter node is active if the parameter's value matches - // the conditional node's parent_value_condition. - // - // If two items in conditional_parameter_specs have the same name, they - // must have disjoint parent_value_condition. - repeated ConditionalParameterSpec conditional_parameter_specs = 10; - } - - // The decay curve automated stopping rule builds a Gaussian Process - // Regressor to predict the final objective value of a Trial based on the - // already completed Trials and the intermediate measurements of the current - // Trial. Early stopping is requested for the current Trial if there is very - // low probability to exceed the optimal value found so far. - message DecayCurveAutomatedStoppingSpec { - // True if [Measurement.elapsed_duration][google.cloud.aiplatform.v1beta1.Measurement.elapsed_duration] is used as the x-axis of each - // Trials Decay Curve. Otherwise, [Measurement.step_count][google.cloud.aiplatform.v1beta1.Measurement.step_count] will be used - // as the x-axis. - bool use_elapsed_duration = 1; - } - - // The median automated stopping rule stops a pending Trial if the Trial's - // best objective_value is strictly below the median 'performance' of all - // completed Trials reported up to the Trial's last measurement. - // Currently, 'performance' refers to the running average of the objective - // values reported by the Trial in each measurement. - message MedianAutomatedStoppingSpec { - // True if median automated stopping rule applies on - // [Measurement.elapsed_duration][google.cloud.aiplatform.v1beta1.Measurement.elapsed_duration]. It means that elapsed_duration - // field of latest measurement of current Trial is used to compute median - // objective value for each completed Trials. - bool use_elapsed_duration = 1; - } - - // Configuration for ConvexAutomatedStoppingSpec. - // When there are enough completed trials (configured by - // min_measurement_count), for pending trials with enough measurements and - // steps, the policy first computes an overestimate of the objective value at - // max_num_steps according to the slope of the incomplete objective value - // curve. No prediction can be made if the curve is completely flat. If the - // overestimation is worse than the best objective value of the completed - // trials, this pending trial will be early-stopped, but a last measurement - // will be added to the pending trial with max_num_steps and predicted - // objective value from the autoregression model. - message ConvexAutomatedStoppingSpec { - // Steps used in predicting the final objective for early stopped trials. In - // general, it's set to be the same as the defined steps in training / - // tuning. If not defined, it will learn it from the completed trials. When - // use_steps is false, this field is set to the maximum elapsed seconds. - int64 max_step_count = 1; - - // Minimum number of steps for a trial to complete. Trials which do not have - // a measurement with step_count > min_step_count won't be considered for - // early stopping. It's ok to set it to 0, and a trial can be early stopped - // at any stage. By default, min_step_count is set to be one-tenth of the - // max_step_count. - // When use_elapsed_duration is true, this field is set to the minimum - // elapsed seconds. - int64 min_step_count = 2; - - // The minimal number of measurements in a Trial. Early-stopping checks - // will not trigger if less than min_measurement_count+1 completed trials or - // pending trials with less than min_measurement_count measurements. If not - // defined, the default value is 5. - int64 min_measurement_count = 3; - - // The hyper-parameter name used in the tuning job that stands for learning - // rate. Leave it blank if learning rate is not in a parameter in tuning. - // The learning_rate is used to estimate the objective value of the ongoing - // trial. - string learning_rate_parameter_name = 4; - - // This bool determines whether or not the rule is applied based on - // elapsed_secs or steps. If use_elapsed_duration==false, the early stopping - // decision is made according to the predicted objective values according to - // the target steps. If use_elapsed_duration==true, elapsed_secs is used - // instead of steps. Also, in this case, the parameters max_num_steps and - // min_num_steps are overloaded to contain max_elapsed_seconds and - // min_elapsed_seconds. - bool use_elapsed_duration = 5; - } - - // Configuration for ConvexStopPolicy. - message ConvexStopConfig { - option deprecated = true; - - // Steps used in predicting the final objective for early stopped trials. In - // general, it's set to be the same as the defined steps in training / - // tuning. When use_steps is false, this field is set to the maximum elapsed - // seconds. - int64 max_num_steps = 1; - - // Minimum number of steps for a trial to complete. Trials which do not have - // a measurement with num_steps > min_num_steps won't be considered for - // early stopping. It's ok to set it to 0, and a trial can be early stopped - // at any stage. By default, min_num_steps is set to be one-tenth of the - // max_num_steps. - // When use_steps is false, this field is set to the minimum elapsed - // seconds. - int64 min_num_steps = 2; - - // The number of Trial measurements used in autoregressive model for - // value prediction. A trial won't be considered early stopping if has fewer - // measurement points. - int64 autoregressive_order = 3; - - // The hyper-parameter name used in the tuning job that stands for learning - // rate. Leave it blank if learning rate is not in a parameter in tuning. - // The learning_rate is used to estimate the objective value of the ongoing - // trial. - string learning_rate_parameter_name = 4; - - // This bool determines whether or not the rule is applied based on - // elapsed_secs or steps. If use_seconds==false, the early stopping decision - // is made according to the predicted objective values according to the - // target steps. If use_seconds==true, elapsed_secs is used instead of - // steps. Also, in this case, the parameters max_num_steps and min_num_steps - // are overloaded to contain max_elapsed_seconds and min_elapsed_seconds. - bool use_seconds = 5; - } - - // The available search algorithms for the Study. - enum Algorithm { - // The default algorithm used by Vertex AI for [hyperparameter - // tuning](https://cloud.google.com/vertex-ai/docs/training/hyperparameter-tuning-overview) - // and [Vertex AI Vizier](https://cloud.google.com/vertex-ai/docs/vizier). - ALGORITHM_UNSPECIFIED = 0; - - // Simple grid search within the feasible space. To use grid search, - // all parameters must be `INTEGER`, `CATEGORICAL`, or `DISCRETE`. - GRID_SEARCH = 2; - - // Simple random search within the feasible space. - RANDOM_SEARCH = 3; - } - - // Describes the noise level of the repeated observations. - // - // "Noisy" means that the repeated observations with the same Trial parameters - // may lead to different metric evaluations. - enum ObservationNoise { - // The default noise level chosen by Vertex AI. - OBSERVATION_NOISE_UNSPECIFIED = 0; - - // Vertex AI assumes that the objective function is (nearly) - // perfectly reproducible, and will never repeat the same Trial - // parameters. - LOW = 1; - - // Vertex AI will estimate the amount of noise in metric - // evaluations, it may repeat the same Trial parameters more than once. - HIGH = 2; - } - - // This indicates which measurement to use if/when the service automatically - // selects the final measurement from previously reported intermediate - // measurements. Choose this based on two considerations: - // A) Do you expect your measurements to monotonically improve? - // If so, choose LAST_MEASUREMENT. On the other hand, if you're in a - // situation where your system can "over-train" and you expect the - // performance to get better for a while but then start declining, - // choose BEST_MEASUREMENT. - // B) Are your measurements significantly noisy and/or irreproducible? - // If so, BEST_MEASUREMENT will tend to be over-optimistic, and it - // may be better to choose LAST_MEASUREMENT. - // If both or neither of (A) and (B) apply, it doesn't matter which - // selection type is chosen. - enum MeasurementSelectionType { - // Will be treated as LAST_MEASUREMENT. - MEASUREMENT_SELECTION_TYPE_UNSPECIFIED = 0; - - // Use the last measurement reported. - LAST_MEASUREMENT = 1; - - // Use the best measurement reported. - BEST_MEASUREMENT = 2; - } - - oneof automated_stopping_spec { - // The automated early stopping spec using decay curve rule. - DecayCurveAutomatedStoppingSpec decay_curve_stopping_spec = 4; - - // The automated early stopping spec using median rule. - MedianAutomatedStoppingSpec median_automated_stopping_spec = 5; - - // Deprecated. - // The automated early stopping using convex stopping rule. - ConvexStopConfig convex_stop_config = 8 [deprecated = true]; - - // The automated early stopping spec using convex stopping rule. - ConvexAutomatedStoppingSpec convex_automated_stopping_spec = 9; - } - - // Required. Metric specs for the Study. - repeated MetricSpec metrics = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The set of parameters to tune. - repeated ParameterSpec parameters = 2 [(google.api.field_behavior) = REQUIRED]; - - // The search algorithm specified for the Study. - Algorithm algorithm = 3; - - // The observation noise level of the study. - // Currently only supported by the Vertex AI Vizier service. Not supported by - // HyperparamterTuningJob or TrainingPipeline. - ObservationNoise observation_noise = 6; - - // Describe which measurement selection type will be used - MeasurementSelectionType measurement_selection_type = 7; -} - -// A message representing a Measurement of a Trial. A Measurement contains -// the Metrics got by executing a Trial using suggested hyperparameter -// values. -message Measurement { - // A message representing a metric in the measurement. - message Metric { - // Output only. The ID of the Metric. The Metric should be defined in - // [StudySpec's Metrics][google.cloud.aiplatform.v1beta1.StudySpec.metrics]. - string metric_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The value for this metric. - double value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. Time that the Trial has been running at the point of this Measurement. - google.protobuf.Duration elapsed_duration = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of steps the machine learning model has been trained for. - // Must be non-negative. - int64 step_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A list of metrics got by evaluating the objective functions using suggested - // Parameter values. - repeated Metric metrics = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto deleted file mode 100644 index 640e636e..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard.proto +++ /dev/null @@ -1,86 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "TensorboardProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Tensorboard is a physical database that stores users' training metrics. -// A default Tensorboard is provided in each region of a GCP project. -// If needed users can also create extra Tensorboards in their projects. -message Tensorboard { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/Tensorboard" - pattern: "projects/{project}/locations/{location}/tensorboards/{tensorboard}" - }; - - // Output only. Name of the Tensorboard. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. User provided name of this Tensorboard. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Description of this Tensorboard. - string description = 3; - - // Customer-managed encryption key spec for a Tensorboard. If set, this - // Tensorboard and all sub-resources of this Tensorboard will be secured by - // this key. - EncryptionSpec encryption_spec = 11; - - // Output only. Consumer project Cloud Storage path prefix used to store blob data, which - // can either be a bucket or directory. Does not end with a '/'. - string blob_storage_path_prefix = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of Runs stored in this Tensorboard. - int32 run_count = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Tensorboard was created. - google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this Tensorboard was last updated. - google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize your Tensorboards. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one Tensorboard - // (System labels are excluded). - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. - map labels = 8; - - // Used to perform a consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 9; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto deleted file mode 100644 index cfc36e30..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto +++ /dev/null @@ -1,101 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "TensorboardDataProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// All the data stored in a TensorboardTimeSeries. -message TimeSeriesData { - // Required. The ID of the TensorboardTimeSeries, which will become the final component - // of the TensorboardTimeSeries' resource name - string tensorboard_time_series_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Immutable. The value type of this time series. All the values in this time series data - // must match this value type. - TensorboardTimeSeries.ValueType value_type = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Required. Data points in this time series. - repeated TimeSeriesDataPoint values = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// A TensorboardTimeSeries data point. -message TimeSeriesDataPoint { - // Value of this time series data point. - oneof value { - // A scalar value. - Scalar scalar = 3; - - // A tensor value. - TensorboardTensor tensor = 4; - - // A blob sequence value. - TensorboardBlobSequence blobs = 5; - } - - // Wall clock timestamp when this data point is generated by the end user. - google.protobuf.Timestamp wall_time = 1; - - // Step index of this data point within the run. - int64 step = 2; -} - -// One point viewable on a scalar metric plot. -message Scalar { - // Value of the point at this step / timestamp. - double value = 1; -} - -// One point viewable on a tensor metric plot. -message TensorboardTensor { - // Required. Serialized form of - // https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/tensor.proto - bytes value = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Version number of TensorProto used to serialize [value][google.cloud.aiplatform.v1beta1.TensorboardTensor.value]. - int32 version_number = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// One point viewable on a blob metric plot, but mostly just a wrapper message -// to work around repeated fields can't be used directly within `oneof` fields. -message TensorboardBlobSequence { - // List of blobs contained within the sequence. - repeated TensorboardBlob values = 1; -} - -// One blob (e.g, image, graph) viewable on a blob metric plot. -message TensorboardBlob { - // Output only. A URI safe key uniquely identifying a blob. Can be used to locate the blob - // stored in the Cloud Storage bucket of the consumer project. - string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The bytes of the blob is not present unless it's returned by the - // ReadTensorboardBlobData endpoint. - bytes data = 2 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto deleted file mode 100644 index 0258ef6d..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto +++ /dev/null @@ -1,78 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "TensorboardExperimentProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A TensorboardExperiment is a group of TensorboardRuns, that are typically the -// results of a training job run, in a Tensorboard. -message TensorboardExperiment { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/TensorboardExperiment" - pattern: "projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}" - }; - - // Output only. Name of the TensorboardExperiment. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User provided name of this TensorboardExperiment. - string display_name = 2; - - // Description of this TensorboardExperiment. - string description = 3; - - // Output only. Timestamp when this TensorboardExperiment was created. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this TensorboardExperiment was last updated. - google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize your Datasets. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one Dataset (System - // labels are excluded). - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. Following system labels exist for each Dataset: - // * "aiplatform.googleapis.com/dataset_metadata_schema": - // - output only, its value is the - // [metadata_schema's][metadata_schema_uri] title. - map labels = 6; - - // Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 7; - - // Immutable. Source of the TensorboardExperiment. Example: a custom training job. - string source = 8 [(google.api.field_behavior) = IMMUTABLE]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto deleted file mode 100644 index b5f570c8..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto +++ /dev/null @@ -1,81 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "TensorboardRunProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// TensorboardRun maps to a specific execution of a training job with a given -// set of hyperparameter values, model definition, dataset, etc -message TensorboardRun { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/TensorboardRun" - pattern: "projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}" - }; - - // Output only. Name of the TensorboardRun. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. User provided name of this TensorboardRun. - // This value must be unique among all TensorboardRuns - // belonging to the same parent TensorboardExperiment. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Description of this TensorboardRun. - string description = 3; - - // Output only. Timestamp when this TensorboardRun was created. - google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this TensorboardRun was last updated. - google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize your TensorboardRuns. - // - // This field will be used to filter and visualize Runs in the Tensorboard UI. - // For example, a Vertex AI training job can set a label - // aiplatform.googleapis.com/training_job_id=xxxxx to all the runs created - // within that job. An end user can set a label experiment_id=xxxxx for all - // the runs produced in a Jupyter notebook. These runs can be grouped by a - // label value and visualized together in the Tensorboard UI. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one TensorboardRun - // (System labels are excluded). - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with "aiplatform.googleapis.com/" - // and are immutable. - map labels = 8; - - // Used to perform a consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 9; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto deleted file mode 100644 index 629e5d79..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto +++ /dev/null @@ -1,1004 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/operation.proto"; -import "google/cloud/aiplatform/v1beta1/tensorboard.proto"; -import "google/cloud/aiplatform/v1beta1/tensorboard_data.proto"; -import "google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto"; -import "google/cloud/aiplatform/v1beta1/tensorboard_run.proto"; -import "google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "TensorboardServiceProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// TensorboardService -service TensorboardService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a Tensorboard. - rpc CreateTensorboard(CreateTensorboardRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/tensorboards" - body: "tensorboard" - }; - option (google.api.method_signature) = "parent,tensorboard"; - option (google.longrunning.operation_info) = { - response_type: "Tensorboard" - metadata_type: "CreateTensorboardOperationMetadata" - }; - } - - // Gets a Tensorboard. - rpc GetTensorboard(GetTensorboardRequest) returns (Tensorboard) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/tensorboards/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a Tensorboard. - rpc UpdateTensorboard(UpdateTensorboardRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1beta1/{tensorboard.name=projects/*/locations/*/tensorboards/*}" - body: "tensorboard" - }; - option (google.api.method_signature) = "tensorboard,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Tensorboard" - metadata_type: "UpdateTensorboardOperationMetadata" - }; - } - - // Lists Tensorboards in a Location. - rpc ListTensorboards(ListTensorboardsRequest) returns (ListTensorboardsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/tensorboards" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a Tensorboard. - rpc DeleteTensorboard(DeleteTensorboardRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/tensorboards/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Creates a TensorboardExperiment. - rpc CreateTensorboardExperiment(CreateTensorboardExperimentRequest) returns (TensorboardExperiment) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/tensorboards/*}/experiments" - body: "tensorboard_experiment" - }; - option (google.api.method_signature) = "parent,tensorboard_experiment,tensorboard_experiment_id"; - } - - // Gets a TensorboardExperiment. - rpc GetTensorboardExperiment(GetTensorboardExperimentRequest) returns (TensorboardExperiment) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a TensorboardExperiment. - rpc UpdateTensorboardExperiment(UpdateTensorboardExperimentRequest) returns (TensorboardExperiment) { - option (google.api.http) = { - patch: "/v1beta1/{tensorboard_experiment.name=projects/*/locations/*/tensorboards/*/experiments/*}" - body: "tensorboard_experiment" - }; - option (google.api.method_signature) = "tensorboard_experiment,update_mask"; - } - - // Lists TensorboardExperiments in a Location. - rpc ListTensorboardExperiments(ListTensorboardExperimentsRequest) returns (ListTensorboardExperimentsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/tensorboards/*}/experiments" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a TensorboardExperiment. - rpc DeleteTensorboardExperiment(DeleteTensorboardExperimentRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Creates a TensorboardRun. - rpc CreateTensorboardRun(CreateTensorboardRunRequest) returns (TensorboardRun) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs" - body: "tensorboard_run" - }; - option (google.api.method_signature) = "parent,tensorboard_run,tensorboard_run_id"; - } - - // Batch create TensorboardRuns. - rpc BatchCreateTensorboardRuns(BatchCreateTensorboardRunsRequest) returns (BatchCreateTensorboardRunsResponse) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs:batchCreate" - body: "*" - }; - option (google.api.method_signature) = "parent,requests"; - } - - // Gets a TensorboardRun. - rpc GetTensorboardRun(GetTensorboardRunRequest) returns (TensorboardRun) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a TensorboardRun. - rpc UpdateTensorboardRun(UpdateTensorboardRunRequest) returns (TensorboardRun) { - option (google.api.http) = { - patch: "/v1beta1/{tensorboard_run.name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}" - body: "tensorboard_run" - }; - option (google.api.method_signature) = "tensorboard_run,update_mask"; - } - - // Lists TensorboardRuns in a Location. - rpc ListTensorboardRuns(ListTensorboardRunsRequest) returns (ListTensorboardRunsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a TensorboardRun. - rpc DeleteTensorboardRun(DeleteTensorboardRunRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Batch create TensorboardTimeSeries that belong to a TensorboardExperiment. - rpc BatchCreateTensorboardTimeSeries(BatchCreateTensorboardTimeSeriesRequest) returns (BatchCreateTensorboardTimeSeriesResponse) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/tensorboards/*/experiments/*}/runs/*/timeSeries:batchCreate" - body: "*" - }; - option (google.api.method_signature) = "parent,requests"; - } - - // Creates a TensorboardTimeSeries. - rpc CreateTensorboardTimeSeries(CreateTensorboardTimeSeriesRequest) returns (TensorboardTimeSeries) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/timeSeries" - body: "tensorboard_time_series" - }; - option (google.api.method_signature) = "parent,tensorboard_time_series"; - } - - // Gets a TensorboardTimeSeries. - rpc GetTensorboardTimeSeries(GetTensorboardTimeSeriesRequest) returns (TensorboardTimeSeries) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a TensorboardTimeSeries. - rpc UpdateTensorboardTimeSeries(UpdateTensorboardTimeSeriesRequest) returns (TensorboardTimeSeries) { - option (google.api.http) = { - patch: "/v1beta1/{tensorboard_time_series.name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}" - body: "tensorboard_time_series" - }; - option (google.api.method_signature) = "tensorboard_time_series,update_mask"; - } - - // Lists TensorboardTimeSeries in a Location. - rpc ListTensorboardTimeSeries(ListTensorboardTimeSeriesRequest) returns (ListTensorboardTimeSeriesResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/timeSeries" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a TensorboardTimeSeries. - rpc DeleteTensorboardTimeSeries(DeleteTensorboardTimeSeriesRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // Reads multiple TensorboardTimeSeries' data. The data point number limit is - // 1000 for scalars, 100 for tensors and blob references. If the number of - // data points stored is less than the limit, all data will be returned. - // Otherwise, that limit number of data points will be randomly selected from - // this time series and returned. - rpc BatchReadTensorboardTimeSeriesData(BatchReadTensorboardTimeSeriesDataRequest) returns (BatchReadTensorboardTimeSeriesDataResponse) { - option (google.api.http) = { - get: "/v1beta1/{tensorboard=projects/*/locations/*/tensorboards/*}/experiments/*/runs/*/timeSeries:batchRead" - }; - option (google.api.method_signature) = "tensorboard"; - } - - // Reads a TensorboardTimeSeries' data. By default, if the number of data - // points stored is less than 1000, all data will be returned. Otherwise, 1000 - // data points will be randomly selected from this time series and returned. - // This value can be changed by changing max_data_points, which can't be - // greater than 10k. - rpc ReadTensorboardTimeSeriesData(ReadTensorboardTimeSeriesDataRequest) returns (ReadTensorboardTimeSeriesDataResponse) { - option (google.api.http) = { - get: "/v1beta1/{tensorboard_time_series=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}:read" - }; - option (google.api.method_signature) = "tensorboard_time_series"; - } - - // Gets bytes of TensorboardBlobs. - // This is to allow reading blob data stored in consumer project's Cloud - // Storage bucket without users having to obtain Cloud Storage access - // permission. - rpc ReadTensorboardBlobData(ReadTensorboardBlobDataRequest) returns (stream ReadTensorboardBlobDataResponse) { - option (google.api.http) = { - get: "/v1beta1/{time_series=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}:readBlobData" - }; - option (google.api.method_signature) = "time_series"; - } - - // Write time series data points of multiple TensorboardTimeSeries in multiple - // TensorboardRun's. If any data fail to be ingested, an error will be - // returned. - rpc WriteTensorboardExperimentData(WriteTensorboardExperimentDataRequest) returns (WriteTensorboardExperimentDataResponse) { - option (google.api.http) = { - post: "/v1beta1/{tensorboard_experiment=projects/*/locations/*/tensorboards/*/experiments/*}:write" - body: "*" - }; - option (google.api.method_signature) = "tensorboard_experiment,write_run_data_requests"; - } - - // Write time series data points into multiple TensorboardTimeSeries under - // a TensorboardRun. If any data fail to be ingested, an error will be - // returned. - rpc WriteTensorboardRunData(WriteTensorboardRunDataRequest) returns (WriteTensorboardRunDataResponse) { - option (google.api.http) = { - post: "/v1beta1/{tensorboard_run=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}:write" - body: "*" - }; - option (google.api.method_signature) = "tensorboard_run,time_series_data"; - } - - // Exports a TensorboardTimeSeries' data. Data is returned in paginated - // responses. - rpc ExportTensorboardTimeSeriesData(ExportTensorboardTimeSeriesDataRequest) returns (ExportTensorboardTimeSeriesDataResponse) { - option (google.api.http) = { - post: "/v1beta1/{tensorboard_time_series=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}:exportTensorboardTimeSeries" - body: "*" - }; - option (google.api.method_signature) = "tensorboard_time_series"; - } -} - -// Request message for [TensorboardService.CreateTensorboard][google.cloud.aiplatform.v1beta1.TensorboardService.CreateTensorboard]. -message CreateTensorboardRequest { - // Required. The resource name of the Location to create the Tensorboard in. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Tensorboard" - } - ]; - - // Required. The Tensorboard to create. - Tensorboard tensorboard = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [TensorboardService.GetTensorboard][google.cloud.aiplatform.v1beta1.TensorboardService.GetTensorboard]. -message GetTensorboardRequest { - // Required. The name of the Tensorboard resource. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Tensorboard" - } - ]; -} - -// Request message for [TensorboardService.ListTensorboards][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards]. -message ListTensorboardsRequest { - // Required. The resource name of the Location to list Tensorboards. - // Format: - // `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/Tensorboard" - } - ]; - - // Lists the Tensorboards that match the filter expression. - string filter = 2; - - // The maximum number of Tensorboards to return. The service may return - // fewer than this value. If unspecified, at most 100 Tensorboards will be - // returned. The maximum value is 100; values above 100 will be coerced to - // 100. - int32 page_size = 3; - - // A page token, received from a previous - // [TensorboardService.ListTensorboards][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards] call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [TensorboardService.ListTensorboards][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards] must - // match the call that provided the page token. - string page_token = 4; - - // Field to use to sort the list. - string order_by = 5; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 6; -} - -// Response message for [TensorboardService.ListTensorboards][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards]. -message ListTensorboardsResponse { - // The Tensorboards mathching the request. - repeated Tensorboard tensorboards = 1; - - // A token, which can be sent as [ListTensorboardsRequest.page_token][google.cloud.aiplatform.v1beta1.ListTensorboardsRequest.page_token] - // to retrieve the next page. If this field is omitted, there are no - // subsequent pages. - string next_page_token = 2; -} - -// Request message for [TensorboardService.UpdateTensorboard][google.cloud.aiplatform.v1beta1.TensorboardService.UpdateTensorboard]. -message UpdateTensorboardRequest { - // Required. Field mask is used to specify the fields to be overwritten in the - // Tensorboard resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then all fields will be overwritten if new - // values are specified. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Tensorboard's `name` field is used to identify the - // Tensorboard to be updated. Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - Tensorboard tensorboard = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [TensorboardService.DeleteTensorboard][google.cloud.aiplatform.v1beta1.TensorboardService.DeleteTensorboard]. -message DeleteTensorboardRequest { - // Required. The name of the Tensorboard to be deleted. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Tensorboard" - } - ]; -} - -// Request message for [TensorboardService.CreateTensorboardExperiment][google.cloud.aiplatform.v1beta1.TensorboardService.CreateTensorboardExperiment]. -message CreateTensorboardExperimentRequest { - // Required. The resource name of the Tensorboard to create the TensorboardExperiment - // in. Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardExperiment" - } - ]; - - // The TensorboardExperiment to create. - TensorboardExperiment tensorboard_experiment = 2; - - // Required. The ID to use for the Tensorboard experiment, which will become the final - // component of the Tensorboard experiment's resource name. - // - // This value should be 1-128 characters, and valid characters - // are /[a-z][0-9]-/. - string tensorboard_experiment_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [TensorboardService.GetTensorboardExperiment][google.cloud.aiplatform.v1beta1.TensorboardService.GetTensorboardExperiment]. -message GetTensorboardExperimentRequest { - // Required. The name of the TensorboardExperiment resource. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardExperiment" - } - ]; -} - -// Request message for [TensorboardService.ListTensorboardExperiments][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments]. -message ListTensorboardExperimentsRequest { - // Required. The resource name of the Tensorboard to list TensorboardExperiments. - // Format: - // 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/TensorboardExperiment" - } - ]; - - // Lists the TensorboardExperiments that match the filter expression. - string filter = 2; - - // The maximum number of TensorboardExperiments to return. The service may - // return fewer than this value. If unspecified, at most 50 - // TensorboardExperiments will be returned. The maximum value is 1000; values - // above 1000 will be coerced to 1000. - int32 page_size = 3; - - // A page token, received from a previous - // [TensorboardService.ListTensorboardExperiments][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments] call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [TensorboardService.ListTensorboardExperiments][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments] must - // match the call that provided the page token. - string page_token = 4; - - // Field to use to sort the list. - string order_by = 5; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 6; -} - -// Response message for [TensorboardService.ListTensorboardExperiments][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments]. -message ListTensorboardExperimentsResponse { - // The TensorboardExperiments mathching the request. - repeated TensorboardExperiment tensorboard_experiments = 1; - - // A token, which can be sent as - // [ListTensorboardExperimentsRequest.page_token][google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest.page_token] to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [TensorboardService.UpdateTensorboardExperiment][google.cloud.aiplatform.v1beta1.TensorboardService.UpdateTensorboardExperiment]. -message UpdateTensorboardExperimentRequest { - // Required. Field mask is used to specify the fields to be overwritten in the - // TensorboardExperiment resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then all fields will be overwritten if new - // values are specified. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The TensorboardExperiment's `name` field is used to identify the - // TensorboardExperiment to be updated. Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - TensorboardExperiment tensorboard_experiment = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [TensorboardService.DeleteTensorboardExperiment][google.cloud.aiplatform.v1beta1.TensorboardService.DeleteTensorboardExperiment]. -message DeleteTensorboardExperimentRequest { - // Required. The name of the TensorboardExperiment to be deleted. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardExperiment" - } - ]; -} - -// Request message for [TensorboardService.BatchCreateTensorboardRuns][google.cloud.aiplatform.v1beta1.TensorboardService.BatchCreateTensorboardRuns]. -message BatchCreateTensorboardRunsRequest { - // Required. The resource name of the TensorboardExperiment to create the - // TensorboardRuns in. Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - // The parent field in the CreateTensorboardRunRequest messages must match - // this field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardExperiment" - } - ]; - - // Required. The request message specifying the TensorboardRuns to create. - // A maximum of 1000 TensorboardRuns can be created in a batch. - repeated CreateTensorboardRunRequest requests = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [TensorboardService.BatchCreateTensorboardRuns][google.cloud.aiplatform.v1beta1.TensorboardService.BatchCreateTensorboardRuns]. -message BatchCreateTensorboardRunsResponse { - // The created TensorboardRuns. - repeated TensorboardRun tensorboard_runs = 1; -} - -// Request message for [TensorboardService.CreateTensorboardRun][google.cloud.aiplatform.v1beta1.TensorboardService.CreateTensorboardRun]. -message CreateTensorboardRunRequest { - // Required. The resource name of the TensorboardExperiment to create the TensorboardRun - // in. Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardRun" - } - ]; - - // Required. The TensorboardRun to create. - TensorboardRun tensorboard_run = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID to use for the Tensorboard run, which will become the final - // component of the Tensorboard run's resource name. - // - // This value should be 1-128 characters, and valid characters - // are /[a-z][0-9]-/. - string tensorboard_run_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [TensorboardService.GetTensorboardRun][google.cloud.aiplatform.v1beta1.TensorboardService.GetTensorboardRun]. -message GetTensorboardRunRequest { - // Required. The name of the TensorboardRun resource. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardRun" - } - ]; -} - -// Request message for [TensorboardService.ReadTensorboardBlobData][google.cloud.aiplatform.v1beta1.TensorboardService.ReadTensorboardBlobData]. -message ReadTensorboardBlobDataRequest { - // Required. The resource name of the TensorboardTimeSeries to list Blobs. - // Format: - // 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - string time_series = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardTimeSeries" - } - ]; - - // IDs of the blobs to read. - repeated string blob_ids = 2; -} - -// Response message for [TensorboardService.ReadTensorboardBlobData][google.cloud.aiplatform.v1beta1.TensorboardService.ReadTensorboardBlobData]. -message ReadTensorboardBlobDataResponse { - // Blob messages containing blob bytes. - repeated TensorboardBlob blobs = 1; -} - -// Request message for [TensorboardService.ListTensorboardRuns][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns]. -message ListTensorboardRunsRequest { - // Required. The resource name of the TensorboardExperiment to list TensorboardRuns. - // Format: - // 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/TensorboardRun" - } - ]; - - // Lists the TensorboardRuns that match the filter expression. - string filter = 2; - - // The maximum number of TensorboardRuns to return. The service may return - // fewer than this value. If unspecified, at most 50 TensorboardRuns will be - // returned. The maximum value is 1000; values above 1000 will be coerced to - // 1000. - int32 page_size = 3; - - // A page token, received from a previous - // [TensorboardService.ListTensorboardRuns][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns] call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [TensorboardService.ListTensorboardRuns][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns] must - // match the call that provided the page token. - string page_token = 4; - - // Field to use to sort the list. - string order_by = 5; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 6; -} - -// Response message for [TensorboardService.ListTensorboardRuns][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns]. -message ListTensorboardRunsResponse { - // The TensorboardRuns mathching the request. - repeated TensorboardRun tensorboard_runs = 1; - - // A token, which can be sent as [ListTensorboardRunsRequest.page_token][google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest.page_token] to - // retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [TensorboardService.UpdateTensorboardRun][google.cloud.aiplatform.v1beta1.TensorboardService.UpdateTensorboardRun]. -message UpdateTensorboardRunRequest { - // Required. Field mask is used to specify the fields to be overwritten in the - // TensorboardRun resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then all fields will be overwritten if new - // values are specified. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The TensorboardRun's `name` field is used to identify the TensorboardRun to - // be updated. Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - TensorboardRun tensorboard_run = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [TensorboardService.DeleteTensorboardRun][google.cloud.aiplatform.v1beta1.TensorboardService.DeleteTensorboardRun]. -message DeleteTensorboardRunRequest { - // Required. The name of the TensorboardRun to be deleted. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardRun" - } - ]; -} - -// Request message for [TensorboardService.BatchCreateTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.BatchCreateTensorboardTimeSeries]. -message BatchCreateTensorboardTimeSeriesRequest { - // Required. The resource name of the TensorboardExperiment to create the - // TensorboardTimeSeries in. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - // The TensorboardRuns referenced by the parent fields in the - // CreateTensorboardTimeSeriesRequest messages must be sub resources of this - // TensorboardExperiment. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardExperiment" - } - ]; - - // Required. The request message specifying the TensorboardTimeSeries to create. - // A maximum of 1000 TensorboardTimeSeries can be created in a batch. - repeated CreateTensorboardTimeSeriesRequest requests = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [TensorboardService.BatchCreateTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.BatchCreateTensorboardTimeSeries]. -message BatchCreateTensorboardTimeSeriesResponse { - // The created TensorboardTimeSeries. - repeated TensorboardTimeSeries tensorboard_time_series = 1; -} - -// Request message for [TensorboardService.CreateTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.CreateTensorboardTimeSeries]. -message CreateTensorboardTimeSeriesRequest { - // Required. The resource name of the TensorboardRun to create the - // TensorboardTimeSeries in. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardTimeSeries" - } - ]; - - // Optional. The user specified unique ID to use for the TensorboardTimeSeries, which - // will become the final component of the TensorboardTimeSeries's resource - // name. - // This value should match "[a-z0-9][a-z0-9-]{0, 127}" - string tensorboard_time_series_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The TensorboardTimeSeries to create. - TensorboardTimeSeries tensorboard_time_series = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [TensorboardService.GetTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.GetTensorboardTimeSeries]. -message GetTensorboardTimeSeriesRequest { - // Required. The name of the TensorboardTimeSeries resource. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardTimeSeries" - } - ]; -} - -// Request message for [TensorboardService.ListTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries]. -message ListTensorboardTimeSeriesRequest { - // Required. The resource name of the TensorboardRun to list TensorboardTimeSeries. - // Format: - // 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "aiplatform.googleapis.com/TensorboardTimeSeries" - } - ]; - - // Lists the TensorboardTimeSeries that match the filter expression. - string filter = 2; - - // The maximum number of TensorboardTimeSeries to return. The service may - // return fewer than this value. If unspecified, at most 50 - // TensorboardTimeSeries will be returned. The maximum value is 1000; values - // above 1000 will be coerced to 1000. - int32 page_size = 3; - - // A page token, received from a previous - // [TensorboardService.ListTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries] call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [TensorboardService.ListTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries] must - // match the call that provided the page token. - string page_token = 4; - - // Field to use to sort the list. - string order_by = 5; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 6; -} - -// Response message for [TensorboardService.ListTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries]. -message ListTensorboardTimeSeriesResponse { - // The TensorboardTimeSeries mathching the request. - repeated TensorboardTimeSeries tensorboard_time_series = 1; - - // A token, which can be sent as - // [ListTensorboardTimeSeriesRequest.page_token][google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest.page_token] to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for [TensorboardService.UpdateTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.UpdateTensorboardTimeSeries]. -message UpdateTensorboardTimeSeriesRequest { - // Required. Field mask is used to specify the fields to be overwritten in the - // TensorboardTimeSeries resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then all fields will be overwritten if new - // values are specified. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The TensorboardTimeSeries' `name` field is used to identify the - // TensorboardTimeSeries to be updated. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - TensorboardTimeSeries tensorboard_time_series = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [TensorboardService.DeleteTensorboardTimeSeries][google.cloud.aiplatform.v1beta1.TensorboardService.DeleteTensorboardTimeSeries]. -message DeleteTensorboardTimeSeriesRequest { - // Required. The name of the TensorboardTimeSeries to be deleted. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardTimeSeries" - } - ]; -} - -// Request message for -// [TensorboardService.BatchReadTensorboardTimeSeriesData][google.cloud.aiplatform.v1beta1.TensorboardService.BatchReadTensorboardTimeSeriesData]. -message BatchReadTensorboardTimeSeriesDataRequest { - // Required. The resource name of the Tensorboard containing TensorboardTimeSeries to - // read data from. Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}`. - // The TensorboardTimeSeries referenced by [time_series][google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataRequest.time_series] must be sub - // resources of this Tensorboard. - string tensorboard = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Tensorboard" - } - ]; - - // Required. The resource names of the TensorboardTimeSeries to read data from. Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - repeated string time_series = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardTimeSeries" - } - ]; -} - -// Response message for -// [TensorboardService.BatchReadTensorboardTimeSeriesData][google.cloud.aiplatform.v1beta1.TensorboardService.BatchReadTensorboardTimeSeriesData]. -message BatchReadTensorboardTimeSeriesDataResponse { - // The returned time series data. - repeated TimeSeriesData time_series_data = 1; -} - -// Request message for [TensorboardService.ReadTensorboardTimeSeriesData][google.cloud.aiplatform.v1beta1.TensorboardService.ReadTensorboardTimeSeriesData]. -message ReadTensorboardTimeSeriesDataRequest { - // Required. The resource name of the TensorboardTimeSeries to read data from. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - string tensorboard_time_series = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardTimeSeries" - } - ]; - - // The maximum number of TensorboardTimeSeries' data to return. - // - // This value should be a positive integer. - // This value can be set to -1 to return all data. - int32 max_data_points = 2; - - // Reads the TensorboardTimeSeries' data that match the filter expression. - string filter = 3; -} - -// Response message for [TensorboardService.ReadTensorboardTimeSeriesData][google.cloud.aiplatform.v1beta1.TensorboardService.ReadTensorboardTimeSeriesData]. -message ReadTensorboardTimeSeriesDataResponse { - // The returned time series data. - TimeSeriesData time_series_data = 1; -} - -// Request message for [TensorboardService.WriteTensorboardExperimentData][google.cloud.aiplatform.v1beta1.TensorboardService.WriteTensorboardExperimentData]. -message WriteTensorboardExperimentDataRequest { - // Required. The resource name of the TensorboardExperiment to write data to. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - string tensorboard_experiment = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardExperiment" - } - ]; - - // Required. Requests containing per-run TensorboardTimeSeries data to write. - repeated WriteTensorboardRunDataRequest write_run_data_requests = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [TensorboardService.WriteTensorboardExperimentData][google.cloud.aiplatform.v1beta1.TensorboardService.WriteTensorboardExperimentData]. -message WriteTensorboardExperimentDataResponse { - -} - -// Request message for [TensorboardService.WriteTensorboardRunData][google.cloud.aiplatform.v1beta1.TensorboardService.WriteTensorboardRunData]. -message WriteTensorboardRunDataRequest { - // Required. The resource name of the TensorboardRun to write data to. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - string tensorboard_run = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardRun" - } - ]; - - // Required. The TensorboardTimeSeries data to write. - // Values with in a time series are indexed by their step value. - // Repeated writes to the same step will overwrite the existing value for that - // step. - // The upper limit of data points per write request is 5000. - repeated TimeSeriesData time_series_data = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [TensorboardService.WriteTensorboardRunData][google.cloud.aiplatform.v1beta1.TensorboardService.WriteTensorboardRunData]. -message WriteTensorboardRunDataResponse { - -} - -// Request message for [TensorboardService.ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData]. -message ExportTensorboardTimeSeriesDataRequest { - // Required. The resource name of the TensorboardTimeSeries to export data from. - // Format: - // `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - string tensorboard_time_series = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/TensorboardTimeSeries" - } - ]; - - // Exports the TensorboardTimeSeries' data that match the filter expression. - string filter = 2; - - // The maximum number of data points to return per page. - // The default page_size will be 1000. Values must be between 1 and 10000. - // Values above 10000 will be coerced to 10000. - int32 page_size = 3; - - // A page token, received from a previous - // [TensorboardService.ExportTensorboardTimeSeries][] call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // [TensorboardService.ExportTensorboardTimeSeries][] must - // match the call that provided the page token. - string page_token = 4; - - // Field to use to sort the TensorboardTimeSeries' data. - // By default, TensorboardTimeSeries' data will be returned in a pseudo random - // order. - string order_by = 5; -} - -// Response message for [TensorboardService.ExportTensorboardTimeSeriesData][google.cloud.aiplatform.v1beta1.TensorboardService.ExportTensorboardTimeSeriesData]. -message ExportTensorboardTimeSeriesDataResponse { - // The returned time series data points. - repeated TimeSeriesDataPoint time_series_data_points = 1; - - // A token, which can be sent as - // [ExportTensorboardTimeSeriesRequest.page_token][] to retrieve the next - // page. If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Details of operations that perform create Tensorboard. -message CreateTensorboardOperationMetadata { - // Operation metadata for Tensorboard. - GenericOperationMetadata generic_metadata = 1; -} - -// Details of operations that perform update Tensorboard. -message UpdateTensorboardOperationMetadata { - // Operation metadata for Tensorboard. - GenericOperationMetadata generic_metadata = 1; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto deleted file mode 100644 index 6e202a6e..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto +++ /dev/null @@ -1,106 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "TensorboardTimeSeriesProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// TensorboardTimeSeries maps to times series produced in training runs -message TensorboardTimeSeries { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/TensorboardTimeSeries" - pattern: "projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}" - }; - - // Describes metadata for a TensorboardTimeSeries. - message Metadata { - // Output only. Max step index of all data points within a TensorboardTimeSeries. - int64 max_step = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Max wall clock timestamp of all data points within a - // TensorboardTimeSeries. - google.protobuf.Timestamp max_wall_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The largest blob sequence length (number of blobs) of all data points in - // this time series, if its ValueType is BLOB_SEQUENCE. - int64 max_blob_sequence_length = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // An enum representing the value type of a TensorboardTimeSeries. - enum ValueType { - // The value type is unspecified. - VALUE_TYPE_UNSPECIFIED = 0; - - // Used for TensorboardTimeSeries that is a list of scalars. - // E.g. accuracy of a model over epochs/time. - SCALAR = 1; - - // Used for TensorboardTimeSeries that is a list of tensors. - // E.g. histograms of weights of layer in a model over epoch/time. - TENSOR = 2; - - // Used for TensorboardTimeSeries that is a list of blob sequences. - // E.g. set of sample images with labels over epochs/time. - BLOB_SEQUENCE = 3; - } - - // Output only. Name of the TensorboardTimeSeries. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. User provided name of this TensorboardTimeSeries. - // This value should be unique among all TensorboardTimeSeries resources - // belonging to the same TensorboardRun resource (parent resource). - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Description of this TensorboardTimeSeries. - string description = 3; - - // Required. Immutable. Type of TensorboardTimeSeries value. - ValueType value_type = 4 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Output only. Timestamp when this TensorboardTimeSeries was created. - google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when this TensorboardTimeSeries was last updated. - google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Used to perform a consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 7; - - // Immutable. Name of the plugin this time series pertain to. Such as Scalar, Tensor, - // Blob - string plugin_name = 8 [(google.api.field_behavior) = IMMUTABLE]; - - // Data of the current plugin, with the size limited to 65KB. - bytes plugin_data = 9; - - // Output only. Scalar, Tensor, or Blob metadata for this TensorboardTimeSeries. - Metadata metadata = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto deleted file mode 100644 index c4c9225e..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto +++ /dev/null @@ -1,399 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.aiplatform.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; -import "google/cloud/aiplatform/v1beta1/io.proto"; -import "google/cloud/aiplatform/v1beta1/model.proto"; -import "google/cloud/aiplatform/v1beta1/pipeline_state.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; -option java_multiple_files = true; -option java_outer_classname = "TrainingPipelineProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// The TrainingPipeline orchestrates tasks associated with training a Model. It -// always executes the training task, and optionally may also -// export data from Vertex AI's Dataset which becomes the training input, -// [upload][google.cloud.aiplatform.v1beta1.ModelService.UploadModel] the Model to Vertex AI, and evaluate the -// Model. -message TrainingPipeline { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/TrainingPipeline" - pattern: "projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}" - }; - - // Output only. Resource name of the TrainingPipeline. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The user-defined name of this TrainingPipeline. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Specifies Vertex AI owned input data that may be used for training the - // Model. The TrainingPipeline's [training_task_definition][google.cloud.aiplatform.v1beta1.TrainingPipeline.training_task_definition] should make - // clear whether this config is used and if there are any special requirements - // on how it should be filled. If nothing about this config is mentioned in - // the [training_task_definition][google.cloud.aiplatform.v1beta1.TrainingPipeline.training_task_definition], then it should be assumed that the - // TrainingPipeline does not depend on this configuration. - InputDataConfig input_data_config = 3; - - // Required. A Google Cloud Storage path to the YAML file that defines the training task - // which is responsible for producing the model artifact, and may also include - // additional auxiliary work. - // The definition files that can be used here are found in - // gs://google-cloud-aiplatform/schema/trainingjob/definition/. - // Note: The URI given on output will be immutable and probably different, - // including the URI scheme, than the one given on input. The output URI will - // point to a location where the user only has a read access. - string training_task_definition = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. The training task's parameter(s), as specified in the - // [training_task_definition][google.cloud.aiplatform.v1beta1.TrainingPipeline.training_task_definition]'s `inputs`. - google.protobuf.Value training_task_inputs = 5 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The metadata information as specified in the [training_task_definition][google.cloud.aiplatform.v1beta1.TrainingPipeline.training_task_definition]'s - // `metadata`. This metadata is an auxiliary runtime and final information - // about the training task. While the pipeline is running this information is - // populated only at a best effort basis. Only present if the - // pipeline's [training_task_definition][google.cloud.aiplatform.v1beta1.TrainingPipeline.training_task_definition] contains `metadata` object. - google.protobuf.Value training_task_metadata = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Describes the Model that may be uploaded (via [ModelService.UploadModel][google.cloud.aiplatform.v1beta1.ModelService.UploadModel]) - // by this TrainingPipeline. The TrainingPipeline's - // [training_task_definition][google.cloud.aiplatform.v1beta1.TrainingPipeline.training_task_definition] should make clear whether this Model - // description should be populated, and if there are any special requirements - // regarding how it should be filled. If nothing is mentioned in the - // [training_task_definition][google.cloud.aiplatform.v1beta1.TrainingPipeline.training_task_definition], then it should be assumed that this field - // should not be filled and the training task either uploads the Model without - // a need of this information, or that training task does not support - // uploading a Model as part of the pipeline. - // When the Pipeline's state becomes `PIPELINE_STATE_SUCCEEDED` and - // the trained Model had been uploaded into Vertex AI, then the - // model_to_upload's resource [name][google.cloud.aiplatform.v1beta1.Model.name] is populated. The Model - // is always uploaded into the Project and Location in which this pipeline - // is. - Model model_to_upload = 7; - - // Optional. The ID to use for the uploaded Model, which will become the final - // component of the model resource name. - // - // This value may be up to 63 characters, and valid characters are - // `[a-z0-9_-]`. The first character cannot be a number or hyphen. - string model_id = 22 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. When specify this field, the `model_to_upload` will not be uploaded as a - // new model, instead, it will become a new version of this `parent_model`. - string parent_model = 21 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The detailed state of the pipeline. - PipelineState state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Only populated when the pipeline's state is `PIPELINE_STATE_FAILED` or - // `PIPELINE_STATE_CANCELLED`. - google.rpc.Status error = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the TrainingPipeline was created. - google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the TrainingPipeline for the first time entered the - // `PIPELINE_STATE_RUNNING` state. - google.protobuf.Timestamp start_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the TrainingPipeline entered any of the following states: - // `PIPELINE_STATE_SUCCEEDED`, `PIPELINE_STATE_FAILED`, - // `PIPELINE_STATE_CANCELLED`. - google.protobuf.Timestamp end_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the TrainingPipeline was most recently updated. - google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The labels with user-defined metadata to organize TrainingPipelines. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - map labels = 15; - - // Customer-managed encryption key spec for a TrainingPipeline. If set, this - // TrainingPipeline will be secured by this key. - // - // Note: Model trained by this TrainingPipeline is also secured by this key if - // [model_to_upload][google.cloud.aiplatform.v1beta1.TrainingPipeline.encryption_spec] is not set separately. - EncryptionSpec encryption_spec = 18; -} - -// Specifies Vertex AI owned input data to be used for training, and -// possibly evaluating, the Model. -message InputDataConfig { - // The instructions how the input data should be split between the - // training, validation and test sets. - // If no split type is provided, the [fraction_split][google.cloud.aiplatform.v1beta1.InputDataConfig.fraction_split] is used by default. - oneof split { - // Split based on fractions defining the size of each set. - FractionSplit fraction_split = 2; - - // Split based on the provided filters for each set. - FilterSplit filter_split = 3; - - // Supported only for tabular Datasets. - // - // Split based on a predefined key. - PredefinedSplit predefined_split = 4; - - // Supported only for tabular Datasets. - // - // Split based on the timestamp of the input data pieces. - TimestampSplit timestamp_split = 5; - - // Supported only for tabular Datasets. - // - // Split based on the distribution of the specified column. - StratifiedSplit stratified_split = 12; - } - - // Only applicable to Custom and Hyperparameter Tuning TrainingPipelines. - // - // The destination of the training data to be written to. - // - // Supported destination file formats: - // * For non-tabular data: "jsonl". - // * For tabular data: "csv" and "bigquery". - // - // The following Vertex AI environment variables are passed to containers - // or python modules of the training task when this field is set: - // - // * AIP_DATA_FORMAT : Exported data format. - // * AIP_TRAINING_DATA_URI : Sharded exported training data uris. - // * AIP_VALIDATION_DATA_URI : Sharded exported validation data uris. - // * AIP_TEST_DATA_URI : Sharded exported test data uris. - oneof destination { - // The Cloud Storage location where the training data is to be - // written to. In the given directory a new directory is created with - // name: - // `dataset---` - // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. - // All training input data is written into that directory. - // - // The Vertex AI environment variables representing Cloud Storage - // data URIs are represented in the Cloud Storage wildcard - // format to support sharded data. e.g.: "gs://.../training-*.jsonl" - // - // * AIP_DATA_FORMAT = "jsonl" for non-tabular data, "csv" for tabular data - // * AIP_TRAINING_DATA_URI = - // "gcs_destination/dataset--- - * region_tag:aiplatform_v1beta1_generated_DatasetService_GetDataset_async - */ - getDataset( - request?: protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDataset, - protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest|undefined, {}|undefined - ]>; - getDataset( - request: protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IDataset, - protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest|null|undefined, - {}|null|undefined>): void; - getDataset( - request: protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IDataset, - protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest|null|undefined, - {}|null|undefined>): void; - getDataset( - request?: protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IDataset, - protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IDataset, - protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDataset, - protos.google.cloud.aiplatform.v1beta1.IGetDatasetRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getDataset(request, options, callback); - } -/** - * Updates a Dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1beta1.Dataset} request.dataset - * Required. The Dataset which replaces the resource on the server. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The update mask applies to the resource. - * For the `FieldMask` definition, see {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. - * Updatable fields: - * - * * `display_name` - * * `description` - * * `labels` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Dataset]{@link google.cloud.aiplatform.v1beta1.Dataset}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_DatasetService_UpdateDataset_async - */ - updateDataset( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDataset, - protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest|undefined, {}|undefined - ]>; - updateDataset( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IDataset, - protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest|null|undefined, - {}|null|undefined>): void; - updateDataset( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IDataset, - protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest|null|undefined, - {}|null|undefined>): void; - updateDataset( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IDataset, - protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IDataset, - protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDataset, - protos.google.cloud.aiplatform.v1beta1.IUpdateDatasetRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'dataset.name': request.dataset!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateDataset(request, options, callback); - } -/** - * Gets an AnnotationSpec. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the AnnotationSpec resource. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AnnotationSpec]{@link google.cloud.aiplatform.v1beta1.AnnotationSpec}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_DatasetService_GetAnnotationSpec_async - */ - getAnnotationSpec( - request?: protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IAnnotationSpec, - protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest|undefined, {}|undefined - ]>; - getAnnotationSpec( - request: protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IAnnotationSpec, - protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest|null|undefined, - {}|null|undefined>): void; - getAnnotationSpec( - request: protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IAnnotationSpec, - protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest|null|undefined, - {}|null|undefined>): void; - getAnnotationSpec( - request?: protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IAnnotationSpec, - protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IAnnotationSpec, - protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IAnnotationSpec, - protos.google.cloud.aiplatform.v1beta1.IGetAnnotationSpecRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getAnnotationSpec(request, options, callback); - } - -/** - * Creates a Dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the Dataset in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1beta1.Dataset} request.dataset - * Required. The Dataset to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_DatasetService_CreateDataset_async - */ - createDataset( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateDatasetRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createDataset( - request: protos.google.cloud.aiplatform.v1beta1.ICreateDatasetRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createDataset( - request: protos.google.cloud.aiplatform.v1beta1.ICreateDatasetRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createDataset( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateDatasetRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createDataset(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createDataset()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_DatasetService_CreateDataset_async - */ - async checkCreateDatasetProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createDataset, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a Dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Dataset to delete. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_DatasetService_DeleteDataset_async - */ - deleteDataset( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteDatasetRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteDataset( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteDatasetRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteDataset( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteDatasetRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteDataset( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteDatasetRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteDataset(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteDataset()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_DatasetService_DeleteDataset_async - */ - async checkDeleteDatasetProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteDataset, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Imports data into a Dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Dataset resource. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param {number[]} request.importConfigs - * Required. The desired input locations. The contents of all input locations will be - * imported in one batch. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_DatasetService_ImportData_async - */ - importData( - request?: protos.google.cloud.aiplatform.v1beta1.IImportDataRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - importData( - request: protos.google.cloud.aiplatform.v1beta1.IImportDataRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importData( - request: protos.google.cloud.aiplatform.v1beta1.IImportDataRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importData( - request?: protos.google.cloud.aiplatform.v1beta1.IImportDataRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.importData(request, options, callback); - } -/** - * Check the status of the long running operation returned by `importData()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_DatasetService_ImportData_async - */ - async checkImportDataProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.importData, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Exports data from a Dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Dataset resource. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param {google.cloud.aiplatform.v1beta1.ExportDataConfig} request.exportConfig - * Required. The desired output location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_DatasetService_ExportData_async - */ - exportData( - request?: protos.google.cloud.aiplatform.v1beta1.IExportDataRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - exportData( - request: protos.google.cloud.aiplatform.v1beta1.IExportDataRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportData( - request: protos.google.cloud.aiplatform.v1beta1.IExportDataRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportData( - request?: protos.google.cloud.aiplatform.v1beta1.IExportDataRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.exportData(request, options, callback); - } -/** - * Check the status of the long running operation returned by `exportData()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_DatasetService_ExportData_async - */ - async checkExportDataProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.exportData, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Datasets in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the Dataset's parent resource. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `display_name`: supports = and != - * * `metadata_schema_uri`: supports = and != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * * `display_name` - * * `create_time` - * * `update_time` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Dataset]{@link google.cloud.aiplatform.v1beta1.Dataset}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDatasetsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDatasets( - request?: protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDataset[], - protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListDatasetsResponse - ]>; - listDatasets( - request: protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, - protos.google.cloud.aiplatform.v1beta1.IListDatasetsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDataset>): void; - listDatasets( - request: protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, - protos.google.cloud.aiplatform.v1beta1.IListDatasetsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDataset>): void; - listDatasets( - request?: protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, - protos.google.cloud.aiplatform.v1beta1.IListDatasetsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDataset>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, - protos.google.cloud.aiplatform.v1beta1.IListDatasetsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDataset>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDataset[], - protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListDatasetsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listDatasets(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the Dataset's parent resource. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `display_name`: supports = and != - * * `metadata_schema_uri`: supports = and != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * * `display_name` - * * `create_time` - * * `update_time` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Dataset]{@link google.cloud.aiplatform.v1beta1.Dataset} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDatasetsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDatasetsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDatasets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDatasets.createStream( - this.innerApiCalls.listDatasets as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDatasets`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the Dataset's parent resource. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `display_name`: supports = and != - * * `metadata_schema_uri`: supports = and != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * * `display_name` - * * `create_time` - * * `update_time` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Dataset]{@link google.cloud.aiplatform.v1beta1.Dataset}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_DatasetService_ListDatasets_async - */ - listDatasetsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListDatasetsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDatasets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDatasets.asyncIterate( - this.innerApiCalls['listDatasets'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists DataItems in a Dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Dataset to list DataItems from. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [DataItem]{@link google.cloud.aiplatform.v1beta1.DataItem}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDataItemsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDataItems( - request?: protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDataItem[], - protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListDataItemsResponse - ]>; - listDataItems( - request: protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, - protos.google.cloud.aiplatform.v1beta1.IListDataItemsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDataItem>): void; - listDataItems( - request: protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, - protos.google.cloud.aiplatform.v1beta1.IListDataItemsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDataItem>): void; - listDataItems( - request?: protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, - protos.google.cloud.aiplatform.v1beta1.IListDataItemsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDataItem>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, - protos.google.cloud.aiplatform.v1beta1.IListDataItemsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDataItem>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDataItem[], - protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListDataItemsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listDataItems(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Dataset to list DataItems from. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [DataItem]{@link google.cloud.aiplatform.v1beta1.DataItem} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDataItemsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDataItemsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDataItems']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDataItems.createStream( - this.innerApiCalls.listDataItems as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDataItems`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Dataset to list DataItems from. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [DataItem]{@link google.cloud.aiplatform.v1beta1.DataItem}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_DatasetService_ListDataItems_async - */ - listDataItemsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListDataItemsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDataItems']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDataItems.asyncIterate( - this.innerApiCalls['listDataItems'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists Annotations belongs to a dataitem - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the DataItem to list Annotations from. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Annotation]{@link google.cloud.aiplatform.v1beta1.Annotation}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listAnnotationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listAnnotations( - request?: protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IAnnotation[], - protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListAnnotationsResponse - ]>; - listAnnotations( - request: protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, - protos.google.cloud.aiplatform.v1beta1.IListAnnotationsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IAnnotation>): void; - listAnnotations( - request: protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, - protos.google.cloud.aiplatform.v1beta1.IListAnnotationsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IAnnotation>): void; - listAnnotations( - request?: protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, - protos.google.cloud.aiplatform.v1beta1.IListAnnotationsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IAnnotation>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, - protos.google.cloud.aiplatform.v1beta1.IListAnnotationsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IAnnotation>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IAnnotation[], - protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListAnnotationsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listAnnotations(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the DataItem to list Annotations from. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Annotation]{@link google.cloud.aiplatform.v1beta1.Annotation} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listAnnotationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listAnnotationsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listAnnotations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAnnotations.createStream( - this.innerApiCalls.listAnnotations as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAnnotations`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the DataItem to list Annotations from. - * Format: - * `projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Annotation]{@link google.cloud.aiplatform.v1beta1.Annotation}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_DatasetService_ListAnnotations_async - */ - listAnnotationsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListAnnotationsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listAnnotations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAnnotations.asyncIterate( - this.innerApiCalls['listAnnotations'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.datasetServiceStub && !this._terminated) { - return this.datasetServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/dataset_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/dataset_service_client_config.json deleted file mode 100644 index 64c47562..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/dataset_service_client_config.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1beta1.DatasetService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateDataset": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetDataset": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateDataset": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListDatasets": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteDataset": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ImportData": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ExportData": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListDataItems": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetAnnotationSpec": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListAnnotations": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/dataset_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/dataset_service_proto_list.json deleted file mode 100644 index c916ab12..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/dataset_service_proto_list.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/context.proto", - "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1beta1/event.proto", - "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/io.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/study.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1beta1/types.proto", - "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1beta1/value.proto", - "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_client.ts deleted file mode 100644 index 968a0f49..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_client.ts +++ /dev/null @@ -1,3134 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/endpoint_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './endpoint_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * A service for managing Vertex AI's Endpoints. - * @class - * @memberof v1beta1 - */ -export class EndpointServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - endpointServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of EndpointServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof EndpointServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listEndpoints: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'endpoints') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const createEndpointResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.Endpoint') as gax.protobuf.Type; - const createEndpointMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.CreateEndpointOperationMetadata') as gax.protobuf.Type; - const deleteEndpointResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteEndpointMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const deployModelResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeployModelResponse') as gax.protobuf.Type; - const deployModelMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeployModelOperationMetadata') as gax.protobuf.Type; - const undeployModelResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.UndeployModelResponse') as gax.protobuf.Type; - const undeployModelMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.UndeployModelOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createEndpoint: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createEndpointResponse.decode.bind(createEndpointResponse), - createEndpointMetadata.decode.bind(createEndpointMetadata)), - deleteEndpoint: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteEndpointResponse.decode.bind(deleteEndpointResponse), - deleteEndpointMetadata.decode.bind(deleteEndpointMetadata)), - deployModel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deployModelResponse.decode.bind(deployModelResponse), - deployModelMetadata.decode.bind(deployModelMetadata)), - undeployModel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - undeployModelResponse.decode.bind(undeployModelResponse), - undeployModelMetadata.decode.bind(undeployModelMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1beta1.EndpointService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.endpointServiceStub) { - return this.endpointServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1beta1.EndpointService. - this.endpointServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.EndpointService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1beta1.EndpointService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const endpointServiceStubMethods = - ['createEndpoint', 'getEndpoint', 'listEndpoints', 'updateEndpoint', 'deleteEndpoint', 'deployModel', 'undeployModel']; - for (const methodName of endpointServiceStubMethods) { - const callPromise = this.endpointServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.endpointServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets an Endpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Endpoint resource. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Endpoint]{@link google.cloud.aiplatform.v1beta1.Endpoint}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_EndpointService_GetEndpoint_async - */ - getEndpoint( - request?: protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IEndpoint, - protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest|undefined, {}|undefined - ]>; - getEndpoint( - request: protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IEndpoint, - protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest|null|undefined, - {}|null|undefined>): void; - getEndpoint( - request: protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IEndpoint, - protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest|null|undefined, - {}|null|undefined>): void; - getEndpoint( - request?: protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IEndpoint, - protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IEndpoint, - protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IEndpoint, - protos.google.cloud.aiplatform.v1beta1.IGetEndpointRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getEndpoint(request, options, callback); - } -/** - * Updates an Endpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1beta1.Endpoint} request.endpoint - * Required. The Endpoint which replaces the resource on the server. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The update mask applies to the resource. See {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Endpoint]{@link google.cloud.aiplatform.v1beta1.Endpoint}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_EndpointService_UpdateEndpoint_async - */ - updateEndpoint( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IEndpoint, - protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest|undefined, {}|undefined - ]>; - updateEndpoint( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IEndpoint, - protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest|null|undefined, - {}|null|undefined>): void; - updateEndpoint( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IEndpoint, - protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest|null|undefined, - {}|null|undefined>): void; - updateEndpoint( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IEndpoint, - protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IEndpoint, - protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IEndpoint, - protos.google.cloud.aiplatform.v1beta1.IUpdateEndpointRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'endpoint.name': request.endpoint!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateEndpoint(request, options, callback); - } - -/** - * Creates an Endpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the Endpoint in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1beta1.Endpoint} request.endpoint - * Required. The Endpoint to create. - * @param {string} request.endpointId - * Immutable. The ID to use for endpoint, which will become the final - * component of the endpoint resource name. - * If not provided, Vertex AI will generate a value for this ID. - * - * This value should be 1-10 characters, and valid characters are /[0-9]/. - * When using HTTP/JSON, this field is populated based on a query string - * argument, such as `?endpoint_id=12345`. This is the fallback for fields - * that are not included in either the URI or the body. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_async - */ - createEndpoint( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateEndpointRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createEndpoint( - request: protos.google.cloud.aiplatform.v1beta1.ICreateEndpointRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createEndpoint( - request: protos.google.cloud.aiplatform.v1beta1.ICreateEndpointRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createEndpoint( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateEndpointRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createEndpoint(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createEndpoint()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_EndpointService_CreateEndpoint_async - */ - async checkCreateEndpointProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createEndpoint, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes an Endpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Endpoint resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_async - */ - deleteEndpoint( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteEndpointRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteEndpoint( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteEndpointRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteEndpoint( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteEndpointRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteEndpoint( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteEndpointRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteEndpoint(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteEndpoint()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_EndpointService_DeleteEndpoint_async - */ - async checkDeleteEndpointProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteEndpoint, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deploys a Model into this Endpoint, creating a DeployedModel within it. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.endpoint - * Required. The name of the Endpoint resource into which to deploy a Model. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param {google.cloud.aiplatform.v1beta1.DeployedModel} request.deployedModel - * Required. The DeployedModel to be created within the Endpoint. Note that - * {@link google.cloud.aiplatform.v1beta1.Endpoint.traffic_split|Endpoint.traffic_split} must be updated for the DeployedModel to start - * receiving traffic, either as part of this call, or via - * {@link google.cloud.aiplatform.v1beta1.EndpointService.UpdateEndpoint|EndpointService.UpdateEndpoint}. - * @param {number[]} request.trafficSplit - * A map from a DeployedModel's ID to the percentage of this Endpoint's - * traffic that should be forwarded to that DeployedModel. - * - * If this field is non-empty, then the Endpoint's - * {@link google.cloud.aiplatform.v1beta1.Endpoint.traffic_split|traffic_split} will be overwritten with it. - * To refer to the ID of the just being deployed Model, a "0" should be used, - * and the actual ID of the new DeployedModel will be filled in its place by - * this method. The traffic percentage values must add up to 100. - * - * If this field is empty, then the Endpoint's - * {@link google.cloud.aiplatform.v1beta1.Endpoint.traffic_split|traffic_split} is not updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_EndpointService_DeployModel_async - */ - deployModel( - request?: protos.google.cloud.aiplatform.v1beta1.IDeployModelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deployModel( - request: protos.google.cloud.aiplatform.v1beta1.IDeployModelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deployModel( - request: protos.google.cloud.aiplatform.v1beta1.IDeployModelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deployModel( - request?: protos.google.cloud.aiplatform.v1beta1.IDeployModelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'endpoint': request.endpoint || '', - }); - this.initialize(); - return this.innerApiCalls.deployModel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deployModel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_EndpointService_DeployModel_async - */ - async checkDeployModelProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deployModel, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Undeploys a Model from an Endpoint, removing a DeployedModel from it, and - * freeing all resources it's using. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.endpoint - * Required. The name of the Endpoint resource from which to undeploy a Model. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param {string} request.deployedModelId - * Required. The ID of the DeployedModel to be undeployed from the Endpoint. - * @param {number[]} request.trafficSplit - * If this field is provided, then the Endpoint's - * {@link google.cloud.aiplatform.v1beta1.Endpoint.traffic_split|traffic_split} will be overwritten with it. If - * last DeployedModel is being undeployed from the Endpoint, the - * [Endpoint.traffic_split] will always end up empty when this call returns. - * A DeployedModel will be successfully undeployed only if it doesn't have - * any traffic assigned to it when this method executes, or if this field - * unassigns any traffic to it. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_EndpointService_UndeployModel_async - */ - undeployModel( - request?: protos.google.cloud.aiplatform.v1beta1.IUndeployModelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - undeployModel( - request: protos.google.cloud.aiplatform.v1beta1.IUndeployModelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - undeployModel( - request: protos.google.cloud.aiplatform.v1beta1.IUndeployModelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - undeployModel( - request?: protos.google.cloud.aiplatform.v1beta1.IUndeployModelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'endpoint': request.endpoint || '', - }); - this.initialize(); - return this.innerApiCalls.undeployModel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `undeployModel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_EndpointService_UndeployModel_async - */ - async checkUndeployModelProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.undeployModel, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Endpoints in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location from which to list the Endpoints. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID, - * i.e. the last segment of the Endpoint's {@link google.cloud.aiplatform.v1beta1.Endpoint.name|resource name}. - * * `display_name` supports = and, != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `endpoint=1` - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @param {number} [request.pageSize] - * Optional. The standard list page size. - * @param {string} [request.pageToken] - * Optional. The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListEndpointsResponse.next_page_token|ListEndpointsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints|EndpointService.ListEndpoints} call. - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Endpoint]{@link google.cloud.aiplatform.v1beta1.Endpoint}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listEndpointsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listEndpoints( - request?: protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IEndpoint[], - protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListEndpointsResponse - ]>; - listEndpoints( - request: protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, - protos.google.cloud.aiplatform.v1beta1.IListEndpointsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IEndpoint>): void; - listEndpoints( - request: protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, - protos.google.cloud.aiplatform.v1beta1.IListEndpointsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IEndpoint>): void; - listEndpoints( - request?: protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, - protos.google.cloud.aiplatform.v1beta1.IListEndpointsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IEndpoint>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, - protos.google.cloud.aiplatform.v1beta1.IListEndpointsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IEndpoint>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IEndpoint[], - protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListEndpointsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listEndpoints(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location from which to list the Endpoints. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID, - * i.e. the last segment of the Endpoint's {@link google.cloud.aiplatform.v1beta1.Endpoint.name|resource name}. - * * `display_name` supports = and, != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `endpoint=1` - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @param {number} [request.pageSize] - * Optional. The standard list page size. - * @param {string} [request.pageToken] - * Optional. The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListEndpointsResponse.next_page_token|ListEndpointsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints|EndpointService.ListEndpoints} call. - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Endpoint]{@link google.cloud.aiplatform.v1beta1.Endpoint} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listEndpointsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listEndpointsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listEndpoints']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listEndpoints.createStream( - this.innerApiCalls.listEndpoints as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listEndpoints`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location from which to list the Endpoints. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID, - * i.e. the last segment of the Endpoint's {@link google.cloud.aiplatform.v1beta1.Endpoint.name|resource name}. - * * `display_name` supports = and, != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `endpoint=1` - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @param {number} [request.pageSize] - * Optional. The standard list page size. - * @param {string} [request.pageToken] - * Optional. The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListEndpointsResponse.next_page_token|ListEndpointsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints|EndpointService.ListEndpoints} call. - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Endpoint]{@link google.cloud.aiplatform.v1beta1.Endpoint}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_EndpointService_ListEndpoints_async - */ - listEndpointsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListEndpointsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listEndpoints']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listEndpoints.asyncIterate( - this.innerApiCalls['listEndpoints'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.endpointServiceStub && !this._terminated) { - return this.endpointServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_client_config.json deleted file mode 100644 index 4775abb5..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_client_config.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1beta1.EndpointService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateEndpoint": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetEndpoint": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListEndpoints": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateEndpoint": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteEndpoint": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeployModel": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UndeployModel": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_proto_list.json deleted file mode 100644 index c916ab12..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_proto_list.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/context.proto", - "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1beta1/event.proto", - "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/io.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/study.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1beta1/types.proto", - "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1beta1/value.proto", - "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts deleted file mode 100644 index ec79ef5c..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts +++ /dev/null @@ -1,2386 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, GoogleError} from 'google-gax'; - -import { PassThrough } from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/featurestore_online_serving_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './featurestore_online_serving_service_client_config.json'; - -const version = require('../../../package.json').version; - -/** - * A service for serving online feature values. - * @class - * @memberof v1beta1 - */ -export class FeaturestoreOnlineServingServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - featurestoreOnlineServingServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of FeaturestoreOnlineServingServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof FeaturestoreOnlineServingServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service provide streaming responses. - // Provide descriptors for these. - this.descriptors.stream = { - streamingReadFeatureValues: new this._gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.featurestoreOnlineServingServiceStub) { - return this.featurestoreOnlineServingServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService. - this.featurestoreOnlineServingServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const featurestoreOnlineServingServiceStubMethods = - ['readFeatureValues', 'streamingReadFeatureValues']; - for (const methodName of featurestoreOnlineServingServiceStubMethods) { - const callPromise = this.featurestoreOnlineServingServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - if (methodName in this.descriptors.stream) { - const stream = new PassThrough(); - setImmediate(() => { - stream.emit('error', new GoogleError('The client has already been closed.')); - }); - return stream; - } - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.stream[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.featurestoreOnlineServingServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Reads Feature values of a specific entity of an EntityType. For reading - * feature values of multiple entities of an EntityType, please use - * StreamingReadFeatureValues. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.entityType - * Required. The resource name of the EntityType for the entity being read. - * 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`. - * @param {string} request.entityId - * Required. ID for a specific entity. For example, - * for a machine learning model predicting user clicks on a website, an entity - * ID could be `user_123`. - * @param {google.cloud.aiplatform.v1beta1.FeatureSelector} request.featureSelector - * Required. Selector choosing Features of the target EntityType. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ReadFeatureValuesResponse]{@link google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreOnlineServingService_ReadFeatureValues_async - */ - readFeatureValues( - request?: protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesResponse, - protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest|undefined, {}|undefined - ]>; - readFeatureValues( - request: protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesResponse, - protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest|null|undefined, - {}|null|undefined>): void; - readFeatureValues( - request: protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesResponse, - protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest|null|undefined, - {}|null|undefined>): void; - readFeatureValues( - request?: protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesResponse, - protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesResponse, - protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesResponse, - protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'entity_type': request.entityType || '', - }); - this.initialize(); - return this.innerApiCalls.readFeatureValues(request, options, callback); - } - -/** - * Reads Feature values for multiple entities. Depending on their size, data - * for different entities may be broken - * up across multiple responses. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.entityType - * Required. The resource name of the entities' type. - * 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`. - * @param {string[]} request.entityIds - * Required. IDs of entities to read Feature values of. The maximum number of IDs is - * 100. For example, for a machine learning model predicting user clicks on a - * website, an entity ID could be `user_123`. - * @param {google.cloud.aiplatform.v1beta1.FeatureSelector} request.featureSelector - * Required. Selector choosing Features of the target EntityType. Feature IDs will be - * deduplicated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits [ReadFeatureValuesResponse]{@link google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse} on 'data' event. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreOnlineServingService_StreamingReadFeatureValues_async - */ - streamingReadFeatureValues( - request?: protos.google.cloud.aiplatform.v1beta1.IStreamingReadFeatureValuesRequest, - options?: CallOptions): - gax.CancellableStream{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'entity_type': request.entityType || '', - }); - this.initialize(); - return this.innerApiCalls.streamingReadFeatureValues(request, options); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.featurestoreOnlineServingServiceStub && !this._terminated) { - return this.featurestoreOnlineServingServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client_config.json deleted file mode 100644 index 0a2256f4..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client_config.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ReadFeatureValues": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "StreamingReadFeatureValues": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_proto_list.json deleted file mode 100644 index c916ab12..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_proto_list.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/context.proto", - "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1beta1/event.proto", - "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/io.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/study.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1beta1/types.proto", - "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1beta1/value.proto", - "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_client.ts deleted file mode 100644 index db5f3106..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_client.ts +++ /dev/null @@ -1,5310 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/featurestore_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './featurestore_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * The service that handles CRUD and List for resources for Featurestore. - * @class - * @memberof v1beta1 - */ -export class FeaturestoreServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - featurestoreServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of FeaturestoreServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof FeaturestoreServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listFeaturestores: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'featurestores'), - listEntityTypes: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'entityTypes'), - listFeatures: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'features'), - searchFeatures: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'features') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const createFeaturestoreResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.Featurestore') as gax.protobuf.Type; - const createFeaturestoreMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.CreateFeaturestoreOperationMetadata') as gax.protobuf.Type; - const updateFeaturestoreResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.Featurestore') as gax.protobuf.Type; - const updateFeaturestoreMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.UpdateFeaturestoreOperationMetadata') as gax.protobuf.Type; - const deleteFeaturestoreResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteFeaturestoreMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const createEntityTypeResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.EntityType') as gax.protobuf.Type; - const createEntityTypeMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.CreateEntityTypeOperationMetadata') as gax.protobuf.Type; - const deleteEntityTypeResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteEntityTypeMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const createFeatureResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.Feature') as gax.protobuf.Type; - const createFeatureMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.CreateFeatureOperationMetadata') as gax.protobuf.Type; - const batchCreateFeaturesResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.BatchCreateFeaturesResponse') as gax.protobuf.Type; - const batchCreateFeaturesMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.BatchCreateFeaturesOperationMetadata') as gax.protobuf.Type; - const deleteFeatureResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteFeatureMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const importFeatureValuesResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.ImportFeatureValuesResponse') as gax.protobuf.Type; - const importFeatureValuesMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata') as gax.protobuf.Type; - const batchReadFeatureValuesResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.BatchReadFeatureValuesResponse') as gax.protobuf.Type; - const batchReadFeatureValuesMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.BatchReadFeatureValuesOperationMetadata') as gax.protobuf.Type; - const exportFeatureValuesResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.ExportFeatureValuesResponse') as gax.protobuf.Type; - const exportFeatureValuesMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.ExportFeatureValuesOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createFeaturestore: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createFeaturestoreResponse.decode.bind(createFeaturestoreResponse), - createFeaturestoreMetadata.decode.bind(createFeaturestoreMetadata)), - updateFeaturestore: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateFeaturestoreResponse.decode.bind(updateFeaturestoreResponse), - updateFeaturestoreMetadata.decode.bind(updateFeaturestoreMetadata)), - deleteFeaturestore: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteFeaturestoreResponse.decode.bind(deleteFeaturestoreResponse), - deleteFeaturestoreMetadata.decode.bind(deleteFeaturestoreMetadata)), - createEntityType: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createEntityTypeResponse.decode.bind(createEntityTypeResponse), - createEntityTypeMetadata.decode.bind(createEntityTypeMetadata)), - deleteEntityType: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteEntityTypeResponse.decode.bind(deleteEntityTypeResponse), - deleteEntityTypeMetadata.decode.bind(deleteEntityTypeMetadata)), - createFeature: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createFeatureResponse.decode.bind(createFeatureResponse), - createFeatureMetadata.decode.bind(createFeatureMetadata)), - batchCreateFeatures: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - batchCreateFeaturesResponse.decode.bind(batchCreateFeaturesResponse), - batchCreateFeaturesMetadata.decode.bind(batchCreateFeaturesMetadata)), - deleteFeature: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteFeatureResponse.decode.bind(deleteFeatureResponse), - deleteFeatureMetadata.decode.bind(deleteFeatureMetadata)), - importFeatureValues: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - importFeatureValuesResponse.decode.bind(importFeatureValuesResponse), - importFeatureValuesMetadata.decode.bind(importFeatureValuesMetadata)), - batchReadFeatureValues: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - batchReadFeatureValuesResponse.decode.bind(batchReadFeatureValuesResponse), - batchReadFeatureValuesMetadata.decode.bind(batchReadFeatureValuesMetadata)), - exportFeatureValues: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - exportFeatureValuesResponse.decode.bind(exportFeatureValuesResponse), - exportFeatureValuesMetadata.decode.bind(exportFeatureValuesMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1beta1.FeaturestoreService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.featurestoreServiceStub) { - return this.featurestoreServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1beta1.FeaturestoreService. - this.featurestoreServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.FeaturestoreService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1beta1.FeaturestoreService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const featurestoreServiceStubMethods = - ['createFeaturestore', 'getFeaturestore', 'listFeaturestores', 'updateFeaturestore', 'deleteFeaturestore', 'createEntityType', 'getEntityType', 'listEntityTypes', 'updateEntityType', 'deleteEntityType', 'createFeature', 'batchCreateFeatures', 'getFeature', 'listFeatures', 'updateFeature', 'deleteFeature', 'importFeatureValues', 'batchReadFeatureValues', 'exportFeatureValues', 'searchFeatures']; - for (const methodName of featurestoreServiceStubMethods) { - const callPromise = this.featurestoreServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.featurestoreServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets details of a single Featurestore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Featurestore resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Featurestore]{@link google.cloud.aiplatform.v1beta1.Featurestore}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_GetFeaturestore_async - */ - getFeaturestore( - request?: protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IFeaturestore, - protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest|undefined, {}|undefined - ]>; - getFeaturestore( - request: protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IFeaturestore, - protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest|null|undefined, - {}|null|undefined>): void; - getFeaturestore( - request: protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IFeaturestore, - protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest|null|undefined, - {}|null|undefined>): void; - getFeaturestore( - request?: protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IFeaturestore, - protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IFeaturestore, - protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IFeaturestore, - protos.google.cloud.aiplatform.v1beta1.IGetFeaturestoreRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getFeaturestore(request, options, callback); - } -/** - * Gets details of a single EntityType. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the EntityType resource. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [EntityType]{@link google.cloud.aiplatform.v1beta1.EntityType}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_GetEntityType_async - */ - getEntityType( - request?: protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IEntityType, - protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest|undefined, {}|undefined - ]>; - getEntityType( - request: protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IEntityType, - protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest|null|undefined, - {}|null|undefined>): void; - getEntityType( - request: protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IEntityType, - protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest|null|undefined, - {}|null|undefined>): void; - getEntityType( - request?: protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IEntityType, - protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IEntityType, - protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IEntityType, - protos.google.cloud.aiplatform.v1beta1.IGetEntityTypeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getEntityType(request, options, callback); - } -/** - * Updates the parameters of a single EntityType. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1beta1.EntityType} request.entityType - * Required. The EntityType's `name` field is used to identify the EntityType to be - * updated. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {google.protobuf.FieldMask} request.updateMask - * Field mask is used to specify the fields to be overwritten in the - * EntityType resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then only the non-empty fields present in the - * request will be overwritten. Set the update_mask to `*` to override all - * fields. - * - * Updatable fields: - * - * * `description` - * * `labels` - * * `monitoring_config.snapshot_analysis.disabled` - * * `monitoring_config.snapshot_analysis.monitoring_interval_days` - * * `monitoring_config.snapshot_analysis.staleness_days` - * * `monitoring_config.import_features_analysis.state` - * * `monitoring_config.import_features_analysis.anomaly_detection_baseline` - * * `monitoring_config.numerical_threshold_config.value` - * * `monitoring_config.categorical_threshold_config.value` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [EntityType]{@link google.cloud.aiplatform.v1beta1.EntityType}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_UpdateEntityType_async - */ - updateEntityType( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IEntityType, - protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest|undefined, {}|undefined - ]>; - updateEntityType( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IEntityType, - protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest|null|undefined, - {}|null|undefined>): void; - updateEntityType( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IEntityType, - protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest|null|undefined, - {}|null|undefined>): void; - updateEntityType( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IEntityType, - protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IEntityType, - protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IEntityType, - protos.google.cloud.aiplatform.v1beta1.IUpdateEntityTypeRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'entity_type.name': request.entityType!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateEntityType(request, options, callback); - } -/** - * Gets details of a single Feature. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Feature resource. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Feature]{@link google.cloud.aiplatform.v1beta1.Feature}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_GetFeature_async - */ - getFeature( - request?: protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IFeature, - protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest|undefined, {}|undefined - ]>; - getFeature( - request: protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IFeature, - protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest|null|undefined, - {}|null|undefined>): void; - getFeature( - request: protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IFeature, - protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest|null|undefined, - {}|null|undefined>): void; - getFeature( - request?: protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IFeature, - protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IFeature, - protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IFeature, - protos.google.cloud.aiplatform.v1beta1.IGetFeatureRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getFeature(request, options, callback); - } -/** - * Updates the parameters of a single Feature. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1beta1.Feature} request.feature - * Required. The Feature's `name` field is used to identify the Feature to be - * updated. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` - * @param {google.protobuf.FieldMask} request.updateMask - * Field mask is used to specify the fields to be overwritten in the - * Features resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then only the non-empty fields present in the - * request will be overwritten. Set the update_mask to `*` to override all - * fields. - * - * Updatable fields: - * - * * `description` - * * `labels` - * * `disable_monitoring` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Feature]{@link google.cloud.aiplatform.v1beta1.Feature}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_UpdateFeature_async - */ - updateFeature( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IFeature, - protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest|undefined, {}|undefined - ]>; - updateFeature( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IFeature, - protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest|null|undefined, - {}|null|undefined>): void; - updateFeature( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IFeature, - protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest|null|undefined, - {}|null|undefined>): void; - updateFeature( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IFeature, - protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IFeature, - protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IFeature, - protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'feature.name': request.feature!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateFeature(request, options, callback); - } - -/** - * Creates a new Featurestore in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create Featurestores. - * Format: - * `projects/{project}/locations/{location}'` - * @param {google.cloud.aiplatform.v1beta1.Featurestore} request.featurestore - * Required. The Featurestore to create. - * @param {string} request.featurestoreId - * Required. The ID to use for this Featurestore, which will become the final component - * of the Featurestore's resource name. - * - * This value may be up to 60 characters, and valid characters are - * `[a-z0-9_]`. The first character cannot be a number. - * - * The value must be unique within the project and location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_CreateFeaturestore_async - */ - createFeaturestore( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateFeaturestoreRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createFeaturestore( - request: protos.google.cloud.aiplatform.v1beta1.ICreateFeaturestoreRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createFeaturestore( - request: protos.google.cloud.aiplatform.v1beta1.ICreateFeaturestoreRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createFeaturestore( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateFeaturestoreRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createFeaturestore(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createFeaturestore()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_CreateFeaturestore_async - */ - async checkCreateFeaturestoreProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createFeaturestore, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the parameters of a single Featurestore. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1beta1.Featurestore} request.featurestore - * Required. The Featurestore's `name` field is used to identify the Featurestore to be - * updated. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param {google.protobuf.FieldMask} request.updateMask - * Field mask is used to specify the fields to be overwritten in the - * Featurestore resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then only the non-empty fields present in the - * request will be overwritten. Set the update_mask to `*` to override all - * fields. - * - * Updatable fields: - * - * * `labels` - * * `online_serving_config.fixed_node_count` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_UpdateFeaturestore_async - */ - updateFeaturestore( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateFeaturestoreRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateFeaturestore( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateFeaturestoreRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateFeaturestore( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateFeaturestoreRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateFeaturestore( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateFeaturestoreRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'featurestore.name': request.featurestore!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateFeaturestore(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateFeaturestore()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_UpdateFeaturestore_async - */ - async checkUpdateFeaturestoreProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateFeaturestore, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single Featurestore. The Featurestore must not contain any - * EntityTypes or `force` must be set to true for the request to succeed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Featurestore to be deleted. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param {boolean} request.force - * If set to true, any EntityTypes and Features for this Featurestore will - * also be deleted. (Otherwise, the request will only work if the Featurestore - * has no EntityTypes.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_DeleteFeaturestore_async - */ - deleteFeaturestore( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteFeaturestoreRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteFeaturestore( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteFeaturestoreRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteFeaturestore( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteFeaturestoreRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteFeaturestore( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteFeaturestoreRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteFeaturestore(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteFeaturestore()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_DeleteFeaturestore_async - */ - async checkDeleteFeaturestoreProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteFeaturestore, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a new EntityType in a given Featurestore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Featurestore to create EntityTypes. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param {google.cloud.aiplatform.v1beta1.EntityType} request.entityType - * The EntityType to create. - * @param {string} request.entityTypeId - * Required. The ID to use for the EntityType, which will become the final component of - * the EntityType's resource name. - * - * This value may be up to 60 characters, and valid characters are - * `[a-z0-9_]`. The first character cannot be a number. - * - * The value must be unique within a featurestore. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_CreateEntityType_async - */ - createEntityType( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateEntityTypeRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createEntityType( - request: protos.google.cloud.aiplatform.v1beta1.ICreateEntityTypeRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createEntityType( - request: protos.google.cloud.aiplatform.v1beta1.ICreateEntityTypeRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createEntityType( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateEntityTypeRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createEntityType(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createEntityType()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_CreateEntityType_async - */ - async checkCreateEntityTypeProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createEntityType, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single EntityType. The EntityType must not have any Features - * or `force` must be set to true for the request to succeed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the EntityType to be deleted. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {boolean} request.force - * If set to true, any Features for this EntityType will also be deleted. - * (Otherwise, the request will only work if the EntityType has no Features.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_DeleteEntityType_async - */ - deleteEntityType( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteEntityTypeRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteEntityType( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteEntityTypeRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteEntityType( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteEntityTypeRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteEntityType( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteEntityTypeRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteEntityType(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteEntityType()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_DeleteEntityType_async - */ - async checkDeleteEntityTypeProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteEntityType, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a new Feature in a given EntityType. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the EntityType to create a Feature. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {google.cloud.aiplatform.v1beta1.Feature} request.feature - * Required. The Feature to create. - * @param {string} request.featureId - * Required. The ID to use for the Feature, which will become the final component of - * the Feature's resource name. - * - * This value may be up to 60 characters, and valid characters are - * `[a-z0-9_]`. The first character cannot be a number. - * - * The value must be unique within an EntityType. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_CreateFeature_async - */ - createFeature( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateFeatureRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createFeature( - request: protos.google.cloud.aiplatform.v1beta1.ICreateFeatureRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createFeature( - request: protos.google.cloud.aiplatform.v1beta1.ICreateFeatureRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createFeature( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateFeatureRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createFeature(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createFeature()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_CreateFeature_async - */ - async checkCreateFeatureProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createFeature, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a batch of Features in a given EntityType. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the EntityType to create the batch of Features under. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {number[]} request.requests - * Required. The request message specifying the Features to create. All Features must be - * created under the same parent EntityType. The `parent` field in each child - * request message can be omitted. If `parent` is set in a child request, then - * the value must match the `parent` value in this request message. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_BatchCreateFeatures_async - */ - batchCreateFeatures( - request?: protos.google.cloud.aiplatform.v1beta1.IBatchCreateFeaturesRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - batchCreateFeatures( - request: protos.google.cloud.aiplatform.v1beta1.IBatchCreateFeaturesRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchCreateFeatures( - request: protos.google.cloud.aiplatform.v1beta1.IBatchCreateFeaturesRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchCreateFeatures( - request?: protos.google.cloud.aiplatform.v1beta1.IBatchCreateFeaturesRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.batchCreateFeatures(request, options, callback); - } -/** - * Check the status of the long running operation returned by `batchCreateFeatures()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_BatchCreateFeatures_async - */ - async checkBatchCreateFeaturesProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.batchCreateFeatures, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single Feature. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Features to be deleted. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_DeleteFeature_async - */ - deleteFeature( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteFeatureRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteFeature( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteFeatureRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteFeature( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteFeatureRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteFeature( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteFeatureRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteFeature(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteFeature()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_DeleteFeature_async - */ - async checkDeleteFeatureProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteFeature, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Imports Feature values into the Featurestore from a source storage. - * - * The progress of the import is tracked by the returned operation. The - * imported features are guaranteed to be visible to subsequent read - * operations after the operation is marked as successfully done. - * - * If an import operation fails, the Feature values returned from - * reads and exports may be inconsistent. If consistency is - * required, the caller must retry the same import request again and wait till - * the new operation returned is marked as successfully done. - * - * There are also scenarios where the caller can cause inconsistency. - * - * - Source data for import contains multiple distinct Feature values for - * the same entity ID and timestamp. - * - Source is modified during an import. This includes adding, updating, or - * removing source data and/or metadata. Examples of updating metadata - * include but are not limited to changing storage location, storage class, - * or retention policy. - * - Online serving cluster is under-provisioned. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1beta1.AvroSource} request.avroSource - * @param {google.cloud.aiplatform.v1beta1.BigQuerySource} request.bigquerySource - * @param {google.cloud.aiplatform.v1beta1.CsvSource} request.csvSource - * @param {string} request.featureTimeField - * Source column that holds the Feature timestamp for all Feature - * values in each entity. - * @param {google.protobuf.Timestamp} request.featureTime - * Single Feature timestamp for all entities being imported. The - * timestamp must not have higher than millisecond precision. - * @param {string} request.entityType - * Required. The resource name of the EntityType grouping the Features for which values - * are being imported. Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entityType}` - * @param {string} request.entityIdField - * Source column that holds entity IDs. If not provided, entity IDs are - * extracted from the column named `entity_id`. - * @param {number[]} request.featureSpecs - * Required. Specifications defining which Feature values to import from the entity. The - * request fails if no feature_specs are provided, and having multiple - * feature_specs for one Feature is not allowed. - * @param {boolean} request.disableOnlineServing - * If set, data will not be imported for online serving. This - * is typically used for backfilling, where Feature generation timestamps are - * not in the timestamp range needed for online serving. - * @param {number} request.workerCount - * Specifies the number of workers that are used to write data to the - * Featurestore. Consider the online serving capacity that you require to - * achieve the desired import throughput without interfering with online - * serving. The value must be positive, and less than or equal to 100. - * If not set, defaults to using 1 worker. The low count ensures minimal - * impact on online serving performance. - * @param {boolean} request.disableIngestionAnalysis - * If true, API doesn't start ingestion analysis pipeline. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_ImportFeatureValues_async - */ - importFeatureValues( - request?: protos.google.cloud.aiplatform.v1beta1.IImportFeatureValuesRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - importFeatureValues( - request: protos.google.cloud.aiplatform.v1beta1.IImportFeatureValuesRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importFeatureValues( - request: protos.google.cloud.aiplatform.v1beta1.IImportFeatureValuesRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importFeatureValues( - request?: protos.google.cloud.aiplatform.v1beta1.IImportFeatureValuesRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'entity_type': request.entityType || '', - }); - this.initialize(); - return this.innerApiCalls.importFeatureValues(request, options, callback); - } -/** - * Check the status of the long running operation returned by `importFeatureValues()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_ImportFeatureValues_async - */ - async checkImportFeatureValuesProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.importFeatureValues, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Batch reads Feature values from a Featurestore. - * - * This API enables batch reading Feature values, where each read - * instance in the batch may read Feature values of entities from one or - * more EntityTypes. Point-in-time correctness is guaranteed for Feature - * values of each read instance as of each instance's read timestamp. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1beta1.CsvSource} request.csvReadInstances - * Each read instance consists of exactly one read timestamp and one or more - * entity IDs identifying entities of the corresponding EntityTypes whose - * Features are requested. - * - * Each output instance contains Feature values of requested entities - * concatenated together as of the read time. - * - * An example read instance may be `foo_entity_id, bar_entity_id, - * 2020-01-01T10:00:00.123Z`. - * - * An example output instance may be `foo_entity_id, bar_entity_id, - * 2020-01-01T10:00:00.123Z, foo_entity_feature1_value, - * bar_entity_feature2_value`. - * - * Timestamp in each read instance must be millisecond-aligned. - * - * `csv_read_instances` are read instances stored in a plain-text CSV file. - * The header should be: - * [ENTITY_TYPE_ID1], [ENTITY_TYPE_ID2], ..., timestamp - * - * The columns can be in any order. - * - * Values in the timestamp column must use the RFC 3339 format, e.g. - * `2012-07-30T10:43:17.123Z`. - * @param {google.cloud.aiplatform.v1beta1.BigQuerySource} request.bigqueryReadInstances - * Similar to csv_read_instances, but from BigQuery source. - * @param {string} request.featurestore - * Required. The resource name of the Featurestore from which to query Feature values. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param {google.cloud.aiplatform.v1beta1.FeatureValueDestination} request.destination - * Required. Specifies output location and format. - * @param {number[]} request.passThroughFields - * When not empty, the specified fields in the *_read_instances source will be - * joined as-is in the output, in addition to those fields from the - * Featurestore Entity. - * - * For BigQuery source, the type of the pass-through values will be - * automatically inferred. For CSV source, the pass-through values will be - * passed as opaque bytes. - * @param {number[]} request.entityTypeSpecs - * Required. Specifies EntityType grouping Features to read values of and settings. - * Each EntityType referenced in - * [BatchReadFeatureValuesRequest.entity_type_specs] must have a column - * specifying entity IDs in the EntityType in - * {@link |BatchReadFeatureValuesRequest.request} . - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_BatchReadFeatureValues_async - */ - batchReadFeatureValues( - request?: protos.google.cloud.aiplatform.v1beta1.IBatchReadFeatureValuesRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - batchReadFeatureValues( - request: protos.google.cloud.aiplatform.v1beta1.IBatchReadFeatureValuesRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchReadFeatureValues( - request: protos.google.cloud.aiplatform.v1beta1.IBatchReadFeatureValuesRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchReadFeatureValues( - request?: protos.google.cloud.aiplatform.v1beta1.IBatchReadFeatureValuesRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'featurestore': request.featurestore || '', - }); - this.initialize(); - return this.innerApiCalls.batchReadFeatureValues(request, options, callback); - } -/** - * Check the status of the long running operation returned by `batchReadFeatureValues()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_BatchReadFeatureValues_async - */ - async checkBatchReadFeatureValuesProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.batchReadFeatureValues, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Exports Feature values from all the entities of a target EntityType. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1beta1.ExportFeatureValuesRequest.SnapshotExport} request.snapshotExport - * Exports the latest Feature values of all entities of the EntityType - * within a time range. - * @param {google.cloud.aiplatform.v1beta1.ExportFeatureValuesRequest.FullExport} request.fullExport - * Exports all historical values of all entities of the EntityType within a - * time range - * @param {string} request.entityType - * Required. The resource name of the EntityType from which to export Feature values. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {google.cloud.aiplatform.v1beta1.FeatureValueDestination} request.destination - * Required. Specifies destination location and format. - * @param {google.cloud.aiplatform.v1beta1.FeatureSelector} request.featureSelector - * Required. Selects Features to export values of. - * @param {number[]} request.settings - * Per-Feature export settings. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_ExportFeatureValues_async - */ - exportFeatureValues( - request?: protos.google.cloud.aiplatform.v1beta1.IExportFeatureValuesRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - exportFeatureValues( - request: protos.google.cloud.aiplatform.v1beta1.IExportFeatureValuesRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportFeatureValues( - request: protos.google.cloud.aiplatform.v1beta1.IExportFeatureValuesRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportFeatureValues( - request?: protos.google.cloud.aiplatform.v1beta1.IExportFeatureValuesRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'entity_type': request.entityType || '', - }); - this.initialize(); - return this.innerApiCalls.exportFeatureValues(request, options, callback); - } -/** - * Check the status of the long running operation returned by `exportFeatureValues()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_ExportFeatureValues_async - */ - async checkExportFeatureValuesProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.exportFeatureValues, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Featurestores in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list Featurestores. - * Format: - * `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the featurestores that match the filter expression. The following - * fields are supported: - * - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be - * in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be - * in RFC 3339 format. - * * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, - * `<=`, and `>=` comparisons. - * * `labels`: Supports key-value equality and key presence. - * - * Examples: - * - * * `create_time > "2020-01-01" OR update_time > "2020-01-01"` - * Featurestores created or updated after 2020-01-01. - * * `labels.env = "prod"` - * Featurestores with label "env" set to "prod". - * @param {number} request.pageSize - * The maximum number of Featurestores to return. The service may return fewer - * than this value. If unspecified, at most 100 Featurestores will be - * returned. The maximum value is 100; any value greater than 100 will be - * coerced to 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} must - * match the call that provided the page token. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported Fields: - * - * * `create_time` - * * `update_time` - * * `online_serving_config.fixed_node_count` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Featurestore]{@link google.cloud.aiplatform.v1beta1.Featurestore}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listFeaturestoresAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listFeaturestores( - request?: protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IFeaturestore[], - protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresResponse - ]>; - listFeaturestores( - request: protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, - protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IFeaturestore>): void; - listFeaturestores( - request: protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, - protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IFeaturestore>): void; - listFeaturestores( - request?: protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, - protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IFeaturestore>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, - protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IFeaturestore>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IFeaturestore[], - protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listFeaturestores(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list Featurestores. - * Format: - * `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the featurestores that match the filter expression. The following - * fields are supported: - * - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be - * in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be - * in RFC 3339 format. - * * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, - * `<=`, and `>=` comparisons. - * * `labels`: Supports key-value equality and key presence. - * - * Examples: - * - * * `create_time > "2020-01-01" OR update_time > "2020-01-01"` - * Featurestores created or updated after 2020-01-01. - * * `labels.env = "prod"` - * Featurestores with label "env" set to "prod". - * @param {number} request.pageSize - * The maximum number of Featurestores to return. The service may return fewer - * than this value. If unspecified, at most 100 Featurestores will be - * returned. The maximum value is 100; any value greater than 100 will be - * coerced to 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} must - * match the call that provided the page token. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported Fields: - * - * * `create_time` - * * `update_time` - * * `online_serving_config.fixed_node_count` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Featurestore]{@link google.cloud.aiplatform.v1beta1.Featurestore} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listFeaturestoresAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listFeaturestoresStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listFeaturestores']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listFeaturestores.createStream( - this.innerApiCalls.listFeaturestores as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listFeaturestores`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list Featurestores. - * Format: - * `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the featurestores that match the filter expression. The following - * fields are supported: - * - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be - * in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be - * in RFC 3339 format. - * * `online_serving_config.fixed_node_count`: Supports `=`, `!=`, `<`, `>`, - * `<=`, and `>=` comparisons. - * * `labels`: Supports key-value equality and key presence. - * - * Examples: - * - * * `create_time > "2020-01-01" OR update_time > "2020-01-01"` - * Featurestores created or updated after 2020-01-01. - * * `labels.env = "prod"` - * Featurestores with label "env" set to "prod". - * @param {number} request.pageSize - * The maximum number of Featurestores to return. The service may return fewer - * than this value. If unspecified, at most 100 Featurestores will be - * returned. The maximum value is 100; any value greater than 100 will be - * coerced to 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeaturestores|FeaturestoreService.ListFeaturestores} must - * match the call that provided the page token. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported Fields: - * - * * `create_time` - * * `update_time` - * * `online_serving_config.fixed_node_count` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Featurestore]{@link google.cloud.aiplatform.v1beta1.Featurestore}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_ListFeaturestores_async - */ - listFeaturestoresAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListFeaturestoresRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listFeaturestores']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listFeaturestores.asyncIterate( - this.innerApiCalls['listFeaturestores'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists EntityTypes in a given Featurestore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Featurestore to list EntityTypes. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param {string} request.filter - * Lists the EntityTypes that match the filter expression. The following - * filters are supported: - * - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - * Values must be in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - * Values must be in RFC 3339 format. - * * `labels`: Supports key-value equality as well as key presence. - * - * Examples: - * - * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - * or updated after 2020-01-31T15:30:00.000000Z. - * * `labels.active = yes AND labels.env = prod` --> EntityTypes having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any EntityType which has a label with 'env' as the - * key. - * @param {number} request.pageSize - * The maximum number of EntityTypes to return. The service may return fewer - * than this value. If unspecified, at most 1000 EntityTypes will be returned. - * The maximum value is 1000; any value greater than 1000 will be coerced to - * 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} must - * match the call that provided the page token. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * - * Supported fields: - * - * * `entity_type_id` - * * `create_time` - * * `update_time` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [EntityType]{@link google.cloud.aiplatform.v1beta1.EntityType}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listEntityTypesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listEntityTypes( - request?: protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IEntityType[], - protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListEntityTypesResponse - ]>; - listEntityTypes( - request: protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, - protos.google.cloud.aiplatform.v1beta1.IListEntityTypesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IEntityType>): void; - listEntityTypes( - request: protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, - protos.google.cloud.aiplatform.v1beta1.IListEntityTypesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IEntityType>): void; - listEntityTypes( - request?: protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, - protos.google.cloud.aiplatform.v1beta1.IListEntityTypesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IEntityType>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, - protos.google.cloud.aiplatform.v1beta1.IListEntityTypesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IEntityType>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IEntityType[], - protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListEntityTypesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listEntityTypes(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Featurestore to list EntityTypes. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param {string} request.filter - * Lists the EntityTypes that match the filter expression. The following - * filters are supported: - * - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - * Values must be in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - * Values must be in RFC 3339 format. - * * `labels`: Supports key-value equality as well as key presence. - * - * Examples: - * - * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - * or updated after 2020-01-31T15:30:00.000000Z. - * * `labels.active = yes AND labels.env = prod` --> EntityTypes having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any EntityType which has a label with 'env' as the - * key. - * @param {number} request.pageSize - * The maximum number of EntityTypes to return. The service may return fewer - * than this value. If unspecified, at most 1000 EntityTypes will be returned. - * The maximum value is 1000; any value greater than 1000 will be coerced to - * 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} must - * match the call that provided the page token. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * - * Supported fields: - * - * * `entity_type_id` - * * `create_time` - * * `update_time` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [EntityType]{@link google.cloud.aiplatform.v1beta1.EntityType} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listEntityTypesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listEntityTypesStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listEntityTypes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listEntityTypes.createStream( - this.innerApiCalls.listEntityTypes as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listEntityTypes`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Featurestore to list EntityTypes. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}` - * @param {string} request.filter - * Lists the EntityTypes that match the filter expression. The following - * filters are supported: - * - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - * Values must be in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `>=`, and `<=` comparisons. - * Values must be in RFC 3339 format. - * * `labels`: Supports key-value equality as well as key presence. - * - * Examples: - * - * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - * or updated after 2020-01-31T15:30:00.000000Z. - * * `labels.active = yes AND labels.env = prod` --> EntityTypes having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any EntityType which has a label with 'env' as the - * key. - * @param {number} request.pageSize - * The maximum number of EntityTypes to return. The service may return fewer - * than this value. If unspecified, at most 1000 EntityTypes will be returned. - * The maximum value is 1000; any value greater than 1000 will be coerced to - * 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListEntityTypes|FeaturestoreService.ListEntityTypes} must - * match the call that provided the page token. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * - * Supported fields: - * - * * `entity_type_id` - * * `create_time` - * * `update_time` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [EntityType]{@link google.cloud.aiplatform.v1beta1.EntityType}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_ListEntityTypes_async - */ - listEntityTypesAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListEntityTypesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listEntityTypes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listEntityTypes.asyncIterate( - this.innerApiCalls['listEntityTypes'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists Features in a given EntityType. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list Features. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {string} request.filter - * Lists the Features that match the filter expression. The following - * filters are supported: - * - * * `value_type`: Supports = and != comparisons. - * * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - * be in RFC 3339 format. - * * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - * be in RFC 3339 format. - * * `labels`: Supports key-value equality as well as key presence. - * - * Examples: - * - * * `value_type = DOUBLE` --> Features whose type is DOUBLE. - * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - * or updated after 2020-01-31T15:30:00.000000Z. - * * `labels.active = yes AND labels.env = prod` --> Features having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any Feature which has a label with 'env' as the - * key. - * @param {number} request.pageSize - * The maximum number of Features to return. The service may return fewer - * than this value. If unspecified, at most 1000 Features will be returned. - * The maximum value is 1000; any value greater than 1000 will be coerced to - * 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} must - * match the call that provided the page token. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * - * * `feature_id` - * * `value_type` - * * `create_time` - * * `update_time` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {number} request.latestStatsCount - * If set, return the most recent {@link google.cloud.aiplatform.v1beta1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count} - * of stats for each Feature in response. Valid value is [0, 10]. If number of - * stats exists < {@link google.cloud.aiplatform.v1beta1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count}, return all - * existing stats. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Feature]{@link google.cloud.aiplatform.v1beta1.Feature}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listFeaturesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listFeatures( - request?: protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IFeature[], - protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListFeaturesResponse - ]>; - listFeatures( - request: protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, - protos.google.cloud.aiplatform.v1beta1.IListFeaturesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IFeature>): void; - listFeatures( - request: protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, - protos.google.cloud.aiplatform.v1beta1.IListFeaturesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IFeature>): void; - listFeatures( - request?: protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, - protos.google.cloud.aiplatform.v1beta1.IListFeaturesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IFeature>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, - protos.google.cloud.aiplatform.v1beta1.IListFeaturesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IFeature>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IFeature[], - protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListFeaturesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listFeatures(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list Features. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {string} request.filter - * Lists the Features that match the filter expression. The following - * filters are supported: - * - * * `value_type`: Supports = and != comparisons. - * * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - * be in RFC 3339 format. - * * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - * be in RFC 3339 format. - * * `labels`: Supports key-value equality as well as key presence. - * - * Examples: - * - * * `value_type = DOUBLE` --> Features whose type is DOUBLE. - * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - * or updated after 2020-01-31T15:30:00.000000Z. - * * `labels.active = yes AND labels.env = prod` --> Features having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any Feature which has a label with 'env' as the - * key. - * @param {number} request.pageSize - * The maximum number of Features to return. The service may return fewer - * than this value. If unspecified, at most 1000 Features will be returned. - * The maximum value is 1000; any value greater than 1000 will be coerced to - * 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} must - * match the call that provided the page token. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * - * * `feature_id` - * * `value_type` - * * `create_time` - * * `update_time` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {number} request.latestStatsCount - * If set, return the most recent {@link google.cloud.aiplatform.v1beta1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count} - * of stats for each Feature in response. Valid value is [0, 10]. If number of - * stats exists < {@link google.cloud.aiplatform.v1beta1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count}, return all - * existing stats. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Feature]{@link google.cloud.aiplatform.v1beta1.Feature} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listFeaturesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listFeaturesStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listFeatures']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listFeatures.createStream( - this.innerApiCalls.listFeatures as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listFeatures`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list Features. - * Format: - * `projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}` - * @param {string} request.filter - * Lists the Features that match the filter expression. The following - * filters are supported: - * - * * `value_type`: Supports = and != comparisons. - * * `create_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - * be in RFC 3339 format. - * * `update_time`: Supports =, !=, <, >, >=, and <= comparisons. Values must - * be in RFC 3339 format. - * * `labels`: Supports key-value equality as well as key presence. - * - * Examples: - * - * * `value_type = DOUBLE` --> Features whose type is DOUBLE. - * * `create_time > \"2020-01-31T15:30:00.000000Z\" OR - * update_time > \"2020-01-31T15:30:00.000000Z\"` --> EntityTypes created - * or updated after 2020-01-31T15:30:00.000000Z. - * * `labels.active = yes AND labels.env = prod` --> Features having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any Feature which has a label with 'env' as the - * key. - * @param {number} request.pageSize - * The maximum number of Features to return. The service may return fewer - * than this value. If unspecified, at most 1000 Features will be returned. - * The maximum value is 1000; any value greater than 1000 will be coerced to - * 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.ListFeatures|FeaturestoreService.ListFeatures} must - * match the call that provided the page token. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order. - * Use "desc" after a field name for descending. - * Supported fields: - * - * * `feature_id` - * * `value_type` - * * `create_time` - * * `update_time` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {number} request.latestStatsCount - * If set, return the most recent {@link google.cloud.aiplatform.v1beta1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count} - * of stats for each Feature in response. Valid value is [0, 10]. If number of - * stats exists < {@link google.cloud.aiplatform.v1beta1.ListFeaturesRequest.latest_stats_count|ListFeaturesRequest.latest_stats_count}, return all - * existing stats. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Feature]{@link google.cloud.aiplatform.v1beta1.Feature}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_ListFeatures_async - */ - listFeaturesAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListFeaturesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listFeatures']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listFeatures.asyncIterate( - this.innerApiCalls['listFeatures'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Searches Features matching a query in a given project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.location - * Required. The resource name of the Location to search Features. - * Format: - * `projects/{project}/locations/{location}` - * @param {string} request.query - * Query string that is a conjunction of field-restricted queries and/or - * field-restricted filters. Field-restricted queries and filters can be - * combined using `AND` to form a conjunction. - * - * A field query is in the form FIELD:QUERY. This implicitly checks if QUERY - * exists as a substring within Feature's FIELD. The QUERY - * and the FIELD are converted to a sequence of words (i.e. tokens) for - * comparison. This is done by: - * - * * Removing leading/trailing whitespace and tokenizing the search value. - * Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore - * `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated - * as a wildcard that matches characters within a token. - * * Ignoring case. - * * Prepending an asterisk to the first and appending an asterisk to the - * last token in QUERY. - * - * A QUERY must be either a singular token or a phrase. A phrase is one or - * multiple words enclosed in double quotation marks ("). With phrases, the - * order of the words is important. Words in the phrase must be matching in - * order and consecutively. - * - * Supported FIELDs for field-restricted queries: - * - * * `feature_id` - * * `description` - * * `entity_type_id` - * - * Examples: - * - * * `feature_id: foo` --> Matches a Feature with ID containing the substring - * `foo` (eg. `foo`, `foofeature`, `barfoo`). - * * `feature_id: foo*feature` --> Matches a Feature with ID containing the - * substring `foo*feature` (eg. `foobarfeature`). - * * `feature_id: foo AND description: bar` --> Matches a Feature with ID - * containing the substring `foo` and description containing the substring - * `bar`. - * - * - * Besides field queries, the following exact-match filters are - * supported. The exact-match filters do not support wildcards. Unlike - * field-restricted queries, exact-match filters are case-sensitive. - * - * * `feature_id`: Supports = comparisons. - * * `description`: Supports = comparisons. Multi-token filters should be - * enclosed in quotes. - * * `entity_type_id`: Supports = comparisons. - * * `value_type`: Supports = and != comparisons. - * * `labels`: Supports key-value equality as well as key presence. - * * `featurestore_id`: Supports = comparisons. - * - * Examples: - * * `description = "foo bar"` --> Any Feature with description exactly equal - * to `foo bar` - * * `value_type = DOUBLE` --> Features whose type is DOUBLE. - * * `labels.active = yes AND labels.env = prod` --> Features having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any Feature which has a label with `env` as the - * key. - * @param {number} request.pageSize - * The maximum number of Features to return. The service may return fewer - * than this value. If unspecified, at most 100 Features will be returned. - * The maximum value is 100; any value greater than 100 will be coerced to - * 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures}, except `page_size`, must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Feature]{@link google.cloud.aiplatform.v1beta1.Feature}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `searchFeaturesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - searchFeatures( - request?: protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IFeature[], - protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest|null, - protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesResponse - ]>; - searchFeatures( - request: protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, - protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IFeature>): void; - searchFeatures( - request: protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, - protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IFeature>): void; - searchFeatures( - request?: protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, - protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IFeature>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, - protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IFeature>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IFeature[], - protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest|null, - protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'location': request.location || '', - }); - this.initialize(); - return this.innerApiCalls.searchFeatures(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.location - * Required. The resource name of the Location to search Features. - * Format: - * `projects/{project}/locations/{location}` - * @param {string} request.query - * Query string that is a conjunction of field-restricted queries and/or - * field-restricted filters. Field-restricted queries and filters can be - * combined using `AND` to form a conjunction. - * - * A field query is in the form FIELD:QUERY. This implicitly checks if QUERY - * exists as a substring within Feature's FIELD. The QUERY - * and the FIELD are converted to a sequence of words (i.e. tokens) for - * comparison. This is done by: - * - * * Removing leading/trailing whitespace and tokenizing the search value. - * Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore - * `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated - * as a wildcard that matches characters within a token. - * * Ignoring case. - * * Prepending an asterisk to the first and appending an asterisk to the - * last token in QUERY. - * - * A QUERY must be either a singular token or a phrase. A phrase is one or - * multiple words enclosed in double quotation marks ("). With phrases, the - * order of the words is important. Words in the phrase must be matching in - * order and consecutively. - * - * Supported FIELDs for field-restricted queries: - * - * * `feature_id` - * * `description` - * * `entity_type_id` - * - * Examples: - * - * * `feature_id: foo` --> Matches a Feature with ID containing the substring - * `foo` (eg. `foo`, `foofeature`, `barfoo`). - * * `feature_id: foo*feature` --> Matches a Feature with ID containing the - * substring `foo*feature` (eg. `foobarfeature`). - * * `feature_id: foo AND description: bar` --> Matches a Feature with ID - * containing the substring `foo` and description containing the substring - * `bar`. - * - * - * Besides field queries, the following exact-match filters are - * supported. The exact-match filters do not support wildcards. Unlike - * field-restricted queries, exact-match filters are case-sensitive. - * - * * `feature_id`: Supports = comparisons. - * * `description`: Supports = comparisons. Multi-token filters should be - * enclosed in quotes. - * * `entity_type_id`: Supports = comparisons. - * * `value_type`: Supports = and != comparisons. - * * `labels`: Supports key-value equality as well as key presence. - * * `featurestore_id`: Supports = comparisons. - * - * Examples: - * * `description = "foo bar"` --> Any Feature with description exactly equal - * to `foo bar` - * * `value_type = DOUBLE` --> Features whose type is DOUBLE. - * * `labels.active = yes AND labels.env = prod` --> Features having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any Feature which has a label with `env` as the - * key. - * @param {number} request.pageSize - * The maximum number of Features to return. The service may return fewer - * than this value. If unspecified, at most 100 Features will be returned. - * The maximum value is 100; any value greater than 100 will be coerced to - * 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures}, except `page_size`, must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Feature]{@link google.cloud.aiplatform.v1beta1.Feature} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `searchFeaturesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - searchFeaturesStream( - request?: protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'location': request.location || '', - }); - const defaultCallSettings = this._defaults['searchFeatures']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchFeatures.createStream( - this.innerApiCalls.searchFeatures as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `searchFeatures`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.location - * Required. The resource name of the Location to search Features. - * Format: - * `projects/{project}/locations/{location}` - * @param {string} request.query - * Query string that is a conjunction of field-restricted queries and/or - * field-restricted filters. Field-restricted queries and filters can be - * combined using `AND` to form a conjunction. - * - * A field query is in the form FIELD:QUERY. This implicitly checks if QUERY - * exists as a substring within Feature's FIELD. The QUERY - * and the FIELD are converted to a sequence of words (i.e. tokens) for - * comparison. This is done by: - * - * * Removing leading/trailing whitespace and tokenizing the search value. - * Characters that are not one of alphanumeric `[a-zA-Z0-9]`, underscore - * `_`, or asterisk `*` are treated as delimiters for tokens. `*` is treated - * as a wildcard that matches characters within a token. - * * Ignoring case. - * * Prepending an asterisk to the first and appending an asterisk to the - * last token in QUERY. - * - * A QUERY must be either a singular token or a phrase. A phrase is one or - * multiple words enclosed in double quotation marks ("). With phrases, the - * order of the words is important. Words in the phrase must be matching in - * order and consecutively. - * - * Supported FIELDs for field-restricted queries: - * - * * `feature_id` - * * `description` - * * `entity_type_id` - * - * Examples: - * - * * `feature_id: foo` --> Matches a Feature with ID containing the substring - * `foo` (eg. `foo`, `foofeature`, `barfoo`). - * * `feature_id: foo*feature` --> Matches a Feature with ID containing the - * substring `foo*feature` (eg. `foobarfeature`). - * * `feature_id: foo AND description: bar` --> Matches a Feature with ID - * containing the substring `foo` and description containing the substring - * `bar`. - * - * - * Besides field queries, the following exact-match filters are - * supported. The exact-match filters do not support wildcards. Unlike - * field-restricted queries, exact-match filters are case-sensitive. - * - * * `feature_id`: Supports = comparisons. - * * `description`: Supports = comparisons. Multi-token filters should be - * enclosed in quotes. - * * `entity_type_id`: Supports = comparisons. - * * `value_type`: Supports = and != comparisons. - * * `labels`: Supports key-value equality as well as key presence. - * * `featurestore_id`: Supports = comparisons. - * - * Examples: - * * `description = "foo bar"` --> Any Feature with description exactly equal - * to `foo bar` - * * `value_type = DOUBLE` --> Features whose type is DOUBLE. - * * `labels.active = yes AND labels.env = prod` --> Features having both - * (active: yes) and (env: prod) labels. - * * `labels.env: *` --> Any Feature which has a label with `env` as the - * key. - * @param {number} request.pageSize - * The maximum number of Features to return. The service may return fewer - * than this value. If unspecified, at most 100 Features will be returned. - * The maximum value is 100; any value greater than 100 will be coerced to - * 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.FeaturestoreService.SearchFeatures|FeaturestoreService.SearchFeatures}, except `page_size`, must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Feature]{@link google.cloud.aiplatform.v1beta1.Feature}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_FeaturestoreService_SearchFeatures_async - */ - searchFeaturesAsync( - request?: protos.google.cloud.aiplatform.v1beta1.ISearchFeaturesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'location': request.location || '', - }); - const defaultCallSettings = this._defaults['searchFeatures']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchFeatures.asyncIterate( - this.innerApiCalls['searchFeatures'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.featurestoreServiceStub && !this._terminated) { - return this.featurestoreServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_client_config.json deleted file mode 100644 index 094a033d..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_client_config.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1beta1.FeaturestoreService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateFeaturestore": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetFeaturestore": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListFeaturestores": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateFeaturestore": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteFeaturestore": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateEntityType": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetEntityType": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListEntityTypes": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateEntityType": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteEntityType": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateFeature": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchCreateFeatures": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetFeature": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListFeatures": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateFeature": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteFeature": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ImportFeatureValues": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchReadFeatureValues": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ExportFeatureValues": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SearchFeatures": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_proto_list.json deleted file mode 100644 index c916ab12..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_proto_list.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/context.proto", - "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1beta1/event.proto", - "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/io.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/study.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1beta1/types.proto", - "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1beta1/value.proto", - "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json b/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json deleted file mode 100644 index a8aca391..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json +++ /dev/null @@ -1,2243 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.aiplatform.v1beta1", - "libraryPackage": "@google-cloud/aiplatform", - "services": { - "DatasetService": { - "clients": { - "grpc": { - "libraryClient": "DatasetServiceClient", - "rpcs": { - "GetDataset": { - "methods": [ - "getDataset" - ] - }, - "UpdateDataset": { - "methods": [ - "updateDataset" - ] - }, - "GetAnnotationSpec": { - "methods": [ - "getAnnotationSpec" - ] - }, - "CreateDataset": { - "methods": [ - "createDataset" - ] - }, - "DeleteDataset": { - "methods": [ - "deleteDataset" - ] - }, - "ImportData": { - "methods": [ - "importData" - ] - }, - "ExportData": { - "methods": [ - "exportData" - ] - }, - "ListDatasets": { - "methods": [ - "listDatasets", - "listDatasetsStream", - "listDatasetsAsync" - ] - }, - "ListDataItems": { - "methods": [ - "listDataItems", - "listDataItemsStream", - "listDataItemsAsync" - ] - }, - "ListAnnotations": { - "methods": [ - "listAnnotations", - "listAnnotationsStream", - "listAnnotationsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "DatasetServiceClient", - "rpcs": { - "GetDataset": { - "methods": [ - "getDataset" - ] - }, - "UpdateDataset": { - "methods": [ - "updateDataset" - ] - }, - "GetAnnotationSpec": { - "methods": [ - "getAnnotationSpec" - ] - }, - "CreateDataset": { - "methods": [ - "createDataset" - ] - }, - "DeleteDataset": { - "methods": [ - "deleteDataset" - ] - }, - "ImportData": { - "methods": [ - "importData" - ] - }, - "ExportData": { - "methods": [ - "exportData" - ] - }, - "ListDatasets": { - "methods": [ - "listDatasets", - "listDatasetsStream", - "listDatasetsAsync" - ] - }, - "ListDataItems": { - "methods": [ - "listDataItems", - "listDataItemsStream", - "listDataItemsAsync" - ] - }, - "ListAnnotations": { - "methods": [ - "listAnnotations", - "listAnnotationsStream", - "listAnnotationsAsync" - ] - } - } - } - } - }, - "EndpointService": { - "clients": { - "grpc": { - "libraryClient": "EndpointServiceClient", - "rpcs": { - "GetEndpoint": { - "methods": [ - "getEndpoint" - ] - }, - "UpdateEndpoint": { - "methods": [ - "updateEndpoint" - ] - }, - "CreateEndpoint": { - "methods": [ - "createEndpoint" - ] - }, - "DeleteEndpoint": { - "methods": [ - "deleteEndpoint" - ] - }, - "DeployModel": { - "methods": [ - "deployModel" - ] - }, - "UndeployModel": { - "methods": [ - "undeployModel" - ] - }, - "ListEndpoints": { - "methods": [ - "listEndpoints", - "listEndpointsStream", - "listEndpointsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "EndpointServiceClient", - "rpcs": { - "GetEndpoint": { - "methods": [ - "getEndpoint" - ] - }, - "UpdateEndpoint": { - "methods": [ - "updateEndpoint" - ] - }, - "CreateEndpoint": { - "methods": [ - "createEndpoint" - ] - }, - "DeleteEndpoint": { - "methods": [ - "deleteEndpoint" - ] - }, - "DeployModel": { - "methods": [ - "deployModel" - ] - }, - "UndeployModel": { - "methods": [ - "undeployModel" - ] - }, - "ListEndpoints": { - "methods": [ - "listEndpoints", - "listEndpointsStream", - "listEndpointsAsync" - ] - } - } - } - } - }, - "FeaturestoreOnlineServingService": { - "clients": { - "grpc": { - "libraryClient": "FeaturestoreOnlineServingServiceClient", - "rpcs": { - "ReadFeatureValues": { - "methods": [ - "readFeatureValues" - ] - }, - "StreamingReadFeatureValues": { - "methods": [ - "streamingReadFeatureValues" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "FeaturestoreOnlineServingServiceClient", - "rpcs": { - "ReadFeatureValues": { - "methods": [ - "readFeatureValues" - ] - } - } - } - } - }, - "FeaturestoreService": { - "clients": { - "grpc": { - "libraryClient": "FeaturestoreServiceClient", - "rpcs": { - "GetFeaturestore": { - "methods": [ - "getFeaturestore" - ] - }, - "GetEntityType": { - "methods": [ - "getEntityType" - ] - }, - "UpdateEntityType": { - "methods": [ - "updateEntityType" - ] - }, - "GetFeature": { - "methods": [ - "getFeature" - ] - }, - "UpdateFeature": { - "methods": [ - "updateFeature" - ] - }, - "CreateFeaturestore": { - "methods": [ - "createFeaturestore" - ] - }, - "UpdateFeaturestore": { - "methods": [ - "updateFeaturestore" - ] - }, - "DeleteFeaturestore": { - "methods": [ - "deleteFeaturestore" - ] - }, - "CreateEntityType": { - "methods": [ - "createEntityType" - ] - }, - "DeleteEntityType": { - "methods": [ - "deleteEntityType" - ] - }, - "CreateFeature": { - "methods": [ - "createFeature" - ] - }, - "BatchCreateFeatures": { - "methods": [ - "batchCreateFeatures" - ] - }, - "DeleteFeature": { - "methods": [ - "deleteFeature" - ] - }, - "ImportFeatureValues": { - "methods": [ - "importFeatureValues" - ] - }, - "BatchReadFeatureValues": { - "methods": [ - "batchReadFeatureValues" - ] - }, - "ExportFeatureValues": { - "methods": [ - "exportFeatureValues" - ] - }, - "ListFeaturestores": { - "methods": [ - "listFeaturestores", - "listFeaturestoresStream", - "listFeaturestoresAsync" - ] - }, - "ListEntityTypes": { - "methods": [ - "listEntityTypes", - "listEntityTypesStream", - "listEntityTypesAsync" - ] - }, - "ListFeatures": { - "methods": [ - "listFeatures", - "listFeaturesStream", - "listFeaturesAsync" - ] - }, - "SearchFeatures": { - "methods": [ - "searchFeatures", - "searchFeaturesStream", - "searchFeaturesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "FeaturestoreServiceClient", - "rpcs": { - "GetFeaturestore": { - "methods": [ - "getFeaturestore" - ] - }, - "GetEntityType": { - "methods": [ - "getEntityType" - ] - }, - "UpdateEntityType": { - "methods": [ - "updateEntityType" - ] - }, - "GetFeature": { - "methods": [ - "getFeature" - ] - }, - "UpdateFeature": { - "methods": [ - "updateFeature" - ] - }, - "CreateFeaturestore": { - "methods": [ - "createFeaturestore" - ] - }, - "UpdateFeaturestore": { - "methods": [ - "updateFeaturestore" - ] - }, - "DeleteFeaturestore": { - "methods": [ - "deleteFeaturestore" - ] - }, - "CreateEntityType": { - "methods": [ - "createEntityType" - ] - }, - "DeleteEntityType": { - "methods": [ - "deleteEntityType" - ] - }, - "CreateFeature": { - "methods": [ - "createFeature" - ] - }, - "BatchCreateFeatures": { - "methods": [ - "batchCreateFeatures" - ] - }, - "DeleteFeature": { - "methods": [ - "deleteFeature" - ] - }, - "ImportFeatureValues": { - "methods": [ - "importFeatureValues" - ] - }, - "BatchReadFeatureValues": { - "methods": [ - "batchReadFeatureValues" - ] - }, - "ExportFeatureValues": { - "methods": [ - "exportFeatureValues" - ] - }, - "ListFeaturestores": { - "methods": [ - "listFeaturestores", - "listFeaturestoresStream", - "listFeaturestoresAsync" - ] - }, - "ListEntityTypes": { - "methods": [ - "listEntityTypes", - "listEntityTypesStream", - "listEntityTypesAsync" - ] - }, - "ListFeatures": { - "methods": [ - "listFeatures", - "listFeaturesStream", - "listFeaturesAsync" - ] - }, - "SearchFeatures": { - "methods": [ - "searchFeatures", - "searchFeaturesStream", - "searchFeaturesAsync" - ] - } - } - } - } - }, - "IndexEndpointService": { - "clients": { - "grpc": { - "libraryClient": "IndexEndpointServiceClient", - "rpcs": { - "GetIndexEndpoint": { - "methods": [ - "getIndexEndpoint" - ] - }, - "UpdateIndexEndpoint": { - "methods": [ - "updateIndexEndpoint" - ] - }, - "CreateIndexEndpoint": { - "methods": [ - "createIndexEndpoint" - ] - }, - "DeleteIndexEndpoint": { - "methods": [ - "deleteIndexEndpoint" - ] - }, - "DeployIndex": { - "methods": [ - "deployIndex" - ] - }, - "UndeployIndex": { - "methods": [ - "undeployIndex" - ] - }, - "MutateDeployedIndex": { - "methods": [ - "mutateDeployedIndex" - ] - }, - "ListIndexEndpoints": { - "methods": [ - "listIndexEndpoints", - "listIndexEndpointsStream", - "listIndexEndpointsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "IndexEndpointServiceClient", - "rpcs": { - "GetIndexEndpoint": { - "methods": [ - "getIndexEndpoint" - ] - }, - "UpdateIndexEndpoint": { - "methods": [ - "updateIndexEndpoint" - ] - }, - "CreateIndexEndpoint": { - "methods": [ - "createIndexEndpoint" - ] - }, - "DeleteIndexEndpoint": { - "methods": [ - "deleteIndexEndpoint" - ] - }, - "DeployIndex": { - "methods": [ - "deployIndex" - ] - }, - "UndeployIndex": { - "methods": [ - "undeployIndex" - ] - }, - "MutateDeployedIndex": { - "methods": [ - "mutateDeployedIndex" - ] - }, - "ListIndexEndpoints": { - "methods": [ - "listIndexEndpoints", - "listIndexEndpointsStream", - "listIndexEndpointsAsync" - ] - } - } - } - } - }, - "IndexService": { - "clients": { - "grpc": { - "libraryClient": "IndexServiceClient", - "rpcs": { - "GetIndex": { - "methods": [ - "getIndex" - ] - }, - "CreateIndex": { - "methods": [ - "createIndex" - ] - }, - "UpdateIndex": { - "methods": [ - "updateIndex" - ] - }, - "DeleteIndex": { - "methods": [ - "deleteIndex" - ] - }, - "ListIndexes": { - "methods": [ - "listIndexes", - "listIndexesStream", - "listIndexesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "IndexServiceClient", - "rpcs": { - "GetIndex": { - "methods": [ - "getIndex" - ] - }, - "CreateIndex": { - "methods": [ - "createIndex" - ] - }, - "UpdateIndex": { - "methods": [ - "updateIndex" - ] - }, - "DeleteIndex": { - "methods": [ - "deleteIndex" - ] - }, - "ListIndexes": { - "methods": [ - "listIndexes", - "listIndexesStream", - "listIndexesAsync" - ] - } - } - } - } - }, - "JobService": { - "clients": { - "grpc": { - "libraryClient": "JobServiceClient", - "rpcs": { - "CreateCustomJob": { - "methods": [ - "createCustomJob" - ] - }, - "GetCustomJob": { - "methods": [ - "getCustomJob" - ] - }, - "CancelCustomJob": { - "methods": [ - "cancelCustomJob" - ] - }, - "CreateDataLabelingJob": { - "methods": [ - "createDataLabelingJob" - ] - }, - "GetDataLabelingJob": { - "methods": [ - "getDataLabelingJob" - ] - }, - "CancelDataLabelingJob": { - "methods": [ - "cancelDataLabelingJob" - ] - }, - "CreateHyperparameterTuningJob": { - "methods": [ - "createHyperparameterTuningJob" - ] - }, - "GetHyperparameterTuningJob": { - "methods": [ - "getHyperparameterTuningJob" - ] - }, - "CancelHyperparameterTuningJob": { - "methods": [ - "cancelHyperparameterTuningJob" - ] - }, - "CreateBatchPredictionJob": { - "methods": [ - "createBatchPredictionJob" - ] - }, - "GetBatchPredictionJob": { - "methods": [ - "getBatchPredictionJob" - ] - }, - "CancelBatchPredictionJob": { - "methods": [ - "cancelBatchPredictionJob" - ] - }, - "CreateModelDeploymentMonitoringJob": { - "methods": [ - "createModelDeploymentMonitoringJob" - ] - }, - "GetModelDeploymentMonitoringJob": { - "methods": [ - "getModelDeploymentMonitoringJob" - ] - }, - "PauseModelDeploymentMonitoringJob": { - "methods": [ - "pauseModelDeploymentMonitoringJob" - ] - }, - "ResumeModelDeploymentMonitoringJob": { - "methods": [ - "resumeModelDeploymentMonitoringJob" - ] - }, - "DeleteCustomJob": { - "methods": [ - "deleteCustomJob" - ] - }, - "DeleteDataLabelingJob": { - "methods": [ - "deleteDataLabelingJob" - ] - }, - "DeleteHyperparameterTuningJob": { - "methods": [ - "deleteHyperparameterTuningJob" - ] - }, - "DeleteBatchPredictionJob": { - "methods": [ - "deleteBatchPredictionJob" - ] - }, - "UpdateModelDeploymentMonitoringJob": { - "methods": [ - "updateModelDeploymentMonitoringJob" - ] - }, - "DeleteModelDeploymentMonitoringJob": { - "methods": [ - "deleteModelDeploymentMonitoringJob" - ] - }, - "ListCustomJobs": { - "methods": [ - "listCustomJobs", - "listCustomJobsStream", - "listCustomJobsAsync" - ] - }, - "ListDataLabelingJobs": { - "methods": [ - "listDataLabelingJobs", - "listDataLabelingJobsStream", - "listDataLabelingJobsAsync" - ] - }, - "ListHyperparameterTuningJobs": { - "methods": [ - "listHyperparameterTuningJobs", - "listHyperparameterTuningJobsStream", - "listHyperparameterTuningJobsAsync" - ] - }, - "ListBatchPredictionJobs": { - "methods": [ - "listBatchPredictionJobs", - "listBatchPredictionJobsStream", - "listBatchPredictionJobsAsync" - ] - }, - "SearchModelDeploymentMonitoringStatsAnomalies": { - "methods": [ - "searchModelDeploymentMonitoringStatsAnomalies", - "searchModelDeploymentMonitoringStatsAnomaliesStream", - "searchModelDeploymentMonitoringStatsAnomaliesAsync" - ] - }, - "ListModelDeploymentMonitoringJobs": { - "methods": [ - "listModelDeploymentMonitoringJobs", - "listModelDeploymentMonitoringJobsStream", - "listModelDeploymentMonitoringJobsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "JobServiceClient", - "rpcs": { - "CreateCustomJob": { - "methods": [ - "createCustomJob" - ] - }, - "GetCustomJob": { - "methods": [ - "getCustomJob" - ] - }, - "CancelCustomJob": { - "methods": [ - "cancelCustomJob" - ] - }, - "CreateDataLabelingJob": { - "methods": [ - "createDataLabelingJob" - ] - }, - "GetDataLabelingJob": { - "methods": [ - "getDataLabelingJob" - ] - }, - "CancelDataLabelingJob": { - "methods": [ - "cancelDataLabelingJob" - ] - }, - "CreateHyperparameterTuningJob": { - "methods": [ - "createHyperparameterTuningJob" - ] - }, - "GetHyperparameterTuningJob": { - "methods": [ - "getHyperparameterTuningJob" - ] - }, - "CancelHyperparameterTuningJob": { - "methods": [ - "cancelHyperparameterTuningJob" - ] - }, - "CreateBatchPredictionJob": { - "methods": [ - "createBatchPredictionJob" - ] - }, - "GetBatchPredictionJob": { - "methods": [ - "getBatchPredictionJob" - ] - }, - "CancelBatchPredictionJob": { - "methods": [ - "cancelBatchPredictionJob" - ] - }, - "CreateModelDeploymentMonitoringJob": { - "methods": [ - "createModelDeploymentMonitoringJob" - ] - }, - "GetModelDeploymentMonitoringJob": { - "methods": [ - "getModelDeploymentMonitoringJob" - ] - }, - "PauseModelDeploymentMonitoringJob": { - "methods": [ - "pauseModelDeploymentMonitoringJob" - ] - }, - "ResumeModelDeploymentMonitoringJob": { - "methods": [ - "resumeModelDeploymentMonitoringJob" - ] - }, - "DeleteCustomJob": { - "methods": [ - "deleteCustomJob" - ] - }, - "DeleteDataLabelingJob": { - "methods": [ - "deleteDataLabelingJob" - ] - }, - "DeleteHyperparameterTuningJob": { - "methods": [ - "deleteHyperparameterTuningJob" - ] - }, - "DeleteBatchPredictionJob": { - "methods": [ - "deleteBatchPredictionJob" - ] - }, - "UpdateModelDeploymentMonitoringJob": { - "methods": [ - "updateModelDeploymentMonitoringJob" - ] - }, - "DeleteModelDeploymentMonitoringJob": { - "methods": [ - "deleteModelDeploymentMonitoringJob" - ] - }, - "ListCustomJobs": { - "methods": [ - "listCustomJobs", - "listCustomJobsStream", - "listCustomJobsAsync" - ] - }, - "ListDataLabelingJobs": { - "methods": [ - "listDataLabelingJobs", - "listDataLabelingJobsStream", - "listDataLabelingJobsAsync" - ] - }, - "ListHyperparameterTuningJobs": { - "methods": [ - "listHyperparameterTuningJobs", - "listHyperparameterTuningJobsStream", - "listHyperparameterTuningJobsAsync" - ] - }, - "ListBatchPredictionJobs": { - "methods": [ - "listBatchPredictionJobs", - "listBatchPredictionJobsStream", - "listBatchPredictionJobsAsync" - ] - }, - "SearchModelDeploymentMonitoringStatsAnomalies": { - "methods": [ - "searchModelDeploymentMonitoringStatsAnomalies", - "searchModelDeploymentMonitoringStatsAnomaliesStream", - "searchModelDeploymentMonitoringStatsAnomaliesAsync" - ] - }, - "ListModelDeploymentMonitoringJobs": { - "methods": [ - "listModelDeploymentMonitoringJobs", - "listModelDeploymentMonitoringJobsStream", - "listModelDeploymentMonitoringJobsAsync" - ] - } - } - } - } - }, - "MetadataService": { - "clients": { - "grpc": { - "libraryClient": "MetadataServiceClient", - "rpcs": { - "GetMetadataStore": { - "methods": [ - "getMetadataStore" - ] - }, - "CreateArtifact": { - "methods": [ - "createArtifact" - ] - }, - "GetArtifact": { - "methods": [ - "getArtifact" - ] - }, - "UpdateArtifact": { - "methods": [ - "updateArtifact" - ] - }, - "CreateContext": { - "methods": [ - "createContext" - ] - }, - "GetContext": { - "methods": [ - "getContext" - ] - }, - "UpdateContext": { - "methods": [ - "updateContext" - ] - }, - "AddContextArtifactsAndExecutions": { - "methods": [ - "addContextArtifactsAndExecutions" - ] - }, - "AddContextChildren": { - "methods": [ - "addContextChildren" - ] - }, - "QueryContextLineageSubgraph": { - "methods": [ - "queryContextLineageSubgraph" - ] - }, - "CreateExecution": { - "methods": [ - "createExecution" - ] - }, - "GetExecution": { - "methods": [ - "getExecution" - ] - }, - "UpdateExecution": { - "methods": [ - "updateExecution" - ] - }, - "AddExecutionEvents": { - "methods": [ - "addExecutionEvents" - ] - }, - "QueryExecutionInputsAndOutputs": { - "methods": [ - "queryExecutionInputsAndOutputs" - ] - }, - "CreateMetadataSchema": { - "methods": [ - "createMetadataSchema" - ] - }, - "GetMetadataSchema": { - "methods": [ - "getMetadataSchema" - ] - }, - "QueryArtifactLineageSubgraph": { - "methods": [ - "queryArtifactLineageSubgraph" - ] - }, - "CreateMetadataStore": { - "methods": [ - "createMetadataStore" - ] - }, - "DeleteMetadataStore": { - "methods": [ - "deleteMetadataStore" - ] - }, - "DeleteArtifact": { - "methods": [ - "deleteArtifact" - ] - }, - "PurgeArtifacts": { - "methods": [ - "purgeArtifacts" - ] - }, - "DeleteContext": { - "methods": [ - "deleteContext" - ] - }, - "PurgeContexts": { - "methods": [ - "purgeContexts" - ] - }, - "DeleteExecution": { - "methods": [ - "deleteExecution" - ] - }, - "PurgeExecutions": { - "methods": [ - "purgeExecutions" - ] - }, - "ListMetadataStores": { - "methods": [ - "listMetadataStores", - "listMetadataStoresStream", - "listMetadataStoresAsync" - ] - }, - "ListArtifacts": { - "methods": [ - "listArtifacts", - "listArtifactsStream", - "listArtifactsAsync" - ] - }, - "ListContexts": { - "methods": [ - "listContexts", - "listContextsStream", - "listContextsAsync" - ] - }, - "ListExecutions": { - "methods": [ - "listExecutions", - "listExecutionsStream", - "listExecutionsAsync" - ] - }, - "ListMetadataSchemas": { - "methods": [ - "listMetadataSchemas", - "listMetadataSchemasStream", - "listMetadataSchemasAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "MetadataServiceClient", - "rpcs": { - "GetMetadataStore": { - "methods": [ - "getMetadataStore" - ] - }, - "CreateArtifact": { - "methods": [ - "createArtifact" - ] - }, - "GetArtifact": { - "methods": [ - "getArtifact" - ] - }, - "UpdateArtifact": { - "methods": [ - "updateArtifact" - ] - }, - "CreateContext": { - "methods": [ - "createContext" - ] - }, - "GetContext": { - "methods": [ - "getContext" - ] - }, - "UpdateContext": { - "methods": [ - "updateContext" - ] - }, - "AddContextArtifactsAndExecutions": { - "methods": [ - "addContextArtifactsAndExecutions" - ] - }, - "AddContextChildren": { - "methods": [ - "addContextChildren" - ] - }, - "QueryContextLineageSubgraph": { - "methods": [ - "queryContextLineageSubgraph" - ] - }, - "CreateExecution": { - "methods": [ - "createExecution" - ] - }, - "GetExecution": { - "methods": [ - "getExecution" - ] - }, - "UpdateExecution": { - "methods": [ - "updateExecution" - ] - }, - "AddExecutionEvents": { - "methods": [ - "addExecutionEvents" - ] - }, - "QueryExecutionInputsAndOutputs": { - "methods": [ - "queryExecutionInputsAndOutputs" - ] - }, - "CreateMetadataSchema": { - "methods": [ - "createMetadataSchema" - ] - }, - "GetMetadataSchema": { - "methods": [ - "getMetadataSchema" - ] - }, - "QueryArtifactLineageSubgraph": { - "methods": [ - "queryArtifactLineageSubgraph" - ] - }, - "CreateMetadataStore": { - "methods": [ - "createMetadataStore" - ] - }, - "DeleteMetadataStore": { - "methods": [ - "deleteMetadataStore" - ] - }, - "DeleteArtifact": { - "methods": [ - "deleteArtifact" - ] - }, - "PurgeArtifacts": { - "methods": [ - "purgeArtifacts" - ] - }, - "DeleteContext": { - "methods": [ - "deleteContext" - ] - }, - "PurgeContexts": { - "methods": [ - "purgeContexts" - ] - }, - "DeleteExecution": { - "methods": [ - "deleteExecution" - ] - }, - "PurgeExecutions": { - "methods": [ - "purgeExecutions" - ] - }, - "ListMetadataStores": { - "methods": [ - "listMetadataStores", - "listMetadataStoresStream", - "listMetadataStoresAsync" - ] - }, - "ListArtifacts": { - "methods": [ - "listArtifacts", - "listArtifactsStream", - "listArtifactsAsync" - ] - }, - "ListContexts": { - "methods": [ - "listContexts", - "listContextsStream", - "listContextsAsync" - ] - }, - "ListExecutions": { - "methods": [ - "listExecutions", - "listExecutionsStream", - "listExecutionsAsync" - ] - }, - "ListMetadataSchemas": { - "methods": [ - "listMetadataSchemas", - "listMetadataSchemasStream", - "listMetadataSchemasAsync" - ] - } - } - } - } - }, - "MigrationService": { - "clients": { - "grpc": { - "libraryClient": "MigrationServiceClient", - "rpcs": { - "BatchMigrateResources": { - "methods": [ - "batchMigrateResources" - ] - }, - "SearchMigratableResources": { - "methods": [ - "searchMigratableResources", - "searchMigratableResourcesStream", - "searchMigratableResourcesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "MigrationServiceClient", - "rpcs": { - "BatchMigrateResources": { - "methods": [ - "batchMigrateResources" - ] - }, - "SearchMigratableResources": { - "methods": [ - "searchMigratableResources", - "searchMigratableResourcesStream", - "searchMigratableResourcesAsync" - ] - } - } - } - } - }, - "ModelService": { - "clients": { - "grpc": { - "libraryClient": "ModelServiceClient", - "rpcs": { - "GetModel": { - "methods": [ - "getModel" - ] - }, - "UpdateModel": { - "methods": [ - "updateModel" - ] - }, - "MergeVersionAliases": { - "methods": [ - "mergeVersionAliases" - ] - }, - "ImportModelEvaluation": { - "methods": [ - "importModelEvaluation" - ] - }, - "GetModelEvaluation": { - "methods": [ - "getModelEvaluation" - ] - }, - "GetModelEvaluationSlice": { - "methods": [ - "getModelEvaluationSlice" - ] - }, - "UploadModel": { - "methods": [ - "uploadModel" - ] - }, - "UpdateExplanationDataset": { - "methods": [ - "updateExplanationDataset" - ] - }, - "DeleteModel": { - "methods": [ - "deleteModel" - ] - }, - "DeleteModelVersion": { - "methods": [ - "deleteModelVersion" - ] - }, - "ExportModel": { - "methods": [ - "exportModel" - ] - }, - "ListModels": { - "methods": [ - "listModels", - "listModelsStream", - "listModelsAsync" - ] - }, - "ListModelVersions": { - "methods": [ - "listModelVersions", - "listModelVersionsStream", - "listModelVersionsAsync" - ] - }, - "ListModelEvaluations": { - "methods": [ - "listModelEvaluations", - "listModelEvaluationsStream", - "listModelEvaluationsAsync" - ] - }, - "ListModelEvaluationSlices": { - "methods": [ - "listModelEvaluationSlices", - "listModelEvaluationSlicesStream", - "listModelEvaluationSlicesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ModelServiceClient", - "rpcs": { - "GetModel": { - "methods": [ - "getModel" - ] - }, - "UpdateModel": { - "methods": [ - "updateModel" - ] - }, - "MergeVersionAliases": { - "methods": [ - "mergeVersionAliases" - ] - }, - "ImportModelEvaluation": { - "methods": [ - "importModelEvaluation" - ] - }, - "GetModelEvaluation": { - "methods": [ - "getModelEvaluation" - ] - }, - "GetModelEvaluationSlice": { - "methods": [ - "getModelEvaluationSlice" - ] - }, - "UploadModel": { - "methods": [ - "uploadModel" - ] - }, - "UpdateExplanationDataset": { - "methods": [ - "updateExplanationDataset" - ] - }, - "DeleteModel": { - "methods": [ - "deleteModel" - ] - }, - "DeleteModelVersion": { - "methods": [ - "deleteModelVersion" - ] - }, - "ExportModel": { - "methods": [ - "exportModel" - ] - }, - "ListModels": { - "methods": [ - "listModels", - "listModelsStream", - "listModelsAsync" - ] - }, - "ListModelVersions": { - "methods": [ - "listModelVersions", - "listModelVersionsStream", - "listModelVersionsAsync" - ] - }, - "ListModelEvaluations": { - "methods": [ - "listModelEvaluations", - "listModelEvaluationsStream", - "listModelEvaluationsAsync" - ] - }, - "ListModelEvaluationSlices": { - "methods": [ - "listModelEvaluationSlices", - "listModelEvaluationSlicesStream", - "listModelEvaluationSlicesAsync" - ] - } - } - } - } - }, - "PipelineService": { - "clients": { - "grpc": { - "libraryClient": "PipelineServiceClient", - "rpcs": { - "CreateTrainingPipeline": { - "methods": [ - "createTrainingPipeline" - ] - }, - "GetTrainingPipeline": { - "methods": [ - "getTrainingPipeline" - ] - }, - "CancelTrainingPipeline": { - "methods": [ - "cancelTrainingPipeline" - ] - }, - "CreatePipelineJob": { - "methods": [ - "createPipelineJob" - ] - }, - "GetPipelineJob": { - "methods": [ - "getPipelineJob" - ] - }, - "CancelPipelineJob": { - "methods": [ - "cancelPipelineJob" - ] - }, - "DeleteTrainingPipeline": { - "methods": [ - "deleteTrainingPipeline" - ] - }, - "DeletePipelineJob": { - "methods": [ - "deletePipelineJob" - ] - }, - "ListTrainingPipelines": { - "methods": [ - "listTrainingPipelines", - "listTrainingPipelinesStream", - "listTrainingPipelinesAsync" - ] - }, - "ListPipelineJobs": { - "methods": [ - "listPipelineJobs", - "listPipelineJobsStream", - "listPipelineJobsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "PipelineServiceClient", - "rpcs": { - "CreateTrainingPipeline": { - "methods": [ - "createTrainingPipeline" - ] - }, - "GetTrainingPipeline": { - "methods": [ - "getTrainingPipeline" - ] - }, - "CancelTrainingPipeline": { - "methods": [ - "cancelTrainingPipeline" - ] - }, - "CreatePipelineJob": { - "methods": [ - "createPipelineJob" - ] - }, - "GetPipelineJob": { - "methods": [ - "getPipelineJob" - ] - }, - "CancelPipelineJob": { - "methods": [ - "cancelPipelineJob" - ] - }, - "DeleteTrainingPipeline": { - "methods": [ - "deleteTrainingPipeline" - ] - }, - "DeletePipelineJob": { - "methods": [ - "deletePipelineJob" - ] - }, - "ListTrainingPipelines": { - "methods": [ - "listTrainingPipelines", - "listTrainingPipelinesStream", - "listTrainingPipelinesAsync" - ] - }, - "ListPipelineJobs": { - "methods": [ - "listPipelineJobs", - "listPipelineJobsStream", - "listPipelineJobsAsync" - ] - } - } - } - } - }, - "PredictionService": { - "clients": { - "grpc": { - "libraryClient": "PredictionServiceClient", - "rpcs": { - "Predict": { - "methods": [ - "predict" - ] - }, - "RawPredict": { - "methods": [ - "rawPredict" - ] - }, - "Explain": { - "methods": [ - "explain" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "PredictionServiceClient", - "rpcs": { - "Predict": { - "methods": [ - "predict" - ] - }, - "RawPredict": { - "methods": [ - "rawPredict" - ] - }, - "Explain": { - "methods": [ - "explain" - ] - } - } - } - } - }, - "SpecialistPoolService": { - "clients": { - "grpc": { - "libraryClient": "SpecialistPoolServiceClient", - "rpcs": { - "GetSpecialistPool": { - "methods": [ - "getSpecialistPool" - ] - }, - "CreateSpecialistPool": { - "methods": [ - "createSpecialistPool" - ] - }, - "DeleteSpecialistPool": { - "methods": [ - "deleteSpecialistPool" - ] - }, - "UpdateSpecialistPool": { - "methods": [ - "updateSpecialistPool" - ] - }, - "ListSpecialistPools": { - "methods": [ - "listSpecialistPools", - "listSpecialistPoolsStream", - "listSpecialistPoolsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "SpecialistPoolServiceClient", - "rpcs": { - "GetSpecialistPool": { - "methods": [ - "getSpecialistPool" - ] - }, - "CreateSpecialistPool": { - "methods": [ - "createSpecialistPool" - ] - }, - "DeleteSpecialistPool": { - "methods": [ - "deleteSpecialistPool" - ] - }, - "UpdateSpecialistPool": { - "methods": [ - "updateSpecialistPool" - ] - }, - "ListSpecialistPools": { - "methods": [ - "listSpecialistPools", - "listSpecialistPoolsStream", - "listSpecialistPoolsAsync" - ] - } - } - } - } - }, - "TensorboardService": { - "clients": { - "grpc": { - "libraryClient": "TensorboardServiceClient", - "rpcs": { - "GetTensorboard": { - "methods": [ - "getTensorboard" - ] - }, - "CreateTensorboardExperiment": { - "methods": [ - "createTensorboardExperiment" - ] - }, - "GetTensorboardExperiment": { - "methods": [ - "getTensorboardExperiment" - ] - }, - "UpdateTensorboardExperiment": { - "methods": [ - "updateTensorboardExperiment" - ] - }, - "CreateTensorboardRun": { - "methods": [ - "createTensorboardRun" - ] - }, - "BatchCreateTensorboardRuns": { - "methods": [ - "batchCreateTensorboardRuns" - ] - }, - "GetTensorboardRun": { - "methods": [ - "getTensorboardRun" - ] - }, - "UpdateTensorboardRun": { - "methods": [ - "updateTensorboardRun" - ] - }, - "BatchCreateTensorboardTimeSeries": { - "methods": [ - "batchCreateTensorboardTimeSeries" - ] - }, - "CreateTensorboardTimeSeries": { - "methods": [ - "createTensorboardTimeSeries" - ] - }, - "GetTensorboardTimeSeries": { - "methods": [ - "getTensorboardTimeSeries" - ] - }, - "UpdateTensorboardTimeSeries": { - "methods": [ - "updateTensorboardTimeSeries" - ] - }, - "BatchReadTensorboardTimeSeriesData": { - "methods": [ - "batchReadTensorboardTimeSeriesData" - ] - }, - "ReadTensorboardTimeSeriesData": { - "methods": [ - "readTensorboardTimeSeriesData" - ] - }, - "WriteTensorboardExperimentData": { - "methods": [ - "writeTensorboardExperimentData" - ] - }, - "WriteTensorboardRunData": { - "methods": [ - "writeTensorboardRunData" - ] - }, - "ReadTensorboardBlobData": { - "methods": [ - "readTensorboardBlobData" - ] - }, - "CreateTensorboard": { - "methods": [ - "createTensorboard" - ] - }, - "UpdateTensorboard": { - "methods": [ - "updateTensorboard" - ] - }, - "DeleteTensorboard": { - "methods": [ - "deleteTensorboard" - ] - }, - "DeleteTensorboardExperiment": { - "methods": [ - "deleteTensorboardExperiment" - ] - }, - "DeleteTensorboardRun": { - "methods": [ - "deleteTensorboardRun" - ] - }, - "DeleteTensorboardTimeSeries": { - "methods": [ - "deleteTensorboardTimeSeries" - ] - }, - "ListTensorboards": { - "methods": [ - "listTensorboards", - "listTensorboardsStream", - "listTensorboardsAsync" - ] - }, - "ListTensorboardExperiments": { - "methods": [ - "listTensorboardExperiments", - "listTensorboardExperimentsStream", - "listTensorboardExperimentsAsync" - ] - }, - "ListTensorboardRuns": { - "methods": [ - "listTensorboardRuns", - "listTensorboardRunsStream", - "listTensorboardRunsAsync" - ] - }, - "ListTensorboardTimeSeries": { - "methods": [ - "listTensorboardTimeSeries", - "listTensorboardTimeSeriesStream", - "listTensorboardTimeSeriesAsync" - ] - }, - "ExportTensorboardTimeSeriesData": { - "methods": [ - "exportTensorboardTimeSeriesData", - "exportTensorboardTimeSeriesDataStream", - "exportTensorboardTimeSeriesDataAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "TensorboardServiceClient", - "rpcs": { - "GetTensorboard": { - "methods": [ - "getTensorboard" - ] - }, - "CreateTensorboardExperiment": { - "methods": [ - "createTensorboardExperiment" - ] - }, - "GetTensorboardExperiment": { - "methods": [ - "getTensorboardExperiment" - ] - }, - "UpdateTensorboardExperiment": { - "methods": [ - "updateTensorboardExperiment" - ] - }, - "CreateTensorboardRun": { - "methods": [ - "createTensorboardRun" - ] - }, - "BatchCreateTensorboardRuns": { - "methods": [ - "batchCreateTensorboardRuns" - ] - }, - "GetTensorboardRun": { - "methods": [ - "getTensorboardRun" - ] - }, - "UpdateTensorboardRun": { - "methods": [ - "updateTensorboardRun" - ] - }, - "BatchCreateTensorboardTimeSeries": { - "methods": [ - "batchCreateTensorboardTimeSeries" - ] - }, - "CreateTensorboardTimeSeries": { - "methods": [ - "createTensorboardTimeSeries" - ] - }, - "GetTensorboardTimeSeries": { - "methods": [ - "getTensorboardTimeSeries" - ] - }, - "UpdateTensorboardTimeSeries": { - "methods": [ - "updateTensorboardTimeSeries" - ] - }, - "BatchReadTensorboardTimeSeriesData": { - "methods": [ - "batchReadTensorboardTimeSeriesData" - ] - }, - "ReadTensorboardTimeSeriesData": { - "methods": [ - "readTensorboardTimeSeriesData" - ] - }, - "WriteTensorboardExperimentData": { - "methods": [ - "writeTensorboardExperimentData" - ] - }, - "WriteTensorboardRunData": { - "methods": [ - "writeTensorboardRunData" - ] - }, - "CreateTensorboard": { - "methods": [ - "createTensorboard" - ] - }, - "UpdateTensorboard": { - "methods": [ - "updateTensorboard" - ] - }, - "DeleteTensorboard": { - "methods": [ - "deleteTensorboard" - ] - }, - "DeleteTensorboardExperiment": { - "methods": [ - "deleteTensorboardExperiment" - ] - }, - "DeleteTensorboardRun": { - "methods": [ - "deleteTensorboardRun" - ] - }, - "DeleteTensorboardTimeSeries": { - "methods": [ - "deleteTensorboardTimeSeries" - ] - }, - "ListTensorboards": { - "methods": [ - "listTensorboards", - "listTensorboardsStream", - "listTensorboardsAsync" - ] - }, - "ListTensorboardExperiments": { - "methods": [ - "listTensorboardExperiments", - "listTensorboardExperimentsStream", - "listTensorboardExperimentsAsync" - ] - }, - "ListTensorboardRuns": { - "methods": [ - "listTensorboardRuns", - "listTensorboardRunsStream", - "listTensorboardRunsAsync" - ] - }, - "ListTensorboardTimeSeries": { - "methods": [ - "listTensorboardTimeSeries", - "listTensorboardTimeSeriesStream", - "listTensorboardTimeSeriesAsync" - ] - }, - "ExportTensorboardTimeSeriesData": { - "methods": [ - "exportTensorboardTimeSeriesData", - "exportTensorboardTimeSeriesDataStream", - "exportTensorboardTimeSeriesDataAsync" - ] - } - } - } - } - }, - "VizierService": { - "clients": { - "grpc": { - "libraryClient": "VizierServiceClient", - "rpcs": { - "CreateStudy": { - "methods": [ - "createStudy" - ] - }, - "GetStudy": { - "methods": [ - "getStudy" - ] - }, - "DeleteStudy": { - "methods": [ - "deleteStudy" - ] - }, - "LookupStudy": { - "methods": [ - "lookupStudy" - ] - }, - "CreateTrial": { - "methods": [ - "createTrial" - ] - }, - "GetTrial": { - "methods": [ - "getTrial" - ] - }, - "AddTrialMeasurement": { - "methods": [ - "addTrialMeasurement" - ] - }, - "CompleteTrial": { - "methods": [ - "completeTrial" - ] - }, - "DeleteTrial": { - "methods": [ - "deleteTrial" - ] - }, - "StopTrial": { - "methods": [ - "stopTrial" - ] - }, - "ListOptimalTrials": { - "methods": [ - "listOptimalTrials" - ] - }, - "SuggestTrials": { - "methods": [ - "suggestTrials" - ] - }, - "CheckTrialEarlyStoppingState": { - "methods": [ - "checkTrialEarlyStoppingState" - ] - }, - "ListStudies": { - "methods": [ - "listStudies", - "listStudiesStream", - "listStudiesAsync" - ] - }, - "ListTrials": { - "methods": [ - "listTrials", - "listTrialsStream", - "listTrialsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "VizierServiceClient", - "rpcs": { - "CreateStudy": { - "methods": [ - "createStudy" - ] - }, - "GetStudy": { - "methods": [ - "getStudy" - ] - }, - "DeleteStudy": { - "methods": [ - "deleteStudy" - ] - }, - "LookupStudy": { - "methods": [ - "lookupStudy" - ] - }, - "CreateTrial": { - "methods": [ - "createTrial" - ] - }, - "GetTrial": { - "methods": [ - "getTrial" - ] - }, - "AddTrialMeasurement": { - "methods": [ - "addTrialMeasurement" - ] - }, - "CompleteTrial": { - "methods": [ - "completeTrial" - ] - }, - "DeleteTrial": { - "methods": [ - "deleteTrial" - ] - }, - "StopTrial": { - "methods": [ - "stopTrial" - ] - }, - "ListOptimalTrials": { - "methods": [ - "listOptimalTrials" - ] - }, - "SuggestTrials": { - "methods": [ - "suggestTrials" - ] - }, - "CheckTrialEarlyStoppingState": { - "methods": [ - "checkTrialEarlyStoppingState" - ] - }, - "ListStudies": { - "methods": [ - "listStudies", - "listStudiesStream", - "listStudiesAsync" - ] - }, - "ListTrials": { - "methods": [ - "listTrials", - "listTrialsStream", - "listTrialsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/index.ts b/owl-bot-staging/v1beta1/src/v1beta1/index.ts deleted file mode 100644 index e88d60a9..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/index.ts +++ /dev/null @@ -1,33 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {DatasetServiceClient} from './dataset_service_client'; -export {EndpointServiceClient} from './endpoint_service_client'; -export {FeaturestoreOnlineServingServiceClient} from './featurestore_online_serving_service_client'; -export {FeaturestoreServiceClient} from './featurestore_service_client'; -export {IndexEndpointServiceClient} from './index_endpoint_service_client'; -export {IndexServiceClient} from './index_service_client'; -export {JobServiceClient} from './job_service_client'; -export {MetadataServiceClient} from './metadata_service_client'; -export {MigrationServiceClient} from './migration_service_client'; -export {ModelServiceClient} from './model_service_client'; -export {PipelineServiceClient} from './pipeline_service_client'; -export {PredictionServiceClient} from './prediction_service_client'; -export {SpecialistPoolServiceClient} from './specialist_pool_service_client'; -export {TensorboardServiceClient} from './tensorboard_service_client'; -export {VizierServiceClient} from './vizier_service_client'; diff --git a/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_client.ts deleted file mode 100644 index f1dfd8db..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_client.ts +++ /dev/null @@ -1,3218 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/index_endpoint_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './index_endpoint_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * A service for managing Vertex AI's IndexEndpoints. - * @class - * @memberof v1beta1 - */ -export class IndexEndpointServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - indexEndpointServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of IndexEndpointServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof IndexEndpointServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listIndexEndpoints: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'indexEndpoints') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const createIndexEndpointResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.IndexEndpoint') as gax.protobuf.Type; - const createIndexEndpointMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.CreateIndexEndpointOperationMetadata') as gax.protobuf.Type; - const deleteIndexEndpointResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteIndexEndpointMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const deployIndexResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeployIndexResponse') as gax.protobuf.Type; - const deployIndexMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeployIndexOperationMetadata') as gax.protobuf.Type; - const undeployIndexResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.UndeployIndexResponse') as gax.protobuf.Type; - const undeployIndexMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.UndeployIndexOperationMetadata') as gax.protobuf.Type; - const mutateDeployedIndexResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.MutateDeployedIndexResponse') as gax.protobuf.Type; - const mutateDeployedIndexMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.MutateDeployedIndexOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createIndexEndpoint: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createIndexEndpointResponse.decode.bind(createIndexEndpointResponse), - createIndexEndpointMetadata.decode.bind(createIndexEndpointMetadata)), - deleteIndexEndpoint: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteIndexEndpointResponse.decode.bind(deleteIndexEndpointResponse), - deleteIndexEndpointMetadata.decode.bind(deleteIndexEndpointMetadata)), - deployIndex: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deployIndexResponse.decode.bind(deployIndexResponse), - deployIndexMetadata.decode.bind(deployIndexMetadata)), - undeployIndex: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - undeployIndexResponse.decode.bind(undeployIndexResponse), - undeployIndexMetadata.decode.bind(undeployIndexMetadata)), - mutateDeployedIndex: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - mutateDeployedIndexResponse.decode.bind(mutateDeployedIndexResponse), - mutateDeployedIndexMetadata.decode.bind(mutateDeployedIndexMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1beta1.IndexEndpointService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.indexEndpointServiceStub) { - return this.indexEndpointServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1beta1.IndexEndpointService. - this.indexEndpointServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.IndexEndpointService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1beta1.IndexEndpointService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const indexEndpointServiceStubMethods = - ['createIndexEndpoint', 'getIndexEndpoint', 'listIndexEndpoints', 'updateIndexEndpoint', 'deleteIndexEndpoint', 'deployIndex', 'undeployIndex', 'mutateDeployedIndex']; - for (const methodName of indexEndpointServiceStubMethods) { - const callPromise = this.indexEndpointServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.indexEndpointServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets an IndexEndpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the IndexEndpoint resource. - * Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [IndexEndpoint]{@link google.cloud.aiplatform.v1beta1.IndexEndpoint}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_GetIndexEndpoint_async - */ - getIndexEndpoint( - request?: protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest|undefined, {}|undefined - ]>; - getIndexEndpoint( - request: protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest|null|undefined, - {}|null|undefined>): void; - getIndexEndpoint( - request: protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest|null|undefined, - {}|null|undefined>): void; - getIndexEndpoint( - request?: protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1beta1.IGetIndexEndpointRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getIndexEndpoint(request, options, callback); - } -/** - * Updates an IndexEndpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1beta1.IndexEndpoint} request.indexEndpoint - * Required. The IndexEndpoint which replaces the resource on the server. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The update mask applies to the resource. See {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [IndexEndpoint]{@link google.cloud.aiplatform.v1beta1.IndexEndpoint}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_UpdateIndexEndpoint_async - */ - updateIndexEndpoint( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest|undefined, {}|undefined - ]>; - updateIndexEndpoint( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest|null|undefined, - {}|null|undefined>): void; - updateIndexEndpoint( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest|null|undefined, - {}|null|undefined>): void; - updateIndexEndpoint( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint, - protos.google.cloud.aiplatform.v1beta1.IUpdateIndexEndpointRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'index_endpoint.name': request.indexEndpoint!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateIndexEndpoint(request, options, callback); - } - -/** - * Creates an IndexEndpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the IndexEndpoint in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1beta1.IndexEndpoint} request.indexEndpoint - * Required. The IndexEndpoint to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_CreateIndexEndpoint_async - */ - createIndexEndpoint( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateIndexEndpointRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createIndexEndpoint( - request: protos.google.cloud.aiplatform.v1beta1.ICreateIndexEndpointRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createIndexEndpoint( - request: protos.google.cloud.aiplatform.v1beta1.ICreateIndexEndpointRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createIndexEndpoint( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateIndexEndpointRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createIndexEndpoint(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createIndexEndpoint()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_CreateIndexEndpoint_async - */ - async checkCreateIndexEndpointProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createIndexEndpoint, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes an IndexEndpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the IndexEndpoint resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_DeleteIndexEndpoint_async - */ - deleteIndexEndpoint( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteIndexEndpointRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteIndexEndpoint( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteIndexEndpointRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteIndexEndpoint( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteIndexEndpointRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteIndexEndpoint( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteIndexEndpointRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteIndexEndpoint(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteIndexEndpoint()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_DeleteIndexEndpoint_async - */ - async checkDeleteIndexEndpointProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteIndexEndpoint, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deploys an Index into this IndexEndpoint, creating a DeployedIndex within - * it. - * Only non-empty Indexes can be deployed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.indexEndpoint - * Required. The name of the IndexEndpoint resource into which to deploy an Index. - * Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param {google.cloud.aiplatform.v1beta1.DeployedIndex} request.deployedIndex - * Required. The DeployedIndex to be created within the IndexEndpoint. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_DeployIndex_async - */ - deployIndex( - request?: protos.google.cloud.aiplatform.v1beta1.IDeployIndexRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deployIndex( - request: protos.google.cloud.aiplatform.v1beta1.IDeployIndexRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deployIndex( - request: protos.google.cloud.aiplatform.v1beta1.IDeployIndexRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deployIndex( - request?: protos.google.cloud.aiplatform.v1beta1.IDeployIndexRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'index_endpoint': request.indexEndpoint || '', - }); - this.initialize(); - return this.innerApiCalls.deployIndex(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deployIndex()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_DeployIndex_async - */ - async checkDeployIndexProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deployIndex, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Undeploys an Index from an IndexEndpoint, removing a DeployedIndex from it, - * and freeing all resources it's using. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.indexEndpoint - * Required. The name of the IndexEndpoint resource from which to undeploy an Index. - * Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param {string} request.deployedIndexId - * Required. The ID of the DeployedIndex to be undeployed from the IndexEndpoint. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_UndeployIndex_async - */ - undeployIndex( - request?: protos.google.cloud.aiplatform.v1beta1.IUndeployIndexRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - undeployIndex( - request: protos.google.cloud.aiplatform.v1beta1.IUndeployIndexRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - undeployIndex( - request: protos.google.cloud.aiplatform.v1beta1.IUndeployIndexRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - undeployIndex( - request?: protos.google.cloud.aiplatform.v1beta1.IUndeployIndexRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'index_endpoint': request.indexEndpoint || '', - }); - this.initialize(); - return this.innerApiCalls.undeployIndex(request, options, callback); - } -/** - * Check the status of the long running operation returned by `undeployIndex()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_UndeployIndex_async - */ - async checkUndeployIndexProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.undeployIndex, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Update an existing DeployedIndex under an IndexEndpoint. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.indexEndpoint - * Required. The name of the IndexEndpoint resource into which to deploy an Index. - * Format: - * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - * @param {google.cloud.aiplatform.v1beta1.DeployedIndex} request.deployedIndex - * Required. The DeployedIndex to be updated within the IndexEndpoint. - * Currently, the updatable fields are {@link automatic_resources|DeployedIndex} - * and {@link dedicated_resources|DeployedIndex} - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_MutateDeployedIndex_async - */ - mutateDeployedIndex( - request?: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedIndexRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - mutateDeployedIndex( - request: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedIndexRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - mutateDeployedIndex( - request: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedIndexRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - mutateDeployedIndex( - request?: protos.google.cloud.aiplatform.v1beta1.IMutateDeployedIndexRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'index_endpoint': request.indexEndpoint || '', - }); - this.initialize(); - return this.innerApiCalls.mutateDeployedIndex(request, options, callback); - } -/** - * Check the status of the long running operation returned by `mutateDeployedIndex()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_MutateDeployedIndex_async - */ - async checkMutateDeployedIndexProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.mutateDeployedIndex, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists IndexEndpoints in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location from which to list the IndexEndpoints. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `index_endpoint` supports = and !=. `index_endpoint` represents the - * IndexEndpoint ID, ie. the last segment of the IndexEndpoint's - * {@link google.cloud.aiplatform.v1beta1.IndexEndpoint.name|resourcename}. - * * `display_name` supports =, != and regex() - * (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* or labels:key - key existence - * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `index_endpoint="1"` - * * `display_name="myDisplayName"` - * * `regex(display_name, "^A") -> The display name starts with an A. - * * `labels.myKey="myValue"` - * @param {number} [request.pageSize] - * Optional. The standard list page size. - * @param {string} [request.pageToken] - * Optional. The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListIndexEndpointsResponse.next_page_token|ListIndexEndpointsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.IndexEndpointService.ListIndexEndpoints|IndexEndpointService.ListIndexEndpoints} call. - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [IndexEndpoint]{@link google.cloud.aiplatform.v1beta1.IndexEndpoint}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listIndexEndpointsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listIndexEndpoints( - request?: protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint[], - protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsResponse - ]>; - listIndexEndpoints( - request: protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, - protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint>): void; - listIndexEndpoints( - request: protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, - protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint>): void; - listIndexEndpoints( - request?: protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, - protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, - protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint[], - protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listIndexEndpoints(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location from which to list the IndexEndpoints. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `index_endpoint` supports = and !=. `index_endpoint` represents the - * IndexEndpoint ID, ie. the last segment of the IndexEndpoint's - * {@link google.cloud.aiplatform.v1beta1.IndexEndpoint.name|resourcename}. - * * `display_name` supports =, != and regex() - * (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* or labels:key - key existence - * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `index_endpoint="1"` - * * `display_name="myDisplayName"` - * * `regex(display_name, "^A") -> The display name starts with an A. - * * `labels.myKey="myValue"` - * @param {number} [request.pageSize] - * Optional. The standard list page size. - * @param {string} [request.pageToken] - * Optional. The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListIndexEndpointsResponse.next_page_token|ListIndexEndpointsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.IndexEndpointService.ListIndexEndpoints|IndexEndpointService.ListIndexEndpoints} call. - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [IndexEndpoint]{@link google.cloud.aiplatform.v1beta1.IndexEndpoint} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listIndexEndpointsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listIndexEndpointsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listIndexEndpoints']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listIndexEndpoints.createStream( - this.innerApiCalls.listIndexEndpoints as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listIndexEndpoints`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location from which to list the IndexEndpoints. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `index_endpoint` supports = and !=. `index_endpoint` represents the - * IndexEndpoint ID, ie. the last segment of the IndexEndpoint's - * {@link google.cloud.aiplatform.v1beta1.IndexEndpoint.name|resourcename}. - * * `display_name` supports =, != and regex() - * (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) - * * `labels` supports general map functions that is: - * `labels.key=value` - key:value equality - * `labels.key:* or labels:key - key existence - * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `index_endpoint="1"` - * * `display_name="myDisplayName"` - * * `regex(display_name, "^A") -> The display name starts with an A. - * * `labels.myKey="myValue"` - * @param {number} [request.pageSize] - * Optional. The standard list page size. - * @param {string} [request.pageToken] - * Optional. The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListIndexEndpointsResponse.next_page_token|ListIndexEndpointsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.IndexEndpointService.ListIndexEndpoints|IndexEndpointService.ListIndexEndpoints} call. - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [IndexEndpoint]{@link google.cloud.aiplatform.v1beta1.IndexEndpoint}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexEndpointService_ListIndexEndpoints_async - */ - listIndexEndpointsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListIndexEndpointsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listIndexEndpoints']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listIndexEndpoints.asyncIterate( - this.innerApiCalls['listIndexEndpoints'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.indexEndpointServiceStub && !this._terminated) { - return this.indexEndpointServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_client_config.json deleted file mode 100644 index a2abf1a1..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_client_config.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1beta1.IndexEndpointService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateIndexEndpoint": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIndexEndpoint": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListIndexEndpoints": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateIndexEndpoint": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteIndexEndpoint": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeployIndex": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UndeployIndex": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "MutateDeployedIndex": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_proto_list.json deleted file mode 100644 index c916ab12..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_proto_list.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/context.proto", - "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1beta1/event.proto", - "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/io.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/study.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1beta1/types.proto", - "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1beta1/value.proto", - "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/index_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/index_service_client.ts deleted file mode 100644 index ad3d722d..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/index_service_client.ts +++ /dev/null @@ -1,2884 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/index_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './index_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * A service for creating and managing Vertex AI's Index resources. - * @class - * @memberof v1beta1 - */ -export class IndexServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - indexServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of IndexServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof IndexServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listIndexes: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'indexes') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const createIndexResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.Index') as gax.protobuf.Type; - const createIndexMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.CreateIndexOperationMetadata') as gax.protobuf.Type; - const updateIndexResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.Index') as gax.protobuf.Type; - const updateIndexMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.UpdateIndexOperationMetadata') as gax.protobuf.Type; - const deleteIndexResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteIndexMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createIndex: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createIndexResponse.decode.bind(createIndexResponse), - createIndexMetadata.decode.bind(createIndexMetadata)), - updateIndex: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateIndexResponse.decode.bind(updateIndexResponse), - updateIndexMetadata.decode.bind(updateIndexMetadata)), - deleteIndex: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteIndexResponse.decode.bind(deleteIndexResponse), - deleteIndexMetadata.decode.bind(deleteIndexMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1beta1.IndexService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.indexServiceStub) { - return this.indexServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1beta1.IndexService. - this.indexServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.IndexService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1beta1.IndexService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const indexServiceStubMethods = - ['createIndex', 'getIndex', 'listIndexes', 'updateIndex', 'deleteIndex']; - for (const methodName of indexServiceStubMethods) { - const callPromise = this.indexServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.indexServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets an Index. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Index resource. - * Format: - * `projects/{project}/locations/{location}/indexes/{index}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Index]{@link google.cloud.aiplatform.v1beta1.Index}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexService_GetIndex_async - */ - getIndex( - request?: protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IIndex, - protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest|undefined, {}|undefined - ]>; - getIndex( - request: protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IIndex, - protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest|null|undefined, - {}|null|undefined>): void; - getIndex( - request: protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IIndex, - protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest|null|undefined, - {}|null|undefined>): void; - getIndex( - request?: protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IIndex, - protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IIndex, - protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IIndex, - protos.google.cloud.aiplatform.v1beta1.IGetIndexRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getIndex(request, options, callback); - } - -/** - * Creates an Index. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the Index in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1beta1.Index} request.index - * Required. The Index to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexService_CreateIndex_async - */ - createIndex( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateIndexRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createIndex( - request: protos.google.cloud.aiplatform.v1beta1.ICreateIndexRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createIndex( - request: protos.google.cloud.aiplatform.v1beta1.ICreateIndexRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createIndex( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateIndexRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createIndex(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createIndex()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexService_CreateIndex_async - */ - async checkCreateIndexProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createIndex, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates an Index. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1beta1.Index} request.index - * Required. The Index which updates the resource on the server. - * @param {google.protobuf.FieldMask} request.updateMask - * The update mask applies to the resource. - * For the `FieldMask` definition, see {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexService_UpdateIndex_async - */ - updateIndex( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateIndexRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateIndex( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateIndexRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateIndex( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateIndexRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateIndex( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateIndexRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'index.name': request.index!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateIndex(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateIndex()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexService_UpdateIndex_async - */ - async checkUpdateIndexProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateIndex, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes an Index. - * An Index can only be deleted when all its - * {@link google.cloud.aiplatform.v1beta1.Index.deployed_indexes|DeployedIndexes} had been undeployed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Index resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/indexes/{index}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexService_DeleteIndex_async - */ - deleteIndex( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteIndexRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteIndex( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteIndexRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteIndex( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteIndexRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteIndex( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteIndexRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteIndex(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteIndex()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexService_DeleteIndex_async - */ - async checkDeleteIndexProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteIndex, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Indexes in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location from which to list the Indexes. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListIndexesResponse.next_page_token|ListIndexesResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.IndexService.ListIndexes|IndexService.ListIndexes} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Index]{@link google.cloud.aiplatform.v1beta1.Index}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listIndexesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listIndexes( - request?: protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IIndex[], - protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListIndexesResponse - ]>; - listIndexes( - request: protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, - protos.google.cloud.aiplatform.v1beta1.IListIndexesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IIndex>): void; - listIndexes( - request: protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, - protos.google.cloud.aiplatform.v1beta1.IListIndexesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IIndex>): void; - listIndexes( - request?: protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, - protos.google.cloud.aiplatform.v1beta1.IListIndexesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IIndex>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, - protos.google.cloud.aiplatform.v1beta1.IListIndexesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IIndex>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IIndex[], - protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListIndexesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listIndexes(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location from which to list the Indexes. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListIndexesResponse.next_page_token|ListIndexesResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.IndexService.ListIndexes|IndexService.ListIndexes} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Index]{@link google.cloud.aiplatform.v1beta1.Index} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listIndexesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listIndexesStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listIndexes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listIndexes.createStream( - this.innerApiCalls.listIndexes as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listIndexes`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location from which to list the Indexes. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListIndexesResponse.next_page_token|ListIndexesResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.IndexService.ListIndexes|IndexService.ListIndexes} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Index]{@link google.cloud.aiplatform.v1beta1.Index}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_IndexService_ListIndexes_async - */ - listIndexesAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListIndexesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listIndexes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listIndexes.asyncIterate( - this.innerApiCalls['listIndexes'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.indexServiceStub && !this._terminated) { - return this.indexServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/index_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/index_service_client_config.json deleted file mode 100644 index 8151fa3e..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/index_service_client_config.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1beta1.IndexService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateIndex": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIndex": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListIndexes": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateIndex": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteIndex": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/index_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/index_service_proto_list.json deleted file mode 100644 index c916ab12..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/index_service_proto_list.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/context.proto", - "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1beta1/event.proto", - "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/io.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/study.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1beta1/types.proto", - "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1beta1/value.proto", - "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/job_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/job_service_client.ts deleted file mode 100644 index 914cc185..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/job_service_client.ts +++ /dev/null @@ -1,5577 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/job_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './job_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * A service for creating and managing Vertex AI's jobs. - * @class - * @memberof v1beta1 - */ -export class JobServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - jobServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of JobServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof JobServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listCustomJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customJobs'), - listDataLabelingJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dataLabelingJobs'), - listHyperparameterTuningJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'hyperparameterTuningJobs'), - listBatchPredictionJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'batchPredictionJobs'), - searchModelDeploymentMonitoringStatsAnomalies: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'monitoringStats'), - listModelDeploymentMonitoringJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'modelDeploymentMonitoringJobs') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const deleteCustomJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteCustomJobMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const deleteDataLabelingJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteDataLabelingJobMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const deleteHyperparameterTuningJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteHyperparameterTuningJobMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const deleteBatchPredictionJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteBatchPredictionJobMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const updateModelDeploymentMonitoringJobResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob') as gax.protobuf.Type; - const updateModelDeploymentMonitoringJobMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.UpdateModelDeploymentMonitoringJobOperationMetadata') as gax.protobuf.Type; - const deleteModelDeploymentMonitoringJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteModelDeploymentMonitoringJobMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - deleteCustomJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteCustomJobResponse.decode.bind(deleteCustomJobResponse), - deleteCustomJobMetadata.decode.bind(deleteCustomJobMetadata)), - deleteDataLabelingJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteDataLabelingJobResponse.decode.bind(deleteDataLabelingJobResponse), - deleteDataLabelingJobMetadata.decode.bind(deleteDataLabelingJobMetadata)), - deleteHyperparameterTuningJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteHyperparameterTuningJobResponse.decode.bind(deleteHyperparameterTuningJobResponse), - deleteHyperparameterTuningJobMetadata.decode.bind(deleteHyperparameterTuningJobMetadata)), - deleteBatchPredictionJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteBatchPredictionJobResponse.decode.bind(deleteBatchPredictionJobResponse), - deleteBatchPredictionJobMetadata.decode.bind(deleteBatchPredictionJobMetadata)), - updateModelDeploymentMonitoringJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateModelDeploymentMonitoringJobResponse.decode.bind(updateModelDeploymentMonitoringJobResponse), - updateModelDeploymentMonitoringJobMetadata.decode.bind(updateModelDeploymentMonitoringJobMetadata)), - deleteModelDeploymentMonitoringJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteModelDeploymentMonitoringJobResponse.decode.bind(deleteModelDeploymentMonitoringJobResponse), - deleteModelDeploymentMonitoringJobMetadata.decode.bind(deleteModelDeploymentMonitoringJobMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1beta1.JobService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.jobServiceStub) { - return this.jobServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1beta1.JobService. - this.jobServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.JobService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1beta1.JobService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const jobServiceStubMethods = - ['createCustomJob', 'getCustomJob', 'listCustomJobs', 'deleteCustomJob', 'cancelCustomJob', 'createDataLabelingJob', 'getDataLabelingJob', 'listDataLabelingJobs', 'deleteDataLabelingJob', 'cancelDataLabelingJob', 'createHyperparameterTuningJob', 'getHyperparameterTuningJob', 'listHyperparameterTuningJobs', 'deleteHyperparameterTuningJob', 'cancelHyperparameterTuningJob', 'createBatchPredictionJob', 'getBatchPredictionJob', 'listBatchPredictionJobs', 'deleteBatchPredictionJob', 'cancelBatchPredictionJob', 'createModelDeploymentMonitoringJob', 'searchModelDeploymentMonitoringStatsAnomalies', 'getModelDeploymentMonitoringJob', 'listModelDeploymentMonitoringJobs', 'updateModelDeploymentMonitoringJob', 'deleteModelDeploymentMonitoringJob', 'pauseModelDeploymentMonitoringJob', 'resumeModelDeploymentMonitoringJob']; - for (const methodName of jobServiceStubMethods) { - const callPromise = this.jobServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.jobServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Creates a CustomJob. A created CustomJob right away - * will be attempted to be run. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the CustomJob in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1beta1.CustomJob} request.customJob - * Required. The CustomJob to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CustomJob]{@link google.cloud.aiplatform.v1beta1.CustomJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_CreateCustomJob_async - */ - createCustomJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ICustomJob, - protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest|undefined, {}|undefined - ]>; - createCustomJob( - request: protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ICustomJob, - protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest|null|undefined, - {}|null|undefined>): void; - createCustomJob( - request: protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ICustomJob, - protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest|null|undefined, - {}|null|undefined>): void; - createCustomJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ICustomJob, - protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ICustomJob, - protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ICustomJob, - protos.google.cloud.aiplatform.v1beta1.ICreateCustomJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createCustomJob(request, options, callback); - } -/** - * Gets a CustomJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the CustomJob resource. - * Format: - * `projects/{project}/locations/{location}/customJobs/{custom_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CustomJob]{@link google.cloud.aiplatform.v1beta1.CustomJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_GetCustomJob_async - */ - getCustomJob( - request?: protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ICustomJob, - protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest|undefined, {}|undefined - ]>; - getCustomJob( - request: protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ICustomJob, - protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest|null|undefined, - {}|null|undefined>): void; - getCustomJob( - request: protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ICustomJob, - protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest|null|undefined, - {}|null|undefined>): void; - getCustomJob( - request?: protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ICustomJob, - protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ICustomJob, - protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ICustomJob, - protos.google.cloud.aiplatform.v1beta1.IGetCustomJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getCustomJob(request, options, callback); - } -/** - * Cancels a CustomJob. - * Starts asynchronous cancellation on the CustomJob. The server - * makes a best effort to cancel the job, but success is not - * guaranteed. Clients can use {@link google.cloud.aiplatform.v1beta1.JobService.GetCustomJob|JobService.GetCustomJob} or - * other methods to check whether the cancellation succeeded or whether the - * job completed despite cancellation. On successful cancellation, - * the CustomJob is not deleted; instead it becomes a job with - * a {@link google.cloud.aiplatform.v1beta1.CustomJob.error|CustomJob.error} value with a {@link google.rpc.Status.code|google.rpc.Status.code} of 1, - * corresponding to `Code.CANCELLED`, and {@link google.cloud.aiplatform.v1beta1.CustomJob.state|CustomJob.state} is set to - * `CANCELLED`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the CustomJob to cancel. - * Format: - * `projects/{project}/locations/{location}/customJobs/{custom_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_CancelCustomJob_async - */ - cancelCustomJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest|undefined, {}|undefined - ]>; - cancelCustomJob( - request: protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest|null|undefined, - {}|null|undefined>): void; - cancelCustomJob( - request: protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest|null|undefined, - {}|null|undefined>): void; - cancelCustomJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelCustomJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.cancelCustomJob(request, options, callback); - } -/** - * Creates a DataLabelingJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent of the DataLabelingJob. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1beta1.DataLabelingJob} request.dataLabelingJob - * Required. The DataLabelingJob to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [DataLabelingJob]{@link google.cloud.aiplatform.v1beta1.DataLabelingJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_CreateDataLabelingJob_async - */ - createDataLabelingJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest|undefined, {}|undefined - ]>; - createDataLabelingJob( - request: protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest|null|undefined, - {}|null|undefined>): void; - createDataLabelingJob( - request: protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest|null|undefined, - {}|null|undefined>): void; - createDataLabelingJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1beta1.ICreateDataLabelingJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createDataLabelingJob(request, options, callback); - } -/** - * Gets a DataLabelingJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DataLabelingJob. - * Format: - * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [DataLabelingJob]{@link google.cloud.aiplatform.v1beta1.DataLabelingJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_GetDataLabelingJob_async - */ - getDataLabelingJob( - request?: protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest|undefined, {}|undefined - ]>; - getDataLabelingJob( - request: protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest|null|undefined, - {}|null|undefined>): void; - getDataLabelingJob( - request: protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest|null|undefined, - {}|null|undefined>): void; - getDataLabelingJob( - request?: protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob, - protos.google.cloud.aiplatform.v1beta1.IGetDataLabelingJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getDataLabelingJob(request, options, callback); - } -/** - * Cancels a DataLabelingJob. Success of cancellation is not guaranteed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DataLabelingJob. - * Format: - * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_CancelDataLabelingJob_async - */ - cancelDataLabelingJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest|undefined, {}|undefined - ]>; - cancelDataLabelingJob( - request: protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest|null|undefined, - {}|null|undefined>): void; - cancelDataLabelingJob( - request: protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest|null|undefined, - {}|null|undefined>): void; - cancelDataLabelingJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelDataLabelingJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.cancelDataLabelingJob(request, options, callback); - } -/** - * Creates a HyperparameterTuningJob - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the HyperparameterTuningJob in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1beta1.HyperparameterTuningJob} request.hyperparameterTuningJob - * Required. The HyperparameterTuningJob to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_CreateHyperparameterTuningJob_async - */ - createHyperparameterTuningJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest|undefined, {}|undefined - ]>; - createHyperparameterTuningJob( - request: protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>): void; - createHyperparameterTuningJob( - request: protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>): void; - createHyperparameterTuningJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1beta1.ICreateHyperparameterTuningJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createHyperparameterTuningJob(request, options, callback); - } -/** - * Gets a HyperparameterTuningJob - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the HyperparameterTuningJob resource. - * Format: - * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_GetHyperparameterTuningJob_async - */ - getHyperparameterTuningJob( - request?: protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest|undefined, {}|undefined - ]>; - getHyperparameterTuningJob( - request: protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>): void; - getHyperparameterTuningJob( - request: protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>): void; - getHyperparameterTuningJob( - request?: protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob, - protos.google.cloud.aiplatform.v1beta1.IGetHyperparameterTuningJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getHyperparameterTuningJob(request, options, callback); - } -/** - * Cancels a HyperparameterTuningJob. - * Starts asynchronous cancellation on the HyperparameterTuningJob. The server - * makes a best effort to cancel the job, but success is not - * guaranteed. Clients can use {@link google.cloud.aiplatform.v1beta1.JobService.GetHyperparameterTuningJob|JobService.GetHyperparameterTuningJob} or - * other methods to check whether the cancellation succeeded or whether the - * job completed despite cancellation. On successful cancellation, - * the HyperparameterTuningJob is not deleted; instead it becomes a job with - * a {@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.error|HyperparameterTuningJob.error} value with a {@link google.rpc.Status.code|google.rpc.Status.code} - * of 1, corresponding to `Code.CANCELLED`, and - * {@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob.state|HyperparameterTuningJob.state} is set to `CANCELLED`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the HyperparameterTuningJob to cancel. - * Format: - * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_CancelHyperparameterTuningJob_async - */ - cancelHyperparameterTuningJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest|undefined, {}|undefined - ]>; - cancelHyperparameterTuningJob( - request: protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>): void; - cancelHyperparameterTuningJob( - request: protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>): void; - cancelHyperparameterTuningJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelHyperparameterTuningJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.cancelHyperparameterTuningJob(request, options, callback); - } -/** - * Creates a BatchPredictionJob. A BatchPredictionJob once created will - * right away be attempted to start. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the BatchPredictionJob in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1beta1.BatchPredictionJob} request.batchPredictionJob - * Required. The BatchPredictionJob to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchPredictionJob]{@link google.cloud.aiplatform.v1beta1.BatchPredictionJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_CreateBatchPredictionJob_async - */ - createBatchPredictionJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest|undefined, {}|undefined - ]>; - createBatchPredictionJob( - request: protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest|null|undefined, - {}|null|undefined>): void; - createBatchPredictionJob( - request: protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest|null|undefined, - {}|null|undefined>): void; - createBatchPredictionJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1beta1.ICreateBatchPredictionJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createBatchPredictionJob(request, options, callback); - } -/** - * Gets a BatchPredictionJob - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the BatchPredictionJob resource. - * Format: - * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchPredictionJob]{@link google.cloud.aiplatform.v1beta1.BatchPredictionJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_GetBatchPredictionJob_async - */ - getBatchPredictionJob( - request?: protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest|undefined, {}|undefined - ]>; - getBatchPredictionJob( - request: protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest|null|undefined, - {}|null|undefined>): void; - getBatchPredictionJob( - request: protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest|null|undefined, - {}|null|undefined>): void; - getBatchPredictionJob( - request?: protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob, - protos.google.cloud.aiplatform.v1beta1.IGetBatchPredictionJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getBatchPredictionJob(request, options, callback); - } -/** - * Cancels a BatchPredictionJob. - * - * Starts asynchronous cancellation on the BatchPredictionJob. The server - * makes the best effort to cancel the job, but success is not - * guaranteed. Clients can use {@link google.cloud.aiplatform.v1beta1.JobService.GetBatchPredictionJob|JobService.GetBatchPredictionJob} or - * other methods to check whether the cancellation succeeded or whether the - * job completed despite cancellation. On a successful cancellation, - * the BatchPredictionJob is not deleted;instead its - * {@link google.cloud.aiplatform.v1beta1.BatchPredictionJob.state|BatchPredictionJob.state} is set to `CANCELLED`. Any files already - * outputted by the job are not deleted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the BatchPredictionJob to cancel. - * Format: - * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_CancelBatchPredictionJob_async - */ - cancelBatchPredictionJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest|undefined, {}|undefined - ]>; - cancelBatchPredictionJob( - request: protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest|null|undefined, - {}|null|undefined>): void; - cancelBatchPredictionJob( - request: protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest|null|undefined, - {}|null|undefined>): void; - cancelBatchPredictionJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelBatchPredictionJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.cancelBatchPredictionJob(request, options, callback); - } -/** - * Creates a ModelDeploymentMonitoringJob. It will run periodically on a - * configured interval. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent of the ModelDeploymentMonitoringJob. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob} request.modelDeploymentMonitoringJob - * Required. The ModelDeploymentMonitoringJob to create - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_CreateModelDeploymentMonitoringJob_async - */ - createModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest|undefined, {}|undefined - ]>; - createModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): void; - createModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): void; - createModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1beta1.ICreateModelDeploymentMonitoringJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createModelDeploymentMonitoringJob(request, options, callback); - } -/** - * Gets a ModelDeploymentMonitoringJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the ModelDeploymentMonitoringJob. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_GetModelDeploymentMonitoringJob_async - */ - getModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest|undefined, {}|undefined - ]>; - getModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): void; - getModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): void; - getModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob, - protos.google.cloud.aiplatform.v1beta1.IGetModelDeploymentMonitoringJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getModelDeploymentMonitoringJob(request, options, callback); - } -/** - * Pauses a ModelDeploymentMonitoringJob. If the job is running, the server - * makes a best effort to cancel the job. Will mark - * {@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob.state|ModelDeploymentMonitoringJob.state} to 'PAUSED'. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the ModelDeploymentMonitoringJob to pause. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_PauseModelDeploymentMonitoringJob_async - */ - pauseModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest|undefined, {}|undefined - ]>; - pauseModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): void; - pauseModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): void; - pauseModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IPauseModelDeploymentMonitoringJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.pauseModelDeploymentMonitoringJob(request, options, callback); - } -/** - * Resumes a paused ModelDeploymentMonitoringJob. It will start to run from - * next scheduled time. A deleted ModelDeploymentMonitoringJob can't be - * resumed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the ModelDeploymentMonitoringJob to resume. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_ResumeModelDeploymentMonitoringJob_async - */ - resumeModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest|undefined, {}|undefined - ]>; - resumeModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): void; - resumeModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): void; - resumeModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IResumeModelDeploymentMonitoringJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.resumeModelDeploymentMonitoringJob(request, options, callback); - } - -/** - * Deletes a CustomJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the CustomJob resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/customJobs/{custom_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_DeleteCustomJob_async - */ - deleteCustomJob( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteCustomJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteCustomJob( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteCustomJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteCustomJob( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteCustomJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteCustomJob( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteCustomJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteCustomJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteCustomJob()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_DeleteCustomJob_async - */ - async checkDeleteCustomJobProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteCustomJob, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a DataLabelingJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DataLabelingJob to be deleted. - * Format: - * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_DeleteDataLabelingJob_async - */ - deleteDataLabelingJob( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteDataLabelingJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteDataLabelingJob( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteDataLabelingJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteDataLabelingJob( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteDataLabelingJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteDataLabelingJob( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteDataLabelingJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteDataLabelingJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteDataLabelingJob()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_DeleteDataLabelingJob_async - */ - async checkDeleteDataLabelingJobProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteDataLabelingJob, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a HyperparameterTuningJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the HyperparameterTuningJob resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_DeleteHyperparameterTuningJob_async - */ - deleteHyperparameterTuningJob( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteHyperparameterTuningJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteHyperparameterTuningJob( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteHyperparameterTuningJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteHyperparameterTuningJob( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteHyperparameterTuningJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteHyperparameterTuningJob( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteHyperparameterTuningJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteHyperparameterTuningJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteHyperparameterTuningJob()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_DeleteHyperparameterTuningJob_async - */ - async checkDeleteHyperparameterTuningJobProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteHyperparameterTuningJob, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a BatchPredictionJob. Can only be called on jobs that already - * finished. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the BatchPredictionJob resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_DeleteBatchPredictionJob_async - */ - deleteBatchPredictionJob( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteBatchPredictionJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteBatchPredictionJob( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteBatchPredictionJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteBatchPredictionJob( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteBatchPredictionJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteBatchPredictionJob( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteBatchPredictionJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteBatchPredictionJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteBatchPredictionJob()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_DeleteBatchPredictionJob_async - */ - async checkDeleteBatchPredictionJobProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteBatchPredictionJob, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates a ModelDeploymentMonitoringJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob} request.modelDeploymentMonitoringJob - * Required. The model monitoring configuration which replaces the resource on the - * server. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The update mask is used to specify the fields to be overwritten in the - * ModelDeploymentMonitoringJob resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then only the non-empty fields present in the - * request will be overwritten. Set the update_mask to `*` to override all - * fields. - * For the objective config, the user can either provide the update mask for - * model_deployment_monitoring_objective_configs or any combination of its - * nested fields, such as: - * model_deployment_monitoring_objective_configs.objective_config.training_dataset. - * - * Updatable fields: - * - * * `display_name` - * * `model_deployment_monitoring_schedule_config` - * * `model_monitoring_alert_config` - * * `logging_sampling_strategy` - * * `labels` - * * `log_ttl` - * * `enable_monitoring_pipeline_logs` - * . and - * * `model_deployment_monitoring_objective_configs` - * . or - * * `model_deployment_monitoring_objective_configs.objective_config.training_dataset` - * * `model_deployment_monitoring_objective_configs.objective_config.training_prediction_skew_detection_config` - * * `model_deployment_monitoring_objective_configs.objective_config.prediction_drift_detection_config` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_UpdateModelDeploymentMonitoringJob_async - */ - updateModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateModelDeploymentMonitoringJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateModelDeploymentMonitoringJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateModelDeploymentMonitoringJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateModelDeploymentMonitoringJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'model_deployment_monitoring_job.name': request.modelDeploymentMonitoringJob!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateModelDeploymentMonitoringJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateModelDeploymentMonitoringJob()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_UpdateModelDeploymentMonitoringJob_async - */ - async checkUpdateModelDeploymentMonitoringJobProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateModelDeploymentMonitoringJob, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a ModelDeploymentMonitoringJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the model monitoring job to delete. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_DeleteModelDeploymentMonitoringJob_async - */ - deleteModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteModelDeploymentMonitoringJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteModelDeploymentMonitoringJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteModelDeploymentMonitoringJob( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteModelDeploymentMonitoringJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteModelDeploymentMonitoringJob( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteModelDeploymentMonitoringJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteModelDeploymentMonitoringJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteModelDeploymentMonitoringJob()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_DeleteModelDeploymentMonitoringJob_async - */ - async checkDeleteModelDeploymentMonitoringJobProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteModelDeploymentMonitoringJob, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists CustomJobs in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the CustomJobs from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListCustomJobsResponse.next_page_token|ListCustomJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.JobService.ListCustomJobs|JobService.ListCustomJobs} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [CustomJob]{@link google.cloud.aiplatform.v1beta1.CustomJob}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listCustomJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listCustomJobs( - request?: protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ICustomJob[], - protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListCustomJobsResponse - ]>; - listCustomJobs( - request: protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListCustomJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ICustomJob>): void; - listCustomJobs( - request: protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListCustomJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ICustomJob>): void; - listCustomJobs( - request?: protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListCustomJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ICustomJob>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListCustomJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ICustomJob>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ICustomJob[], - protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListCustomJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listCustomJobs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the CustomJobs from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListCustomJobsResponse.next_page_token|ListCustomJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.JobService.ListCustomJobs|JobService.ListCustomJobs} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [CustomJob]{@link google.cloud.aiplatform.v1beta1.CustomJob} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listCustomJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listCustomJobsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listCustomJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listCustomJobs.createStream( - this.innerApiCalls.listCustomJobs as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listCustomJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the CustomJobs from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListCustomJobsResponse.next_page_token|ListCustomJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.JobService.ListCustomJobs|JobService.ListCustomJobs} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [CustomJob]{@link google.cloud.aiplatform.v1beta1.CustomJob}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_ListCustomJobs_async - */ - listCustomJobsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListCustomJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listCustomJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listCustomJobs.asyncIterate( - this.innerApiCalls['listCustomJobs'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists DataLabelingJobs in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent of the DataLabelingJob. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. FieldMask represents a set of - * symbolic field paths. For example, the mask can be `paths: "name"`. The - * "name" here is a field in DataLabelingJob. - * If this field is not set, all fields of the DataLabelingJob are returned. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order by - * default. - * Use `desc` after a field name for descending. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [DataLabelingJob]{@link google.cloud.aiplatform.v1beta1.DataLabelingJob}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDataLabelingJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDataLabelingJobs( - request?: protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob[], - protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsResponse - ]>; - listDataLabelingJobs( - request: protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob>): void; - listDataLabelingJobs( - request: protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob>): void; - listDataLabelingJobs( - request?: protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob[], - protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listDataLabelingJobs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent of the DataLabelingJob. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. FieldMask represents a set of - * symbolic field paths. For example, the mask can be `paths: "name"`. The - * "name" here is a field in DataLabelingJob. - * If this field is not set, all fields of the DataLabelingJob are returned. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order by - * default. - * Use `desc` after a field name for descending. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [DataLabelingJob]{@link google.cloud.aiplatform.v1beta1.DataLabelingJob} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDataLabelingJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDataLabelingJobsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDataLabelingJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDataLabelingJobs.createStream( - this.innerApiCalls.listDataLabelingJobs as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDataLabelingJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent of the DataLabelingJob. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. FieldMask represents a set of - * symbolic field paths. For example, the mask can be `paths: "name"`. The - * "name" here is a field in DataLabelingJob. - * If this field is not set, all fields of the DataLabelingJob are returned. - * @param {string} request.orderBy - * A comma-separated list of fields to order by, sorted in ascending order by - * default. - * Use `desc` after a field name for descending. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [DataLabelingJob]{@link google.cloud.aiplatform.v1beta1.DataLabelingJob}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_ListDataLabelingJobs_async - */ - listDataLabelingJobsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListDataLabelingJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDataLabelingJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDataLabelingJobs.asyncIterate( - this.innerApiCalls['listDataLabelingJobs'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists HyperparameterTuningJobs in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the HyperparameterTuningJobs - * from. Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsResponse.next_page_token|ListHyperparameterTuningJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.JobService.ListHyperparameterTuningJobs|JobService.ListHyperparameterTuningJobs} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listHyperparameterTuningJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listHyperparameterTuningJobs( - request?: protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob[], - protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsResponse - ]>; - listHyperparameterTuningJobs( - request: protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob>): void; - listHyperparameterTuningJobs( - request: protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob>): void; - listHyperparameterTuningJobs( - request?: protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob[], - protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listHyperparameterTuningJobs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the HyperparameterTuningJobs - * from. Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsResponse.next_page_token|ListHyperparameterTuningJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.JobService.ListHyperparameterTuningJobs|JobService.ListHyperparameterTuningJobs} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listHyperparameterTuningJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listHyperparameterTuningJobsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listHyperparameterTuningJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listHyperparameterTuningJobs.createStream( - this.innerApiCalls.listHyperparameterTuningJobs as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listHyperparameterTuningJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the HyperparameterTuningJobs - * from. Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsResponse.next_page_token|ListHyperparameterTuningJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.JobService.ListHyperparameterTuningJobs|JobService.ListHyperparameterTuningJobs} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [HyperparameterTuningJob]{@link google.cloud.aiplatform.v1beta1.HyperparameterTuningJob}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_ListHyperparameterTuningJobs_async - */ - listHyperparameterTuningJobsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListHyperparameterTuningJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listHyperparameterTuningJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listHyperparameterTuningJobs.asyncIterate( - this.innerApiCalls['listHyperparameterTuningJobs'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists BatchPredictionJobs in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the BatchPredictionJobs - * from. Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * * `model_display_name` supports = and != - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsResponse.next_page_token|ListBatchPredictionJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.JobService.ListBatchPredictionJobs|JobService.ListBatchPredictionJobs} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [BatchPredictionJob]{@link google.cloud.aiplatform.v1beta1.BatchPredictionJob}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listBatchPredictionJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listBatchPredictionJobs( - request?: protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob[], - protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsResponse - ]>; - listBatchPredictionJobs( - request: protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob>): void; - listBatchPredictionJobs( - request: protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob>): void; - listBatchPredictionJobs( - request?: protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob[], - protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listBatchPredictionJobs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the BatchPredictionJobs - * from. Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * * `model_display_name` supports = and != - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsResponse.next_page_token|ListBatchPredictionJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.JobService.ListBatchPredictionJobs|JobService.ListBatchPredictionJobs} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [BatchPredictionJob]{@link google.cloud.aiplatform.v1beta1.BatchPredictionJob} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listBatchPredictionJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listBatchPredictionJobsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listBatchPredictionJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listBatchPredictionJobs.createStream( - this.innerApiCalls.listBatchPredictionJobs as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listBatchPredictionJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the BatchPredictionJobs - * from. Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * * `model_display_name` supports = and != - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name="my_job"` - * - * * `state="JOB_STATE_RUNNING" OR display_name="my_job"` - * - * * `NOT display_name="my_job"` - * - * * `state="JOB_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsResponse.next_page_token|ListBatchPredictionJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.JobService.ListBatchPredictionJobs|JobService.ListBatchPredictionJobs} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [BatchPredictionJob]{@link google.cloud.aiplatform.v1beta1.BatchPredictionJob}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_ListBatchPredictionJobs_async - */ - listBatchPredictionJobsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListBatchPredictionJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listBatchPredictionJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listBatchPredictionJobs.asyncIterate( - this.innerApiCalls['listBatchPredictionJobs'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Searches Model Monitoring Statistics generated within a given time window. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.modelDeploymentMonitoringJob - * Required. ModelDeploymentMonitoring Job resource name. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param {string} request.deployedModelId - * Required. The DeployedModel ID of the - * [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. - * @param {string} request.featureDisplayName - * The feature display name. If specified, only return the stats belonging to - * this feature. Format: - * {@link google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name|ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name}, - * example: "user_destination". - * @param {number[]} request.objectives - * Required. Objectives of the stats to retrieve. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * A page token received from a previous - * {@link google.cloud.aiplatform.v1beta1.JobService.SearchModelDeploymentMonitoringStatsAnomalies|JobService.SearchModelDeploymentMonitoringStatsAnomalies} - * call. - * @param {google.protobuf.Timestamp} request.startTime - * The earliest timestamp of stats being generated. - * If not set, indicates fetching stats till the earliest possible one. - * @param {google.protobuf.Timestamp} request.endTime - * The latest timestamp of stats being generated. - * If not set, indicates feching stats till the latest possible one. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [ModelMonitoringStatsAnomalies]{@link google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `searchModelDeploymentMonitoringStatsAnomaliesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - searchModelDeploymentMonitoringStatsAnomalies( - request?: protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModelMonitoringStatsAnomalies[], - protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest|null, - protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse - ]>; - searchModelDeploymentMonitoringStatsAnomalies( - request: protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModelMonitoringStatsAnomalies>): void; - searchModelDeploymentMonitoringStatsAnomalies( - request: protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModelMonitoringStatsAnomalies>): void; - searchModelDeploymentMonitoringStatsAnomalies( - request?: protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModelMonitoringStatsAnomalies>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModelMonitoringStatsAnomalies>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModelMonitoringStatsAnomalies[], - protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest|null, - protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'model_deployment_monitoring_job': request.modelDeploymentMonitoringJob || '', - }); - this.initialize(); - return this.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.modelDeploymentMonitoringJob - * Required. ModelDeploymentMonitoring Job resource name. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param {string} request.deployedModelId - * Required. The DeployedModel ID of the - * [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. - * @param {string} request.featureDisplayName - * The feature display name. If specified, only return the stats belonging to - * this feature. Format: - * {@link google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name|ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name}, - * example: "user_destination". - * @param {number[]} request.objectives - * Required. Objectives of the stats to retrieve. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * A page token received from a previous - * {@link google.cloud.aiplatform.v1beta1.JobService.SearchModelDeploymentMonitoringStatsAnomalies|JobService.SearchModelDeploymentMonitoringStatsAnomalies} - * call. - * @param {google.protobuf.Timestamp} request.startTime - * The earliest timestamp of stats being generated. - * If not set, indicates fetching stats till the earliest possible one. - * @param {google.protobuf.Timestamp} request.endTime - * The latest timestamp of stats being generated. - * If not set, indicates feching stats till the latest possible one. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [ModelMonitoringStatsAnomalies]{@link google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `searchModelDeploymentMonitoringStatsAnomaliesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - searchModelDeploymentMonitoringStatsAnomaliesStream( - request?: protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'model_deployment_monitoring_job': request.modelDeploymentMonitoringJob || '', - }); - const defaultCallSettings = this._defaults['searchModelDeploymentMonitoringStatsAnomalies']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream( - this.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `searchModelDeploymentMonitoringStatsAnomalies`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.modelDeploymentMonitoringJob - * Required. ModelDeploymentMonitoring Job resource name. - * Format: - * `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}` - * @param {string} request.deployedModelId - * Required. The DeployedModel ID of the - * [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. - * @param {string} request.featureDisplayName - * The feature display name. If specified, only return the stats belonging to - * this feature. Format: - * {@link google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name|ModelMonitoringStatsAnomalies.FeatureHistoricStatsAnomalies.feature_display_name}, - * example: "user_destination". - * @param {number[]} request.objectives - * Required. Objectives of the stats to retrieve. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * A page token received from a previous - * {@link google.cloud.aiplatform.v1beta1.JobService.SearchModelDeploymentMonitoringStatsAnomalies|JobService.SearchModelDeploymentMonitoringStatsAnomalies} - * call. - * @param {google.protobuf.Timestamp} request.startTime - * The earliest timestamp of stats being generated. - * If not set, indicates fetching stats till the earliest possible one. - * @param {google.protobuf.Timestamp} request.endTime - * The latest timestamp of stats being generated. - * If not set, indicates feching stats till the latest possible one. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [ModelMonitoringStatsAnomalies]{@link google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_SearchModelDeploymentMonitoringStatsAnomalies_async - */ - searchModelDeploymentMonitoringStatsAnomaliesAsync( - request?: protos.google.cloud.aiplatform.v1beta1.ISearchModelDeploymentMonitoringStatsAnomaliesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'model_deployment_monitoring_job': request.modelDeploymentMonitoringJob || '', - }); - const defaultCallSettings = this._defaults['searchModelDeploymentMonitoringStatsAnomalies']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate( - this.innerApiCalls['searchModelDeploymentMonitoringStatsAnomalies'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists ModelDeploymentMonitoringJobs in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent of the ModelDeploymentMonitoringJob. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listModelDeploymentMonitoringJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listModelDeploymentMonitoringJobs( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob[], - protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsResponse - ]>; - listModelDeploymentMonitoringJobs( - request: protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob>): void; - listModelDeploymentMonitoringJobs( - request: protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob>): void; - listModelDeploymentMonitoringJobs( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob[], - protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listModelDeploymentMonitoringJobs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent of the ModelDeploymentMonitoringJob. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listModelDeploymentMonitoringJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listModelDeploymentMonitoringJobsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listModelDeploymentMonitoringJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listModelDeploymentMonitoringJobs.createStream( - this.innerApiCalls.listModelDeploymentMonitoringJobs as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listModelDeploymentMonitoringJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent of the ModelDeploymentMonitoringJob. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [ModelDeploymentMonitoringJob]{@link google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_JobService_ListModelDeploymentMonitoringJobs_async - */ - listModelDeploymentMonitoringJobsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelDeploymentMonitoringJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listModelDeploymentMonitoringJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate( - this.innerApiCalls['listModelDeploymentMonitoringJobs'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.jobServiceStub && !this._terminated) { - return this.jobServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/job_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/job_service_client_config.json deleted file mode 100644 index 8c3c6dd4..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/job_service_client_config.json +++ /dev/null @@ -1,166 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1beta1.JobService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateCustomJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetCustomJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListCustomJobs": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteCustomJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelCustomJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateDataLabelingJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetDataLabelingJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListDataLabelingJobs": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteDataLabelingJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelDataLabelingJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateHyperparameterTuningJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetHyperparameterTuningJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListHyperparameterTuningJobs": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteHyperparameterTuningJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelHyperparameterTuningJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateBatchPredictionJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetBatchPredictionJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListBatchPredictionJobs": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteBatchPredictionJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelBatchPredictionJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateModelDeploymentMonitoringJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SearchModelDeploymentMonitoringStatsAnomalies": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetModelDeploymentMonitoringJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListModelDeploymentMonitoringJobs": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateModelDeploymentMonitoringJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteModelDeploymentMonitoringJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PauseModelDeploymentMonitoringJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ResumeModelDeploymentMonitoringJob": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/job_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/job_service_proto_list.json deleted file mode 100644 index c916ab12..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/job_service_proto_list.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/context.proto", - "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1beta1/event.proto", - "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/io.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/study.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1beta1/types.proto", - "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1beta1/value.proto", - "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_client.ts deleted file mode 100644 index 8e52506f..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_client.ts +++ /dev/null @@ -1,5917 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/metadata_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './metadata_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * Service for reading and writing metadata entries. - * @class - * @memberof v1beta1 - */ -export class MetadataServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - metadataServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of MetadataServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof MetadataServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listMetadataStores: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'metadataStores'), - listArtifacts: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'artifacts'), - listContexts: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'contexts'), - listExecutions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'executions'), - listMetadataSchemas: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'metadataSchemas') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const createMetadataStoreResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.MetadataStore') as gax.protobuf.Type; - const createMetadataStoreMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.CreateMetadataStoreOperationMetadata') as gax.protobuf.Type; - const deleteMetadataStoreResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteMetadataStoreMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteMetadataStoreOperationMetadata') as gax.protobuf.Type; - const deleteArtifactResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteArtifactMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const purgeArtifactsResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.PurgeArtifactsResponse') as gax.protobuf.Type; - const purgeArtifactsMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.PurgeArtifactsMetadata') as gax.protobuf.Type; - const deleteContextResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteContextMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const purgeContextsResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.PurgeContextsResponse') as gax.protobuf.Type; - const purgeContextsMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.PurgeContextsMetadata') as gax.protobuf.Type; - const deleteExecutionResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteExecutionMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const purgeExecutionsResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.PurgeExecutionsResponse') as gax.protobuf.Type; - const purgeExecutionsMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.PurgeExecutionsMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createMetadataStore: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createMetadataStoreResponse.decode.bind(createMetadataStoreResponse), - createMetadataStoreMetadata.decode.bind(createMetadataStoreMetadata)), - deleteMetadataStore: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteMetadataStoreResponse.decode.bind(deleteMetadataStoreResponse), - deleteMetadataStoreMetadata.decode.bind(deleteMetadataStoreMetadata)), - deleteArtifact: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteArtifactResponse.decode.bind(deleteArtifactResponse), - deleteArtifactMetadata.decode.bind(deleteArtifactMetadata)), - purgeArtifacts: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - purgeArtifactsResponse.decode.bind(purgeArtifactsResponse), - purgeArtifactsMetadata.decode.bind(purgeArtifactsMetadata)), - deleteContext: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteContextResponse.decode.bind(deleteContextResponse), - deleteContextMetadata.decode.bind(deleteContextMetadata)), - purgeContexts: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - purgeContextsResponse.decode.bind(purgeContextsResponse), - purgeContextsMetadata.decode.bind(purgeContextsMetadata)), - deleteExecution: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteExecutionResponse.decode.bind(deleteExecutionResponse), - deleteExecutionMetadata.decode.bind(deleteExecutionMetadata)), - purgeExecutions: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - purgeExecutionsResponse.decode.bind(purgeExecutionsResponse), - purgeExecutionsMetadata.decode.bind(purgeExecutionsMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1beta1.MetadataService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.metadataServiceStub) { - return this.metadataServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1beta1.MetadataService. - this.metadataServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.MetadataService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1beta1.MetadataService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const metadataServiceStubMethods = - ['createMetadataStore', 'getMetadataStore', 'listMetadataStores', 'deleteMetadataStore', 'createArtifact', 'getArtifact', 'listArtifacts', 'updateArtifact', 'deleteArtifact', 'purgeArtifacts', 'createContext', 'getContext', 'listContexts', 'updateContext', 'deleteContext', 'purgeContexts', 'addContextArtifactsAndExecutions', 'addContextChildren', 'queryContextLineageSubgraph', 'createExecution', 'getExecution', 'listExecutions', 'updateExecution', 'deleteExecution', 'purgeExecutions', 'addExecutionEvents', 'queryExecutionInputsAndOutputs', 'createMetadataSchema', 'getMetadataSchema', 'listMetadataSchemas', 'queryArtifactLineageSubgraph']; - for (const methodName of metadataServiceStubMethods) { - const callPromise = this.metadataServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.metadataServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Retrieves a specific MetadataStore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the MetadataStore to retrieve. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [MetadataStore]{@link google.cloud.aiplatform.v1beta1.MetadataStore}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_GetMetadataStore_async - */ - getMetadataStore( - request?: protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IMetadataStore, - protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest|undefined, {}|undefined - ]>; - getMetadataStore( - request: protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IMetadataStore, - protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest|null|undefined, - {}|null|undefined>): void; - getMetadataStore( - request: protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IMetadataStore, - protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest|null|undefined, - {}|null|undefined>): void; - getMetadataStore( - request?: protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IMetadataStore, - protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IMetadataStore, - protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IMetadataStore, - protos.google.cloud.aiplatform.v1beta1.IGetMetadataStoreRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getMetadataStore(request, options, callback); - } -/** - * Creates an Artifact associated with a MetadataStore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the MetadataStore where the Artifact should - * be created. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {google.cloud.aiplatform.v1beta1.Artifact} request.artifact - * Required. The Artifact to create. - * @param {string} request.artifactId - * The {artifact} portion of the resource name with the format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - * If not provided, the Artifact's ID will be a UUID generated by the service. - * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. - * Must be unique across all Artifacts in the parent MetadataStore. (Otherwise - * the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the - * caller can't view the preexisting Artifact.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Artifact]{@link google.cloud.aiplatform.v1beta1.Artifact}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_CreateArtifact_async - */ - createArtifact( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IArtifact, - protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest|undefined, {}|undefined - ]>; - createArtifact( - request: protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IArtifact, - protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest|null|undefined, - {}|null|undefined>): void; - createArtifact( - request: protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IArtifact, - protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest|null|undefined, - {}|null|undefined>): void; - createArtifact( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IArtifact, - protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IArtifact, - protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IArtifact, - protos.google.cloud.aiplatform.v1beta1.ICreateArtifactRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createArtifact(request, options, callback); - } -/** - * Retrieves a specific Artifact. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Artifact to retrieve. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Artifact]{@link google.cloud.aiplatform.v1beta1.Artifact}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_GetArtifact_async - */ - getArtifact( - request?: protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IArtifact, - protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest|undefined, {}|undefined - ]>; - getArtifact( - request: protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IArtifact, - protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest|null|undefined, - {}|null|undefined>): void; - getArtifact( - request: protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IArtifact, - protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest|null|undefined, - {}|null|undefined>): void; - getArtifact( - request?: protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IArtifact, - protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IArtifact, - protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IArtifact, - protos.google.cloud.aiplatform.v1beta1.IGetArtifactRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getArtifact(request, options, callback); - } -/** - * Updates a stored Artifact. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1beta1.Artifact} request.artifact - * Required. The Artifact containing updates. - * The Artifact's {@link google.cloud.aiplatform.v1beta1.Artifact.name|Artifact.name} field is used to identify the Artifact to - * be updated. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. A FieldMask indicating which fields should be updated. - * Functionality of this field is not yet supported. - * @param {boolean} request.allowMissing - * If set to true, and the {@link google.cloud.aiplatform.v1beta1.Artifact|Artifact} is not found, a new {@link google.cloud.aiplatform.v1beta1.Artifact|Artifact} is - * created. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Artifact]{@link google.cloud.aiplatform.v1beta1.Artifact}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_UpdateArtifact_async - */ - updateArtifact( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IArtifact, - protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest|undefined, {}|undefined - ]>; - updateArtifact( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IArtifact, - protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest|null|undefined, - {}|null|undefined>): void; - updateArtifact( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IArtifact, - protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest|null|undefined, - {}|null|undefined>): void; - updateArtifact( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IArtifact, - protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IArtifact, - protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IArtifact, - protos.google.cloud.aiplatform.v1beta1.IUpdateArtifactRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'artifact.name': request.artifact!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateArtifact(request, options, callback); - } -/** - * Creates a Context associated with a MetadataStore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the MetadataStore where the Context should be - * created. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {google.cloud.aiplatform.v1beta1.Context} request.context - * Required. The Context to create. - * @param {string} request.contextId - * The {context} portion of the resource name with the format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`. - * If not provided, the Context's ID will be a UUID generated by the service. - * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. - * Must be unique across all Contexts in the parent MetadataStore. (Otherwise - * the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the - * caller can't view the preexisting Context.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Context]{@link google.cloud.aiplatform.v1beta1.Context}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_CreateContext_async - */ - createContext( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IContext, - protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest|undefined, {}|undefined - ]>; - createContext( - request: protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IContext, - protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest|null|undefined, - {}|null|undefined>): void; - createContext( - request: protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IContext, - protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest|null|undefined, - {}|null|undefined>): void; - createContext( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IContext, - protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IContext, - protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IContext, - protos.google.cloud.aiplatform.v1beta1.ICreateContextRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createContext(request, options, callback); - } -/** - * Retrieves a specific Context. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Context to retrieve. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Context]{@link google.cloud.aiplatform.v1beta1.Context}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_GetContext_async - */ - getContext( - request?: protos.google.cloud.aiplatform.v1beta1.IGetContextRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IContext, - protos.google.cloud.aiplatform.v1beta1.IGetContextRequest|undefined, {}|undefined - ]>; - getContext( - request: protos.google.cloud.aiplatform.v1beta1.IGetContextRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IContext, - protos.google.cloud.aiplatform.v1beta1.IGetContextRequest|null|undefined, - {}|null|undefined>): void; - getContext( - request: protos.google.cloud.aiplatform.v1beta1.IGetContextRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IContext, - protos.google.cloud.aiplatform.v1beta1.IGetContextRequest|null|undefined, - {}|null|undefined>): void; - getContext( - request?: protos.google.cloud.aiplatform.v1beta1.IGetContextRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IContext, - protos.google.cloud.aiplatform.v1beta1.IGetContextRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IContext, - protos.google.cloud.aiplatform.v1beta1.IGetContextRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IContext, - protos.google.cloud.aiplatform.v1beta1.IGetContextRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getContext(request, options, callback); - } -/** - * Updates a stored Context. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1beta1.Context} request.context - * Required. The Context containing updates. - * The Context's {@link google.cloud.aiplatform.v1beta1.Context.name|Context.name} field is used to identify the Context to be - * updated. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. A FieldMask indicating which fields should be updated. - * Functionality of this field is not yet supported. - * @param {boolean} request.allowMissing - * If set to true, and the {@link google.cloud.aiplatform.v1beta1.Context|Context} is not found, a new {@link google.cloud.aiplatform.v1beta1.Context|Context} is - * created. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Context]{@link google.cloud.aiplatform.v1beta1.Context}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_UpdateContext_async - */ - updateContext( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IContext, - protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest|undefined, {}|undefined - ]>; - updateContext( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IContext, - protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest|null|undefined, - {}|null|undefined>): void; - updateContext( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IContext, - protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest|null|undefined, - {}|null|undefined>): void; - updateContext( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IContext, - protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IContext, - protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IContext, - protos.google.cloud.aiplatform.v1beta1.IUpdateContextRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'context.name': request.context!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateContext(request, options, callback); - } -/** - * Adds a set of Artifacts and Executions to a Context. If any of the - * Artifacts or Executions have already been added to a Context, they are - * simply skipped. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.context - * Required. The resource name of the Context that the Artifacts and Executions - * belong to. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * @param {string[]} request.artifacts - * The resource names of the Artifacts to attribute to the Context. - * - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - * @param {string[]} request.executions - * The resource names of the Executions to associate with the - * Context. - * - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AddContextArtifactsAndExecutionsResponse]{@link google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_AddContextArtifactsAndExecutions_async - */ - addContextArtifactsAndExecutions( - request?: protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsResponse, - protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest|undefined, {}|undefined - ]>; - addContextArtifactsAndExecutions( - request: protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsResponse, - protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest|null|undefined, - {}|null|undefined>): void; - addContextArtifactsAndExecutions( - request: protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsResponse, - protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest|null|undefined, - {}|null|undefined>): void; - addContextArtifactsAndExecutions( - request?: protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsResponse, - protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsResponse, - protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsResponse, - protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'context': request.context || '', - }); - this.initialize(); - return this.innerApiCalls.addContextArtifactsAndExecutions(request, options, callback); - } -/** - * Adds a set of Contexts as children to a parent Context. If any of the - * child Contexts have already been added to the parent Context, they are - * simply skipped. If this call would create a cycle or cause any Context to - * have more than 10 parents, the request will fail with an INVALID_ARGUMENT - * error. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.context - * Required. The resource name of the parent Context. - * - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * @param {string[]} request.childContexts - * The resource names of the child Contexts. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AddContextChildrenResponse]{@link google.cloud.aiplatform.v1beta1.AddContextChildrenResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_AddContextChildren_async - */ - addContextChildren( - request?: protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenResponse, - protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest|undefined, {}|undefined - ]>; - addContextChildren( - request: protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenResponse, - protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest|null|undefined, - {}|null|undefined>): void; - addContextChildren( - request: protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenResponse, - protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest|null|undefined, - {}|null|undefined>): void; - addContextChildren( - request?: protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenResponse, - protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenResponse, - protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenResponse, - protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'context': request.context || '', - }); - this.initialize(); - return this.innerApiCalls.addContextChildren(request, options, callback); - } -/** - * Retrieves Artifacts and Executions within the specified Context, connected - * by Event edges and returned as a LineageSubgraph. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.context - * Required. The resource name of the Context whose Artifacts and Executions - * should be retrieved as a LineageSubgraph. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * - * The request may error with FAILED_PRECONDITION if the number of Artifacts, - * the number of Executions, or the number of Events that would be returned - * for the Context exceeds 1000. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [LineageSubgraph]{@link google.cloud.aiplatform.v1beta1.LineageSubgraph}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_QueryContextLineageSubgraph_async - */ - queryContextLineageSubgraph( - request?: protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest|undefined, {}|undefined - ]>; - queryContextLineageSubgraph( - request: protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest|null|undefined, - {}|null|undefined>): void; - queryContextLineageSubgraph( - request: protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest|null|undefined, - {}|null|undefined>): void; - queryContextLineageSubgraph( - request?: protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1beta1.IQueryContextLineageSubgraphRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'context': request.context || '', - }); - this.initialize(); - return this.innerApiCalls.queryContextLineageSubgraph(request, options, callback); - } -/** - * Creates an Execution associated with a MetadataStore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the MetadataStore where the Execution should - * be created. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {google.cloud.aiplatform.v1beta1.Execution} request.execution - * Required. The Execution to create. - * @param {string} request.executionId - * The {execution} portion of the resource name with the format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * If not provided, the Execution's ID will be a UUID generated by the - * service. - * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. - * Must be unique across all Executions in the parent MetadataStore. - * (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED - * if the caller can't view the preexisting Execution.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Execution]{@link google.cloud.aiplatform.v1beta1.Execution}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_CreateExecution_async - */ - createExecution( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IExecution, - protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest|undefined, {}|undefined - ]>; - createExecution( - request: protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IExecution, - protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest|null|undefined, - {}|null|undefined>): void; - createExecution( - request: protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IExecution, - protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest|null|undefined, - {}|null|undefined>): void; - createExecution( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IExecution, - protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IExecution, - protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IExecution, - protos.google.cloud.aiplatform.v1beta1.ICreateExecutionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createExecution(request, options, callback); - } -/** - * Retrieves a specific Execution. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Execution to retrieve. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Execution]{@link google.cloud.aiplatform.v1beta1.Execution}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_GetExecution_async - */ - getExecution( - request?: protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IExecution, - protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest|undefined, {}|undefined - ]>; - getExecution( - request: protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IExecution, - protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest|null|undefined, - {}|null|undefined>): void; - getExecution( - request: protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IExecution, - protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest|null|undefined, - {}|null|undefined>): void; - getExecution( - request?: protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IExecution, - protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IExecution, - protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IExecution, - protos.google.cloud.aiplatform.v1beta1.IGetExecutionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getExecution(request, options, callback); - } -/** - * Updates a stored Execution. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1beta1.Execution} request.execution - * Required. The Execution containing updates. - * The Execution's {@link google.cloud.aiplatform.v1beta1.Execution.name|Execution.name} field is used to identify the Execution - * to be updated. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. A FieldMask indicating which fields should be updated. - * Functionality of this field is not yet supported. - * @param {boolean} request.allowMissing - * If set to true, and the {@link google.cloud.aiplatform.v1beta1.Execution|Execution} is not found, a new {@link google.cloud.aiplatform.v1beta1.Execution|Execution} - * is created. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Execution]{@link google.cloud.aiplatform.v1beta1.Execution}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_UpdateExecution_async - */ - updateExecution( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IExecution, - protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest|undefined, {}|undefined - ]>; - updateExecution( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IExecution, - protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest|null|undefined, - {}|null|undefined>): void; - updateExecution( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IExecution, - protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest|null|undefined, - {}|null|undefined>): void; - updateExecution( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IExecution, - protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IExecution, - protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IExecution, - protos.google.cloud.aiplatform.v1beta1.IUpdateExecutionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'execution.name': request.execution!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateExecution(request, options, callback); - } -/** - * Adds Events to the specified Execution. An Event indicates whether an - * Artifact was used as an input or output for an Execution. If an Event - * already exists between the Execution and the Artifact, the Event is - * skipped. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.execution - * Required. The resource name of the Execution that the Events connect - * Artifacts with. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * @param {number[]} request.events - * The Events to create and add. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AddExecutionEventsResponse]{@link google.cloud.aiplatform.v1beta1.AddExecutionEventsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_AddExecutionEvents_async - */ - addExecutionEvents( - request?: protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsResponse, - protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest|undefined, {}|undefined - ]>; - addExecutionEvents( - request: protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsResponse, - protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest|null|undefined, - {}|null|undefined>): void; - addExecutionEvents( - request: protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsResponse, - protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest|null|undefined, - {}|null|undefined>): void; - addExecutionEvents( - request?: protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsResponse, - protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsResponse, - protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsResponse, - protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'execution': request.execution || '', - }); - this.initialize(); - return this.innerApiCalls.addExecutionEvents(request, options, callback); - } -/** - * Obtains the set of input and output Artifacts for this Execution, in the - * form of LineageSubgraph that also contains the Execution and connecting - * Events. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.execution - * Required. The resource name of the Execution whose input and output Artifacts should - * be retrieved as a LineageSubgraph. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [LineageSubgraph]{@link google.cloud.aiplatform.v1beta1.LineageSubgraph}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_QueryExecutionInputsAndOutputs_async - */ - queryExecutionInputsAndOutputs( - request?: protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest|undefined, {}|undefined - ]>; - queryExecutionInputsAndOutputs( - request: protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest|null|undefined, - {}|null|undefined>): void; - queryExecutionInputsAndOutputs( - request: protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest|null|undefined, - {}|null|undefined>): void; - queryExecutionInputsAndOutputs( - request?: protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1beta1.IQueryExecutionInputsAndOutputsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'execution': request.execution || '', - }); - this.initialize(); - return this.innerApiCalls.queryExecutionInputsAndOutputs(request, options, callback); - } -/** - * Creates a MetadataSchema. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the MetadataStore where the MetadataSchema should - * be created. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {google.cloud.aiplatform.v1beta1.MetadataSchema} request.metadataSchema - * Required. The MetadataSchema to create. - * @param {string} request.metadataSchemaId - * The {metadata_schema} portion of the resource name with the format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` - * If not provided, the MetadataStore's ID will be a UUID generated by the - * service. - * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. - * Must be unique across all MetadataSchemas in the parent Location. - * (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED - * if the caller can't view the preexisting MetadataSchema.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [MetadataSchema]{@link google.cloud.aiplatform.v1beta1.MetadataSchema}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_CreateMetadataSchema_async - */ - createMetadataSchema( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, - protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest|undefined, {}|undefined - ]>; - createMetadataSchema( - request: protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, - protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest|null|undefined, - {}|null|undefined>): void; - createMetadataSchema( - request: protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, - protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest|null|undefined, - {}|null|undefined>): void; - createMetadataSchema( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, - protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, - protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, - protos.google.cloud.aiplatform.v1beta1.ICreateMetadataSchemaRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createMetadataSchema(request, options, callback); - } -/** - * Retrieves a specific MetadataSchema. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the MetadataSchema to retrieve. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/metadataSchemas/{metadataschema}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [MetadataSchema]{@link google.cloud.aiplatform.v1beta1.MetadataSchema}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_GetMetadataSchema_async - */ - getMetadataSchema( - request?: protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, - protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest|undefined, {}|undefined - ]>; - getMetadataSchema( - request: protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, - protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest|null|undefined, - {}|null|undefined>): void; - getMetadataSchema( - request: protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, - protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest|null|undefined, - {}|null|undefined>): void; - getMetadataSchema( - request?: protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, - protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, - protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IMetadataSchema, - protos.google.cloud.aiplatform.v1beta1.IGetMetadataSchemaRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getMetadataSchema(request, options, callback); - } -/** - * Retrieves lineage of an Artifact represented through Artifacts and - * Executions connected by Event edges and returned as a LineageSubgraph. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.artifact - * Required. The resource name of the Artifact whose Lineage needs to be retrieved as a - * LineageSubgraph. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - * - * The request may error with FAILED_PRECONDITION if the number of Artifacts, - * the number of Executions, or the number of Events that would be returned - * for the Context exceeds 1000. - * @param {number} request.maxHops - * Specifies the size of the lineage graph in terms of number of hops from the - * specified artifact. - * Negative Value: INVALID_ARGUMENT error is returned - * 0: Only input artifact is returned. - * No value: Transitive closure is performed to return the complete graph. - * @param {string} request.filter - * Filter specifying the boolean condition for the Artifacts to satisfy in - * order to be part of the Lineage Subgraph. - * The syntax to define filter query is based on https://google.aip.dev/160. - * The supported set of filters include the following: - * - * * **Attribute filtering**: - * For example: `display_name = "test"` - * Supported fields include: `name`, `display_name`, `uri`, `state`, - * `schema_title`, `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"` - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..`. - * For example: `metadata.field_1.number_value = 10.0` - * - * Each of the above supported filter types can be combined together using - * logical operators (`AND` & `OR`). - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [LineageSubgraph]{@link google.cloud.aiplatform.v1beta1.LineageSubgraph}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_QueryArtifactLineageSubgraph_async - */ - queryArtifactLineageSubgraph( - request?: protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest|undefined, {}|undefined - ]>; - queryArtifactLineageSubgraph( - request: protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest|null|undefined, - {}|null|undefined>): void; - queryArtifactLineageSubgraph( - request: protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest|null|undefined, - {}|null|undefined>): void; - queryArtifactLineageSubgraph( - request?: protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph, - protos.google.cloud.aiplatform.v1beta1.IQueryArtifactLineageSubgraphRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'artifact': request.artifact || '', - }); - this.initialize(); - return this.innerApiCalls.queryArtifactLineageSubgraph(request, options, callback); - } - -/** - * Initializes a MetadataStore, including allocation of resources. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location where the MetadataStore should - * be created. - * Format: `projects/{project}/locations/{location}/` - * @param {google.cloud.aiplatform.v1beta1.MetadataStore} request.metadataStore - * Required. The MetadataStore to create. - * @param {string} request.metadataStoreId - * The {metadatastore} portion of the resource name with the format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * If not provided, the MetadataStore's ID will be a UUID generated by the - * service. - * Must be 4-128 characters in length. Valid characters are `/{@link 0-9|a-z}-/`. - * Must be unique across all MetadataStores in the parent Location. - * (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED - * if the caller can't view the preexisting MetadataStore.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_CreateMetadataStore_async - */ - createMetadataStore( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateMetadataStoreRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createMetadataStore( - request: protos.google.cloud.aiplatform.v1beta1.ICreateMetadataStoreRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createMetadataStore( - request: protos.google.cloud.aiplatform.v1beta1.ICreateMetadataStoreRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createMetadataStore( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateMetadataStoreRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createMetadataStore(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createMetadataStore()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_CreateMetadataStore_async - */ - async checkCreateMetadataStoreProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createMetadataStore, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single MetadataStore and all its child resources (Artifacts, - * Executions, and Contexts). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the MetadataStore to delete. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {boolean} request.force - * Deprecated: Field is no longer supported. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_DeleteMetadataStore_async - */ - deleteMetadataStore( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteMetadataStoreRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteMetadataStore( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteMetadataStoreRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteMetadataStore( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteMetadataStoreRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteMetadataStore( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteMetadataStoreRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteMetadataStore(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteMetadataStore()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_DeleteMetadataStore_async - */ - async checkDeleteMetadataStoreProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteMetadataStore, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes an Artifact. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Artifact to delete. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}` - * @param {string} [request.etag] - * Optional. The etag of the Artifact to delete. - * If this is provided, it must match the server's etag. Otherwise, the - * request will fail with a FAILED_PRECONDITION. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_DeleteArtifact_async - */ - deleteArtifact( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteArtifactRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteArtifact( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteArtifactRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteArtifact( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteArtifactRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteArtifact( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteArtifactRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteArtifact(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteArtifact()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_DeleteArtifact_async - */ - async checkDeleteArtifactProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteArtifact, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Purges Artifacts. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The metadata store to purge Artifacts from. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {string} request.filter - * Required. A required filter matching the Artifacts to be purged. - * E.g., `update_time <= 2020-11-19T11:30:00-04:00`. - * @param {boolean} [request.force] - * Optional. Flag to indicate to actually perform the purge. - * If `force` is set to false, the method will return a sample of - * Artifact names that would be deleted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_PurgeArtifacts_async - */ - purgeArtifacts( - request?: protos.google.cloud.aiplatform.v1beta1.IPurgeArtifactsRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - purgeArtifacts( - request: protos.google.cloud.aiplatform.v1beta1.IPurgeArtifactsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - purgeArtifacts( - request: protos.google.cloud.aiplatform.v1beta1.IPurgeArtifactsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - purgeArtifacts( - request?: protos.google.cloud.aiplatform.v1beta1.IPurgeArtifactsRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.purgeArtifacts(request, options, callback); - } -/** - * Check the status of the long running operation returned by `purgeArtifacts()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_PurgeArtifacts_async - */ - async checkPurgeArtifactsProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.purgeArtifacts, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a stored Context. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Context to delete. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}` - * @param {boolean} request.force - * The force deletion semantics is still undefined. - * Users should not use this field. - * @param {string} [request.etag] - * Optional. The etag of the Context to delete. - * If this is provided, it must match the server's etag. Otherwise, the - * request will fail with a FAILED_PRECONDITION. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_DeleteContext_async - */ - deleteContext( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteContextRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteContext( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteContextRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteContext( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteContextRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteContext( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteContextRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteContext(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteContext()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_DeleteContext_async - */ - async checkDeleteContextProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteContext, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Purges Contexts. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The metadata store to purge Contexts from. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {string} request.filter - * Required. A required filter matching the Contexts to be purged. - * E.g., `update_time <= 2020-11-19T11:30:00-04:00`. - * @param {boolean} [request.force] - * Optional. Flag to indicate to actually perform the purge. - * If `force` is set to false, the method will return a sample of - * Context names that would be deleted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_PurgeContexts_async - */ - purgeContexts( - request?: protos.google.cloud.aiplatform.v1beta1.IPurgeContextsRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - purgeContexts( - request: protos.google.cloud.aiplatform.v1beta1.IPurgeContextsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - purgeContexts( - request: protos.google.cloud.aiplatform.v1beta1.IPurgeContextsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - purgeContexts( - request?: protos.google.cloud.aiplatform.v1beta1.IPurgeContextsRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.purgeContexts(request, options, callback); - } -/** - * Check the status of the long running operation returned by `purgeContexts()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_PurgeContexts_async - */ - async checkPurgeContextsProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.purgeContexts, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes an Execution. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Execution to delete. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}` - * @param {string} [request.etag] - * Optional. The etag of the Execution to delete. - * If this is provided, it must match the server's etag. Otherwise, the - * request will fail with a FAILED_PRECONDITION. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_DeleteExecution_async - */ - deleteExecution( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteExecutionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteExecution( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteExecutionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteExecution( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteExecutionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteExecution( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteExecutionRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteExecution(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteExecution()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_DeleteExecution_async - */ - async checkDeleteExecutionProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteExecution, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Purges Executions. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The metadata store to purge Executions from. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {string} request.filter - * Required. A required filter matching the Executions to be purged. - * E.g., `update_time <= 2020-11-19T11:30:00-04:00`. - * @param {boolean} [request.force] - * Optional. Flag to indicate to actually perform the purge. - * If `force` is set to false, the method will return a sample of - * Execution names that would be deleted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_PurgeExecutions_async - */ - purgeExecutions( - request?: protos.google.cloud.aiplatform.v1beta1.IPurgeExecutionsRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - purgeExecutions( - request: protos.google.cloud.aiplatform.v1beta1.IPurgeExecutionsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - purgeExecutions( - request: protos.google.cloud.aiplatform.v1beta1.IPurgeExecutionsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - purgeExecutions( - request?: protos.google.cloud.aiplatform.v1beta1.IPurgeExecutionsRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.purgeExecutions(request, options, callback); - } -/** - * Check the status of the long running operation returned by `purgeExecutions()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_PurgeExecutions_async - */ - async checkPurgeExecutionsProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.purgeExecutions, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists MetadataStores for a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Location whose MetadataStores should be listed. - * Format: - * `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * The maximum number of Metadata Stores to return. The service may return - * fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataStores|MetadataService.ListMetadataStores} call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [MetadataStore]{@link google.cloud.aiplatform.v1beta1.MetadataStore}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listMetadataStoresAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listMetadataStores( - request?: protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IMetadataStore[], - protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresResponse - ]>; - listMetadataStores( - request: protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, - protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IMetadataStore>): void; - listMetadataStores( - request: protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, - protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IMetadataStore>): void; - listMetadataStores( - request?: protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, - protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IMetadataStore>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, - protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IMetadataStore>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IMetadataStore[], - protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listMetadataStores(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Location whose MetadataStores should be listed. - * Format: - * `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * The maximum number of Metadata Stores to return. The service may return - * fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataStores|MetadataService.ListMetadataStores} call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [MetadataStore]{@link google.cloud.aiplatform.v1beta1.MetadataStore} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listMetadataStoresAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listMetadataStoresStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listMetadataStores']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listMetadataStores.createStream( - this.innerApiCalls.listMetadataStores as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listMetadataStores`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Location whose MetadataStores should be listed. - * Format: - * `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * The maximum number of Metadata Stores to return. The service may return - * fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataStores|MetadataService.ListMetadataStores} call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [MetadataStore]{@link google.cloud.aiplatform.v1beta1.MetadataStore}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_ListMetadataStores_async - */ - listMetadataStoresAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListMetadataStoresRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listMetadataStores']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listMetadataStores.asyncIterate( - this.innerApiCalls['listMetadataStores'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists Artifacts in the MetadataStore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose Artifacts should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of Artifacts to return. The service may return fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous {@link google.cloud.aiplatform.v1beta1.MetadataService.ListArtifacts|MetadataService.ListArtifacts} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * Filter specifying the boolean condition for the Artifacts to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * The supported set of filters include the following: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `uri`, `state`, - * `schema_title`, `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"` - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..`. - * For example: `metadata.field_1.number_value = 10.0` - * * **Context based filtering**: - * To filter Artifacts based on the contexts to which they belong, use the - * function operator with the full resource name - * `in_context()`. - * For example: - * `in_context("projects//locations//metadataStores//contexts/")` - * - * Each of the above supported filter types can be combined together using - * logical operators (`AND` & `OR`). - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Artifact]{@link google.cloud.aiplatform.v1beta1.Artifact}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listArtifactsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listArtifacts( - request?: protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IArtifact[], - protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListArtifactsResponse - ]>; - listArtifacts( - request: protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, - protos.google.cloud.aiplatform.v1beta1.IListArtifactsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IArtifact>): void; - listArtifacts( - request: protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, - protos.google.cloud.aiplatform.v1beta1.IListArtifactsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IArtifact>): void; - listArtifacts( - request?: protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, - protos.google.cloud.aiplatform.v1beta1.IListArtifactsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IArtifact>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, - protos.google.cloud.aiplatform.v1beta1.IListArtifactsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IArtifact>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IArtifact[], - protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListArtifactsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listArtifacts(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose Artifacts should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of Artifacts to return. The service may return fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous {@link google.cloud.aiplatform.v1beta1.MetadataService.ListArtifacts|MetadataService.ListArtifacts} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * Filter specifying the boolean condition for the Artifacts to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * The supported set of filters include the following: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `uri`, `state`, - * `schema_title`, `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"` - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..`. - * For example: `metadata.field_1.number_value = 10.0` - * * **Context based filtering**: - * To filter Artifacts based on the contexts to which they belong, use the - * function operator with the full resource name - * `in_context()`. - * For example: - * `in_context("projects//locations//metadataStores//contexts/")` - * - * Each of the above supported filter types can be combined together using - * logical operators (`AND` & `OR`). - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Artifact]{@link google.cloud.aiplatform.v1beta1.Artifact} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listArtifactsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listArtifactsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listArtifacts']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listArtifacts.createStream( - this.innerApiCalls.listArtifacts as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listArtifacts`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose Artifacts should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of Artifacts to return. The service may return fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous {@link google.cloud.aiplatform.v1beta1.MetadataService.ListArtifacts|MetadataService.ListArtifacts} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * Filter specifying the boolean condition for the Artifacts to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * The supported set of filters include the following: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `uri`, `state`, - * `schema_title`, `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"` - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..`. - * For example: `metadata.field_1.number_value = 10.0` - * * **Context based filtering**: - * To filter Artifacts based on the contexts to which they belong, use the - * function operator with the full resource name - * `in_context()`. - * For example: - * `in_context("projects//locations//metadataStores//contexts/")` - * - * Each of the above supported filter types can be combined together using - * logical operators (`AND` & `OR`). - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Artifact]{@link google.cloud.aiplatform.v1beta1.Artifact}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_ListArtifacts_async - */ - listArtifactsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListArtifactsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listArtifacts']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listArtifacts.asyncIterate( - this.innerApiCalls['listArtifacts'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists Contexts on the MetadataStore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose Contexts should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of Contexts to return. The service may return fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous {@link google.cloud.aiplatform.v1beta1.MetadataService.ListContexts|MetadataService.ListContexts} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * Filter specifying the boolean condition for the Contexts to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * Following are the supported set of filters: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `schema_title`, - * `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"`. - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..`. - * For example: `metadata.field_1.number_value = 10.0`. - * * **Parent Child filtering**: - * To filter Contexts based on parent-child relationship use the HAS - * operator as follows: - * - * ``` - * parent_contexts: - * "projects//locations//metadataStores//contexts/" - * child_contexts: - * "projects//locations//metadataStores//contexts/" - * ``` - * - * Each of the above supported filters can be combined together using - * logical operators (`AND` & `OR`). - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Context]{@link google.cloud.aiplatform.v1beta1.Context}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listContextsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listContexts( - request?: protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IContext[], - protos.google.cloud.aiplatform.v1beta1.IListContextsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListContextsResponse - ]>; - listContexts( - request: protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, - protos.google.cloud.aiplatform.v1beta1.IListContextsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IContext>): void; - listContexts( - request: protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, - protos.google.cloud.aiplatform.v1beta1.IListContextsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IContext>): void; - listContexts( - request?: protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, - protos.google.cloud.aiplatform.v1beta1.IListContextsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IContext>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, - protos.google.cloud.aiplatform.v1beta1.IListContextsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IContext>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IContext[], - protos.google.cloud.aiplatform.v1beta1.IListContextsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListContextsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listContexts(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose Contexts should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of Contexts to return. The service may return fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous {@link google.cloud.aiplatform.v1beta1.MetadataService.ListContexts|MetadataService.ListContexts} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * Filter specifying the boolean condition for the Contexts to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * Following are the supported set of filters: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `schema_title`, - * `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"`. - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..`. - * For example: `metadata.field_1.number_value = 10.0`. - * * **Parent Child filtering**: - * To filter Contexts based on parent-child relationship use the HAS - * operator as follows: - * - * ``` - * parent_contexts: - * "projects//locations//metadataStores//contexts/" - * child_contexts: - * "projects//locations//metadataStores//contexts/" - * ``` - * - * Each of the above supported filters can be combined together using - * logical operators (`AND` & `OR`). - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Context]{@link google.cloud.aiplatform.v1beta1.Context} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listContextsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listContextsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listContexts']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listContexts.createStream( - this.innerApiCalls.listContexts as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listContexts`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose Contexts should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of Contexts to return. The service may return fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous {@link google.cloud.aiplatform.v1beta1.MetadataService.ListContexts|MetadataService.ListContexts} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * Filter specifying the boolean condition for the Contexts to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * Following are the supported set of filters: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `schema_title`, - * `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"`. - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..`. - * For example: `metadata.field_1.number_value = 10.0`. - * * **Parent Child filtering**: - * To filter Contexts based on parent-child relationship use the HAS - * operator as follows: - * - * ``` - * parent_contexts: - * "projects//locations//metadataStores//contexts/" - * child_contexts: - * "projects//locations//metadataStores//contexts/" - * ``` - * - * Each of the above supported filters can be combined together using - * logical operators (`AND` & `OR`). - * - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Context]{@link google.cloud.aiplatform.v1beta1.Context}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_ListContexts_async - */ - listContextsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListContextsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listContexts']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listContexts.asyncIterate( - this.innerApiCalls['listContexts'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists Executions in the MetadataStore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose Executions should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of Executions to return. The service may return fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous {@link google.cloud.aiplatform.v1beta1.MetadataService.ListExecutions|MetadataService.ListExecutions} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with an - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * Filter specifying the boolean condition for the Executions to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * Following are the supported set of filters: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `state`, - * `schema_title`, `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"`. - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..` - * For example: `metadata.field_1.number_value = 10.0` - * * **Context based filtering**: - * To filter Executions based on the contexts to which they belong use - * the function operator with the full resource name: - * `in_context()`. - * For example: - * `in_context("projects//locations//metadataStores//contexts/")` - * - * Each of the above supported filters can be combined together using - * logical operators (`AND` & `OR`). - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Execution]{@link google.cloud.aiplatform.v1beta1.Execution}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listExecutionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listExecutions( - request?: protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IExecution[], - protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListExecutionsResponse - ]>; - listExecutions( - request: protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, - protos.google.cloud.aiplatform.v1beta1.IListExecutionsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IExecution>): void; - listExecutions( - request: protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, - protos.google.cloud.aiplatform.v1beta1.IListExecutionsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IExecution>): void; - listExecutions( - request?: protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, - protos.google.cloud.aiplatform.v1beta1.IListExecutionsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IExecution>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, - protos.google.cloud.aiplatform.v1beta1.IListExecutionsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IExecution>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IExecution[], - protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListExecutionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listExecutions(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose Executions should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of Executions to return. The service may return fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous {@link google.cloud.aiplatform.v1beta1.MetadataService.ListExecutions|MetadataService.ListExecutions} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with an - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * Filter specifying the boolean condition for the Executions to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * Following are the supported set of filters: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `state`, - * `schema_title`, `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"`. - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..` - * For example: `metadata.field_1.number_value = 10.0` - * * **Context based filtering**: - * To filter Executions based on the contexts to which they belong use - * the function operator with the full resource name: - * `in_context()`. - * For example: - * `in_context("projects//locations//metadataStores//contexts/")` - * - * Each of the above supported filters can be combined together using - * logical operators (`AND` & `OR`). - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Execution]{@link google.cloud.aiplatform.v1beta1.Execution} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listExecutionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listExecutionsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listExecutions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listExecutions.createStream( - this.innerApiCalls.listExecutions as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listExecutions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose Executions should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of Executions to return. The service may return fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous {@link google.cloud.aiplatform.v1beta1.MetadataService.ListExecutions|MetadataService.ListExecutions} - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with an - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * Filter specifying the boolean condition for the Executions to satisfy in - * order to be part of the result set. - * The syntax to define filter query is based on https://google.aip.dev/160. - * Following are the supported set of filters: - * - * * **Attribute filtering**: - * For example: `display_name = "test"`. - * Supported fields include: `name`, `display_name`, `state`, - * `schema_title`, `create_time`, and `update_time`. - * Time fields, such as `create_time` and `update_time`, require values - * specified in RFC-3339 format. - * For example: `create_time = "2020-11-19T11:30:00-04:00"`. - * * **Metadata field**: - * To filter on metadata fields use traversal operation as follows: - * `metadata..` - * For example: `metadata.field_1.number_value = 10.0` - * * **Context based filtering**: - * To filter Executions based on the contexts to which they belong use - * the function operator with the full resource name: - * `in_context()`. - * For example: - * `in_context("projects//locations//metadataStores//contexts/")` - * - * Each of the above supported filters can be combined together using - * logical operators (`AND` & `OR`). - * For example: `display_name = "test" AND metadata.field1.bool_value = true`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Execution]{@link google.cloud.aiplatform.v1beta1.Execution}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_ListExecutions_async - */ - listExecutionsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListExecutionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listExecutions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listExecutions.asyncIterate( - this.innerApiCalls['listExecutions'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists MetadataSchemas. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose MetadataSchemas should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of MetadataSchemas to return. The service may return - * fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataSchemas|MetadataService.ListMetadataSchemas} call. Provide this to retrieve the - * next page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * A query to filter available MetadataSchemas for matching results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [MetadataSchema]{@link google.cloud.aiplatform.v1beta1.MetadataSchema}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listMetadataSchemasAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listMetadataSchemas( - request?: protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IMetadataSchema[], - protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasResponse - ]>; - listMetadataSchemas( - request: protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, - protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IMetadataSchema>): void; - listMetadataSchemas( - request: protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, - protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IMetadataSchema>): void; - listMetadataSchemas( - request?: protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, - protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IMetadataSchema>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, - protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IMetadataSchema>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IMetadataSchema[], - protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listMetadataSchemas(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose MetadataSchemas should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of MetadataSchemas to return. The service may return - * fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataSchemas|MetadataService.ListMetadataSchemas} call. Provide this to retrieve the - * next page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * A query to filter available MetadataSchemas for matching results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [MetadataSchema]{@link google.cloud.aiplatform.v1beta1.MetadataSchema} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listMetadataSchemasAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listMetadataSchemasStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listMetadataSchemas']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listMetadataSchemas.createStream( - this.innerApiCalls.listMetadataSchemas as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listMetadataSchemas`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The MetadataStore whose MetadataSchemas should be listed. - * Format: - * `projects/{project}/locations/{location}/metadataStores/{metadatastore}` - * @param {number} request.pageSize - * The maximum number of MetadataSchemas to return. The service may return - * fewer. - * Must be in range 1-1000, inclusive. Defaults to 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.MetadataService.ListMetadataSchemas|MetadataService.ListMetadataSchemas} call. Provide this to retrieve the - * next page. - * - * When paginating, all other provided parameters must match the call that - * provided the page token. (Otherwise the request will fail with - * INVALID_ARGUMENT error.) - * @param {string} request.filter - * A query to filter available MetadataSchemas for matching results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [MetadataSchema]{@link google.cloud.aiplatform.v1beta1.MetadataSchema}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MetadataService_ListMetadataSchemas_async - */ - listMetadataSchemasAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListMetadataSchemasRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listMetadataSchemas']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listMetadataSchemas.asyncIterate( - this.innerApiCalls['listMetadataSchemas'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.metadataServiceStub && !this._terminated) { - return this.metadataServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_client_config.json deleted file mode 100644 index 39313fa9..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_client_config.json +++ /dev/null @@ -1,175 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1beta1.MetadataService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateMetadataStore": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetMetadataStore": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListMetadataStores": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteMetadataStore": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateArtifact": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetArtifact": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListArtifacts": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateArtifact": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteArtifact": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PurgeArtifacts": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateContext": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetContext": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListContexts": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateContext": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteContext": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PurgeContexts": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "AddContextArtifactsAndExecutions": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "AddContextChildren": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "QueryContextLineageSubgraph": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateExecution": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetExecution": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListExecutions": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateExecution": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteExecution": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PurgeExecutions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "AddExecutionEvents": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "QueryExecutionInputsAndOutputs": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateMetadataSchema": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetMetadataSchema": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListMetadataSchemas": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "QueryArtifactLineageSubgraph": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_proto_list.json deleted file mode 100644 index c916ab12..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_proto_list.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/context.proto", - "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1beta1/event.proto", - "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/io.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/study.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1beta1/types.proto", - "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1beta1/value.proto", - "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/migration_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/migration_service_client.ts deleted file mode 100644 index 3c7f0246..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/migration_service_client.ts +++ /dev/null @@ -1,2642 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/migration_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './migration_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * A service that migrates resources from automl.googleapis.com, - * datalabeling.googleapis.com and ml.googleapis.com to Vertex AI. - * @class - * @memberof v1beta1 - */ -export class MigrationServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - migrationServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of MigrationServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof MigrationServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - searchMigratableResources: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'migratableResources') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const batchMigrateResourcesResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.BatchMigrateResourcesResponse') as gax.protobuf.Type; - const batchMigrateResourcesMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.BatchMigrateResourcesOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - batchMigrateResources: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - batchMigrateResourcesResponse.decode.bind(batchMigrateResourcesResponse), - batchMigrateResourcesMetadata.decode.bind(batchMigrateResourcesMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1beta1.MigrationService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.migrationServiceStub) { - return this.migrationServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1beta1.MigrationService. - this.migrationServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.MigrationService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1beta1.MigrationService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const migrationServiceStubMethods = - ['searchMigratableResources', 'batchMigrateResources']; - for (const methodName of migrationServiceStubMethods) { - const callPromise = this.migrationServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.migrationServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - -/** - * Batch migrates resources from ml.googleapis.com, automl.googleapis.com, - * and datalabeling.googleapis.com to Vertex AI. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location of the migrated resource will live in. - * Format: `projects/{project}/locations/{location}` - * @param {number[]} request.migrateResourceRequests - * Required. The request messages specifying the resources to migrate. - * They must be in the same location as the destination. - * Up to 50 resources can be migrated in one batch. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MigrationService_BatchMigrateResources_async - */ - batchMigrateResources( - request?: protos.google.cloud.aiplatform.v1beta1.IBatchMigrateResourcesRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - batchMigrateResources( - request: protos.google.cloud.aiplatform.v1beta1.IBatchMigrateResourcesRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchMigrateResources( - request: protos.google.cloud.aiplatform.v1beta1.IBatchMigrateResourcesRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchMigrateResources( - request?: protos.google.cloud.aiplatform.v1beta1.IBatchMigrateResourcesRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.batchMigrateResources(request, options, callback); - } -/** - * Check the status of the long running operation returned by `batchMigrateResources()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MigrationService_BatchMigrateResources_async - */ - async checkBatchMigrateResourcesProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.batchMigrateResources, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Searches all of the resources in automl.googleapis.com, - * datalabeling.googleapis.com and ml.googleapis.com that can be migrated to - * Vertex AI's given location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location that the migratable resources should be searched from. - * It's the Vertex AI location that the resources can be migrated to, not - * the resources' original location. - * Format: - * `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * The standard page size. - * The default and maximum value is 100. - * @param {string} request.pageToken - * The standard page token. - * @param {string} request.filter - * A filter for your search. You can use the following types of filters: - * - * * Resource type filters. The following strings filter for a specific type - * of {@link google.cloud.aiplatform.v1beta1.MigratableResource|MigratableResource}: - * * `ml_engine_model_version:*` - * * `automl_model:*` - * * `automl_dataset:*` - * * `data_labeling_dataset:*` - * * "Migrated or not" filters. The following strings filter for resources - * that either have or have not already been migrated: - * * `last_migrate_time:*` filters for migrated resources. - * * `NOT last_migrate_time:*` filters for not yet migrated resources. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [MigratableResource]{@link google.cloud.aiplatform.v1beta1.MigratableResource}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `searchMigratableResourcesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - searchMigratableResources( - request?: protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IMigratableResource[], - protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest|null, - protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesResponse - ]>; - searchMigratableResources( - request: protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, - protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IMigratableResource>): void; - searchMigratableResources( - request: protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, - protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IMigratableResource>): void; - searchMigratableResources( - request?: protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, - protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IMigratableResource>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, - protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IMigratableResource>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IMigratableResource[], - protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest|null, - protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.searchMigratableResources(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location that the migratable resources should be searched from. - * It's the Vertex AI location that the resources can be migrated to, not - * the resources' original location. - * Format: - * `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * The standard page size. - * The default and maximum value is 100. - * @param {string} request.pageToken - * The standard page token. - * @param {string} request.filter - * A filter for your search. You can use the following types of filters: - * - * * Resource type filters. The following strings filter for a specific type - * of {@link google.cloud.aiplatform.v1beta1.MigratableResource|MigratableResource}: - * * `ml_engine_model_version:*` - * * `automl_model:*` - * * `automl_dataset:*` - * * `data_labeling_dataset:*` - * * "Migrated or not" filters. The following strings filter for resources - * that either have or have not already been migrated: - * * `last_migrate_time:*` filters for migrated resources. - * * `NOT last_migrate_time:*` filters for not yet migrated resources. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [MigratableResource]{@link google.cloud.aiplatform.v1beta1.MigratableResource} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `searchMigratableResourcesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - searchMigratableResourcesStream( - request?: protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['searchMigratableResources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchMigratableResources.createStream( - this.innerApiCalls.searchMigratableResources as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `searchMigratableResources`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location that the migratable resources should be searched from. - * It's the Vertex AI location that the resources can be migrated to, not - * the resources' original location. - * Format: - * `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * The standard page size. - * The default and maximum value is 100. - * @param {string} request.pageToken - * The standard page token. - * @param {string} request.filter - * A filter for your search. You can use the following types of filters: - * - * * Resource type filters. The following strings filter for a specific type - * of {@link google.cloud.aiplatform.v1beta1.MigratableResource|MigratableResource}: - * * `ml_engine_model_version:*` - * * `automl_model:*` - * * `automl_dataset:*` - * * `data_labeling_dataset:*` - * * "Migrated or not" filters. The following strings filter for resources - * that either have or have not already been migrated: - * * `last_migrate_time:*` filters for migrated resources. - * * `NOT last_migrate_time:*` filters for not yet migrated resources. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [MigratableResource]{@link google.cloud.aiplatform.v1beta1.MigratableResource}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_MigrationService_SearchMigratableResources_async - */ - searchMigratableResourcesAsync( - request?: protos.google.cloud.aiplatform.v1beta1.ISearchMigratableResourcesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['searchMigratableResources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchMigratableResources.asyncIterate( - this.innerApiCalls['searchMigratableResources'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.migrationServiceStub && !this._terminated) { - return this.migrationServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/migration_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/migration_service_client_config.json deleted file mode 100644 index 10583430..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/migration_service_client_config.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1beta1.MigrationService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "SearchMigratableResources": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchMigrateResources": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/migration_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/migration_service_proto_list.json deleted file mode 100644 index c916ab12..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/migration_service_proto_list.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/context.proto", - "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1beta1/event.proto", - "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/io.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/study.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1beta1/types.proto", - "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1beta1/value.proto", - "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/model_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/model_service_client.ts deleted file mode 100644 index f991040b..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/model_service_client.ts +++ /dev/null @@ -1,4184 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/model_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './model_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * A service for managing Vertex AI's machine learning Models. - * @class - * @memberof v1beta1 - */ -export class ModelServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - modelServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ModelServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof ModelServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listModels: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'models'), - listModelVersions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'models'), - listModelEvaluations: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'modelEvaluations'), - listModelEvaluationSlices: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'modelEvaluationSlices') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const uploadModelResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.UploadModelResponse') as gax.protobuf.Type; - const uploadModelMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.UploadModelOperationMetadata') as gax.protobuf.Type; - const updateExplanationDatasetResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse') as gax.protobuf.Type; - const updateExplanationDatasetMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata') as gax.protobuf.Type; - const deleteModelResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteModelMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const deleteModelVersionResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteModelVersionMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const exportModelResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.ExportModelResponse') as gax.protobuf.Type; - const exportModelMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.ExportModelOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - uploadModel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - uploadModelResponse.decode.bind(uploadModelResponse), - uploadModelMetadata.decode.bind(uploadModelMetadata)), - updateExplanationDataset: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateExplanationDatasetResponse.decode.bind(updateExplanationDatasetResponse), - updateExplanationDatasetMetadata.decode.bind(updateExplanationDatasetMetadata)), - deleteModel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteModelResponse.decode.bind(deleteModelResponse), - deleteModelMetadata.decode.bind(deleteModelMetadata)), - deleteModelVersion: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteModelVersionResponse.decode.bind(deleteModelVersionResponse), - deleteModelVersionMetadata.decode.bind(deleteModelVersionMetadata)), - exportModel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - exportModelResponse.decode.bind(exportModelResponse), - exportModelMetadata.decode.bind(exportModelMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1beta1.ModelService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.modelServiceStub) { - return this.modelServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1beta1.ModelService. - this.modelServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.ModelService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1beta1.ModelService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const modelServiceStubMethods = - ['uploadModel', 'getModel', 'listModels', 'listModelVersions', 'updateModel', 'updateExplanationDataset', 'deleteModel', 'deleteModelVersion', 'mergeVersionAliases', 'exportModel', 'importModelEvaluation', 'getModelEvaluation', 'listModelEvaluations', 'getModelEvaluationSlice', 'listModelEvaluationSlices']; - for (const methodName of modelServiceStubMethods) { - const callPromise = this.modelServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.modelServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets a Model. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Model resource. - * Format: `projects/{project}/locations/{location}/models/{model}` - * - * In order to retrieve a specific version of the model, also provide - * the version ID or version alias. - * Example: projects/{project}/locations/{location}/models/{model}@2 - * or - * projects/{project}/locations/{location}/models/{model}@golden - * If no version ID or alias is specified, the "default" version will be - * returned. The "default" version alias is created for the first version of - * the model, and can be moved to other versions later on. There will be - * exactly one default version. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Model]{@link google.cloud.aiplatform.v1beta1.Model}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_GetModel_async - */ - getModel( - request?: protos.google.cloud.aiplatform.v1beta1.IGetModelRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModel, - protos.google.cloud.aiplatform.v1beta1.IGetModelRequest|undefined, {}|undefined - ]>; - getModel( - request: protos.google.cloud.aiplatform.v1beta1.IGetModelRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IModel, - protos.google.cloud.aiplatform.v1beta1.IGetModelRequest|null|undefined, - {}|null|undefined>): void; - getModel( - request: protos.google.cloud.aiplatform.v1beta1.IGetModelRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IModel, - protos.google.cloud.aiplatform.v1beta1.IGetModelRequest|null|undefined, - {}|null|undefined>): void; - getModel( - request?: protos.google.cloud.aiplatform.v1beta1.IGetModelRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IModel, - protos.google.cloud.aiplatform.v1beta1.IGetModelRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IModel, - protos.google.cloud.aiplatform.v1beta1.IGetModelRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModel, - protos.google.cloud.aiplatform.v1beta1.IGetModelRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getModel(request, options, callback); - } -/** - * Updates a Model. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1beta1.Model} request.model - * Required. The Model which replaces the resource on the server. - * When Model Versioning is enabled, the model.name will be used to determine - * whether to update the model or model version. - * 1. model.name with the @ value, e.g. models/123@1, refers to a version - * specific update. - * 2. model.name without the @ value, e.g. models/123, refers to a model - * update. - * 3. model.name with @-, e.g. models/123@-, refers to a model update. - * 4. Supported model fields: display_name, description; supported - * version-specific fields: version_description. Labels are supported in both - * scenarios. Both the model labels and the version labels are merged when a - * model is returned. When updating labels, if the request is for - * model-specific update, model label gets updated. Otherwise, version labels - * get updated. - * 5. A model name or model version name fields update mismatch will cause a - * precondition error. - * 6. One request cannot update both the model and the version fields. You - * must update them separately. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The update mask applies to the resource. - * For the `FieldMask` definition, see {@link google.protobuf.FieldMask|google.protobuf.FieldMask}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Model]{@link google.cloud.aiplatform.v1beta1.Model}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_UpdateModel_async - */ - updateModel( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModel, - protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest|undefined, {}|undefined - ]>; - updateModel( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IModel, - protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest|null|undefined, - {}|null|undefined>): void; - updateModel( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IModel, - protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest|null|undefined, - {}|null|undefined>): void; - updateModel( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IModel, - protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IModel, - protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModel, - protos.google.cloud.aiplatform.v1beta1.IUpdateModelRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'model.name': request.model!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateModel(request, options, callback); - } -/** - * Merges a set of aliases for a Model version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the model version to merge aliases, with a version ID - * explicitly included. - * - * Example: `projects/{project}/locations/{location}/models/{model}@1234` - * @param {string[]} request.versionAliases - * Required. The set of version aliases to merge. - * The alias should be at most 128 characters, and match - * `{@link a-z0-9-|a-z}{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 - * 1) The aliases returned from GetModel API might not have the exactly same - * order from this MergeVersionAliases API. 2) Adding and deleting the same - * alias in the request is not recommended, and the 2 operations will be - * cancelled out. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Model]{@link google.cloud.aiplatform.v1beta1.Model}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_MergeVersionAliases_async - */ - mergeVersionAliases( - request?: protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModel, - protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest|undefined, {}|undefined - ]>; - mergeVersionAliases( - request: protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IModel, - protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest|null|undefined, - {}|null|undefined>): void; - mergeVersionAliases( - request: protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IModel, - protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest|null|undefined, - {}|null|undefined>): void; - mergeVersionAliases( - request?: protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IModel, - protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IModel, - protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModel, - protos.google.cloud.aiplatform.v1beta1.IMergeVersionAliasesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.mergeVersionAliases(request, options, callback); - } -/** - * Imports an externally generated ModelEvaluation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent model resource. - * Format: `projects/{project}/locations/{location}/models/{model}` - * @param {google.cloud.aiplatform.v1beta1.ModelEvaluation} request.modelEvaluation - * Required. Model evaluation resource to be imported. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ModelEvaluation]{@link google.cloud.aiplatform.v1beta1.ModelEvaluation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_ImportModelEvaluation_async - */ - importModelEvaluation( - request?: protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, - protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest|undefined, {}|undefined - ]>; - importModelEvaluation( - request: protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, - protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest|null|undefined, - {}|null|undefined>): void; - importModelEvaluation( - request: protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, - protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest|null|undefined, - {}|null|undefined>): void; - importModelEvaluation( - request?: protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, - protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, - protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, - protos.google.cloud.aiplatform.v1beta1.IImportModelEvaluationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.importModelEvaluation(request, options, callback); - } -/** - * Gets a ModelEvaluation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the ModelEvaluation resource. - * Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ModelEvaluation]{@link google.cloud.aiplatform.v1beta1.ModelEvaluation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_GetModelEvaluation_async - */ - getModelEvaluation( - request?: protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, - protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest|undefined, {}|undefined - ]>; - getModelEvaluation( - request: protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, - protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest|null|undefined, - {}|null|undefined>): void; - getModelEvaluation( - request: protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, - protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest|null|undefined, - {}|null|undefined>): void; - getModelEvaluation( - request?: protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, - protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, - protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModelEvaluation, - protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getModelEvaluation(request, options, callback); - } -/** - * Gets a ModelEvaluationSlice. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the ModelEvaluationSlice resource. - * Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ModelEvaluationSlice]{@link google.cloud.aiplatform.v1beta1.ModelEvaluationSlice}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_GetModelEvaluationSlice_async - */ - getModelEvaluationSlice( - request?: protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice, - protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest|undefined, {}|undefined - ]>; - getModelEvaluationSlice( - request: protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice, - protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest|null|undefined, - {}|null|undefined>): void; - getModelEvaluationSlice( - request: protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice, - protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest|null|undefined, - {}|null|undefined>): void; - getModelEvaluationSlice( - request?: protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice, - protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice, - protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice, - protos.google.cloud.aiplatform.v1beta1.IGetModelEvaluationSliceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getModelEvaluationSlice(request, options, callback); - } - -/** - * Uploads a Model artifact into Vertex AI. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location into which to upload the Model. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.parentModel] - * Optional. The resource name of the model into which to upload the version. Only - * specify this field when uploading a new version. - * @param {string} [request.modelId] - * Optional. The ID to use for the uploaded Model, which will become the final - * component of the model resource name. - * - * This value may be up to 63 characters, and valid characters are - * `[a-z0-9_-]`. The first character cannot be a number or hyphen. - * @param {google.cloud.aiplatform.v1beta1.Model} request.model - * Required. The Model to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_UploadModel_async - */ - uploadModel( - request?: protos.google.cloud.aiplatform.v1beta1.IUploadModelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - uploadModel( - request: protos.google.cloud.aiplatform.v1beta1.IUploadModelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - uploadModel( - request: protos.google.cloud.aiplatform.v1beta1.IUploadModelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - uploadModel( - request?: protos.google.cloud.aiplatform.v1beta1.IUploadModelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.uploadModel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `uploadModel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_UploadModel_async - */ - async checkUploadModelProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.uploadModel, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Incremental update the dataset used for a examples model. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.model - * Required. The resource name of the Model to update. - * Format: `projects/{project}/locations/{location}/models/{model}` - * @param {google.cloud.aiplatform.v1beta1.Examples} request.examples - * The example config containing the location of the dataset. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_UpdateExplanationDataset_async - */ - updateExplanationDataset( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateExplanationDataset( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateExplanationDataset( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateExplanationDataset( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'model': request.model || '', - }); - this.initialize(); - return this.innerApiCalls.updateExplanationDataset(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateExplanationDataset()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_UpdateExplanationDataset_async - */ - async checkUpdateExplanationDatasetProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateExplanationDataset, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a Model. - * - * A model cannot be deleted if any {@link google.cloud.aiplatform.v1beta1.Endpoint|Endpoint} resource has a - * {@link google.cloud.aiplatform.v1beta1.DeployedModel|DeployedModel} based on the model in its - * {@link google.cloud.aiplatform.v1beta1.Endpoint.deployed_models|deployed_models} field. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Model resource to be deleted. - * Format: `projects/{project}/locations/{location}/models/{model}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_DeleteModel_async - */ - deleteModel( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteModelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteModel( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteModelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteModel( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteModelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteModel( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteModelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteModel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteModel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_DeleteModel_async - */ - async checkDeleteModelProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteModel, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a Model version. - * - * Model version can only be deleted if there are no {@link |DeployedModels} - * created from it. Deleting the only version in the Model is not allowed. Use - * {@link google.cloud.aiplatform.v1beta1.ModelService.DeleteModel|DeleteModel} for deleting the Model instead. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the model version to be deleted, with a version ID explicitly - * included. - * - * Example: `projects/{project}/locations/{location}/models/{model}@1234` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_DeleteModelVersion_async - */ - deleteModelVersion( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteModelVersionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteModelVersion( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteModelVersionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteModelVersion( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteModelVersionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteModelVersion( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteModelVersionRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteModelVersion(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteModelVersion()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_DeleteModelVersion_async - */ - async checkDeleteModelVersionProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteModelVersion, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Exports a trained, exportable Model to a location specified by the - * user. A Model is considered to be exportable if it has at least one - * {@link google.cloud.aiplatform.v1beta1.Model.supported_export_formats|supported export format}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Model to export. - * The resource name may contain version id or version alias to specify the - * version, if no version is specified, the default version will be exported. - * @param {google.cloud.aiplatform.v1beta1.ExportModelRequest.OutputConfig} request.outputConfig - * Required. The desired output location and configuration. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_ExportModel_async - */ - exportModel( - request?: protos.google.cloud.aiplatform.v1beta1.IExportModelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - exportModel( - request: protos.google.cloud.aiplatform.v1beta1.IExportModelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportModel( - request: protos.google.cloud.aiplatform.v1beta1.IExportModelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportModel( - request?: protos.google.cloud.aiplatform.v1beta1.IExportModelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.exportModel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `exportModel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_ExportModel_async - */ - async checkExportModelProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.exportModel, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Models in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the Models from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `model` supports = and !=. `model` represents the Model ID, - * i.e. the last segment of the Model's {@link google.cloud.aiplatform.v1beta1.Model.name|resource name}. - * * `display_name` supports = and != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `model=1234` - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModels|ModelService.ListModels} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Model]{@link google.cloud.aiplatform.v1beta1.Model}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listModelsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listModels( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModel[], - protos.google.cloud.aiplatform.v1beta1.IListModelsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListModelsResponse - ]>; - listModels( - request: protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModel>): void; - listModels( - request: protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModel>): void; - listModels( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModel>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModel>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModel[], - protos.google.cloud.aiplatform.v1beta1.IListModelsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListModelsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listModels(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the Models from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `model` supports = and !=. `model` represents the Model ID, - * i.e. the last segment of the Model's {@link google.cloud.aiplatform.v1beta1.Model.name|resource name}. - * * `display_name` supports = and != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `model=1234` - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModels|ModelService.ListModels} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Model]{@link google.cloud.aiplatform.v1beta1.Model} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listModelsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listModelsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listModels']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listModels.createStream( - this.innerApiCalls.listModels as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listModels`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the Models from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `model` supports = and !=. `model` represents the Model ID, - * i.e. the last segment of the Model's {@link google.cloud.aiplatform.v1beta1.Model.name|resource name}. - * * `display_name` supports = and != - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `model=1234` - * * `displayName="myDisplayName"` - * * `labels.myKey="myValue"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModels|ModelService.ListModels} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Model]{@link google.cloud.aiplatform.v1beta1.Model}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_ListModels_async - */ - listModelsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listModels']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listModels.asyncIterate( - this.innerApiCalls['listModels'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists versions of the specified model. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the model to list versions for. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token|ListModelVersionsResponse.next_page_token} of the previous - * {@link |ModelService.ListModelversions} call. - * @param {string} request.filter - * An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `labels.myKey="myValue"` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Model]{@link google.cloud.aiplatform.v1beta1.Model}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listModelVersionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listModelVersions( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModel[], - protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListModelVersionsResponse - ]>; - listModelVersions( - request: protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelVersionsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModel>): void; - listModelVersions( - request: protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelVersionsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModel>): void; - listModelVersions( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelVersionsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModel>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelVersionsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModel>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModel[], - protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListModelVersionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.listModelVersions(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the model to list versions for. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token|ListModelVersionsResponse.next_page_token} of the previous - * {@link |ModelService.ListModelversions} call. - * @param {string} request.filter - * An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `labels.myKey="myValue"` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Model]{@link google.cloud.aiplatform.v1beta1.Model} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listModelVersionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listModelVersionsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - const defaultCallSettings = this._defaults['listModelVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listModelVersions.createStream( - this.innerApiCalls.listModelVersions as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listModelVersions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the model to list versions for. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.next_page_token|ListModelVersionsResponse.next_page_token} of the previous - * {@link |ModelService.ListModelversions} call. - * @param {string} request.filter - * An expression for filtering the results of the request. For field names - * both snake_case and camelCase are supported. - * - * * `labels` supports general map functions that is: - * * `labels.key=value` - key:value equality - * * `labels.key:* or labels:key - key existence - * * A key including a space must be quoted. `labels."a key"`. - * - * Some examples: - * * `labels.myKey="myValue"` - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Model]{@link google.cloud.aiplatform.v1beta1.Model}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_ListModelVersions_async - */ - listModelVersionsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelVersionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - const defaultCallSettings = this._defaults['listModelVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listModelVersions.asyncIterate( - this.innerApiCalls['listModelVersions'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists ModelEvaluations in a Model. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Model to list the ModelEvaluations from. - * Format: `projects/{project}/locations/{location}/models/{model}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluations|ModelService.ListModelEvaluations} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [ModelEvaluation]{@link google.cloud.aiplatform.v1beta1.ModelEvaluation}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listModelEvaluationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listModelEvaluations( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModelEvaluation[], - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsResponse - ]>; - listModelEvaluations( - request: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModelEvaluation>): void; - listModelEvaluations( - request: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModelEvaluation>): void; - listModelEvaluations( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModelEvaluation>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModelEvaluation>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModelEvaluation[], - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listModelEvaluations(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Model to list the ModelEvaluations from. - * Format: `projects/{project}/locations/{location}/models/{model}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluations|ModelService.ListModelEvaluations} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [ModelEvaluation]{@link google.cloud.aiplatform.v1beta1.ModelEvaluation} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listModelEvaluationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listModelEvaluationsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listModelEvaluations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listModelEvaluations.createStream( - this.innerApiCalls.listModelEvaluations as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listModelEvaluations`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Model to list the ModelEvaluations from. - * Format: `projects/{project}/locations/{location}/models/{model}` - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluations|ModelService.ListModelEvaluations} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [ModelEvaluation]{@link google.cloud.aiplatform.v1beta1.ModelEvaluation}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_ListModelEvaluations_async - */ - listModelEvaluationsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listModelEvaluations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listModelEvaluations.asyncIterate( - this.innerApiCalls['listModelEvaluations'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists ModelEvaluationSlices in a ModelEvaluation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the ModelEvaluation to list the ModelEvaluationSlices - * from. Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` - * @param {string} request.filter - * The standard list filter. - * - * * `slice.dimension` - for =. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesResponse.next_page_token|ListModelEvaluationSlicesResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluationSlices|ModelService.ListModelEvaluationSlices} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [ModelEvaluationSlice]{@link google.cloud.aiplatform.v1beta1.ModelEvaluationSlice}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listModelEvaluationSlicesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listModelEvaluationSlices( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice[], - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesResponse - ]>; - listModelEvaluationSlices( - request: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice>): void; - listModelEvaluationSlices( - request: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice>): void; - listModelEvaluationSlices( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice[], - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listModelEvaluationSlices(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the ModelEvaluation to list the ModelEvaluationSlices - * from. Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` - * @param {string} request.filter - * The standard list filter. - * - * * `slice.dimension` - for =. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesResponse.next_page_token|ListModelEvaluationSlicesResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluationSlices|ModelService.ListModelEvaluationSlices} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [ModelEvaluationSlice]{@link google.cloud.aiplatform.v1beta1.ModelEvaluationSlice} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listModelEvaluationSlicesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listModelEvaluationSlicesStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listModelEvaluationSlices']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listModelEvaluationSlices.createStream( - this.innerApiCalls.listModelEvaluationSlices as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listModelEvaluationSlices`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the ModelEvaluation to list the ModelEvaluationSlices - * from. Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` - * @param {string} request.filter - * The standard list filter. - * - * * `slice.dimension` - for =. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesResponse.next_page_token|ListModelEvaluationSlicesResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluationSlices|ModelService.ListModelEvaluationSlices} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [ModelEvaluationSlice]{@link google.cloud.aiplatform.v1beta1.ModelEvaluationSlice}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_ModelService_ListModelEvaluationSlices_async - */ - listModelEvaluationSlicesAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListModelEvaluationSlicesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listModelEvaluationSlices']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listModelEvaluationSlices.asyncIterate( - this.innerApiCalls['listModelEvaluationSlices'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.modelServiceStub && !this._terminated) { - return this.modelServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/model_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/model_service_client_config.json deleted file mode 100644 index 5d0c4612..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/model_service_client_config.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1beta1.ModelService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "UploadModel": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetModel": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListModels": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListModelVersions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateModel": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateExplanationDataset": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteModel": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteModelVersion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "MergeVersionAliases": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ExportModel": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ImportModelEvaluation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetModelEvaluation": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListModelEvaluations": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetModelEvaluationSlice": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListModelEvaluationSlices": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/model_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/model_service_proto_list.json deleted file mode 100644 index c916ab12..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/model_service_proto_list.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/context.proto", - "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1beta1/event.proto", - "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/io.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/study.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1beta1/types.proto", - "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1beta1/value.proto", - "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_client.ts deleted file mode 100644 index 3c4f891c..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_client.ts +++ /dev/null @@ -1,3550 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/pipeline_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './pipeline_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * A service for creating and managing Vertex AI's pipelines. This includes both - * `TrainingPipeline` resources (used for AutoML and custom training) and - * `PipelineJob` resources (used for Vertex AI Pipelines). - * @class - * @memberof v1beta1 - */ -export class PipelineServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - pipelineServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of PipelineServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof PipelineServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listTrainingPipelines: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'trainingPipelines'), - listPipelineJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'pipelineJobs') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const deleteTrainingPipelineResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteTrainingPipelineMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const deletePipelineJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deletePipelineJobMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - deleteTrainingPipeline: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteTrainingPipelineResponse.decode.bind(deleteTrainingPipelineResponse), - deleteTrainingPipelineMetadata.decode.bind(deleteTrainingPipelineMetadata)), - deletePipelineJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deletePipelineJobResponse.decode.bind(deletePipelineJobResponse), - deletePipelineJobMetadata.decode.bind(deletePipelineJobMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1beta1.PipelineService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.pipelineServiceStub) { - return this.pipelineServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1beta1.PipelineService. - this.pipelineServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.PipelineService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1beta1.PipelineService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const pipelineServiceStubMethods = - ['createTrainingPipeline', 'getTrainingPipeline', 'listTrainingPipelines', 'deleteTrainingPipeline', 'cancelTrainingPipeline', 'createPipelineJob', 'getPipelineJob', 'listPipelineJobs', 'deletePipelineJob', 'cancelPipelineJob']; - for (const methodName of pipelineServiceStubMethods) { - const callPromise = this.pipelineServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.pipelineServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Creates a TrainingPipeline. A created TrainingPipeline right away will be - * attempted to be run. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the TrainingPipeline in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1beta1.TrainingPipeline} request.trainingPipeline - * Required. The TrainingPipeline to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TrainingPipeline]{@link google.cloud.aiplatform.v1beta1.TrainingPipeline}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_PipelineService_CreateTrainingPipeline_async - */ - createTrainingPipeline( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest|undefined, {}|undefined - ]>; - createTrainingPipeline( - request: protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest|null|undefined, - {}|null|undefined>): void; - createTrainingPipeline( - request: protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest|null|undefined, - {}|null|undefined>): void; - createTrainingPipeline( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1beta1.ICreateTrainingPipelineRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createTrainingPipeline(request, options, callback); - } -/** - * Gets a TrainingPipeline. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the TrainingPipeline resource. - * Format: - * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TrainingPipeline]{@link google.cloud.aiplatform.v1beta1.TrainingPipeline}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_PipelineService_GetTrainingPipeline_async - */ - getTrainingPipeline( - request?: protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest|undefined, {}|undefined - ]>; - getTrainingPipeline( - request: protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest|null|undefined, - {}|null|undefined>): void; - getTrainingPipeline( - request: protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest|null|undefined, - {}|null|undefined>): void; - getTrainingPipeline( - request?: protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline, - protos.google.cloud.aiplatform.v1beta1.IGetTrainingPipelineRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getTrainingPipeline(request, options, callback); - } -/** - * Cancels a TrainingPipeline. - * Starts asynchronous cancellation on the TrainingPipeline. The server - * makes a best effort to cancel the pipeline, but success is not - * guaranteed. Clients can use {@link google.cloud.aiplatform.v1beta1.PipelineService.GetTrainingPipeline|PipelineService.GetTrainingPipeline} or - * other methods to check whether the cancellation succeeded or whether the - * pipeline completed despite cancellation. On successful cancellation, - * the TrainingPipeline is not deleted; instead it becomes a pipeline with - * a {@link google.cloud.aiplatform.v1beta1.TrainingPipeline.error|TrainingPipeline.error} value with a {@link google.rpc.Status.code|google.rpc.Status.code} of 1, - * corresponding to `Code.CANCELLED`, and {@link google.cloud.aiplatform.v1beta1.TrainingPipeline.state|TrainingPipeline.state} is set to - * `CANCELLED`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the TrainingPipeline to cancel. - * Format: - * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_PipelineService_CancelTrainingPipeline_async - */ - cancelTrainingPipeline( - request?: protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest|undefined, {}|undefined - ]>; - cancelTrainingPipeline( - request: protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest|null|undefined, - {}|null|undefined>): void; - cancelTrainingPipeline( - request: protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest|null|undefined, - {}|null|undefined>): void; - cancelTrainingPipeline( - request?: protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelTrainingPipelineRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.cancelTrainingPipeline(request, options, callback); - } -/** - * Creates a PipelineJob. A PipelineJob will run immediately when created. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the PipelineJob in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1beta1.PipelineJob} request.pipelineJob - * Required. The PipelineJob to create. - * @param {string} request.pipelineJobId - * The ID to use for the PipelineJob, which will become the final component of - * the PipelineJob name. If not provided, an ID will be automatically - * generated. - * - * This value should be less than 128 characters, and valid characters - * are /{@link 0-9|a-z}-/. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [PipelineJob]{@link google.cloud.aiplatform.v1beta1.PipelineJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_PipelineService_CreatePipelineJob_async - */ - createPipelineJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IPipelineJob, - protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest|undefined, {}|undefined - ]>; - createPipelineJob( - request: protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IPipelineJob, - protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest|null|undefined, - {}|null|undefined>): void; - createPipelineJob( - request: protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IPipelineJob, - protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest|null|undefined, - {}|null|undefined>): void; - createPipelineJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IPipelineJob, - protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IPipelineJob, - protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IPipelineJob, - protos.google.cloud.aiplatform.v1beta1.ICreatePipelineJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createPipelineJob(request, options, callback); - } -/** - * Gets a PipelineJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the PipelineJob resource. - * Format: - * `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [PipelineJob]{@link google.cloud.aiplatform.v1beta1.PipelineJob}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_PipelineService_GetPipelineJob_async - */ - getPipelineJob( - request?: protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IPipelineJob, - protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest|undefined, {}|undefined - ]>; - getPipelineJob( - request: protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IPipelineJob, - protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest|null|undefined, - {}|null|undefined>): void; - getPipelineJob( - request: protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IPipelineJob, - protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest|null|undefined, - {}|null|undefined>): void; - getPipelineJob( - request?: protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IPipelineJob, - protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IPipelineJob, - protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IPipelineJob, - protos.google.cloud.aiplatform.v1beta1.IGetPipelineJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getPipelineJob(request, options, callback); - } -/** - * Cancels a PipelineJob. - * Starts asynchronous cancellation on the PipelineJob. The server - * makes a best effort to cancel the pipeline, but success is not - * guaranteed. Clients can use {@link google.cloud.aiplatform.v1beta1.PipelineService.GetPipelineJob|PipelineService.GetPipelineJob} or - * other methods to check whether the cancellation succeeded or whether the - * pipeline completed despite cancellation. On successful cancellation, - * the PipelineJob is not deleted; instead it becomes a pipeline with - * a {@link google.cloud.aiplatform.v1beta1.PipelineJob.error|PipelineJob.error} value with a {@link google.rpc.Status.code|google.rpc.Status.code} of 1, - * corresponding to `Code.CANCELLED`, and {@link google.cloud.aiplatform.v1beta1.PipelineJob.state|PipelineJob.state} is set to - * `CANCELLED`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the PipelineJob to cancel. - * Format: - * `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_PipelineService_CancelPipelineJob_async - */ - cancelPipelineJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest|undefined, {}|undefined - ]>; - cancelPipelineJob( - request: protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest|null|undefined, - {}|null|undefined>): void; - cancelPipelineJob( - request: protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest|null|undefined, - {}|null|undefined>): void; - cancelPipelineJob( - request?: protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.ICancelPipelineJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.cancelPipelineJob(request, options, callback); - } - -/** - * Deletes a TrainingPipeline. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the TrainingPipeline resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_PipelineService_DeleteTrainingPipeline_async - */ - deleteTrainingPipeline( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTrainingPipelineRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteTrainingPipeline( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteTrainingPipelineRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTrainingPipeline( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteTrainingPipelineRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTrainingPipeline( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTrainingPipelineRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteTrainingPipeline(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteTrainingPipeline()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_PipelineService_DeleteTrainingPipeline_async - */ - async checkDeleteTrainingPipelineProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTrainingPipeline, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a PipelineJob. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the PipelineJob resource to be deleted. - * Format: - * `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_PipelineService_DeletePipelineJob_async - */ - deletePipelineJob( - request?: protos.google.cloud.aiplatform.v1beta1.IDeletePipelineJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deletePipelineJob( - request: protos.google.cloud.aiplatform.v1beta1.IDeletePipelineJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deletePipelineJob( - request: protos.google.cloud.aiplatform.v1beta1.IDeletePipelineJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deletePipelineJob( - request?: protos.google.cloud.aiplatform.v1beta1.IDeletePipelineJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deletePipelineJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deletePipelineJob()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_PipelineService_DeletePipelineJob_async - */ - async checkDeletePipelineJobProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deletePipelineJob, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists TrainingPipelines in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the TrainingPipelines from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name="my_pipeline"` - * - * * `state="PIPELINE_STATE_RUNNING" OR display_name="my_pipeline"` - * - * * `NOT display_name="my_pipeline"` - * - * * `state="PIPELINE_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListTrainingPipelinesResponse.next_page_token|ListTrainingPipelinesResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.PipelineService.ListTrainingPipelines|PipelineService.ListTrainingPipelines} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [TrainingPipeline]{@link google.cloud.aiplatform.v1beta1.TrainingPipeline}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listTrainingPipelinesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTrainingPipelines( - request?: protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline[], - protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesResponse - ]>; - listTrainingPipelines( - request: protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, - protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline>): void; - listTrainingPipelines( - request: protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, - protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline>): void; - listTrainingPipelines( - request?: protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, - protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, - protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline[], - protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listTrainingPipelines(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the TrainingPipelines from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name="my_pipeline"` - * - * * `state="PIPELINE_STATE_RUNNING" OR display_name="my_pipeline"` - * - * * `NOT display_name="my_pipeline"` - * - * * `state="PIPELINE_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListTrainingPipelinesResponse.next_page_token|ListTrainingPipelinesResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.PipelineService.ListTrainingPipelines|PipelineService.ListTrainingPipelines} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [TrainingPipeline]{@link google.cloud.aiplatform.v1beta1.TrainingPipeline} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listTrainingPipelinesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTrainingPipelinesStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTrainingPipelines']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTrainingPipelines.createStream( - this.innerApiCalls.listTrainingPipelines as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTrainingPipelines`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the TrainingPipelines from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * The standard list filter. - * Supported fields: - * - * * `display_name` supports = and !=. - * - * * `state` supports = and !=. - * - * Some examples of using the filter are: - * - * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name="my_pipeline"` - * - * * `state="PIPELINE_STATE_RUNNING" OR display_name="my_pipeline"` - * - * * `NOT display_name="my_pipeline"` - * - * * `state="PIPELINE_STATE_FAILED"` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListTrainingPipelinesResponse.next_page_token|ListTrainingPipelinesResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.PipelineService.ListTrainingPipelines|PipelineService.ListTrainingPipelines} call. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [TrainingPipeline]{@link google.cloud.aiplatform.v1beta1.TrainingPipeline}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_PipelineService_ListTrainingPipelines_async - */ - listTrainingPipelinesAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListTrainingPipelinesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTrainingPipelines']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTrainingPipelines.asyncIterate( - this.innerApiCalls['listTrainingPipelines'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists PipelineJobs in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the PipelineJobs from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the PipelineJobs that match the filter expression. The following - * fields are supported: - * - * * `pipeline_name`: Supports `=` and `!=` comparisons. - * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. - * * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. - * for example, can check if pipeline's display_name contains *step* by doing - * display_name:\"*step*\" - * * `state`: Supports `=` and `!=` comparisons. - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `labels`: Supports key-value equality and key presence. - * * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. - * * `template_metadata.version_name`: Supports `=`, `!=` comparisons, and `:` - * wildcard. - * - * Filter expressions can be combined together using logical operators - * (`AND` & `OR`). - * For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. - * - * The syntax to define filter expression is based on - * https://google.aip.dev/160. - * - * Examples: - * - * * `create_time>"2021-05-18T00:00:00Z" OR - * update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated - * after 2020-05-18 00:00:00 UTC. - * * `labels.env = "prod"` - * PipelineJobs with label "env" set to "prod". - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListPipelineJobsResponse.next_page_token|ListPipelineJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.PipelineService.ListPipelineJobs|PipelineService.ListPipelineJobs} call. - * @param {string} request.orderBy - * A comma-separated list of fields to order by. The default sort order is in - * ascending order. Use "desc" after a field name for descending. You can have - * multiple order_by fields provided e.g. "create_time desc, end_time", - * "end_time, start_time, update_time" For example, using "create_time desc, - * end_time" will order results by create time in descending order, and if - * there are multiple jobs having the same create time, order them by the end - * time in ascending order. if order_by is not specified, it will order by - * default order is create time in descending order. Supported fields: - * * `create_time` - * * `update_time` - * * `end_time` - * * `start_time` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [PipelineJob]{@link google.cloud.aiplatform.v1beta1.PipelineJob}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listPipelineJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listPipelineJobs( - request?: protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IPipelineJob[], - protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsResponse - ]>; - listPipelineJobs( - request: protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IPipelineJob>): void; - listPipelineJobs( - request: protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IPipelineJob>): void; - listPipelineJobs( - request?: protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IPipelineJob>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, - protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IPipelineJob>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IPipelineJob[], - protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listPipelineJobs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the PipelineJobs from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the PipelineJobs that match the filter expression. The following - * fields are supported: - * - * * `pipeline_name`: Supports `=` and `!=` comparisons. - * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. - * * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. - * for example, can check if pipeline's display_name contains *step* by doing - * display_name:\"*step*\" - * * `state`: Supports `=` and `!=` comparisons. - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `labels`: Supports key-value equality and key presence. - * * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. - * * `template_metadata.version_name`: Supports `=`, `!=` comparisons, and `:` - * wildcard. - * - * Filter expressions can be combined together using logical operators - * (`AND` & `OR`). - * For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. - * - * The syntax to define filter expression is based on - * https://google.aip.dev/160. - * - * Examples: - * - * * `create_time>"2021-05-18T00:00:00Z" OR - * update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated - * after 2020-05-18 00:00:00 UTC. - * * `labels.env = "prod"` - * PipelineJobs with label "env" set to "prod". - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListPipelineJobsResponse.next_page_token|ListPipelineJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.PipelineService.ListPipelineJobs|PipelineService.ListPipelineJobs} call. - * @param {string} request.orderBy - * A comma-separated list of fields to order by. The default sort order is in - * ascending order. Use "desc" after a field name for descending. You can have - * multiple order_by fields provided e.g. "create_time desc, end_time", - * "end_time, start_time, update_time" For example, using "create_time desc, - * end_time" will order results by create time in descending order, and if - * there are multiple jobs having the same create time, order them by the end - * time in ascending order. if order_by is not specified, it will order by - * default order is create time in descending order. Supported fields: - * * `create_time` - * * `update_time` - * * `end_time` - * * `start_time` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [PipelineJob]{@link google.cloud.aiplatform.v1beta1.PipelineJob} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listPipelineJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listPipelineJobsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listPipelineJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listPipelineJobs.createStream( - this.innerApiCalls.listPipelineJobs as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listPipelineJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the PipelineJobs from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the PipelineJobs that match the filter expression. The following - * fields are supported: - * - * * `pipeline_name`: Supports `=` and `!=` comparisons. - * * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. - * * `pipeline_job_user_id`: Supports `=`, `!=` comparisons, and `:` wildcard. - * for example, can check if pipeline's display_name contains *step* by doing - * display_name:\"*step*\" - * * `state`: Supports `=` and `!=` comparisons. - * * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `update_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. - * Values must be in RFC 3339 format. - * * `labels`: Supports key-value equality and key presence. - * * `template_uri`: Supports `=`, `!=` comparisons, and `:` wildcard. - * * `template_metadata.version_name`: Supports `=`, `!=` comparisons, and `:` - * wildcard. - * - * Filter expressions can be combined together using logical operators - * (`AND` & `OR`). - * For example: `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. - * - * The syntax to define filter expression is based on - * https://google.aip.dev/160. - * - * Examples: - * - * * `create_time>"2021-05-18T00:00:00Z" OR - * update_time>"2020-05-18T00:00:00Z"` PipelineJobs created or updated - * after 2020-05-18 00:00:00 UTC. - * * `labels.env = "prod"` - * PipelineJobs with label "env" set to "prod". - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained via - * {@link google.cloud.aiplatform.v1beta1.ListPipelineJobsResponse.next_page_token|ListPipelineJobsResponse.next_page_token} of the previous - * {@link google.cloud.aiplatform.v1beta1.PipelineService.ListPipelineJobs|PipelineService.ListPipelineJobs} call. - * @param {string} request.orderBy - * A comma-separated list of fields to order by. The default sort order is in - * ascending order. Use "desc" after a field name for descending. You can have - * multiple order_by fields provided e.g. "create_time desc, end_time", - * "end_time, start_time, update_time" For example, using "create_time desc, - * end_time" will order results by create time in descending order, and if - * there are multiple jobs having the same create time, order them by the end - * time in ascending order. if order_by is not specified, it will order by - * default order is create time in descending order. Supported fields: - * * `create_time` - * * `update_time` - * * `end_time` - * * `start_time` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [PipelineJob]{@link google.cloud.aiplatform.v1beta1.PipelineJob}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_PipelineService_ListPipelineJobs_async - */ - listPipelineJobsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListPipelineJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listPipelineJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listPipelineJobs.asyncIterate( - this.innerApiCalls['listPipelineJobs'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.pipelineServiceStub && !this._terminated) { - return this.pipelineServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_client_config.json deleted file mode 100644 index dfa51e95..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_client_config.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1beta1.PipelineService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateTrainingPipeline": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetTrainingPipeline": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListTrainingPipelines": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteTrainingPipeline": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelTrainingPipeline": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreatePipelineJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetPipelineJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListPipelineJobs": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeletePipelineJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelPipelineJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_proto_list.json deleted file mode 100644 index c916ab12..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_proto_list.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/context.proto", - "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1beta1/event.proto", - "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/io.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/study.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1beta1/types.proto", - "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1beta1/value.proto", - "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_client.ts deleted file mode 100644 index 4c3c5c74..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_client.ts +++ /dev/null @@ -1,2532 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/prediction_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './prediction_service_client_config.json'; - -const version = require('../../../package.json').version; - -/** - * A service for online predictions and explanations. - * @class - * @memberof v1beta1 - */ -export class PredictionServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - predictionServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of PredictionServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof PredictionServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1beta1.PredictionService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.predictionServiceStub) { - return this.predictionServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1beta1.PredictionService. - this.predictionServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.PredictionService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1beta1.PredictionService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const predictionServiceStubMethods = - ['predict', 'rawPredict', 'explain']; - for (const methodName of predictionServiceStubMethods) { - const callPromise = this.predictionServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.predictionServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Perform an online prediction. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.endpoint - * Required. The name of the Endpoint requested to serve the prediction. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param {number[]} request.instances - * Required. The instances that are the input to the prediction call. - * A DeployedModel may have an upper limit on the number of instances it - * supports per request, and when it is exceeded the prediction call errors - * in case of AutoML Models, or, in case of customer created Models, the - * behaviour is as documented by that Model. - * The schema of any single instance may be specified via Endpoint's - * DeployedModels' {@link google.cloud.aiplatform.v1beta1.DeployedModel.model|Model's} - * {@link google.cloud.aiplatform.v1beta1.Model.predict_schemata|PredictSchemata's} - * {@link google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri|instance_schema_uri}. - * @param {google.protobuf.Value} request.parameters - * The parameters that govern the prediction. The schema of the parameters may - * be specified via Endpoint's DeployedModels' {@link google.cloud.aiplatform.v1beta1.DeployedModel.model|Model's } - * {@link google.cloud.aiplatform.v1beta1.Model.predict_schemata|PredictSchemata's} - * {@link google.cloud.aiplatform.v1beta1.PredictSchemata.parameters_schema_uri|parameters_schema_uri}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [PredictResponse]{@link google.cloud.aiplatform.v1beta1.PredictResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_PredictionService_Predict_async - */ - predict( - request?: protos.google.cloud.aiplatform.v1beta1.IPredictRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IPredictResponse, - protos.google.cloud.aiplatform.v1beta1.IPredictRequest|undefined, {}|undefined - ]>; - predict( - request: protos.google.cloud.aiplatform.v1beta1.IPredictRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IPredictResponse, - protos.google.cloud.aiplatform.v1beta1.IPredictRequest|null|undefined, - {}|null|undefined>): void; - predict( - request: protos.google.cloud.aiplatform.v1beta1.IPredictRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IPredictResponse, - protos.google.cloud.aiplatform.v1beta1.IPredictRequest|null|undefined, - {}|null|undefined>): void; - predict( - request?: protos.google.cloud.aiplatform.v1beta1.IPredictRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IPredictResponse, - protos.google.cloud.aiplatform.v1beta1.IPredictRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IPredictResponse, - protos.google.cloud.aiplatform.v1beta1.IPredictRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IPredictResponse, - protos.google.cloud.aiplatform.v1beta1.IPredictRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'endpoint': request.endpoint || '', - }); - this.initialize(); - return this.innerApiCalls.predict(request, options, callback); - } -/** - * Perform an online prediction with an arbitrary HTTP payload. - * - * The response includes the following HTTP headers: - * - * * `X-Vertex-AI-Endpoint-Id`: ID of the {@link google.cloud.aiplatform.v1beta1.Endpoint|Endpoint} that served this - * prediction. - * - * * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's {@link google.cloud.aiplatform.v1beta1.DeployedModel|DeployedModel} - * that served this prediction. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.endpoint - * Required. The name of the Endpoint requested to serve the prediction. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param {google.api.HttpBody} request.httpBody - * The prediction input. Supports HTTP headers and arbitrary data payload. - * - * A {@link google.cloud.aiplatform.v1beta1.DeployedModel|DeployedModel} may have an upper limit on the number of instances it - * supports per request. When this limit it is exceeded for an AutoML model, - * the {@link google.cloud.aiplatform.v1beta1.PredictionService.RawPredict|RawPredict} method returns an error. - * When this limit is exceeded for a custom-trained model, the behavior varies - * depending on the model. - * - * You can specify the schema for each instance in the - * {@link google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri|predict_schemata.instance_schema_uri} - * field when you create a {@link google.cloud.aiplatform.v1beta1.Model|Model}. This schema applies when you deploy the - * `Model` as a `DeployedModel` to an {@link google.cloud.aiplatform.v1beta1.Endpoint|Endpoint} and use the `RawPredict` - * method. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [HttpBody]{@link google.api.HttpBody}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_PredictionService_RawPredict_async - */ - rawPredict( - request?: protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest, - options?: CallOptions): - Promise<[ - protos.google.api.IHttpBody, - protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest|undefined, {}|undefined - ]>; - rawPredict( - request: protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest, - options: CallOptions, - callback: Callback< - protos.google.api.IHttpBody, - protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest|null|undefined, - {}|null|undefined>): void; - rawPredict( - request: protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest, - callback: Callback< - protos.google.api.IHttpBody, - protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest|null|undefined, - {}|null|undefined>): void; - rawPredict( - request?: protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.api.IHttpBody, - protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.api.IHttpBody, - protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.api.IHttpBody, - protos.google.cloud.aiplatform.v1beta1.IRawPredictRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'endpoint': request.endpoint || '', - }); - this.initialize(); - return this.innerApiCalls.rawPredict(request, options, callback); - } -/** - * Perform an online explanation. - * - * If {@link google.cloud.aiplatform.v1beta1.ExplainRequest.deployed_model_id|deployed_model_id} is specified, - * the corresponding DeployModel must have - * {@link google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec|explanation_spec} - * populated. If {@link google.cloud.aiplatform.v1beta1.ExplainRequest.deployed_model_id|deployed_model_id} - * is not specified, all DeployedModels must have - * {@link google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec|explanation_spec} - * populated. Only deployed AutoML tabular Models have - * explanation_spec. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.endpoint - * Required. The name of the Endpoint requested to serve the explanation. - * Format: - * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param {number[]} request.instances - * Required. The instances that are the input to the explanation call. - * A DeployedModel may have an upper limit on the number of instances it - * supports per request, and when it is exceeded the explanation call errors - * in case of AutoML Models, or, in case of customer created Models, the - * behaviour is as documented by that Model. - * The schema of any single instance may be specified via Endpoint's - * DeployedModels' {@link google.cloud.aiplatform.v1beta1.DeployedModel.model|Model's} - * {@link google.cloud.aiplatform.v1beta1.Model.predict_schemata|PredictSchemata's} - * {@link google.cloud.aiplatform.v1beta1.PredictSchemata.instance_schema_uri|instance_schema_uri}. - * @param {google.protobuf.Value} request.parameters - * The parameters that govern the prediction. The schema of the parameters may - * be specified via Endpoint's DeployedModels' {@link google.cloud.aiplatform.v1beta1.DeployedModel.model|Model's } - * {@link google.cloud.aiplatform.v1beta1.Model.predict_schemata|PredictSchemata's} - * {@link google.cloud.aiplatform.v1beta1.PredictSchemata.parameters_schema_uri|parameters_schema_uri}. - * @param {google.cloud.aiplatform.v1beta1.ExplanationSpecOverride} request.explanationSpecOverride - * If specified, overrides the - * {@link google.cloud.aiplatform.v1beta1.DeployedModel.explanation_spec|explanation_spec} of the DeployedModel. - * Can be used for explaining prediction results with different - * configurations, such as: - * - Explaining top-5 predictions results as opposed to top-1; - * - Increasing path count or step count of the attribution methods to reduce - * approximate errors; - * - Using different baselines for explaining the prediction results. - * @param {string} request.deployedModelId - * If specified, this ExplainRequest will be served by the chosen - * DeployedModel, overriding {@link google.cloud.aiplatform.v1beta1.Endpoint.traffic_split|Endpoint.traffic_split}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ExplainResponse]{@link google.cloud.aiplatform.v1beta1.ExplainResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_PredictionService_Explain_async - */ - explain( - request?: protos.google.cloud.aiplatform.v1beta1.IExplainRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IExplainResponse, - protos.google.cloud.aiplatform.v1beta1.IExplainRequest|undefined, {}|undefined - ]>; - explain( - request: protos.google.cloud.aiplatform.v1beta1.IExplainRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IExplainResponse, - protos.google.cloud.aiplatform.v1beta1.IExplainRequest|null|undefined, - {}|null|undefined>): void; - explain( - request: protos.google.cloud.aiplatform.v1beta1.IExplainRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IExplainResponse, - protos.google.cloud.aiplatform.v1beta1.IExplainRequest|null|undefined, - {}|null|undefined>): void; - explain( - request?: protos.google.cloud.aiplatform.v1beta1.IExplainRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IExplainResponse, - protos.google.cloud.aiplatform.v1beta1.IExplainRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IExplainResponse, - protos.google.cloud.aiplatform.v1beta1.IExplainRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IExplainResponse, - protos.google.cloud.aiplatform.v1beta1.IExplainRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'endpoint': request.endpoint || '', - }); - this.initialize(); - return this.innerApiCalls.explain(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.predictionServiceStub && !this._terminated) { - return this.predictionServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_client_config.json deleted file mode 100644 index 475b31fc..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_client_config.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1beta1.PredictionService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "Predict": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RawPredict": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "Explain": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_proto_list.json deleted file mode 100644 index c916ab12..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_proto_list.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/context.proto", - "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1beta1/event.proto", - "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/io.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/study.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1beta1/types.proto", - "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1beta1/value.proto", - "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_client.ts deleted file mode 100644 index acff0a70..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_client.ts +++ /dev/null @@ -1,2883 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/specialist_pool_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './specialist_pool_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * A service for creating and managing Customer SpecialistPools. - * When customers start Data Labeling jobs, they can reuse/create Specialist - * Pools to bring their own Specialists to label the data. - * Customers can add/remove Managers for the Specialist Pool on Cloud console, - * then Managers will get email notifications to manage Specialists and tasks on - * CrowdCompute console. - * @class - * @memberof v1beta1 - */ -export class SpecialistPoolServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - specialistPoolServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of SpecialistPoolServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof SpecialistPoolServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listSpecialistPools: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'specialistPools') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const createSpecialistPoolResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.SpecialistPool') as gax.protobuf.Type; - const createSpecialistPoolMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.CreateSpecialistPoolOperationMetadata') as gax.protobuf.Type; - const deleteSpecialistPoolResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteSpecialistPoolMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const updateSpecialistPoolResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.SpecialistPool') as gax.protobuf.Type; - const updateSpecialistPoolMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.UpdateSpecialistPoolOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createSpecialistPool: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createSpecialistPoolResponse.decode.bind(createSpecialistPoolResponse), - createSpecialistPoolMetadata.decode.bind(createSpecialistPoolMetadata)), - deleteSpecialistPool: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteSpecialistPoolResponse.decode.bind(deleteSpecialistPoolResponse), - deleteSpecialistPoolMetadata.decode.bind(deleteSpecialistPoolMetadata)), - updateSpecialistPool: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateSpecialistPoolResponse.decode.bind(updateSpecialistPoolResponse), - updateSpecialistPoolMetadata.decode.bind(updateSpecialistPoolMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1beta1.SpecialistPoolService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.specialistPoolServiceStub) { - return this.specialistPoolServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1beta1.SpecialistPoolService. - this.specialistPoolServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.SpecialistPoolService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1beta1.SpecialistPoolService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const specialistPoolServiceStubMethods = - ['createSpecialistPool', 'getSpecialistPool', 'listSpecialistPools', 'deleteSpecialistPool', 'updateSpecialistPool']; - for (const methodName of specialistPoolServiceStubMethods) { - const callPromise = this.specialistPoolServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.specialistPoolServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets a SpecialistPool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the SpecialistPool resource. - * The form is - * `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SpecialistPool]{@link google.cloud.aiplatform.v1beta1.SpecialistPool}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_SpecialistPoolService_GetSpecialistPool_async - */ - getSpecialistPool( - request?: protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ISpecialistPool, - protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest|undefined, {}|undefined - ]>; - getSpecialistPool( - request: protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ISpecialistPool, - protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest|null|undefined, - {}|null|undefined>): void; - getSpecialistPool( - request: protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ISpecialistPool, - protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest|null|undefined, - {}|null|undefined>): void; - getSpecialistPool( - request?: protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ISpecialistPool, - protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ISpecialistPool, - protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ISpecialistPool, - protos.google.cloud.aiplatform.v1beta1.IGetSpecialistPoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getSpecialistPool(request, options, callback); - } - -/** - * Creates a SpecialistPool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent Project name for the new SpecialistPool. - * The form is `projects/{project}/locations/{location}`. - * @param {google.cloud.aiplatform.v1beta1.SpecialistPool} request.specialistPool - * Required. The SpecialistPool to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_SpecialistPoolService_CreateSpecialistPool_async - */ - createSpecialistPool( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateSpecialistPoolRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createSpecialistPool( - request: protos.google.cloud.aiplatform.v1beta1.ICreateSpecialistPoolRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createSpecialistPool( - request: protos.google.cloud.aiplatform.v1beta1.ICreateSpecialistPoolRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createSpecialistPool( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateSpecialistPoolRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createSpecialistPool(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createSpecialistPool()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_SpecialistPoolService_CreateSpecialistPool_async - */ - async checkCreateSpecialistPoolProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createSpecialistPool, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a SpecialistPool as well as all Specialists in the pool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the SpecialistPool to delete. Format: - * `projects/{project}/locations/{location}/specialistPools/{specialist_pool}` - * @param {boolean} request.force - * If set to true, any specialist managers in this SpecialistPool will also be - * deleted. (Otherwise, the request will only work if the SpecialistPool has - * no specialist managers.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_SpecialistPoolService_DeleteSpecialistPool_async - */ - deleteSpecialistPool( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteSpecialistPoolRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteSpecialistPool( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteSpecialistPoolRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteSpecialistPool( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteSpecialistPoolRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteSpecialistPool( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteSpecialistPoolRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteSpecialistPool(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteSpecialistPool()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_SpecialistPoolService_DeleteSpecialistPool_async - */ - async checkDeleteSpecialistPoolProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteSpecialistPool, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates a SpecialistPool. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.aiplatform.v1beta1.SpecialistPool} request.specialistPool - * Required. The SpecialistPool which replaces the resource on the server. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The update mask applies to the resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_SpecialistPoolService_UpdateSpecialistPool_async - */ - updateSpecialistPool( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateSpecialistPoolRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateSpecialistPool( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateSpecialistPoolRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateSpecialistPool( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateSpecialistPoolRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateSpecialistPool( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateSpecialistPoolRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'specialist_pool.name': request.specialistPool!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateSpecialistPool(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateSpecialistPool()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_SpecialistPoolService_UpdateSpecialistPool_async - */ - async checkUpdateSpecialistPoolProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateSpecialistPool, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists SpecialistPools in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the SpecialistPool's parent resource. - * Format: `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained by {@link google.cloud.aiplatform.v1beta1.ListSpecialistPoolsResponse.next_page_token|ListSpecialistPoolsResponse.next_page_token} of - * the previous {@link google.cloud.aiplatform.v1beta1.SpecialistPoolService.ListSpecialistPools|SpecialistPoolService.ListSpecialistPools} call. Return - * first page if empty. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. FieldMask represents a set of - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [SpecialistPool]{@link google.cloud.aiplatform.v1beta1.SpecialistPool}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listSpecialistPoolsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listSpecialistPools( - request?: protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ISpecialistPool[], - protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsResponse - ]>; - listSpecialistPools( - request: protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, - protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ISpecialistPool>): void; - listSpecialistPools( - request: protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, - protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ISpecialistPool>): void; - listSpecialistPools( - request?: protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, - protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ISpecialistPool>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, - protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ISpecialistPool>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ISpecialistPool[], - protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listSpecialistPools(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the SpecialistPool's parent resource. - * Format: `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained by {@link google.cloud.aiplatform.v1beta1.ListSpecialistPoolsResponse.next_page_token|ListSpecialistPoolsResponse.next_page_token} of - * the previous {@link google.cloud.aiplatform.v1beta1.SpecialistPoolService.ListSpecialistPools|SpecialistPoolService.ListSpecialistPools} call. Return - * first page if empty. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. FieldMask represents a set of - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [SpecialistPool]{@link google.cloud.aiplatform.v1beta1.SpecialistPool} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listSpecialistPoolsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listSpecialistPoolsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listSpecialistPools']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSpecialistPools.createStream( - this.innerApiCalls.listSpecialistPools as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSpecialistPools`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the SpecialistPool's parent resource. - * Format: `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * Typically obtained by {@link google.cloud.aiplatform.v1beta1.ListSpecialistPoolsResponse.next_page_token|ListSpecialistPoolsResponse.next_page_token} of - * the previous {@link google.cloud.aiplatform.v1beta1.SpecialistPoolService.ListSpecialistPools|SpecialistPoolService.ListSpecialistPools} call. Return - * first page if empty. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. FieldMask represents a set of - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [SpecialistPool]{@link google.cloud.aiplatform.v1beta1.SpecialistPool}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_SpecialistPoolService_ListSpecialistPools_async - */ - listSpecialistPoolsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListSpecialistPoolsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listSpecialistPools']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSpecialistPools.asyncIterate( - this.innerApiCalls['listSpecialistPools'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.specialistPoolServiceStub && !this._terminated) { - return this.specialistPoolServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_client_config.json deleted file mode 100644 index c39dc80f..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_client_config.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1beta1.SpecialistPoolService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateSpecialistPool": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetSpecialistPool": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListSpecialistPools": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteSpecialistPool": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateSpecialistPool": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_proto_list.json deleted file mode 100644 index c916ab12..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_proto_list.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/context.proto", - "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1beta1/event.proto", - "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/io.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/study.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1beta1/types.proto", - "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1beta1/value.proto", - "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_client.ts deleted file mode 100644 index 987b8f21..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_client.ts +++ /dev/null @@ -1,5387 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall, GoogleError} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import { PassThrough } from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/tensorboard_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './tensorboard_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * TensorboardService - * @class - * @memberof v1beta1 - */ -export class TensorboardServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - tensorboardServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of TensorboardServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof TensorboardServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listTensorboards: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tensorboards'), - listTensorboardExperiments: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tensorboardExperiments'), - listTensorboardRuns: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tensorboardRuns'), - listTensorboardTimeSeries: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tensorboardTimeSeries'), - exportTensorboardTimeSeriesData: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'timeSeriesDataPoints') - }; - - // Some of the methods on this service provide streaming responses. - // Provide descriptors for these. - this.descriptors.stream = { - readTensorboardBlobData: new this._gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING) - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const createTensorboardResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.Tensorboard') as gax.protobuf.Type; - const createTensorboardMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.CreateTensorboardOperationMetadata') as gax.protobuf.Type; - const updateTensorboardResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.Tensorboard') as gax.protobuf.Type; - const updateTensorboardMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.UpdateTensorboardOperationMetadata') as gax.protobuf.Type; - const deleteTensorboardResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteTensorboardMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const deleteTensorboardExperimentResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteTensorboardExperimentMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const deleteTensorboardRunResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteTensorboardRunMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - const deleteTensorboardTimeSeriesResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteTensorboardTimeSeriesMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createTensorboard: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createTensorboardResponse.decode.bind(createTensorboardResponse), - createTensorboardMetadata.decode.bind(createTensorboardMetadata)), - updateTensorboard: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateTensorboardResponse.decode.bind(updateTensorboardResponse), - updateTensorboardMetadata.decode.bind(updateTensorboardMetadata)), - deleteTensorboard: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteTensorboardResponse.decode.bind(deleteTensorboardResponse), - deleteTensorboardMetadata.decode.bind(deleteTensorboardMetadata)), - deleteTensorboardExperiment: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteTensorboardExperimentResponse.decode.bind(deleteTensorboardExperimentResponse), - deleteTensorboardExperimentMetadata.decode.bind(deleteTensorboardExperimentMetadata)), - deleteTensorboardRun: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteTensorboardRunResponse.decode.bind(deleteTensorboardRunResponse), - deleteTensorboardRunMetadata.decode.bind(deleteTensorboardRunMetadata)), - deleteTensorboardTimeSeries: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteTensorboardTimeSeriesResponse.decode.bind(deleteTensorboardTimeSeriesResponse), - deleteTensorboardTimeSeriesMetadata.decode.bind(deleteTensorboardTimeSeriesMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1beta1.TensorboardService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.tensorboardServiceStub) { - return this.tensorboardServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1beta1.TensorboardService. - this.tensorboardServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.TensorboardService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1beta1.TensorboardService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const tensorboardServiceStubMethods = - ['createTensorboard', 'getTensorboard', 'updateTensorboard', 'listTensorboards', 'deleteTensorboard', 'createTensorboardExperiment', 'getTensorboardExperiment', 'updateTensorboardExperiment', 'listTensorboardExperiments', 'deleteTensorboardExperiment', 'createTensorboardRun', 'batchCreateTensorboardRuns', 'getTensorboardRun', 'updateTensorboardRun', 'listTensorboardRuns', 'deleteTensorboardRun', 'batchCreateTensorboardTimeSeries', 'createTensorboardTimeSeries', 'getTensorboardTimeSeries', 'updateTensorboardTimeSeries', 'listTensorboardTimeSeries', 'deleteTensorboardTimeSeries', 'batchReadTensorboardTimeSeriesData', 'readTensorboardTimeSeriesData', 'readTensorboardBlobData', 'writeTensorboardExperimentData', 'writeTensorboardRunData', 'exportTensorboardTimeSeriesData']; - for (const methodName of tensorboardServiceStubMethods) { - const callPromise = this.tensorboardServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - if (methodName in this.descriptors.stream) { - const stream = new PassThrough(); - setImmediate(() => { - stream.emit('error', new GoogleError('The client has already been closed.')); - }); - return stream; - } - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.tensorboardServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets a Tensorboard. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Tensorboard resource. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Tensorboard]{@link google.cloud.aiplatform.v1beta1.Tensorboard}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_GetTensorboard_async - */ - getTensorboard( - request?: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboard, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest|undefined, {}|undefined - ]>; - getTensorboard( - request: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboard, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest|null|undefined, - {}|null|undefined>): void; - getTensorboard( - request: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboard, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest|null|undefined, - {}|null|undefined>): void; - getTensorboard( - request?: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboard, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboard, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboard, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getTensorboard(request, options, callback); - } -/** - * Creates a TensorboardExperiment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Tensorboard to create the TensorboardExperiment - * in. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - * @param {google.cloud.aiplatform.v1beta1.TensorboardExperiment} request.tensorboardExperiment - * The TensorboardExperiment to create. - * @param {string} request.tensorboardExperimentId - * Required. The ID to use for the Tensorboard experiment, which will become the final - * component of the Tensorboard experiment's resource name. - * - * This value should be 1-128 characters, and valid characters - * are /{@link 0-9|a-z}-/. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TensorboardExperiment]{@link google.cloud.aiplatform.v1beta1.TensorboardExperiment}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_CreateTensorboardExperiment_async - */ - createTensorboardExperiment( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest|undefined, {}|undefined - ]>; - createTensorboardExperiment( - request: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest|null|undefined, - {}|null|undefined>): void; - createTensorboardExperiment( - request: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest|null|undefined, - {}|null|undefined>): void; - createTensorboardExperiment( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardExperimentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createTensorboardExperiment(request, options, callback); - } -/** - * Gets a TensorboardExperiment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the TensorboardExperiment resource. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TensorboardExperiment]{@link google.cloud.aiplatform.v1beta1.TensorboardExperiment}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_GetTensorboardExperiment_async - */ - getTensorboardExperiment( - request?: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest|undefined, {}|undefined - ]>; - getTensorboardExperiment( - request: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest|null|undefined, - {}|null|undefined>): void; - getTensorboardExperiment( - request: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest|null|undefined, - {}|null|undefined>): void; - getTensorboardExperiment( - request?: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardExperimentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getTensorboardExperiment(request, options, callback); - } -/** - * Updates a TensorboardExperiment. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Field mask is used to specify the fields to be overwritten in the - * TensorboardExperiment resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten if new - * values are specified. - * @param {google.cloud.aiplatform.v1beta1.TensorboardExperiment} request.tensorboardExperiment - * Required. The TensorboardExperiment's `name` field is used to identify the - * TensorboardExperiment to be updated. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TensorboardExperiment]{@link google.cloud.aiplatform.v1beta1.TensorboardExperiment}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_UpdateTensorboardExperiment_async - */ - updateTensorboardExperiment( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest|undefined, {}|undefined - ]>; - updateTensorboardExperiment( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest|null|undefined, - {}|null|undefined>): void; - updateTensorboardExperiment( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest|null|undefined, - {}|null|undefined>): void; - updateTensorboardExperiment( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment, - protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardExperimentRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard_experiment.name': request.tensorboardExperiment!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateTensorboardExperiment(request, options, callback); - } -/** - * Creates a TensorboardRun. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardExperiment to create the TensorboardRun - * in. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * @param {google.cloud.aiplatform.v1beta1.TensorboardRun} request.tensorboardRun - * Required. The TensorboardRun to create. - * @param {string} request.tensorboardRunId - * Required. The ID to use for the Tensorboard run, which will become the final - * component of the Tensorboard run's resource name. - * - * This value should be 1-128 characters, and valid characters - * are /{@link 0-9|a-z}-/. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TensorboardRun]{@link google.cloud.aiplatform.v1beta1.TensorboardRun}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_CreateTensorboardRun_async - */ - createTensorboardRun( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, - protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest|undefined, {}|undefined - ]>; - createTensorboardRun( - request: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, - protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest|null|undefined, - {}|null|undefined>): void; - createTensorboardRun( - request: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, - protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest|null|undefined, - {}|null|undefined>): void; - createTensorboardRun( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, - protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, - protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, - protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRunRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createTensorboardRun(request, options, callback); - } -/** - * Batch create TensorboardRuns. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardExperiment to create the - * TensorboardRuns in. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * The parent field in the CreateTensorboardRunRequest messages must match - * this field. - * @param {number[]} request.requests - * Required. The request message specifying the TensorboardRuns to create. - * A maximum of 1000 TensorboardRuns can be created in a batch. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchCreateTensorboardRunsResponse]{@link google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_BatchCreateTensorboardRuns_async - */ - batchCreateTensorboardRuns( - request?: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest|undefined, {}|undefined - ]>; - batchCreateTensorboardRuns( - request: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest|null|undefined, - {}|null|undefined>): void; - batchCreateTensorboardRuns( - request: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest|null|undefined, - {}|null|undefined>): void; - batchCreateTensorboardRuns( - request?: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.batchCreateTensorboardRuns(request, options, callback); - } -/** - * Gets a TensorboardRun. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the TensorboardRun resource. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TensorboardRun]{@link google.cloud.aiplatform.v1beta1.TensorboardRun}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_GetTensorboardRun_async - */ - getTensorboardRun( - request?: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest|undefined, {}|undefined - ]>; - getTensorboardRun( - request: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest|null|undefined, - {}|null|undefined>): void; - getTensorboardRun( - request: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest|null|undefined, - {}|null|undefined>): void; - getTensorboardRun( - request?: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardRunRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getTensorboardRun(request, options, callback); - } -/** - * Updates a TensorboardRun. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Field mask is used to specify the fields to be overwritten in the - * TensorboardRun resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten if new - * values are specified. - * @param {google.cloud.aiplatform.v1beta1.TensorboardRun} request.tensorboardRun - * Required. The TensorboardRun's `name` field is used to identify the TensorboardRun to - * be updated. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TensorboardRun]{@link google.cloud.aiplatform.v1beta1.TensorboardRun}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_UpdateTensorboardRun_async - */ - updateTensorboardRun( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, - protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest|undefined, {}|undefined - ]>; - updateTensorboardRun( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, - protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest|null|undefined, - {}|null|undefined>): void; - updateTensorboardRun( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, - protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest|null|undefined, - {}|null|undefined>): void; - updateTensorboardRun( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, - protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, - protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun, - protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRunRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard_run.name': request.tensorboardRun!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateTensorboardRun(request, options, callback); - } -/** - * Batch create TensorboardTimeSeries that belong to a TensorboardExperiment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardExperiment to create the - * TensorboardTimeSeries in. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * The TensorboardRuns referenced by the parent fields in the - * CreateTensorboardTimeSeriesRequest messages must be sub resources of this - * TensorboardExperiment. - * @param {number[]} request.requests - * Required. The request message specifying the TensorboardTimeSeries to create. - * A maximum of 1000 TensorboardTimeSeries can be created in a batch. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchCreateTensorboardTimeSeriesResponse]{@link google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_BatchCreateTensorboardTimeSeries_async - */ - batchCreateTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest|undefined, {}|undefined - ]>; - batchCreateTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): void; - batchCreateTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): void; - batchCreateTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.batchCreateTensorboardTimeSeries(request, options, callback); - } -/** - * Creates a TensorboardTimeSeries. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardRun to create the - * TensorboardTimeSeries in. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - * @param {string} [request.tensorboardTimeSeriesId] - * Optional. The user specified unique ID to use for the TensorboardTimeSeries, which - * will become the final component of the TensorboardTimeSeries's resource - * name. - * This value should match "{@link a-z0-9-|a-z0-9}{0, 127}" - * @param {google.cloud.aiplatform.v1beta1.TensorboardTimeSeries} request.tensorboardTimeSeries - * Required. The TensorboardTimeSeries to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_CreateTensorboardTimeSeries_async - */ - createTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest|undefined, {}|undefined - ]>; - createTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): void; - createTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): void; - createTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardTimeSeriesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createTensorboardTimeSeries(request, options, callback); - } -/** - * Gets a TensorboardTimeSeries. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the TensorboardTimeSeries resource. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_GetTensorboardTimeSeries_async - */ - getTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest|undefined, {}|undefined - ]>; - getTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): void; - getTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): void; - getTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1beta1.IGetTensorboardTimeSeriesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getTensorboardTimeSeries(request, options, callback); - } -/** - * Updates a TensorboardTimeSeries. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Field mask is used to specify the fields to be overwritten in the - * TensorboardTimeSeries resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten if new - * values are specified. - * @param {google.cloud.aiplatform.v1beta1.TensorboardTimeSeries} request.tensorboardTimeSeries - * Required. The TensorboardTimeSeries' `name` field is used to identify the - * TensorboardTimeSeries to be updated. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_UpdateTensorboardTimeSeries_async - */ - updateTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest|undefined, {}|undefined - ]>; - updateTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): void; - updateTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): void; - updateTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries, - protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardTimeSeriesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard_time_series.name': request.tensorboardTimeSeries!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateTensorboardTimeSeries(request, options, callback); - } -/** - * Reads multiple TensorboardTimeSeries' data. The data point number limit is - * 1000 for scalars, 100 for tensors and blob references. If the number of - * data points stored is less than the limit, all data will be returned. - * Otherwise, that limit number of data points will be randomly selected from - * this time series and returned. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tensorboard - * Required. The resource name of the Tensorboard containing TensorboardTimeSeries to - * read data from. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}`. - * The TensorboardTimeSeries referenced by {@link google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataRequest.time_series|time_series} must be sub - * resources of this Tensorboard. - * @param {string[]} request.timeSeries - * Required. The resource names of the TensorboardTimeSeries to read data from. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchReadTensorboardTimeSeriesDataResponse]{@link google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_BatchReadTensorboardTimeSeriesData_async - */ - batchReadTensorboardTimeSeriesData( - request?: protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest|undefined, {}|undefined - ]>; - batchReadTensorboardTimeSeriesData( - request: protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest|null|undefined, - {}|null|undefined>): void; - batchReadTensorboardTimeSeriesData( - request: protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest|null|undefined, - {}|null|undefined>): void; - batchReadTensorboardTimeSeriesData( - request?: protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard': request.tensorboard || '', - }); - this.initialize(); - return this.innerApiCalls.batchReadTensorboardTimeSeriesData(request, options, callback); - } -/** - * Reads a TensorboardTimeSeries' data. By default, if the number of data - * points stored is less than 1000, all data will be returned. Otherwise, 1000 - * data points will be randomly selected from this time series and returned. - * This value can be changed by changing max_data_points, which can't be - * greater than 10k. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tensorboardTimeSeries - * Required. The resource name of the TensorboardTimeSeries to read data from. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param {number} request.maxDataPoints - * The maximum number of TensorboardTimeSeries' data to return. - * - * This value should be a positive integer. - * This value can be set to -1 to return all data. - * @param {string} request.filter - * Reads the TensorboardTimeSeries' data that match the filter expression. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ReadTensorboardTimeSeriesDataResponse]{@link google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_ReadTensorboardTimeSeriesData_async - */ - readTensorboardTimeSeriesData( - request?: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest|undefined, {}|undefined - ]>; - readTensorboardTimeSeriesData( - request: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest|null|undefined, - {}|null|undefined>): void; - readTensorboardTimeSeriesData( - request: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest|null|undefined, - {}|null|undefined>): void; - readTensorboardTimeSeriesData( - request?: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataResponse, - protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard_time_series': request.tensorboardTimeSeries || '', - }); - this.initialize(); - return this.innerApiCalls.readTensorboardTimeSeriesData(request, options, callback); - } -/** - * Write time series data points of multiple TensorboardTimeSeries in multiple - * TensorboardRun's. If any data fail to be ingested, an error will be - * returned. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tensorboardExperiment - * Required. The resource name of the TensorboardExperiment to write data to. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * @param {number[]} request.writeRunDataRequests - * Required. Requests containing per-run TensorboardTimeSeries data to write. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [WriteTensorboardExperimentDataResponse]{@link google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_WriteTensorboardExperimentData_async - */ - writeTensorboardExperimentData( - request?: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataResponse, - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest|undefined, {}|undefined - ]>; - writeTensorboardExperimentData( - request: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataResponse, - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest|null|undefined, - {}|null|undefined>): void; - writeTensorboardExperimentData( - request: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataResponse, - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest|null|undefined, - {}|null|undefined>): void; - writeTensorboardExperimentData( - request?: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataResponse, - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataResponse, - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataResponse, - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard_experiment': request.tensorboardExperiment || '', - }); - this.initialize(); - return this.innerApiCalls.writeTensorboardExperimentData(request, options, callback); - } -/** - * Write time series data points into multiple TensorboardTimeSeries under - * a TensorboardRun. If any data fail to be ingested, an error will be - * returned. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tensorboardRun - * Required. The resource name of the TensorboardRun to write data to. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - * @param {number[]} request.timeSeriesData - * Required. The TensorboardTimeSeries data to write. - * Values with in a time series are indexed by their step value. - * Repeated writes to the same step will overwrite the existing value for that - * step. - * The upper limit of data points per write request is 5000. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [WriteTensorboardRunDataResponse]{@link google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_WriteTensorboardRunData_async - */ - writeTensorboardRunData( - request?: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataResponse, - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest|undefined, {}|undefined - ]>; - writeTensorboardRunData( - request: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataResponse, - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest|null|undefined, - {}|null|undefined>): void; - writeTensorboardRunData( - request: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataResponse, - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest|null|undefined, - {}|null|undefined>): void; - writeTensorboardRunData( - request?: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataResponse, - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataResponse, - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataResponse, - protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard_run': request.tensorboardRun || '', - }); - this.initialize(); - return this.innerApiCalls.writeTensorboardRunData(request, options, callback); - } - -/** - * Gets bytes of TensorboardBlobs. - * This is to allow reading blob data stored in consumer project's Cloud - * Storage bucket without users having to obtain Cloud Storage access - * permission. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.timeSeries - * Required. The resource name of the TensorboardTimeSeries to list Blobs. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - * @param {string[]} request.blobIds - * IDs of the blobs to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits [ReadTensorboardBlobDataResponse]{@link google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataResponse} on 'data' event. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_ReadTensorboardBlobData_async - */ - readTensorboardBlobData( - request?: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardBlobDataRequest, - options?: CallOptions): - gax.CancellableStream{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'time_series': request.timeSeries || '', - }); - this.initialize(); - return this.innerApiCalls.readTensorboardBlobData(request, options); - } - -/** - * Creates a Tensorboard. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the Tensorboard in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1beta1.Tensorboard} request.tensorboard - * Required. The Tensorboard to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_CreateTensorboard_async - */ - createTensorboard( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createTensorboard( - request: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createTensorboard( - request: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createTensorboard( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateTensorboardRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createTensorboard(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createTensorboard()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_CreateTensorboard_async - */ - async checkCreateTensorboardProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createTensorboard, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates a Tensorboard. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Field mask is used to specify the fields to be overwritten in the - * Tensorboard resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten if new - * values are specified. - * @param {google.cloud.aiplatform.v1beta1.Tensorboard} request.tensorboard - * Required. The Tensorboard's `name` field is used to identify the - * Tensorboard to be updated. Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_UpdateTensorboard_async - */ - updateTensorboard( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateTensorboard( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateTensorboard( - request: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateTensorboard( - request?: protos.google.cloud.aiplatform.v1beta1.IUpdateTensorboardRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard.name': request.tensorboard!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateTensorboard(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateTensorboard()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_UpdateTensorboard_async - */ - async checkUpdateTensorboardProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateTensorboard, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a Tensorboard. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Tensorboard to be deleted. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_DeleteTensorboard_async - */ - deleteTensorboard( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteTensorboard( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTensorboard( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTensorboard( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteTensorboard(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteTensorboard()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_DeleteTensorboard_async - */ - async checkDeleteTensorboardProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTensorboard, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a TensorboardExperiment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the TensorboardExperiment to be deleted. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_DeleteTensorboardExperiment_async - */ - deleteTensorboardExperiment( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardExperimentRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteTensorboardExperiment( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardExperimentRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTensorboardExperiment( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardExperimentRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTensorboardExperiment( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardExperimentRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteTensorboardExperiment(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteTensorboardExperiment()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_DeleteTensorboardExperiment_async - */ - async checkDeleteTensorboardExperimentProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTensorboardExperiment, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a TensorboardRun. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the TensorboardRun to be deleted. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_DeleteTensorboardRun_async - */ - deleteTensorboardRun( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardRunRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteTensorboardRun( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardRunRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTensorboardRun( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardRunRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTensorboardRun( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardRunRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteTensorboardRun(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteTensorboardRun()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_DeleteTensorboardRun_async - */ - async checkDeleteTensorboardRunProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTensorboardRun, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a TensorboardTimeSeries. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the TensorboardTimeSeries to be deleted. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_DeleteTensorboardTimeSeries_async - */ - deleteTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardTimeSeriesRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardTimeSeriesRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardTimeSeriesRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTensorboardTimeSeriesRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteTensorboardTimeSeries(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteTensorboardTimeSeries()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_DeleteTensorboardTimeSeries_async - */ - async checkDeleteTensorboardTimeSeriesProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteTensorboardTimeSeries, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Tensorboards in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list Tensorboards. - * Format: - * `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the Tensorboards that match the filter expression. - * @param {number} request.pageSize - * The maximum number of Tensorboards to return. The service may return - * fewer than this value. If unspecified, at most 100 Tensorboards will be - * returned. The maximum value is 100; values above 100 will be coerced to - * 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Tensorboard]{@link google.cloud.aiplatform.v1beta1.Tensorboard}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listTensorboardsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTensorboards( - request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboard[], - protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardsResponse - ]>; - listTensorboards( - request: protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITensorboard>): void; - listTensorboards( - request: protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITensorboard>): void; - listTensorboards( - request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITensorboard>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITensorboard>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboard[], - protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listTensorboards(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list Tensorboards. - * Format: - * `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the Tensorboards that match the filter expression. - * @param {number} request.pageSize - * The maximum number of Tensorboards to return. The service may return - * fewer than this value. If unspecified, at most 100 Tensorboards will be - * returned. The maximum value is 100; values above 100 will be coerced to - * 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Tensorboard]{@link google.cloud.aiplatform.v1beta1.Tensorboard} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listTensorboardsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTensorboardsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTensorboards']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTensorboards.createStream( - this.innerApiCalls.listTensorboards as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTensorboards`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list Tensorboards. - * Format: - * `projects/{project}/locations/{location}` - * @param {string} request.filter - * Lists the Tensorboards that match the filter expression. - * @param {number} request.pageSize - * The maximum number of Tensorboards to return. The service may return - * fewer than this value. If unspecified, at most 100 Tensorboards will be - * returned. The maximum value is 100; values above 100 will be coerced to - * 100. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboards|TensorboardService.ListTensorboards} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Tensorboard]{@link google.cloud.aiplatform.v1beta1.Tensorboard}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_ListTensorboards_async - */ - listTensorboardsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTensorboards']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTensorboards.asyncIterate( - this.innerApiCalls['listTensorboards'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists TensorboardExperiments in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Tensorboard to list TensorboardExperiments. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - * @param {string} request.filter - * Lists the TensorboardExperiments that match the filter expression. - * @param {number} request.pageSize - * The maximum number of TensorboardExperiments to return. The service may - * return fewer than this value. If unspecified, at most 50 - * TensorboardExperiments will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [TensorboardExperiment]{@link google.cloud.aiplatform.v1beta1.TensorboardExperiment}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listTensorboardExperimentsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTensorboardExperiments( - request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment[], - protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsResponse - ]>; - listTensorboardExperiments( - request: protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment>): void; - listTensorboardExperiments( - request: protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment>): void; - listTensorboardExperiments( - request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment[], - protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listTensorboardExperiments(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Tensorboard to list TensorboardExperiments. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - * @param {string} request.filter - * Lists the TensorboardExperiments that match the filter expression. - * @param {number} request.pageSize - * The maximum number of TensorboardExperiments to return. The service may - * return fewer than this value. If unspecified, at most 50 - * TensorboardExperiments will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [TensorboardExperiment]{@link google.cloud.aiplatform.v1beta1.TensorboardExperiment} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listTensorboardExperimentsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTensorboardExperimentsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTensorboardExperiments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTensorboardExperiments.createStream( - this.innerApiCalls.listTensorboardExperiments as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTensorboardExperiments`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Tensorboard to list TensorboardExperiments. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - * @param {string} request.filter - * Lists the TensorboardExperiments that match the filter expression. - * @param {number} request.pageSize - * The maximum number of TensorboardExperiments to return. The service may - * return fewer than this value. If unspecified, at most 50 - * TensorboardExperiments will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardExperiments|TensorboardService.ListTensorboardExperiments} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [TensorboardExperiment]{@link google.cloud.aiplatform.v1beta1.TensorboardExperiment}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_ListTensorboardExperiments_async - */ - listTensorboardExperimentsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardExperimentsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTensorboardExperiments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTensorboardExperiments.asyncIterate( - this.innerApiCalls['listTensorboardExperiments'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists TensorboardRuns in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardExperiment to list TensorboardRuns. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - * @param {string} request.filter - * Lists the TensorboardRuns that match the filter expression. - * @param {number} request.pageSize - * The maximum number of TensorboardRuns to return. The service may return - * fewer than this value. If unspecified, at most 50 TensorboardRuns will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [TensorboardRun]{@link google.cloud.aiplatform.v1beta1.TensorboardRun}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listTensorboardRunsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTensorboardRuns( - request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun[], - protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsResponse - ]>; - listTensorboardRuns( - request: protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun>): void; - listTensorboardRuns( - request: protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun>): void; - listTensorboardRuns( - request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardRun[], - protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listTensorboardRuns(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardExperiment to list TensorboardRuns. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - * @param {string} request.filter - * Lists the TensorboardRuns that match the filter expression. - * @param {number} request.pageSize - * The maximum number of TensorboardRuns to return. The service may return - * fewer than this value. If unspecified, at most 50 TensorboardRuns will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [TensorboardRun]{@link google.cloud.aiplatform.v1beta1.TensorboardRun} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listTensorboardRunsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTensorboardRunsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTensorboardRuns']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTensorboardRuns.createStream( - this.innerApiCalls.listTensorboardRuns as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTensorboardRuns`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardExperiment to list TensorboardRuns. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - * @param {string} request.filter - * Lists the TensorboardRuns that match the filter expression. - * @param {number} request.pageSize - * The maximum number of TensorboardRuns to return. The service may return - * fewer than this value. If unspecified, at most 50 TensorboardRuns will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardRuns|TensorboardService.ListTensorboardRuns} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [TensorboardRun]{@link google.cloud.aiplatform.v1beta1.TensorboardRun}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_ListTensorboardRuns_async - */ - listTensorboardRunsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardRunsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTensorboardRuns']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTensorboardRuns.asyncIterate( - this.innerApiCalls['listTensorboardRuns'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists TensorboardTimeSeries in a Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardRun to list TensorboardTimeSeries. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - * @param {string} request.filter - * Lists the TensorboardTimeSeries that match the filter expression. - * @param {number} request.pageSize - * The maximum number of TensorboardTimeSeries to return. The service may - * return fewer than this value. If unspecified, at most 50 - * TensorboardTimeSeries will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listTensorboardTimeSeriesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries[], - protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesResponse - ]>; - listTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries>): void; - listTensorboardTimeSeries( - request: protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries>): void; - listTensorboardTimeSeries( - request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries[], - protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listTensorboardTimeSeries(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardRun to list TensorboardTimeSeries. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - * @param {string} request.filter - * Lists the TensorboardTimeSeries that match the filter expression. - * @param {number} request.pageSize - * The maximum number of TensorboardTimeSeries to return. The service may - * return fewer than this value. If unspecified, at most 50 - * TensorboardTimeSeries will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listTensorboardTimeSeriesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTensorboardTimeSeriesStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTensorboardTimeSeries']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTensorboardTimeSeries.createStream( - this.innerApiCalls.listTensorboardTimeSeries as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTensorboardTimeSeries`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the TensorboardRun to list TensorboardTimeSeries. - * Format: - * 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - * @param {string} request.filter - * Lists the TensorboardTimeSeries that match the filter expression. - * @param {number} request.pageSize - * The maximum number of TensorboardTimeSeries to return. The service may - * return fewer than this value. If unspecified, at most 50 - * TensorboardTimeSeries will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link google.cloud.aiplatform.v1beta1.TensorboardService.ListTensorboardTimeSeries|TensorboardService.ListTensorboardTimeSeries} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the list. - * @param {google.protobuf.FieldMask} request.readMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [TensorboardTimeSeries]{@link google.cloud.aiplatform.v1beta1.TensorboardTimeSeries}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_ListTensorboardTimeSeries_async - */ - listTensorboardTimeSeriesAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListTensorboardTimeSeriesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTensorboardTimeSeries']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTensorboardTimeSeries.asyncIterate( - this.innerApiCalls['listTensorboardTimeSeries'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Exports a TensorboardTimeSeries' data. Data is returned in paginated - * responses. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tensorboardTimeSeries - * Required. The resource name of the TensorboardTimeSeries to export data from. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param {string} request.filter - * Exports the TensorboardTimeSeries' data that match the filter expression. - * @param {number} request.pageSize - * The maximum number of data points to return per page. - * The default page_size will be 1000. Values must be between 1 and 10000. - * Values above 10000 will be coerced to 10000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link |TensorboardService.ExportTensorboardTimeSeries} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link |TensorboardService.ExportTensorboardTimeSeries} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the TensorboardTimeSeries' data. - * By default, TensorboardTimeSeries' data will be returned in a pseudo random - * order. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [TimeSeriesDataPoint]{@link google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `exportTensorboardTimeSeriesDataAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - exportTensorboardTimeSeriesData( - request?: protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITimeSeriesDataPoint[], - protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest|null, - protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataResponse - ]>; - exportTensorboardTimeSeriesData( - request: protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, - protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITimeSeriesDataPoint>): void; - exportTensorboardTimeSeriesData( - request: protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, - protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITimeSeriesDataPoint>): void; - exportTensorboardTimeSeriesData( - request?: protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, - protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITimeSeriesDataPoint>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, - protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITimeSeriesDataPoint>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITimeSeriesDataPoint[], - protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest|null, - protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard_time_series': request.tensorboardTimeSeries || '', - }); - this.initialize(); - return this.innerApiCalls.exportTensorboardTimeSeriesData(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tensorboardTimeSeries - * Required. The resource name of the TensorboardTimeSeries to export data from. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param {string} request.filter - * Exports the TensorboardTimeSeries' data that match the filter expression. - * @param {number} request.pageSize - * The maximum number of data points to return per page. - * The default page_size will be 1000. Values must be between 1 and 10000. - * Values above 10000 will be coerced to 10000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link |TensorboardService.ExportTensorboardTimeSeries} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link |TensorboardService.ExportTensorboardTimeSeries} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the TensorboardTimeSeries' data. - * By default, TensorboardTimeSeries' data will be returned in a pseudo random - * order. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [TimeSeriesDataPoint]{@link google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `exportTensorboardTimeSeriesDataAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - exportTensorboardTimeSeriesDataStream( - request?: protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard_time_series': request.tensorboardTimeSeries || '', - }); - const defaultCallSettings = this._defaults['exportTensorboardTimeSeriesData']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.exportTensorboardTimeSeriesData.createStream( - this.innerApiCalls.exportTensorboardTimeSeriesData as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `exportTensorboardTimeSeriesData`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tensorboardTimeSeries - * Required. The resource name of the TensorboardTimeSeries to export data from. - * Format: - * `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` - * @param {string} request.filter - * Exports the TensorboardTimeSeries' data that match the filter expression. - * @param {number} request.pageSize - * The maximum number of data points to return per page. - * The default page_size will be 1000. Values must be between 1 and 10000. - * Values above 10000 will be coerced to 10000. - * @param {string} request.pageToken - * A page token, received from a previous - * {@link |TensorboardService.ExportTensorboardTimeSeries} call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * {@link |TensorboardService.ExportTensorboardTimeSeries} must - * match the call that provided the page token. - * @param {string} request.orderBy - * Field to use to sort the TensorboardTimeSeries' data. - * By default, TensorboardTimeSeries' data will be returned in a pseudo random - * order. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [TimeSeriesDataPoint]{@link google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_TensorboardService_ExportTensorboardTimeSeriesData_async - */ - exportTensorboardTimeSeriesDataAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IExportTensorboardTimeSeriesDataRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tensorboard_time_series': request.tensorboardTimeSeries || '', - }); - const defaultCallSettings = this._defaults['exportTensorboardTimeSeriesData']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate( - this.innerApiCalls['exportTensorboardTimeSeriesData'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.tensorboardServiceStub && !this._terminated) { - return this.tensorboardServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_client_config.json deleted file mode 100644 index 96886a76..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_client_config.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1beta1.TensorboardService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateTensorboard": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetTensorboard": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateTensorboard": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListTensorboards": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteTensorboard": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateTensorboardExperiment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetTensorboardExperiment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateTensorboardExperiment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListTensorboardExperiments": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteTensorboardExperiment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateTensorboardRun": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchCreateTensorboardRuns": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetTensorboardRun": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateTensorboardRun": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListTensorboardRuns": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteTensorboardRun": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchCreateTensorboardTimeSeries": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateTensorboardTimeSeries": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetTensorboardTimeSeries": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateTensorboardTimeSeries": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListTensorboardTimeSeries": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteTensorboardTimeSeries": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchReadTensorboardTimeSeriesData": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ReadTensorboardTimeSeriesData": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ReadTensorboardBlobData": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "WriteTensorboardExperimentData": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "WriteTensorboardRunData": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ExportTensorboardTimeSeriesData": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_proto_list.json deleted file mode 100644 index c916ab12..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_proto_list.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/context.proto", - "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1beta1/event.proto", - "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/io.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/study.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1beta1/types.proto", - "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1beta1/value.proto", - "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_client.ts deleted file mode 100644 index d71258b2..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_client.ts +++ /dev/null @@ -1,3713 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/vizier_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './vizier_service_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * Vertex AI Vizier API. - * - * Vertex AI Vizier is a service to solve blackbox optimization problems, - * such as tuning machine learning hyperparameters and searching over deep - * learning architectures. - * @class - * @memberof v1beta1 - */ -export class VizierServiceClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - vizierServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of VizierServiceClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof VizierServiceClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - annotationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' - ), - annotationSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' - ), - artifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' - ), - batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' - ), - contextPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' - ), - customJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/customJobs/{custom_job}' - ), - dataItemPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' - ), - dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' - ), - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}' - ), - endpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/endpoints/{endpoint}' - ), - entityTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' - ), - featurePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' - ), - featurestorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/featurestores/{featurestore}' - ), - hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' - ), - indexPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexes/{index}' - ), - indexEndpointPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' - ), - metadataStorePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' - ), - modelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}' - ), - modelDeploymentMonitoringJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' - ), - modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' - ), - modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' - ), - pipelineJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' - ), - specialistPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' - ), - studyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}' - ), - tensorboardPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' - ), - tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' - ), - tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' - ), - tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' - ), - trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' - ), - trialPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listStudies: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'studies'), - listTrials: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'trials') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const suggestTrialsResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.SuggestTrialsResponse') as gax.protobuf.Type; - const suggestTrialsMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.SuggestTrialsMetadata') as gax.protobuf.Type; - const checkTrialEarlyStoppingStateResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.CheckTrialEarlyStoppingStateResponse') as gax.protobuf.Type; - const checkTrialEarlyStoppingStateMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.CheckTrialEarlyStoppingStateMetatdata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - suggestTrials: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - suggestTrialsResponse.decode.bind(suggestTrialsResponse), - suggestTrialsMetadata.decode.bind(suggestTrialsMetadata)), - checkTrialEarlyStoppingState: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - checkTrialEarlyStoppingStateResponse.decode.bind(checkTrialEarlyStoppingStateResponse), - checkTrialEarlyStoppingStateMetadata.decode.bind(checkTrialEarlyStoppingStateMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1beta1.VizierService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.vizierServiceStub) { - return this.vizierServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1beta1.VizierService. - this.vizierServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.VizierService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1beta1.VizierService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const vizierServiceStubMethods = - ['createStudy', 'getStudy', 'listStudies', 'deleteStudy', 'lookupStudy', 'suggestTrials', 'createTrial', 'getTrial', 'listTrials', 'addTrialMeasurement', 'completeTrial', 'deleteTrial', 'checkTrialEarlyStoppingState', 'stopTrial', 'listOptimalTrials']; - for (const methodName of vizierServiceStubMethods) { - const callPromise = this.vizierServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.vizierServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'aiplatform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'aiplatform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Creates a Study. A resource name will be generated after creation of the - * Study. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to create the CustomJob in. - * Format: `projects/{project}/locations/{location}` - * @param {google.cloud.aiplatform.v1beta1.Study} request.study - * Required. The Study configuration used to create the Study. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Study]{@link google.cloud.aiplatform.v1beta1.Study}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_VizierService_CreateStudy_async - */ - createStudy( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IStudy, - protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest|undefined, {}|undefined - ]>; - createStudy( - request: protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IStudy, - protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest|null|undefined, - {}|null|undefined>): void; - createStudy( - request: protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IStudy, - protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest|null|undefined, - {}|null|undefined>): void; - createStudy( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IStudy, - protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IStudy, - protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IStudy, - protos.google.cloud.aiplatform.v1beta1.ICreateStudyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createStudy(request, options, callback); - } -/** - * Gets a Study by name. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Study resource. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Study]{@link google.cloud.aiplatform.v1beta1.Study}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_VizierService_GetStudy_async - */ - getStudy( - request?: protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IStudy, - protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest|undefined, {}|undefined - ]>; - getStudy( - request: protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IStudy, - protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest|null|undefined, - {}|null|undefined>): void; - getStudy( - request: protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IStudy, - protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest|null|undefined, - {}|null|undefined>): void; - getStudy( - request?: protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IStudy, - protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IStudy, - protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IStudy, - protos.google.cloud.aiplatform.v1beta1.IGetStudyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getStudy(request, options, callback); - } -/** - * Deletes a Study. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Study resource to be deleted. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_VizierService_DeleteStudy_async - */ - deleteStudy( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest|undefined, {}|undefined - ]>; - deleteStudy( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest|null|undefined, - {}|null|undefined>): void; - deleteStudy( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest|null|undefined, - {}|null|undefined>): void; - deleteStudy( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IDeleteStudyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteStudy(request, options, callback); - } -/** - * Looks a study up using the user-defined display_name field instead of the - * fully qualified resource name. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to get the Study from. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.displayName - * Required. The user-defined display name of the Study - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Study]{@link google.cloud.aiplatform.v1beta1.Study}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_VizierService_LookupStudy_async - */ - lookupStudy( - request?: protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IStudy, - protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest|undefined, {}|undefined - ]>; - lookupStudy( - request: protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IStudy, - protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest|null|undefined, - {}|null|undefined>): void; - lookupStudy( - request: protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IStudy, - protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest|null|undefined, - {}|null|undefined>): void; - lookupStudy( - request?: protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IStudy, - protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IStudy, - protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IStudy, - protos.google.cloud.aiplatform.v1beta1.ILookupStudyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.lookupStudy(request, options, callback); - } -/** - * Adds a user provided Trial to a Study. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Study to create the Trial in. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param {google.cloud.aiplatform.v1beta1.Trial} request.trial - * Required. The Trial to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1beta1.Trial}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_VizierService_CreateTrial_async - */ - createTrial( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest|undefined, {}|undefined - ]>; - createTrial( - request: protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest|null|undefined, - {}|null|undefined>): void; - createTrial( - request: protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest|null|undefined, - {}|null|undefined>): void; - createTrial( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.ICreateTrialRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createTrial(request, options, callback); - } -/** - * Gets a Trial. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Trial resource. - * Format: - * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1beta1.Trial}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_VizierService_GetTrial_async - */ - getTrial( - request?: protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest|undefined, {}|undefined - ]>; - getTrial( - request: protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest|null|undefined, - {}|null|undefined>): void; - getTrial( - request: protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest|null|undefined, - {}|null|undefined>): void; - getTrial( - request?: protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.IGetTrialRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getTrial(request, options, callback); - } -/** - * Adds a measurement of the objective metrics to a Trial. This measurement - * is assumed to have been taken before the Trial is complete. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.trialName - * Required. The name of the trial to add measurement. - * Format: - * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` - * @param {google.cloud.aiplatform.v1beta1.Measurement} request.measurement - * Required. The measurement to be added to a Trial. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1beta1.Trial}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_VizierService_AddTrialMeasurement_async - */ - addTrialMeasurement( - request?: protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest|undefined, {}|undefined - ]>; - addTrialMeasurement( - request: protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest|null|undefined, - {}|null|undefined>): void; - addTrialMeasurement( - request: protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest|null|undefined, - {}|null|undefined>): void; - addTrialMeasurement( - request?: protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.IAddTrialMeasurementRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'trial_name': request.trialName || '', - }); - this.initialize(); - return this.innerApiCalls.addTrialMeasurement(request, options, callback); - } -/** - * Marks a Trial as complete. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The Trial's name. - * Format: - * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` - * @param {google.cloud.aiplatform.v1beta1.Measurement} [request.finalMeasurement] - * Optional. If provided, it will be used as the completed Trial's - * final_measurement; Otherwise, the service will auto-select a - * previously reported measurement as the final-measurement - * @param {boolean} [request.trialInfeasible] - * Optional. True if the Trial cannot be run with the given Parameter, and - * final_measurement will be ignored. - * @param {string} [request.infeasibleReason] - * Optional. A human readable reason why the trial was infeasible. This should - * only be provided if `trial_infeasible` is true. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1beta1.Trial}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_VizierService_CompleteTrial_async - */ - completeTrial( - request?: protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest|undefined, {}|undefined - ]>; - completeTrial( - request: protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest|null|undefined, - {}|null|undefined>): void; - completeTrial( - request: protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest|null|undefined, - {}|null|undefined>): void; - completeTrial( - request?: protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.ICompleteTrialRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.completeTrial(request, options, callback); - } -/** - * Deletes a Trial. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The Trial's name. - * Format: - * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_VizierService_DeleteTrial_async - */ - deleteTrial( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest|undefined, {}|undefined - ]>; - deleteTrial( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest|null|undefined, - {}|null|undefined>): void; - deleteTrial( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest|null|undefined, - {}|null|undefined>): void; - deleteTrial( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.aiplatform.v1beta1.IDeleteTrialRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteTrial(request, options, callback); - } -/** - * Stops a Trial. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The Trial's name. - * Format: - * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Trial]{@link google.cloud.aiplatform.v1beta1.Trial}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_VizierService_StopTrial_async - */ - stopTrial( - request?: protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest|undefined, {}|undefined - ]>; - stopTrial( - request: protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest|null|undefined, - {}|null|undefined>): void; - stopTrial( - request: protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest|null|undefined, - {}|null|undefined>): void; - stopTrial( - request?: protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITrial, - protos.google.cloud.aiplatform.v1beta1.IStopTrialRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.stopTrial(request, options, callback); - } -/** - * Lists the pareto-optimal Trials for multi-objective Study or the - * optimal Trials for single-objective Study. The definition of - * pareto-optimal can be checked in wiki page. - * https://en.wikipedia.org/wiki/Pareto_efficiency - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the Study that the optimal Trial belongs to. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListOptimalTrialsResponse]{@link google.cloud.aiplatform.v1beta1.ListOptimalTrialsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_VizierService_ListOptimalTrials_async - */ - listOptimalTrials( - request?: protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsResponse, - protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest|undefined, {}|undefined - ]>; - listOptimalTrials( - request: protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsResponse, - protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest|null|undefined, - {}|null|undefined>): void; - listOptimalTrials( - request: protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsResponse, - protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest|null|undefined, - {}|null|undefined>): void; - listOptimalTrials( - request?: protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsResponse, - protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsResponse, - protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsResponse, - protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listOptimalTrials(request, options, callback); - } - -/** - * Adds one or more Trials to a Study, with parameter values - * suggested by Vertex AI Vizier. Returns a long-running - * operation associated with the generation of Trial suggestions. - * When this long-running operation succeeds, it will contain - * a {@link google.cloud.ml.v1.SuggestTrialsResponse|SuggestTrialsResponse}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location that the Study belongs to. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param {number} request.suggestionCount - * Required. The number of suggestions requested. - * @param {string} request.clientId - * Required. The identifier of the client that is requesting the suggestion. - * - * If multiple SuggestTrialsRequests have the same `client_id`, - * the service will return the identical suggested Trial if the Trial is - * pending, and provide a new Trial if the last suggested Trial was completed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_VizierService_SuggestTrials_async - */ - suggestTrials( - request?: protos.google.cloud.aiplatform.v1beta1.ISuggestTrialsRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - suggestTrials( - request: protos.google.cloud.aiplatform.v1beta1.ISuggestTrialsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - suggestTrials( - request: protos.google.cloud.aiplatform.v1beta1.ISuggestTrialsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - suggestTrials( - request?: protos.google.cloud.aiplatform.v1beta1.ISuggestTrialsRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.suggestTrials(request, options, callback); - } -/** - * Check the status of the long running operation returned by `suggestTrials()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_VizierService_SuggestTrials_async - */ - async checkSuggestTrialsProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.suggestTrials, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Checks whether a Trial should stop or not. Returns a - * long-running operation. When the operation is successful, - * it will contain a - * {@link google.cloud.ml.v1.CheckTrialEarlyStoppingStateResponse|CheckTrialEarlyStoppingStateResponse}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.trialName - * Required. The Trial's name. - * Format: - * `projects/{project}/locations/{location}/studies/{study}/trials/{trial}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_VizierService_CheckTrialEarlyStoppingState_async - */ - checkTrialEarlyStoppingState( - request?: protos.google.cloud.aiplatform.v1beta1.ICheckTrialEarlyStoppingStateRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - checkTrialEarlyStoppingState( - request: protos.google.cloud.aiplatform.v1beta1.ICheckTrialEarlyStoppingStateRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - checkTrialEarlyStoppingState( - request: protos.google.cloud.aiplatform.v1beta1.ICheckTrialEarlyStoppingStateRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - checkTrialEarlyStoppingState( - request?: protos.google.cloud.aiplatform.v1beta1.ICheckTrialEarlyStoppingStateRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'trial_name': request.trialName || '', - }); - this.initialize(); - return this.innerApiCalls.checkTrialEarlyStoppingState(request, options, callback); - } -/** - * Check the status of the long running operation returned by `checkTrialEarlyStoppingState()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_VizierService_CheckTrialEarlyStoppingState_async - */ - async checkCheckTrialEarlyStoppingStateProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.checkTrialEarlyStoppingState, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists all the studies in a region for an associated project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the Study from. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.pageToken] - * Optional. A page token to request the next page of results. - * If unspecified, there are no subsequent pages. - * @param {number} [request.pageSize] - * Optional. The maximum number of studies to return per "page" of results. - * If unspecified, service will pick an appropriate default. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Study]{@link google.cloud.aiplatform.v1beta1.Study}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listStudiesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listStudies( - request?: protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IStudy[], - protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListStudiesResponse - ]>; - listStudies( - request: protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, - protos.google.cloud.aiplatform.v1beta1.IListStudiesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IStudy>): void; - listStudies( - request: protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, - protos.google.cloud.aiplatform.v1beta1.IListStudiesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IStudy>): void; - listStudies( - request?: protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, - protos.google.cloud.aiplatform.v1beta1.IListStudiesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IStudy>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, - protos.google.cloud.aiplatform.v1beta1.IListStudiesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IStudy>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IStudy[], - protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListStudiesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listStudies(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the Study from. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.pageToken] - * Optional. A page token to request the next page of results. - * If unspecified, there are no subsequent pages. - * @param {number} [request.pageSize] - * Optional. The maximum number of studies to return per "page" of results. - * If unspecified, service will pick an appropriate default. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Study]{@link google.cloud.aiplatform.v1beta1.Study} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listStudiesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listStudiesStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listStudies']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listStudies.createStream( - this.innerApiCalls.listStudies as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listStudies`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Location to list the Study from. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.pageToken] - * Optional. A page token to request the next page of results. - * If unspecified, there are no subsequent pages. - * @param {number} [request.pageSize] - * Optional. The maximum number of studies to return per "page" of results. - * If unspecified, service will pick an appropriate default. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Study]{@link google.cloud.aiplatform.v1beta1.Study}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_VizierService_ListStudies_async - */ - listStudiesAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListStudiesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listStudies']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listStudies.asyncIterate( - this.innerApiCalls['listStudies'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - /** - * Lists the Trials associated with a Study. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Study to list the Trial from. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param {string} [request.pageToken] - * Optional. A page token to request the next page of results. - * If unspecified, there are no subsequent pages. - * @param {number} [request.pageSize] - * Optional. The number of Trials to retrieve per "page" of results. - * If unspecified, the service will pick an appropriate default. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Trial]{@link google.cloud.aiplatform.v1beta1.Trial}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listTrialsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTrials( - request?: protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITrial[], - protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListTrialsResponse - ]>; - listTrials( - request: protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, - protos.google.cloud.aiplatform.v1beta1.IListTrialsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITrial>): void; - listTrials( - request: protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, - protos.google.cloud.aiplatform.v1beta1.IListTrialsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITrial>): void; - listTrials( - request?: protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, - protos.google.cloud.aiplatform.v1beta1.IListTrialsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITrial>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, - protos.google.cloud.aiplatform.v1beta1.IListTrialsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ITrial>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ITrial[], - protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListTrialsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listTrials(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Study to list the Trial from. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param {string} [request.pageToken] - * Optional. A page token to request the next page of results. - * If unspecified, there are no subsequent pages. - * @param {number} [request.pageSize] - * Optional. The number of Trials to retrieve per "page" of results. - * If unspecified, the service will pick an appropriate default. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Trial]{@link google.cloud.aiplatform.v1beta1.Trial} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listTrialsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listTrialsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTrials']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTrials.createStream( - this.innerApiCalls.listTrials as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTrials`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the Study to list the Trial from. - * Format: `projects/{project}/locations/{location}/studies/{study}` - * @param {string} [request.pageToken] - * Optional. A page token to request the next page of results. - * If unspecified, there are no subsequent pages. - * @param {number} [request.pageSize] - * Optional. The number of Trials to retrieve per "page" of results. - * If unspecified, the service will pick an appropriate default. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Trial]{@link google.cloud.aiplatform.v1beta1.Trial}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * region_tag:aiplatform_v1beta1_generated_VizierService_ListTrials_async - */ - listTrialsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListTrialsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listTrials']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTrials.asyncIterate( - this.innerApiCalls['listTrials'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified annotation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @param {string} annotation - * @returns {string} Resource name string. - */ - annotationPath(project:string,location:string,dataset:string,dataItem:string,annotation:string) { - return this.pathTemplates.annotationPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - annotation: annotation, - }); - } - - /** - * Parse the project from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).project; - } - - /** - * Parse the location from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).location; - } - - /** - * Parse the dataset from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).dataset; - } - - /** - * Parse the data_item from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).data_item; - } - - /** - * Parse the annotation from Annotation resource. - * - * @param {string} annotationName - * A fully-qualified path representing Annotation resource. - * @returns {string} A string representing the annotation. - */ - matchAnnotationFromAnnotationName(annotationName: string) { - return this.pathTemplates.annotationPathTemplate.match(annotationName).annotation; - } - - /** - * Return a fully-qualified annotationSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} annotation_spec - * @returns {string} Resource name string. - */ - annotationSpecPath(project:string,location:string,dataset:string,annotationSpec:string) { - return this.pathTemplates.annotationSpecPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - annotation_spec: annotationSpec, - }); - } - - /** - * Parse the project from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).project; - } - - /** - * Parse the location from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).location; - } - - /** - * Parse the dataset from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).dataset; - } - - /** - * Parse the annotation_spec from AnnotationSpec resource. - * - * @param {string} annotationSpecName - * A fully-qualified path representing AnnotationSpec resource. - * @returns {string} A string representing the annotation_spec. - */ - matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { - return this.pathTemplates.annotationSpecPathTemplate.match(annotationSpecName).annotation_spec; - } - - /** - * Return a fully-qualified artifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} artifact - * @returns {string} Resource name string. - */ - artifactPath(project:string,location:string,metadataStore:string,artifact:string) { - return this.pathTemplates.artifactPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - artifact: artifact, - }); - } - - /** - * Parse the project from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).project; - } - - /** - * Parse the location from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).location; - } - - /** - * Parse the metadata_store from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).metadata_store; - } - - /** - * Parse the artifact from Artifact resource. - * - * @param {string} artifactName - * A fully-qualified path representing Artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromArtifactName(artifactName: string) { - return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; - } - - /** - * Return a fully-qualified batchPredictionJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch_prediction_job - * @returns {string} Resource name string. - */ - batchPredictionJobPath(project:string,location:string,batchPredictionJob:string) { - return this.pathTemplates.batchPredictionJobPathTemplate.render({ - project: project, - location: location, - batch_prediction_job: batchPredictionJob, - }); - } - - /** - * Parse the project from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).project; - } - - /** - * Parse the location from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).location; - } - - /** - * Parse the batch_prediction_job from BatchPredictionJob resource. - * - * @param {string} batchPredictionJobName - * A fully-qualified path representing BatchPredictionJob resource. - * @returns {string} A string representing the batch_prediction_job. - */ - matchBatchPredictionJobFromBatchPredictionJobName(batchPredictionJobName: string) { - return this.pathTemplates.batchPredictionJobPathTemplate.match(batchPredictionJobName).batch_prediction_job; - } - - /** - * Return a fully-qualified context resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} context - * @returns {string} Resource name string. - */ - contextPath(project:string,location:string,metadataStore:string,context:string) { - return this.pathTemplates.contextPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - context: context, - }); - } - - /** - * Parse the project from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the project. - */ - matchProjectFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).project; - } - - /** - * Parse the location from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the location. - */ - matchLocationFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).location; - } - - /** - * Parse the metadata_store from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).metadata_store; - } - - /** - * Parse the context from Context resource. - * - * @param {string} contextName - * A fully-qualified path representing Context resource. - * @returns {string} A string representing the context. - */ - matchContextFromContextName(contextName: string) { - return this.pathTemplates.contextPathTemplate.match(contextName).context; - } - - /** - * Return a fully-qualified customJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} custom_job - * @returns {string} Resource name string. - */ - customJobPath(project:string,location:string,customJob:string) { - return this.pathTemplates.customJobPathTemplate.render({ - project: project, - location: location, - custom_job: customJob, - }); - } - - /** - * Parse the project from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).project; - } - - /** - * Parse the location from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).location; - } - - /** - * Parse the custom_job from CustomJob resource. - * - * @param {string} customJobName - * A fully-qualified path representing CustomJob resource. - * @returns {string} A string representing the custom_job. - */ - matchCustomJobFromCustomJobName(customJobName: string) { - return this.pathTemplates.customJobPathTemplate.match(customJobName).custom_job; - } - - /** - * Return a fully-qualified dataItem resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} data_item - * @returns {string} Resource name string. - */ - dataItemPath(project:string,location:string,dataset:string,dataItem:string) { - return this.pathTemplates.dataItemPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - data_item: dataItem, - }); - } - - /** - * Parse the project from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; - } - - /** - * Parse the location from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; - } - - /** - * Parse the dataset from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; - } - - /** - * Parse the data_item from DataItem resource. - * - * @param {string} dataItemName - * A fully-qualified path representing DataItem resource. - * @returns {string} A string representing the data_item. - */ - matchDataItemFromDataItemName(dataItemName: string) { - return this.pathTemplates.dataItemPathTemplate.match(dataItemName).data_item; - } - - /** - * Return a fully-qualified dataLabelingJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_labeling_job - * @returns {string} Resource name string. - */ - dataLabelingJobPath(project:string,location:string,dataLabelingJob:string) { - return this.pathTemplates.dataLabelingJobPathTemplate.render({ - project: project, - location: location, - data_labeling_job: dataLabelingJob, - }); - } - - /** - * Parse the project from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).project; - } - - /** - * Parse the location from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).location; - } - - /** - * Parse the data_labeling_job from DataLabelingJob resource. - * - * @param {string} dataLabelingJobName - * A fully-qualified path representing DataLabelingJob resource. - * @returns {string} A string representing the data_labeling_job. - */ - matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { - return this.pathTemplates.dataLabelingJobPathTemplate.match(dataLabelingJobName).data_labeling_job; - } - - /** - * Return a fully-qualified dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,dataset:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the dataset from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; - } - - /** - * Return a fully-qualified endpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} endpoint - * @returns {string} Resource name string. - */ - endpointPath(project:string,location:string,endpoint:string) { - return this.pathTemplates.endpointPathTemplate.render({ - project: project, - location: location, - endpoint: endpoint, - }); - } - - /** - * Parse the project from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).project; - } - - /** - * Parse the location from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).location; - } - - /** - * Parse the endpoint from Endpoint resource. - * - * @param {string} endpointName - * A fully-qualified path representing Endpoint resource. - * @returns {string} A string representing the endpoint. - */ - matchEndpointFromEndpointName(endpointName: string) { - return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint; - } - - /** - * Return a fully-qualified entityType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @returns {string} Resource name string. - */ - entityTypePath(project:string,location:string,featurestore:string,entityType:string) { - return this.pathTemplates.entityTypePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - }); - } - - /** - * Parse the project from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).project; - } - - /** - * Parse the location from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).location; - } - - /** - * Parse the featurestore from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).featurestore; - } - - /** - * Parse the entity_type from EntityType resource. - * - * @param {string} entityTypeName - * A fully-qualified path representing EntityType resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromEntityTypeName(entityTypeName: string) { - return this.pathTemplates.entityTypePathTemplate.match(entityTypeName).entity_type; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,metadataStore:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the metadata_store from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).metadata_store; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified feature resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @param {string} entity_type - * @param {string} feature - * @returns {string} Resource name string. - */ - featurePath(project:string,location:string,featurestore:string,entityType:string,feature:string) { - return this.pathTemplates.featurePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - entity_type: entityType, - feature: feature, - }); - } - - /** - * Parse the project from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).project; - } - - /** - * Parse the location from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).location; - } - - /** - * Parse the featurestore from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).featurestore; - } - - /** - * Parse the entity_type from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the entity_type. - */ - matchEntityTypeFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).entity_type; - } - - /** - * Parse the feature from Feature resource. - * - * @param {string} featureName - * A fully-qualified path representing Feature resource. - * @returns {string} A string representing the feature. - */ - matchFeatureFromFeatureName(featureName: string) { - return this.pathTemplates.featurePathTemplate.match(featureName).feature; - } - - /** - * Return a fully-qualified featurestore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} featurestore - * @returns {string} Resource name string. - */ - featurestorePath(project:string,location:string,featurestore:string) { - return this.pathTemplates.featurestorePathTemplate.render({ - project: project, - location: location, - featurestore: featurestore, - }); - } - - /** - * Parse the project from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).project; - } - - /** - * Parse the location from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).location; - } - - /** - * Parse the featurestore from Featurestore resource. - * - * @param {string} featurestoreName - * A fully-qualified path representing Featurestore resource. - * @returns {string} A string representing the featurestore. - */ - matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { - return this.pathTemplates.featurestorePathTemplate.match(featurestoreName).featurestore; - } - - /** - * Return a fully-qualified hyperparameterTuningJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} hyperparameter_tuning_job - * @returns {string} Resource name string. - */ - hyperparameterTuningJobPath(project:string,location:string,hyperparameterTuningJob:string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ - project: project, - location: location, - hyperparameter_tuning_job: hyperparameterTuningJob, - }); - } - - /** - * Parse the project from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).project; - } - - /** - * Parse the location from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).location; - } - - /** - * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. - * - * @param {string} hyperparameterTuningJobName - * A fully-qualified path representing HyperparameterTuningJob resource. - * @returns {string} A string representing the hyperparameter_tuning_job. - */ - matchHyperparameterTuningJobFromHyperparameterTuningJobName(hyperparameterTuningJobName: string) { - return this.pathTemplates.hyperparameterTuningJobPathTemplate.match(hyperparameterTuningJobName).hyperparameter_tuning_job; - } - - /** - * Return a fully-qualified index resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index - * @returns {string} Resource name string. - */ - indexPath(project:string,location:string,index:string) { - return this.pathTemplates.indexPathTemplate.render({ - project: project, - location: location, - index: index, - }); - } - - /** - * Parse the project from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).project; - } - - /** - * Parse the location from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).location; - } - - /** - * Parse the index from Index resource. - * - * @param {string} indexName - * A fully-qualified path representing Index resource. - * @returns {string} A string representing the index. - */ - matchIndexFromIndexName(indexName: string) { - return this.pathTemplates.indexPathTemplate.match(indexName).index; - } - - /** - * Return a fully-qualified indexEndpoint resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} index_endpoint - * @returns {string} Resource name string. - */ - indexEndpointPath(project:string,location:string,indexEndpoint:string) { - return this.pathTemplates.indexEndpointPathTemplate.render({ - project: project, - location: location, - index_endpoint: indexEndpoint, - }); - } - - /** - * Parse the project from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).project; - } - - /** - * Parse the location from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).location; - } - - /** - * Parse the index_endpoint from IndexEndpoint resource. - * - * @param {string} indexEndpointName - * A fully-qualified path representing IndexEndpoint resource. - * @returns {string} A string representing the index_endpoint. - */ - matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { - return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName).index_endpoint; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified metadataSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @param {string} metadata_schema - * @returns {string} Resource name string. - */ - metadataSchemaPath(project:string,location:string,metadataStore:string,metadataSchema:string) { - return this.pathTemplates.metadataSchemaPathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - metadata_schema: metadataSchema, - }); - } - - /** - * Parse the project from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).project; - } - - /** - * Parse the location from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).location; - } - - /** - * Parse the metadata_store from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_store; - } - - /** - * Parse the metadata_schema from MetadataSchema resource. - * - * @param {string} metadataSchemaName - * A fully-qualified path representing MetadataSchema resource. - * @returns {string} A string representing the metadata_schema. - */ - matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { - return this.pathTemplates.metadataSchemaPathTemplate.match(metadataSchemaName).metadata_schema; - } - - /** - * Return a fully-qualified metadataStore resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} metadata_store - * @returns {string} Resource name string. - */ - metadataStorePath(project:string,location:string,metadataStore:string) { - return this.pathTemplates.metadataStorePathTemplate.render({ - project: project, - location: location, - metadata_store: metadataStore, - }); - } - - /** - * Parse the project from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).project; - } - - /** - * Parse the location from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).location; - } - - /** - * Parse the metadata_store from MetadataStore resource. - * - * @param {string} metadataStoreName - * A fully-qualified path representing MetadataStore resource. - * @returns {string} A string representing the metadata_store. - */ - matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { - return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName).metadata_store; - } - - /** - * Return a fully-qualified model resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @returns {string} Resource name string. - */ - modelPath(project:string,location:string,model:string) { - return this.pathTemplates.modelPathTemplate.render({ - project: project, - location: location, - model: model, - }); - } - - /** - * Parse the project from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).project; - } - - /** - * Parse the location from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).location; - } - - /** - * Parse the model from Model resource. - * - * @param {string} modelName - * A fully-qualified path representing Model resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelName(modelName: string) { - return this.pathTemplates.modelPathTemplate.match(modelName).model; - } - - /** - * Return a fully-qualified modelDeploymentMonitoringJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model_deployment_monitoring_job - * @returns {string} Resource name string. - */ - modelDeploymentMonitoringJobPath(project:string,location:string,modelDeploymentMonitoringJob:string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ - project: project, - location: location, - model_deployment_monitoring_job: modelDeploymentMonitoringJob, - }); - } - - /** - * Parse the project from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).project; - } - - /** - * Parse the location from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).location; - } - - /** - * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. - * - * @param {string} modelDeploymentMonitoringJobName - * A fully-qualified path representing ModelDeploymentMonitoringJob resource. - * @returns {string} A string representing the model_deployment_monitoring_job. - */ - matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(modelDeploymentMonitoringJobName: string) { - return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match(modelDeploymentMonitoringJobName).model_deployment_monitoring_job; - } - - /** - * Return a fully-qualified modelEvaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @returns {string} Resource name string. - */ - modelEvaluationPath(project:string,location:string,model:string,evaluation:string) { - return this.pathTemplates.modelEvaluationPathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - }); - } - - /** - * Parse the project from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).project; - } - - /** - * Parse the location from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).location; - } - - /** - * Parse the model from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).model; - } - - /** - * Parse the evaluation from ModelEvaluation resource. - * - * @param {string} modelEvaluationName - * A fully-qualified path representing ModelEvaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { - return this.pathTemplates.modelEvaluationPathTemplate.match(modelEvaluationName).evaluation; - } - - /** - * Return a fully-qualified modelEvaluationSlice resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} model - * @param {string} evaluation - * @param {string} slice - * @returns {string} Resource name string. - */ - modelEvaluationSlicePath(project:string,location:string,model:string,evaluation:string,slice:string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ - project: project, - location: location, - model: model, - evaluation: evaluation, - slice: slice, - }); - } - - /** - * Parse the project from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the project. - */ - matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).project; - } - - /** - * Parse the location from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the location. - */ - matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).location; - } - - /** - * Parse the model from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the model. - */ - matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).model; - } - - /** - * Parse the evaluation from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).evaluation; - } - - /** - * Parse the slice from ModelEvaluationSlice resource. - * - * @param {string} modelEvaluationSliceName - * A fully-qualified path representing ModelEvaluationSlice resource. - * @returns {string} A string representing the slice. - */ - matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { - return this.pathTemplates.modelEvaluationSlicePathTemplate.match(modelEvaluationSliceName).slice; - } - - /** - * Return a fully-qualified pipelineJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} pipeline_job - * @returns {string} Resource name string. - */ - pipelineJobPath(project:string,location:string,pipelineJob:string) { - return this.pathTemplates.pipelineJobPathTemplate.render({ - project: project, - location: location, - pipeline_job: pipelineJob, - }); - } - - /** - * Parse the project from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).project; - } - - /** - * Parse the location from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).location; - } - - /** - * Parse the pipeline_job from PipelineJob resource. - * - * @param {string} pipelineJobName - * A fully-qualified path representing PipelineJob resource. - * @returns {string} A string representing the pipeline_job. - */ - matchPipelineJobFromPipelineJobName(pipelineJobName: string) { - return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName).pipeline_job; - } - - /** - * Return a fully-qualified specialistPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} specialist_pool - * @returns {string} Resource name string. - */ - specialistPoolPath(project:string,location:string,specialistPool:string) { - return this.pathTemplates.specialistPoolPathTemplate.render({ - project: project, - location: location, - specialist_pool: specialistPool, - }); - } - - /** - * Parse the project from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).project; - } - - /** - * Parse the location from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).location; - } - - /** - * Parse the specialist_pool from SpecialistPool resource. - * - * @param {string} specialistPoolName - * A fully-qualified path representing SpecialistPool resource. - * @returns {string} A string representing the specialist_pool. - */ - matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { - return this.pathTemplates.specialistPoolPathTemplate.match(specialistPoolName).specialist_pool; - } - - /** - * Return a fully-qualified study resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @returns {string} Resource name string. - */ - studyPath(project:string,location:string,study:string) { - return this.pathTemplates.studyPathTemplate.render({ - project: project, - location: location, - study: study, - }); - } - - /** - * Parse the project from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).project; - } - - /** - * Parse the location from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).location; - } - - /** - * Parse the study from Study resource. - * - * @param {string} studyName - * A fully-qualified path representing Study resource. - * @returns {string} A string representing the study. - */ - matchStudyFromStudyName(studyName: string) { - return this.pathTemplates.studyPathTemplate.match(studyName).study; - } - - /** - * Return a fully-qualified tensorboard resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @returns {string} Resource name string. - */ - tensorboardPath(project:string,location:string,tensorboard:string) { - return this.pathTemplates.tensorboardPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - }); - } - - /** - * Parse the project from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).project; - } - - /** - * Parse the location from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).location; - } - - /** - * Parse the tensorboard from Tensorboard resource. - * - * @param {string} tensorboardName - * A fully-qualified path representing Tensorboard resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardName(tensorboardName: string) { - return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName).tensorboard; - } - - /** - * Return a fully-qualified tensorboardExperiment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @returns {string} Resource name string. - */ - tensorboardExperimentPath(project:string,location:string,tensorboard:string,experiment:string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - }); - } - - /** - * Parse the project from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).project; - } - - /** - * Parse the location from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).location; - } - - /** - * Parse the tensorboard from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).tensorboard; - } - - /** - * Parse the experiment from TensorboardExperiment resource. - * - * @param {string} tensorboardExperimentName - * A fully-qualified path representing TensorboardExperiment resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardExperimentName(tensorboardExperimentName: string) { - return this.pathTemplates.tensorboardExperimentPathTemplate.match(tensorboardExperimentName).experiment; - } - - /** - * Return a fully-qualified tensorboardRun resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @returns {string} Resource name string. - */ - tensorboardRunPath(project:string,location:string,tensorboard:string,experiment:string,run:string) { - return this.pathTemplates.tensorboardRunPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - }); - } - - /** - * Parse the project from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).project; - } - - /** - * Parse the location from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).location; - } - - /** - * Parse the tensorboard from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).tensorboard; - } - - /** - * Parse the experiment from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).experiment; - } - - /** - * Parse the run from TensorboardRun resource. - * - * @param {string} tensorboardRunName - * A fully-qualified path representing TensorboardRun resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardRunName(tensorboardRunName: string) { - return this.pathTemplates.tensorboardRunPathTemplate.match(tensorboardRunName).run; - } - - /** - * Return a fully-qualified tensorboardTimeSeries resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} tensorboard - * @param {string} experiment - * @param {string} run - * @param {string} time_series - * @returns {string} Resource name string. - */ - tensorboardTimeSeriesPath(project:string,location:string,tensorboard:string,experiment:string,run:string,timeSeries:string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ - project: project, - location: location, - tensorboard: tensorboard, - experiment: experiment, - run: run, - time_series: timeSeries, - }); - } - - /** - * Parse the project from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).project; - } - - /** - * Parse the location from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).location; - } - - /** - * Parse the tensorboard from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the tensorboard. - */ - matchTensorboardFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).tensorboard; - } - - /** - * Parse the experiment from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the experiment. - */ - matchExperimentFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).experiment; - } - - /** - * Parse the run from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the run. - */ - matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).run; - } - - /** - * Parse the time_series from TensorboardTimeSeries resource. - * - * @param {string} tensorboardTimeSeriesName - * A fully-qualified path representing TensorboardTimeSeries resource. - * @returns {string} A string representing the time_series. - */ - matchTimeSeriesFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { - return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match(tensorboardTimeSeriesName).time_series; - } - - /** - * Return a fully-qualified trainingPipeline resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} training_pipeline - * @returns {string} Resource name string. - */ - trainingPipelinePath(project:string,location:string,trainingPipeline:string) { - return this.pathTemplates.trainingPipelinePathTemplate.render({ - project: project, - location: location, - training_pipeline: trainingPipeline, - }); - } - - /** - * Parse the project from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).project; - } - - /** - * Parse the location from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).location; - } - - /** - * Parse the training_pipeline from TrainingPipeline resource. - * - * @param {string} trainingPipelineName - * A fully-qualified path representing TrainingPipeline resource. - * @returns {string} A string representing the training_pipeline. - */ - matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { - return this.pathTemplates.trainingPipelinePathTemplate.match(trainingPipelineName).training_pipeline; - } - - /** - * Return a fully-qualified trial resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} study - * @param {string} trial - * @returns {string} Resource name string. - */ - trialPath(project:string,location:string,study:string,trial:string) { - return this.pathTemplates.trialPathTemplate.render({ - project: project, - location: location, - study: study, - trial: trial, - }); - } - - /** - * Parse the project from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).project; - } - - /** - * Parse the location from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).location; - } - - /** - * Parse the study from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the study. - */ - matchStudyFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).study; - } - - /** - * Parse the trial from Trial resource. - * - * @param {string} trialName - * A fully-qualified path representing Trial resource. - * @returns {string} A string representing the trial. - */ - matchTrialFromTrialName(trialName: string) { - return this.pathTemplates.trialPathTemplate.match(trialName).trial; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.vizierServiceStub && !this._terminated) { - return this.vizierServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_client_config.json deleted file mode 100644 index 89e31e02..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_client_config.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1beta1.VizierService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateStudy": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetStudy": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListStudies": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteStudy": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "LookupStudy": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SuggestTrials": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateTrial": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetTrial": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListTrials": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "AddTrialMeasurement": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CompleteTrial": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteTrial": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CheckTrialEarlyStoppingState": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "StopTrial": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListOptimalTrials": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_proto_list.json deleted file mode 100644 index c916ab12..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_proto_list.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - "../../protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/annotation_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/artifact.proto", - "../../protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/completion_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/context.proto", - "../../protos/google/cloud/aiplatform/v1beta1/custom_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_item.proto", - "../../protos/google/cloud/aiplatform/v1beta1/data_labeling_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset.proto", - "../../protos/google/cloud/aiplatform/v1beta1/dataset_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_index_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployed_model_ref.proto", - "../../protos/google/cloud/aiplatform/v1beta1/encryption_spec.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/entity_type.proto", - "../../protos/google/cloud/aiplatform/v1beta1/env_var.proto", - "../../protos/google/cloud/aiplatform/v1beta1/event.proto", - "../../protos/google/cloud/aiplatform/v1beta1/execution.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_monitoring_stats.proto", - "../../protos/google/cloud/aiplatform/v1beta1/feature_selector.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/hyperparameter_tuning_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_endpoint_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/index_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/io.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/job_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/lineage_subgraph.proto", - "../../protos/google/cloud/aiplatform/v1beta1/machine_resources.proto", - "../../protos/google/cloud/aiplatform/v1beta1/manual_batch_tuning_parameters.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_schema.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/metadata_store.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migratable_resource.proto", - "../../protos/google/cloud/aiplatform/v1beta1/migration_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto", - "../../protos/google/cloud/aiplatform/v1beta1/model_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/pipeline_state.proto", - "../../protos/google/cloud/aiplatform/v1beta1/prediction_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/geometry.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto", - "../../protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/specialist_pool_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/study.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_data.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_experiment.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_run.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_service.proto", - "../../protos/google/cloud/aiplatform/v1beta1/tensorboard_time_series.proto", - "../../protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto", - "../../protos/google/cloud/aiplatform/v1beta1/types.proto", - "../../protos/google/cloud/aiplatform/v1beta1/unmanaged_container_model.proto", - "../../protos/google/cloud/aiplatform/v1beta1/user_action_reference.proto", - "../../protos/google/cloud/aiplatform/v1beta1/value.proto", - "../../protos/google/cloud/aiplatform/v1beta1/vizier_service.proto" -] diff --git a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index ffac9b16..00000000 --- a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,41 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const aiplatform = require('@google-cloud/aiplatform'); - -function main() { - const datasetServiceClient = new aiplatform.DatasetServiceClient(); - const endpointServiceClient = new aiplatform.EndpointServiceClient(); - const featurestoreOnlineServingServiceClient = new aiplatform.FeaturestoreOnlineServingServiceClient(); - const featurestoreServiceClient = new aiplatform.FeaturestoreServiceClient(); - const indexEndpointServiceClient = new aiplatform.IndexEndpointServiceClient(); - const indexServiceClient = new aiplatform.IndexServiceClient(); - const jobServiceClient = new aiplatform.JobServiceClient(); - const metadataServiceClient = new aiplatform.MetadataServiceClient(); - const migrationServiceClient = new aiplatform.MigrationServiceClient(); - const modelServiceClient = new aiplatform.ModelServiceClient(); - const pipelineServiceClient = new aiplatform.PipelineServiceClient(); - const predictionServiceClient = new aiplatform.PredictionServiceClient(); - const specialistPoolServiceClient = new aiplatform.SpecialistPoolServiceClient(); - const tensorboardServiceClient = new aiplatform.TensorboardServiceClient(); - const vizierServiceClient = new aiplatform.VizierServiceClient(); -} - -main(); diff --git a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 6d8165e0..00000000 --- a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,116 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {DatasetServiceClient, EndpointServiceClient, FeaturestoreOnlineServingServiceClient, FeaturestoreServiceClient, IndexEndpointServiceClient, IndexServiceClient, JobServiceClient, MetadataServiceClient, MigrationServiceClient, ModelServiceClient, PipelineServiceClient, PredictionServiceClient, SpecialistPoolServiceClient, TensorboardServiceClient, VizierServiceClient} from '@google-cloud/aiplatform'; - -// check that the client class type name can be used -function doStuffWithDatasetServiceClient(client: DatasetServiceClient) { - client.close(); -} -function doStuffWithEndpointServiceClient(client: EndpointServiceClient) { - client.close(); -} -function doStuffWithFeaturestoreOnlineServingServiceClient(client: FeaturestoreOnlineServingServiceClient) { - client.close(); -} -function doStuffWithFeaturestoreServiceClient(client: FeaturestoreServiceClient) { - client.close(); -} -function doStuffWithIndexEndpointServiceClient(client: IndexEndpointServiceClient) { - client.close(); -} -function doStuffWithIndexServiceClient(client: IndexServiceClient) { - client.close(); -} -function doStuffWithJobServiceClient(client: JobServiceClient) { - client.close(); -} -function doStuffWithMetadataServiceClient(client: MetadataServiceClient) { - client.close(); -} -function doStuffWithMigrationServiceClient(client: MigrationServiceClient) { - client.close(); -} -function doStuffWithModelServiceClient(client: ModelServiceClient) { - client.close(); -} -function doStuffWithPipelineServiceClient(client: PipelineServiceClient) { - client.close(); -} -function doStuffWithPredictionServiceClient(client: PredictionServiceClient) { - client.close(); -} -function doStuffWithSpecialistPoolServiceClient(client: SpecialistPoolServiceClient) { - client.close(); -} -function doStuffWithTensorboardServiceClient(client: TensorboardServiceClient) { - client.close(); -} -function doStuffWithVizierServiceClient(client: VizierServiceClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const datasetServiceClient = new DatasetServiceClient(); - doStuffWithDatasetServiceClient(datasetServiceClient); - // check that the client instance can be created - const endpointServiceClient = new EndpointServiceClient(); - doStuffWithEndpointServiceClient(endpointServiceClient); - // check that the client instance can be created - const featurestoreOnlineServingServiceClient = new FeaturestoreOnlineServingServiceClient(); - doStuffWithFeaturestoreOnlineServingServiceClient(featurestoreOnlineServingServiceClient); - // check that the client instance can be created - const featurestoreServiceClient = new FeaturestoreServiceClient(); - doStuffWithFeaturestoreServiceClient(featurestoreServiceClient); - // check that the client instance can be created - const indexEndpointServiceClient = new IndexEndpointServiceClient(); - doStuffWithIndexEndpointServiceClient(indexEndpointServiceClient); - // check that the client instance can be created - const indexServiceClient = new IndexServiceClient(); - doStuffWithIndexServiceClient(indexServiceClient); - // check that the client instance can be created - const jobServiceClient = new JobServiceClient(); - doStuffWithJobServiceClient(jobServiceClient); - // check that the client instance can be created - const metadataServiceClient = new MetadataServiceClient(); - doStuffWithMetadataServiceClient(metadataServiceClient); - // check that the client instance can be created - const migrationServiceClient = new MigrationServiceClient(); - doStuffWithMigrationServiceClient(migrationServiceClient); - // check that the client instance can be created - const modelServiceClient = new ModelServiceClient(); - doStuffWithModelServiceClient(modelServiceClient); - // check that the client instance can be created - const pipelineServiceClient = new PipelineServiceClient(); - doStuffWithPipelineServiceClient(pipelineServiceClient); - // check that the client instance can be created - const predictionServiceClient = new PredictionServiceClient(); - doStuffWithPredictionServiceClient(predictionServiceClient); - // check that the client instance can be created - const specialistPoolServiceClient = new SpecialistPoolServiceClient(); - doStuffWithSpecialistPoolServiceClient(specialistPoolServiceClient); - // check that the client instance can be created - const tensorboardServiceClient = new TensorboardServiceClient(); - doStuffWithTensorboardServiceClient(tensorboardServiceClient); - // check that the client instance can be created - const vizierServiceClient = new VizierServiceClient(); - doStuffWithVizierServiceClient(vizierServiceClient); -} - -main(); diff --git a/owl-bot-staging/v1beta1/system-test/install.ts b/owl-bot-staging/v1beta1/system-test/install.ts deleted file mode 100644 index 8ec45222..00000000 --- a/owl-bot-staging/v1beta1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import { packNTest } from 'pack-n-play'; -import { readFileSync } from 'fs'; -import { describe, it } from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/v1beta1/test/gapic_dataset_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_dataset_service_v1beta1.ts deleted file mode 100644 index 6ce3823d..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_dataset_service_v1beta1.ts +++ /dev/null @@ -1,3419 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as datasetserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta1.DatasetServiceClient', () => { - it('has servicePath', () => { - const servicePath = datasetserviceModule.v1beta1.DatasetServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = datasetserviceModule.v1beta1.DatasetServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = datasetserviceModule.v1beta1.DatasetServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.datasetServiceStub, undefined); - await client.initialize(); - assert(client.datasetServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.datasetServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.datasetServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('getDataset', () => { - it('invokes getDataset without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetDatasetRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()); - client.innerApiCalls.getDataset = stubSimpleCall(expectedResponse); - const [response] = await client.getDataset(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDataset without error using callback', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetDatasetRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()); - client.innerApiCalls.getDataset = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDataset( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDataset|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getDataset with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetDatasetRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataset = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataset(request), expectedError); - assert((client.innerApiCalls.getDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDataset with closed client', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetDatasetRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDataset(request), expectedError); - }); - }); - - describe('updateDataset', () => { - it('invokes updateDataset without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateDatasetRequest()); - request.dataset = {}; - request.dataset.name = ''; - const expectedHeaderRequestParams = "dataset.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()); - client.innerApiCalls.updateDataset = stubSimpleCall(expectedResponse); - const [response] = await client.updateDataset(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateDataset without error using callback', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateDatasetRequest()); - request.dataset = {}; - request.dataset.name = ''; - const expectedHeaderRequestParams = "dataset.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()); - client.innerApiCalls.updateDataset = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDataset( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDataset|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateDataset with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateDatasetRequest()); - request.dataset = {}; - request.dataset.name = ''; - const expectedHeaderRequestParams = "dataset.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDataset = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDataset(request), expectedError); - assert((client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateDataset with closed client', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateDatasetRequest()); - request.dataset = {}; - request.dataset.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateDataset(request), expectedError); - }); - }); - - describe('getAnnotationSpec', () => { - it('invokes getAnnotationSpec without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetAnnotationSpecRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AnnotationSpec()); - client.innerApiCalls.getAnnotationSpec = stubSimpleCall(expectedResponse); - const [response] = await client.getAnnotationSpec(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getAnnotationSpec without error using callback', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetAnnotationSpecRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AnnotationSpec()); - client.innerApiCalls.getAnnotationSpec = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getAnnotationSpec( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IAnnotationSpec|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getAnnotationSpec with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetAnnotationSpecRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getAnnotationSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAnnotationSpec(request), expectedError); - assert((client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getAnnotationSpec with closed client', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetAnnotationSpecRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getAnnotationSpec(request), expectedError); - }); - }); - - describe('createDataset', () => { - it('invokes createDataset without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateDatasetRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createDataset = stubLongRunningCall(expectedResponse); - const [operation] = await client.createDataset(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createDataset without error using callback', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateDatasetRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createDataset = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDataset( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createDataset with call error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateDatasetRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createDataset = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createDataset(request), expectedError); - assert((client.innerApiCalls.createDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createDataset with LRO error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateDatasetRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createDataset = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createDataset(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateDatasetProgress without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateDatasetProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateDatasetProgress with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateDatasetProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteDataset', () => { - it('invokes deleteDataset without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteDatasetRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteDataset = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteDataset(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteDataset without error using callback', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteDatasetRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteDataset = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteDataset( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteDataset with call error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteDatasetRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataset = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteDataset(request), expectedError); - assert((client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteDataset with LRO error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteDatasetRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataset = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteDataset(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteDatasetProgress without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteDatasetProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteDatasetProgress with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteDatasetProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('importData', () => { - it('invokes importData without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportDataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.importData = stubLongRunningCall(expectedResponse); - const [operation] = await client.importData(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.importData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes importData without error using callback', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportDataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.importData = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.importData( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.importData as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes importData with call error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportDataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.importData = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.importData(request), expectedError); - assert((client.innerApiCalls.importData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes importData with LRO error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportDataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.importData = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.importData(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.importData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkImportDataProgress without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkImportDataProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkImportDataProgress with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkImportDataProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('exportData', () => { - it('invokes exportData without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportDataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.exportData = stubLongRunningCall(expectedResponse); - const [operation] = await client.exportData(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.exportData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes exportData without error using callback', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportDataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.exportData = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.exportData( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.exportData as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes exportData with call error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportDataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportData = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.exportData(request), expectedError); - assert((client.innerApiCalls.exportData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes exportData with LRO error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportDataRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportData = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.exportData(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.exportData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkExportDataProgress without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkExportDataProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkExportDataProgress with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkExportDataProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listDatasets', () => { - it('invokes listDatasets without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDatasetsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), - ]; - client.innerApiCalls.listDatasets = stubSimpleCall(expectedResponse); - const [response] = await client.listDatasets(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDatasets as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDatasets without error using callback', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDatasetsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), - ]; - client.innerApiCalls.listDatasets = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDatasets( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDataset[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDatasets as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listDatasets with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDatasetsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listDatasets = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDatasets(request), expectedError); - assert((client.innerApiCalls.listDatasets as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDatasetsStream without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDatasetsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), - ]; - client.descriptors.page.listDatasets.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDatasetsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Dataset[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Dataset) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listDatasets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDatasets, request)); - assert.strictEqual( - (client.descriptors.page.listDatasets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listDatasetsStream with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDatasetsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listDatasets.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDatasetsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Dataset[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Dataset) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDatasets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDatasets, request)); - assert.strictEqual( - (client.descriptors.page.listDatasets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDatasets without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDatasetsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Dataset()), - ]; - client.descriptors.page.listDatasets.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IDataset[] = []; - const iterable = client.listDatasetsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDatasets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDatasets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDatasets with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDatasetsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listDatasets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDatasetsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IDataset[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDatasets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDatasets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listDataItems', () => { - it('invokes listDataItems without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataItemsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), - ]; - client.innerApiCalls.listDataItems = stubSimpleCall(expectedResponse); - const [response] = await client.listDataItems(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDataItems as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDataItems without error using callback', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataItemsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), - ]; - client.innerApiCalls.listDataItems = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDataItems( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDataItem[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDataItems as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listDataItems with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataItemsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listDataItems = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDataItems(request), expectedError); - assert((client.innerApiCalls.listDataItems as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDataItemsStream without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataItemsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), - ]; - client.descriptors.page.listDataItems.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDataItemsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.DataItem[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DataItem) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listDataItems.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDataItems, request)); - assert.strictEqual( - (client.descriptors.page.listDataItems.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listDataItemsStream with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataItemsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listDataItems.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDataItemsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.DataItem[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DataItem) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDataItems.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDataItems, request)); - assert.strictEqual( - (client.descriptors.page.listDataItems.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDataItems without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataItemsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataItem()), - ]; - client.descriptors.page.listDataItems.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IDataItem[] = []; - const iterable = client.listDataItemsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDataItems.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDataItems.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDataItems with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataItemsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listDataItems.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDataItemsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IDataItem[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDataItems.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDataItems.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listAnnotations', () => { - it('invokes listAnnotations without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListAnnotationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), - ]; - client.innerApiCalls.listAnnotations = stubSimpleCall(expectedResponse); - const [response] = await client.listAnnotations(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listAnnotations without error using callback', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListAnnotationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), - ]; - client.innerApiCalls.listAnnotations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAnnotations( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IAnnotation[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listAnnotations with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListAnnotationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listAnnotations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAnnotations(request), expectedError); - assert((client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listAnnotationsStream without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListAnnotationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), - ]; - client.descriptors.page.listAnnotations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAnnotationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Annotation[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Annotation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listAnnotations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAnnotations, request)); - assert.strictEqual( - (client.descriptors.page.listAnnotations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listAnnotationsStream with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListAnnotationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listAnnotations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAnnotationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Annotation[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Annotation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAnnotations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAnnotations, request)); - assert.strictEqual( - (client.descriptors.page.listAnnotations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listAnnotations without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListAnnotationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Annotation()), - ]; - client.descriptors.page.listAnnotations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IAnnotation[] = []; - const iterable = client.listAnnotationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listAnnotations with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListAnnotationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listAnnotations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAnnotationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IAnnotation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1beta1/test/gapic_endpoint_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_endpoint_service_v1beta1.ts deleted file mode 100644 index 8a797c84..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_endpoint_service_v1beta1.ts +++ /dev/null @@ -1,2876 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as endpointserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta1.EndpointServiceClient', () => { - it('has servicePath', () => { - const servicePath = endpointserviceModule.v1beta1.EndpointServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = endpointserviceModule.v1beta1.EndpointServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = endpointserviceModule.v1beta1.EndpointServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.endpointServiceStub, undefined); - await client.initialize(); - assert(client.endpointServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.endpointServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.endpointServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('getEndpoint', () => { - it('invokes getEndpoint without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()); - client.innerApiCalls.getEndpoint = stubSimpleCall(expectedResponse); - const [response] = await client.getEndpoint(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getEndpoint without error using callback', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()); - client.innerApiCalls.getEndpoint = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getEndpoint( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IEndpoint|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getEndpoint with error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getEndpoint = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getEndpoint(request), expectedError); - assert((client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getEndpoint with closed client', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetEndpointRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getEndpoint(request), expectedError); - }); - }); - - describe('updateEndpoint', () => { - it('invokes updateEndpoint without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateEndpointRequest()); - request.endpoint = {}; - request.endpoint.name = ''; - const expectedHeaderRequestParams = "endpoint.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()); - client.innerApiCalls.updateEndpoint = stubSimpleCall(expectedResponse); - const [response] = await client.updateEndpoint(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateEndpoint without error using callback', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateEndpointRequest()); - request.endpoint = {}; - request.endpoint.name = ''; - const expectedHeaderRequestParams = "endpoint.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()); - client.innerApiCalls.updateEndpoint = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateEndpoint( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IEndpoint|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateEndpoint with error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateEndpointRequest()); - request.endpoint = {}; - request.endpoint.name = ''; - const expectedHeaderRequestParams = "endpoint.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateEndpoint = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateEndpoint(request), expectedError); - assert((client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateEndpoint with closed client', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateEndpointRequest()); - request.endpoint = {}; - request.endpoint.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateEndpoint(request), expectedError); - }); - }); - - describe('createEndpoint', () => { - it('invokes createEndpoint without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateEndpointRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createEndpoint = stubLongRunningCall(expectedResponse); - const [operation] = await client.createEndpoint(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createEndpoint without error using callback', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateEndpointRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createEndpoint = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createEndpoint( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createEndpoint with call error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateEndpointRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createEndpoint = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createEndpoint(request), expectedError); - assert((client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createEndpoint with LRO error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateEndpointRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createEndpoint = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createEndpoint(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateEndpointProgress without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateEndpointProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateEndpointProgress with error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateEndpointProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteEndpoint', () => { - it('invokes deleteEndpoint without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteEndpoint = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteEndpoint(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteEndpoint without error using callback', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteEndpoint = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteEndpoint( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteEndpoint with call error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEndpoint = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteEndpoint(request), expectedError); - assert((client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteEndpoint with LRO error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEndpoint = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteEndpoint(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteEndpointProgress without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteEndpointProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteEndpointProgress with error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteEndpointProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deployModel', () => { - it('invokes deployModel without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployModelRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deployModel = stubLongRunningCall(expectedResponse); - const [operation] = await client.deployModel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deployModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deployModel without error using callback', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployModelRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deployModel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deployModel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deployModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deployModel with call error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployModelRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deployModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deployModel(request), expectedError); - assert((client.innerApiCalls.deployModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deployModel with LRO error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployModelRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deployModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deployModel(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deployModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeployModelProgress without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeployModelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeployModelProgress with error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeployModelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('undeployModel', () => { - it('invokes undeployModel without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UndeployModelRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.undeployModel = stubLongRunningCall(expectedResponse); - const [operation] = await client.undeployModel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes undeployModel without error using callback', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UndeployModelRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.undeployModel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.undeployModel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes undeployModel with call error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UndeployModelRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.undeployModel(request), expectedError); - assert((client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes undeployModel with LRO error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UndeployModelRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.undeployModel(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUndeployModelProgress without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUndeployModelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUndeployModelProgress with error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUndeployModelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listEndpoints', () => { - it('invokes listEndpoints without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), - ]; - client.innerApiCalls.listEndpoints = stubSimpleCall(expectedResponse); - const [response] = await client.listEndpoints(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listEndpoints without error using callback', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), - ]; - client.innerApiCalls.listEndpoints = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listEndpoints( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IEndpoint[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listEndpoints with error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listEndpoints = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listEndpoints(request), expectedError); - assert((client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listEndpointsStream without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), - ]; - client.descriptors.page.listEndpoints.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listEndpointsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Endpoint[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Endpoint) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listEndpoints.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEndpoints, request)); - assert.strictEqual( - (client.descriptors.page.listEndpoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listEndpointsStream with error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listEndpoints.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listEndpointsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Endpoint[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Endpoint) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listEndpoints.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEndpoints, request)); - assert.strictEqual( - (client.descriptors.page.listEndpoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listEndpoints without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Endpoint()), - ]; - client.descriptors.page.listEndpoints.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IEndpoint[] = []; - const iterable = client.listEndpointsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listEndpoints with error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listEndpoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listEndpointsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IEndpoint[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts deleted file mode 100644 index a2f8a678..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts +++ /dev/null @@ -1,1978 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as featurestoreonlineservingserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubServerStreamingCall(response?: ResponseType, error?: Error) { - const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // write something to the stream to trigger transformStub and send the response back to the client - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - return sinon.stub().returns(mockStream); -} - -describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { - it('has servicePath', () => { - const servicePath = featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.featurestoreOnlineServingServiceStub, undefined); - await client.initialize(); - assert(client.featurestoreOnlineServingServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.featurestoreOnlineServingServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.featurestoreOnlineServingServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('readFeatureValues', () => { - it('invokes readFeatureValues without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse()); - client.innerApiCalls.readFeatureValues = stubSimpleCall(expectedResponse); - const [response] = await client.readFeatureValues(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes readFeatureValues without error using callback', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse()); - client.innerApiCalls.readFeatureValues = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.readFeatureValues( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IReadFeatureValuesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes readFeatureValues with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.readFeatureValues = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.readFeatureValues(request), expectedError); - assert((client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes readFeatureValues with closed client', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesRequest()); - request.entityType = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.readFeatureValues(request), expectedError); - }); - }); - - describe('streamingReadFeatureValues', () => { - it('invokes streamingReadFeatureValues without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.StreamingReadFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse()); - client.innerApiCalls.streamingReadFeatureValues = stubServerStreamingCall(expectedResponse); - const stream = client.streamingReadFeatureValues(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.streamingReadFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions)); - }); - - it('invokes streamingReadFeatureValues with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.StreamingReadFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.streamingReadFeatureValues = stubServerStreamingCall(undefined, expectedError); - const stream = client.streamingReadFeatureValues(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.innerApiCalls.streamingReadFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions)); - }); - - it('invokes streamingReadFeatureValues with closed client', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.StreamingReadFeatureValuesRequest()); - request.entityType = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - const stream = client.streamingReadFeatureValues(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1beta1/test/gapic_featurestore_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_featurestore_service_v1beta1.ts deleted file mode 100644 index 3d2e0fbc..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_featurestore_service_v1beta1.ts +++ /dev/null @@ -1,4882 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as featurestoreserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta1.FeaturestoreServiceClient', () => { - it('has servicePath', () => { - const servicePath = featurestoreserviceModule.v1beta1.FeaturestoreServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = featurestoreserviceModule.v1beta1.FeaturestoreServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = featurestoreserviceModule.v1beta1.FeaturestoreServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.featurestoreServiceStub, undefined); - await client.initialize(); - assert(client.featurestoreServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.featurestoreServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.featurestoreServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('getFeaturestore', () => { - it('invokes getFeaturestore without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetFeaturestoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()); - client.innerApiCalls.getFeaturestore = stubSimpleCall(expectedResponse); - const [response] = await client.getFeaturestore(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getFeaturestore without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetFeaturestoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()); - client.innerApiCalls.getFeaturestore = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getFeaturestore( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IFeaturestore|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getFeaturestore with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetFeaturestoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getFeaturestore = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getFeaturestore(request), expectedError); - assert((client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getFeaturestore with closed client', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetFeaturestoreRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getFeaturestore(request), expectedError); - }); - }); - - describe('getEntityType', () => { - it('invokes getEntityType without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetEntityTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()); - client.innerApiCalls.getEntityType = stubSimpleCall(expectedResponse); - const [response] = await client.getEntityType(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getEntityType without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetEntityTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()); - client.innerApiCalls.getEntityType = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getEntityType( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IEntityType|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getEntityType with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetEntityTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getEntityType = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getEntityType(request), expectedError); - assert((client.innerApiCalls.getEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getEntityType with closed client', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetEntityTypeRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getEntityType(request), expectedError); - }); - }); - - describe('updateEntityType', () => { - it('invokes updateEntityType without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateEntityTypeRequest()); - request.entityType = {}; - request.entityType.name = ''; - const expectedHeaderRequestParams = "entity_type.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()); - client.innerApiCalls.updateEntityType = stubSimpleCall(expectedResponse); - const [response] = await client.updateEntityType(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateEntityType without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateEntityTypeRequest()); - request.entityType = {}; - request.entityType.name = ''; - const expectedHeaderRequestParams = "entity_type.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()); - client.innerApiCalls.updateEntityType = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateEntityType( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IEntityType|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateEntityType with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateEntityTypeRequest()); - request.entityType = {}; - request.entityType.name = ''; - const expectedHeaderRequestParams = "entity_type.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateEntityType = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateEntityType(request), expectedError); - assert((client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateEntityType with closed client', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateEntityTypeRequest()); - request.entityType = {}; - request.entityType.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateEntityType(request), expectedError); - }); - }); - - describe('getFeature', () => { - it('invokes getFeature without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetFeatureRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()); - client.innerApiCalls.getFeature = stubSimpleCall(expectedResponse); - const [response] = await client.getFeature(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getFeature without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetFeatureRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()); - client.innerApiCalls.getFeature = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getFeature( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IFeature|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getFeature with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetFeatureRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getFeature = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getFeature(request), expectedError); - assert((client.innerApiCalls.getFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getFeature with closed client', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetFeatureRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getFeature(request), expectedError); - }); - }); - - describe('updateFeature', () => { - it('invokes updateFeature without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateFeatureRequest()); - request.feature = {}; - request.feature.name = ''; - const expectedHeaderRequestParams = "feature.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()); - client.innerApiCalls.updateFeature = stubSimpleCall(expectedResponse); - const [response] = await client.updateFeature(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateFeature without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateFeatureRequest()); - request.feature = {}; - request.feature.name = ''; - const expectedHeaderRequestParams = "feature.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()); - client.innerApiCalls.updateFeature = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateFeature( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IFeature|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateFeature with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateFeatureRequest()); - request.feature = {}; - request.feature.name = ''; - const expectedHeaderRequestParams = "feature.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateFeature = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateFeature(request), expectedError); - assert((client.innerApiCalls.updateFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateFeature with closed client', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateFeatureRequest()); - request.feature = {}; - request.feature.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateFeature(request), expectedError); - }); - }); - - describe('createFeaturestore', () => { - it('invokes createFeaturestore without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateFeaturestoreRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createFeaturestore = stubLongRunningCall(expectedResponse); - const [operation] = await client.createFeaturestore(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createFeaturestore without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateFeaturestoreRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createFeaturestore = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createFeaturestore( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createFeaturestore with call error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateFeaturestoreRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createFeaturestore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createFeaturestore(request), expectedError); - assert((client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createFeaturestore with LRO error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateFeaturestoreRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createFeaturestore(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateFeaturestoreProgress without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateFeaturestoreProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateFeaturestoreProgress with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateFeaturestoreProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateFeaturestore', () => { - it('invokes updateFeaturestore without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateFeaturestoreRequest()); - request.featurestore = {}; - request.featurestore.name = ''; - const expectedHeaderRequestParams = "featurestore.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateFeaturestore = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateFeaturestore(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateFeaturestore without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateFeaturestoreRequest()); - request.featurestore = {}; - request.featurestore.name = ''; - const expectedHeaderRequestParams = "featurestore.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateFeaturestore = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateFeaturestore( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateFeaturestore with call error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateFeaturestoreRequest()); - request.featurestore = {}; - request.featurestore.name = ''; - const expectedHeaderRequestParams = "featurestore.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateFeaturestore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateFeaturestore(request), expectedError); - assert((client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateFeaturestore with LRO error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateFeaturestoreRequest()); - request.featurestore = {}; - request.featurestore.name = ''; - const expectedHeaderRequestParams = "featurestore.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateFeaturestore(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUpdateFeaturestoreProgress without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateFeaturestoreProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateFeaturestoreProgress with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateFeaturestoreProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteFeaturestore', () => { - it('invokes deleteFeaturestore without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteFeaturestoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteFeaturestore(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteFeaturestore without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteFeaturestoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteFeaturestore = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteFeaturestore( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteFeaturestore with call error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteFeaturestoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteFeaturestore(request), expectedError); - assert((client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteFeaturestore with LRO error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteFeaturestoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteFeaturestore(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteFeaturestoreProgress without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteFeaturestoreProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteFeaturestoreProgress with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteFeaturestoreProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createEntityType', () => { - it('invokes createEntityType without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateEntityTypeRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createEntityType = stubLongRunningCall(expectedResponse); - const [operation] = await client.createEntityType(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createEntityType without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateEntityTypeRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createEntityType = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createEntityType( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createEntityType with call error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateEntityTypeRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createEntityType = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createEntityType(request), expectedError); - assert((client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createEntityType with LRO error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateEntityTypeRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createEntityType = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createEntityType(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateEntityTypeProgress without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateEntityTypeProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateEntityTypeProgress with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateEntityTypeProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteEntityType', () => { - it('invokes deleteEntityType without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteEntityTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteEntityType = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteEntityType(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteEntityType without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteEntityTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteEntityType = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteEntityType( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteEntityType with call error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteEntityTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEntityType = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteEntityType(request), expectedError); - assert((client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteEntityType with LRO error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteEntityTypeRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEntityType = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteEntityType(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteEntityTypeProgress without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteEntityTypeProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteEntityTypeProgress with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteEntityTypeProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createFeature', () => { - it('invokes createFeature without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateFeatureRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createFeature = stubLongRunningCall(expectedResponse); - const [operation] = await client.createFeature(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createFeature without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateFeatureRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createFeature = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createFeature( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createFeature with call error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateFeatureRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createFeature = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createFeature(request), expectedError); - assert((client.innerApiCalls.createFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createFeature with LRO error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateFeatureRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createFeature = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createFeature(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateFeatureProgress without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateFeatureProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateFeatureProgress with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateFeatureProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('batchCreateFeatures', () => { - it('invokes batchCreateFeatures without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchCreateFeatures(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchCreateFeatures without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.batchCreateFeatures = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchCreateFeatures( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes batchCreateFeatures with call error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchCreateFeatures(request), expectedError); - assert((client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchCreateFeatures with LRO error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchCreateFeatures(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkBatchCreateFeaturesProgress without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkBatchCreateFeaturesProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkBatchCreateFeaturesProgress with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkBatchCreateFeaturesProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteFeature', () => { - it('invokes deleteFeature without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteFeatureRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteFeature = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteFeature(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteFeature without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteFeatureRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteFeature = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteFeature( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteFeature with call error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteFeatureRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeature = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteFeature(request), expectedError); - assert((client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteFeature with LRO error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteFeatureRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeature = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteFeature(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteFeatureProgress without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteFeatureProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteFeatureProgress with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteFeatureProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('importFeatureValues', () => { - it('invokes importFeatureValues without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.importFeatureValues = stubLongRunningCall(expectedResponse); - const [operation] = await client.importFeatureValues(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes importFeatureValues without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.importFeatureValues = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.importFeatureValues( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes importFeatureValues with call error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.importFeatureValues = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.importFeatureValues(request), expectedError); - assert((client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes importFeatureValues with LRO error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.importFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.importFeatureValues(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkImportFeatureValuesProgress without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkImportFeatureValuesProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkImportFeatureValuesProgress with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkImportFeatureValuesProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('batchReadFeatureValues', () => { - it('invokes batchReadFeatureValues without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadFeatureValuesRequest()); - request.featurestore = ''; - const expectedHeaderRequestParams = "featurestore="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchReadFeatureValues(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchReadFeatureValues without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadFeatureValuesRequest()); - request.featurestore = ''; - const expectedHeaderRequestParams = "featurestore="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.batchReadFeatureValues = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchReadFeatureValues( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes batchReadFeatureValues with call error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadFeatureValuesRequest()); - request.featurestore = ''; - const expectedHeaderRequestParams = "featurestore="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchReadFeatureValues(request), expectedError); - assert((client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchReadFeatureValues with LRO error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadFeatureValuesRequest()); - request.featurestore = ''; - const expectedHeaderRequestParams = "featurestore="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchReadFeatureValues(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkBatchReadFeatureValuesProgress without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkBatchReadFeatureValuesProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkBatchReadFeatureValuesProgress with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkBatchReadFeatureValuesProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('exportFeatureValues', () => { - it('invokes exportFeatureValues without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.exportFeatureValues = stubLongRunningCall(expectedResponse); - const [operation] = await client.exportFeatureValues(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes exportFeatureValues without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.exportFeatureValues = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.exportFeatureValues( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes exportFeatureValues with call error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportFeatureValues = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.exportFeatureValues(request), expectedError); - assert((client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes exportFeatureValues with LRO error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportFeatureValuesRequest()); - request.entityType = ''; - const expectedHeaderRequestParams = "entity_type="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.exportFeatureValues(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkExportFeatureValuesProgress without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkExportFeatureValuesProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkExportFeatureValuesProgress with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkExportFeatureValuesProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listFeaturestores', () => { - it('invokes listFeaturestores without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), - ]; - client.innerApiCalls.listFeaturestores = stubSimpleCall(expectedResponse); - const [response] = await client.listFeaturestores(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listFeaturestores without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), - ]; - client.innerApiCalls.listFeaturestores = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listFeaturestores( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IFeaturestore[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listFeaturestores with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listFeaturestores = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listFeaturestores(request), expectedError); - assert((client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listFeaturestoresStream without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), - ]; - client.descriptors.page.listFeaturestores.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listFeaturestoresStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Featurestore[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Featurestore) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listFeaturestores.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listFeaturestores, request)); - assert.strictEqual( - (client.descriptors.page.listFeaturestores.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listFeaturestoresStream with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listFeaturestores.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listFeaturestoresStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Featurestore[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Featurestore) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listFeaturestores.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listFeaturestores, request)); - assert.strictEqual( - (client.descriptors.page.listFeaturestores.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listFeaturestores without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Featurestore()), - ]; - client.descriptors.page.listFeaturestores.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IFeaturestore[] = []; - const iterable = client.listFeaturestoresAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listFeaturestores with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listFeaturestores.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listFeaturestoresAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IFeaturestore[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listEntityTypes', () => { - it('invokes listEntityTypes without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEntityTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), - ]; - client.innerApiCalls.listEntityTypes = stubSimpleCall(expectedResponse); - const [response] = await client.listEntityTypes(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listEntityTypes without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEntityTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), - ]; - client.innerApiCalls.listEntityTypes = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listEntityTypes( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IEntityType[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listEntityTypes with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEntityTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listEntityTypes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listEntityTypes(request), expectedError); - assert((client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listEntityTypesStream without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEntityTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), - ]; - client.descriptors.page.listEntityTypes.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listEntityTypesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.EntityType[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.EntityType) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listEntityTypes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEntityTypes, request)); - assert.strictEqual( - (client.descriptors.page.listEntityTypes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listEntityTypesStream with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEntityTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listEntityTypes.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listEntityTypesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.EntityType[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.EntityType) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listEntityTypes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEntityTypes, request)); - assert.strictEqual( - (client.descriptors.page.listEntityTypes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listEntityTypes without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEntityTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.EntityType()), - ]; - client.descriptors.page.listEntityTypes.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IEntityType[] = []; - const iterable = client.listEntityTypesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listEntityTypes with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListEntityTypesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listEntityTypes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listEntityTypesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IEntityType[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listFeatures', () => { - it('invokes listFeatures without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - ]; - client.innerApiCalls.listFeatures = stubSimpleCall(expectedResponse); - const [response] = await client.listFeatures(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listFeatures without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - ]; - client.innerApiCalls.listFeatures = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listFeatures( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IFeature[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listFeatures with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listFeatures = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listFeatures(request), expectedError); - assert((client.innerApiCalls.listFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listFeaturesStream without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - ]; - client.descriptors.page.listFeatures.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listFeaturesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Feature[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Feature) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listFeatures.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listFeatures, request)); - assert.strictEqual( - (client.descriptors.page.listFeatures.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listFeaturesStream with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listFeatures.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listFeaturesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Feature[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Feature) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listFeatures.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listFeatures, request)); - assert.strictEqual( - (client.descriptors.page.listFeatures.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listFeatures without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - ]; - client.descriptors.page.listFeatures.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IFeature[] = []; - const iterable = client.listFeaturesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listFeatures.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listFeatures.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listFeatures with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListFeaturesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listFeatures.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listFeaturesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IFeature[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listFeatures.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listFeatures.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('searchFeatures', () => { - it('invokes searchFeatures without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchFeaturesRequest()); - request.location = ''; - const expectedHeaderRequestParams = "location="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - ]; - client.innerApiCalls.searchFeatures = stubSimpleCall(expectedResponse); - const [response] = await client.searchFeatures(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes searchFeatures without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchFeaturesRequest()); - request.location = ''; - const expectedHeaderRequestParams = "location="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - ]; - client.innerApiCalls.searchFeatures = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.searchFeatures( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IFeature[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes searchFeatures with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchFeaturesRequest()); - request.location = ''; - const expectedHeaderRequestParams = "location="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.searchFeatures = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchFeatures(request), expectedError); - assert((client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes searchFeaturesStream without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchFeaturesRequest()); - request.location = ''; - const expectedHeaderRequestParams = "location="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - ]; - client.descriptors.page.searchFeatures.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchFeaturesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Feature[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Feature) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.searchFeatures.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchFeatures, request)); - assert.strictEqual( - (client.descriptors.page.searchFeatures.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes searchFeaturesStream with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchFeaturesRequest()); - request.location = ''; - const expectedHeaderRequestParams = "location="; - const expectedError = new Error('expected'); - client.descriptors.page.searchFeatures.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchFeaturesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Feature[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Feature) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.searchFeatures.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchFeatures, request)); - assert.strictEqual( - (client.descriptors.page.searchFeatures.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with searchFeatures without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchFeaturesRequest()); - request.location = ''; - const expectedHeaderRequestParams = "location="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Feature()), - ]; - client.descriptors.page.searchFeatures.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IFeature[] = []; - const iterable = client.searchFeaturesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with searchFeatures with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchFeaturesRequest()); - request.location = ''; - const expectedHeaderRequestParams = "location=";const expectedError = new Error('expected'); - client.descriptors.page.searchFeatures.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchFeaturesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IFeature[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts deleted file mode 100644 index d462fff9..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts +++ /dev/null @@ -1,3020 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as indexendpointserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta1.IndexEndpointServiceClient', () => { - it('has servicePath', () => { - const servicePath = indexendpointserviceModule.v1beta1.IndexEndpointServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = indexendpointserviceModule.v1beta1.IndexEndpointServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = indexendpointserviceModule.v1beta1.IndexEndpointServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.indexEndpointServiceStub, undefined); - await client.initialize(); - assert(client.indexEndpointServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.indexEndpointServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.indexEndpointServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('getIndexEndpoint', () => { - it('invokes getIndexEndpoint without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetIndexEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()); - client.innerApiCalls.getIndexEndpoint = stubSimpleCall(expectedResponse); - const [response] = await client.getIndexEndpoint(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getIndexEndpoint without error using callback', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetIndexEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()); - client.innerApiCalls.getIndexEndpoint = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIndexEndpoint( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getIndexEndpoint with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetIndexEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getIndexEndpoint = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIndexEndpoint(request), expectedError); - assert((client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getIndexEndpoint with closed client', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetIndexEndpointRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getIndexEndpoint(request), expectedError); - }); - }); - - describe('updateIndexEndpoint', () => { - it('invokes updateIndexEndpoint without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateIndexEndpointRequest()); - request.indexEndpoint = {}; - request.indexEndpoint.name = ''; - const expectedHeaderRequestParams = "index_endpoint.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()); - client.innerApiCalls.updateIndexEndpoint = stubSimpleCall(expectedResponse); - const [response] = await client.updateIndexEndpoint(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateIndexEndpoint without error using callback', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateIndexEndpointRequest()); - request.indexEndpoint = {}; - request.indexEndpoint.name = ''; - const expectedHeaderRequestParams = "index_endpoint.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()); - client.innerApiCalls.updateIndexEndpoint = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateIndexEndpoint( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateIndexEndpoint with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateIndexEndpointRequest()); - request.indexEndpoint = {}; - request.indexEndpoint.name = ''; - const expectedHeaderRequestParams = "index_endpoint.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateIndexEndpoint = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateIndexEndpoint(request), expectedError); - assert((client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateIndexEndpoint with closed client', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateIndexEndpointRequest()); - request.indexEndpoint = {}; - request.indexEndpoint.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateIndexEndpoint(request), expectedError); - }); - }); - - describe('createIndexEndpoint', () => { - it('invokes createIndexEndpoint without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateIndexEndpointRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(expectedResponse); - const [operation] = await client.createIndexEndpoint(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createIndexEndpoint without error using callback', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateIndexEndpointRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createIndexEndpoint = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createIndexEndpoint( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createIndexEndpoint with call error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateIndexEndpointRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createIndexEndpoint(request), expectedError); - assert((client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createIndexEndpoint with LRO error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateIndexEndpointRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createIndexEndpoint(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateIndexEndpointProgress without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateIndexEndpointProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateIndexEndpointProgress with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateIndexEndpointProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteIndexEndpoint', () => { - it('invokes deleteIndexEndpoint without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteIndexEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteIndexEndpoint(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteIndexEndpoint without error using callback', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteIndexEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteIndexEndpoint( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteIndexEndpoint with call error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteIndexEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteIndexEndpoint(request), expectedError); - assert((client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteIndexEndpoint with LRO error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteIndexEndpointRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteIndexEndpoint(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteIndexEndpointProgress without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteIndexEndpointProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteIndexEndpointProgress with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteIndexEndpointProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deployIndex', () => { - it('invokes deployIndex without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deployIndex = stubLongRunningCall(expectedResponse); - const [operation] = await client.deployIndex(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deployIndex without error using callback', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deployIndex = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deployIndex( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deployIndex with call error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deployIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deployIndex(request), expectedError); - assert((client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deployIndex with LRO error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deployIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deployIndex(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeployIndexProgress without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeployIndexProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeployIndexProgress with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeployIndexProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('undeployIndex', () => { - it('invokes undeployIndex without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UndeployIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.undeployIndex = stubLongRunningCall(expectedResponse); - const [operation] = await client.undeployIndex(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes undeployIndex without error using callback', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UndeployIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.undeployIndex = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.undeployIndex( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes undeployIndex with call error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UndeployIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.undeployIndex(request), expectedError); - assert((client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes undeployIndex with LRO error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UndeployIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.undeployIndex(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUndeployIndexProgress without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUndeployIndexProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUndeployIndexProgress with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUndeployIndexProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('mutateDeployedIndex', () => { - it('invokes mutateDeployedIndex without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MutateDeployedIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(expectedResponse); - const [operation] = await client.mutateDeployedIndex(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes mutateDeployedIndex without error using callback', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MutateDeployedIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.mutateDeployedIndex = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.mutateDeployedIndex( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes mutateDeployedIndex with call error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MutateDeployedIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.mutateDeployedIndex(request), expectedError); - assert((client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes mutateDeployedIndex with LRO error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MutateDeployedIndexRequest()); - request.indexEndpoint = ''; - const expectedHeaderRequestParams = "index_endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.mutateDeployedIndex(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkMutateDeployedIndexProgress without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkMutateDeployedIndexProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkMutateDeployedIndexProgress with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkMutateDeployedIndexProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listIndexEndpoints', () => { - it('invokes listIndexEndpoints without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), - ]; - client.innerApiCalls.listIndexEndpoints = stubSimpleCall(expectedResponse); - const [response] = await client.listIndexEndpoints(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listIndexEndpoints without error using callback', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), - ]; - client.innerApiCalls.listIndexEndpoints = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listIndexEndpoints( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listIndexEndpoints with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listIndexEndpoints = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listIndexEndpoints(request), expectedError); - assert((client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listIndexEndpointsStream without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), - ]; - client.descriptors.page.listIndexEndpoints.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listIndexEndpointsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.IndexEndpoint[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.IndexEndpoint) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listIndexEndpoints.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listIndexEndpoints, request)); - assert.strictEqual( - (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listIndexEndpointsStream with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listIndexEndpoints.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listIndexEndpointsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.IndexEndpoint[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.IndexEndpoint) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listIndexEndpoints.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listIndexEndpoints, request)); - assert.strictEqual( - (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listIndexEndpoints without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint()), - ]; - client.descriptors.page.listIndexEndpoints.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint[] = []; - const iterable = client.listIndexEndpointsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listIndexEndpoints with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listIndexEndpoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listIndexEndpointsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IIndexEndpoint[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1beta1/test/gapic_index_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_index_service_v1beta1.ts deleted file mode 100644 index bb10c504..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_index_service_v1beta1.ts +++ /dev/null @@ -1,2635 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as indexserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta1.IndexServiceClient', () => { - it('has servicePath', () => { - const servicePath = indexserviceModule.v1beta1.IndexServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = indexserviceModule.v1beta1.IndexServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = indexserviceModule.v1beta1.IndexServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.indexServiceStub, undefined); - await client.initialize(); - assert(client.indexServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.indexServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.indexServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('getIndex', () => { - it('invokes getIndex without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetIndexRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()); - client.innerApiCalls.getIndex = stubSimpleCall(expectedResponse); - const [response] = await client.getIndex(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getIndex without error using callback', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetIndexRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()); - client.innerApiCalls.getIndex = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIndex( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IIndex|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getIndex with error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetIndexRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getIndex = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIndex(request), expectedError); - assert((client.innerApiCalls.getIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getIndex with closed client', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetIndexRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getIndex(request), expectedError); - }); - }); - - describe('createIndex', () => { - it('invokes createIndex without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateIndexRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createIndex = stubLongRunningCall(expectedResponse); - const [operation] = await client.createIndex(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createIndex without error using callback', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateIndexRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createIndex = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createIndex( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createIndex with call error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateIndexRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createIndex(request), expectedError); - assert((client.innerApiCalls.createIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createIndex with LRO error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateIndexRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createIndex(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateIndexProgress without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateIndexProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateIndexProgress with error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateIndexProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateIndex', () => { - it('invokes updateIndex without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateIndexRequest()); - request.index = {}; - request.index.name = ''; - const expectedHeaderRequestParams = "index.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateIndex = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateIndex(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateIndex without error using callback', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateIndexRequest()); - request.index = {}; - request.index.name = ''; - const expectedHeaderRequestParams = "index.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateIndex = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateIndex( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateIndex with call error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateIndexRequest()); - request.index = {}; - request.index.name = ''; - const expectedHeaderRequestParams = "index.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateIndex(request), expectedError); - assert((client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateIndex with LRO error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateIndexRequest()); - request.index = {}; - request.index.name = ''; - const expectedHeaderRequestParams = "index.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateIndex(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUpdateIndexProgress without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateIndexProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateIndexProgress with error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateIndexProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteIndex', () => { - it('invokes deleteIndex without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteIndexRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteIndex = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteIndex(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteIndex without error using callback', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteIndexRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteIndex = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteIndex( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteIndex with call error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteIndexRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteIndex(request), expectedError); - assert((client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteIndex with LRO error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteIndexRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteIndex(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteIndexProgress without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteIndexProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteIndexProgress with error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteIndexProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listIndexes', () => { - it('invokes listIndexes without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), - ]; - client.innerApiCalls.listIndexes = stubSimpleCall(expectedResponse); - const [response] = await client.listIndexes(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listIndexes as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listIndexes without error using callback', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), - ]; - client.innerApiCalls.listIndexes = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listIndexes( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IIndex[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listIndexes as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listIndexes with error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listIndexes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listIndexes(request), expectedError); - assert((client.innerApiCalls.listIndexes as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listIndexesStream without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), - ]; - client.descriptors.page.listIndexes.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listIndexesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Index[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Index) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listIndexes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listIndexes, request)); - assert.strictEqual( - (client.descriptors.page.listIndexes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listIndexesStream with error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listIndexes.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listIndexesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Index[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Index) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listIndexes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listIndexes, request)); - assert.strictEqual( - (client.descriptors.page.listIndexes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listIndexes without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Index()), - ]; - client.descriptors.page.listIndexes.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IIndex[] = []; - const iterable = client.listIndexesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listIndexes with error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListIndexesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listIndexes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listIndexesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IIndex[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1beta1/test/gapic_job_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_job_service_v1beta1.ts deleted file mode 100644 index a5eaabea..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_job_service_v1beta1.ts +++ /dev/null @@ -1,5637 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as jobserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta1.JobServiceClient', () => { - it('has servicePath', () => { - const servicePath = jobserviceModule.v1beta1.JobServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = jobserviceModule.v1beta1.JobServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = jobserviceModule.v1beta1.JobServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new jobserviceModule.v1beta1.JobServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.jobServiceStub, undefined); - await client.initialize(); - assert(client.jobServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.jobServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.jobServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('createCustomJob', () => { - it('invokes createCustomJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateCustomJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()); - client.innerApiCalls.createCustomJob = stubSimpleCall(expectedResponse); - const [response] = await client.createCustomJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createCustomJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateCustomJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()); - client.innerApiCalls.createCustomJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCustomJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ICustomJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createCustomJob with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateCustomJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createCustomJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createCustomJob(request), expectedError); - assert((client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createCustomJob with closed client', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateCustomJobRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createCustomJob(request), expectedError); - }); - }); - - describe('getCustomJob', () => { - it('invokes getCustomJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()); - client.innerApiCalls.getCustomJob = stubSimpleCall(expectedResponse); - const [response] = await client.getCustomJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getCustomJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()); - client.innerApiCalls.getCustomJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCustomJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ICustomJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getCustomJob with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getCustomJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCustomJob(request), expectedError); - assert((client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getCustomJob with closed client', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetCustomJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getCustomJob(request), expectedError); - }); - }); - - describe('cancelCustomJob', () => { - it('invokes cancelCustomJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelCustomJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelCustomJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelCustomJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelCustomJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelCustomJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes cancelCustomJob with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelCustomJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelCustomJob(request), expectedError); - assert((client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelCustomJob with closed client', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelCustomJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelCustomJob(request), expectedError); - }); - }); - - describe('createDataLabelingJob', () => { - it('invokes createDataLabelingJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateDataLabelingJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()); - client.innerApiCalls.createDataLabelingJob = stubSimpleCall(expectedResponse); - const [response] = await client.createDataLabelingJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createDataLabelingJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateDataLabelingJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()); - client.innerApiCalls.createDataLabelingJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDataLabelingJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createDataLabelingJob with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateDataLabelingJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createDataLabelingJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDataLabelingJob(request), expectedError); - assert((client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createDataLabelingJob with closed client', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateDataLabelingJobRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createDataLabelingJob(request), expectedError); - }); - }); - - describe('getDataLabelingJob', () => { - it('invokes getDataLabelingJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()); - client.innerApiCalls.getDataLabelingJob = stubSimpleCall(expectedResponse); - const [response] = await client.getDataLabelingJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDataLabelingJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()); - client.innerApiCalls.getDataLabelingJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDataLabelingJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getDataLabelingJob with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataLabelingJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataLabelingJob(request), expectedError); - assert((client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getDataLabelingJob with closed client', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetDataLabelingJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDataLabelingJob(request), expectedError); - }); - }); - - describe('cancelDataLabelingJob', () => { - it('invokes cancelDataLabelingJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelDataLabelingJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelDataLabelingJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelDataLabelingJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelDataLabelingJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes cancelDataLabelingJob with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelDataLabelingJob(request), expectedError); - assert((client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelDataLabelingJob with closed client', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelDataLabelingJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelDataLabelingJob(request), expectedError); - }); - }); - - describe('createHyperparameterTuningJob', () => { - it('invokes createHyperparameterTuningJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateHyperparameterTuningJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()); - client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCall(expectedResponse); - const [response] = await client.createHyperparameterTuningJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createHyperparameterTuningJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateHyperparameterTuningJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()); - client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createHyperparameterTuningJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createHyperparameterTuningJob with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateHyperparameterTuningJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createHyperparameterTuningJob(request), expectedError); - assert((client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createHyperparameterTuningJob with closed client', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateHyperparameterTuningJobRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createHyperparameterTuningJob(request), expectedError); - }); - }); - - describe('getHyperparameterTuningJob', () => { - it('invokes getHyperparameterTuningJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()); - client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCall(expectedResponse); - const [response] = await client.getHyperparameterTuningJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getHyperparameterTuningJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()); - client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getHyperparameterTuningJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getHyperparameterTuningJob with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getHyperparameterTuningJob(request), expectedError); - assert((client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getHyperparameterTuningJob with closed client', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetHyperparameterTuningJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getHyperparameterTuningJob(request), expectedError); - }); - }); - - describe('cancelHyperparameterTuningJob', () => { - it('invokes cancelHyperparameterTuningJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelHyperparameterTuningJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelHyperparameterTuningJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelHyperparameterTuningJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes cancelHyperparameterTuningJob with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelHyperparameterTuningJob(request), expectedError); - assert((client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelHyperparameterTuningJob with closed client', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelHyperparameterTuningJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelHyperparameterTuningJob(request), expectedError); - }); - }); - - describe('createBatchPredictionJob', () => { - it('invokes createBatchPredictionJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateBatchPredictionJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()); - client.innerApiCalls.createBatchPredictionJob = stubSimpleCall(expectedResponse); - const [response] = await client.createBatchPredictionJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createBatchPredictionJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateBatchPredictionJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()); - client.innerApiCalls.createBatchPredictionJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createBatchPredictionJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createBatchPredictionJob with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateBatchPredictionJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createBatchPredictionJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createBatchPredictionJob(request), expectedError); - assert((client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createBatchPredictionJob with closed client', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateBatchPredictionJobRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createBatchPredictionJob(request), expectedError); - }); - }); - - describe('getBatchPredictionJob', () => { - it('invokes getBatchPredictionJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()); - client.innerApiCalls.getBatchPredictionJob = stubSimpleCall(expectedResponse); - const [response] = await client.getBatchPredictionJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getBatchPredictionJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()); - client.innerApiCalls.getBatchPredictionJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getBatchPredictionJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getBatchPredictionJob with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getBatchPredictionJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBatchPredictionJob(request), expectedError); - assert((client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getBatchPredictionJob with closed client', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetBatchPredictionJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getBatchPredictionJob(request), expectedError); - }); - }); - - describe('cancelBatchPredictionJob', () => { - it('invokes cancelBatchPredictionJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelBatchPredictionJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelBatchPredictionJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelBatchPredictionJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes cancelBatchPredictionJob with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelBatchPredictionJob(request), expectedError); - assert((client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelBatchPredictionJob with closed client', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelBatchPredictionJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelBatchPredictionJob(request), expectedError); - }); - }); - - describe('createModelDeploymentMonitoringJob', () => { - it('invokes createModelDeploymentMonitoringJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateModelDeploymentMonitoringJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()); - client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); - const [response] = await client.createModelDeploymentMonitoringJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createModelDeploymentMonitoringJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateModelDeploymentMonitoringJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()); - client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createModelDeploymentMonitoringJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createModelDeploymentMonitoringJob with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateModelDeploymentMonitoringJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createModelDeploymentMonitoringJob(request), expectedError); - assert((client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createModelDeploymentMonitoringJob with closed client', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateModelDeploymentMonitoringJobRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createModelDeploymentMonitoringJob(request), expectedError); - }); - }); - - describe('getModelDeploymentMonitoringJob', () => { - it('invokes getModelDeploymentMonitoringJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()); - client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); - const [response] = await client.getModelDeploymentMonitoringJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getModelDeploymentMonitoringJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()); - client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getModelDeploymentMonitoringJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getModelDeploymentMonitoringJob with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getModelDeploymentMonitoringJob(request), expectedError); - assert((client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getModelDeploymentMonitoringJob with closed client', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getModelDeploymentMonitoringJob(request), expectedError); - }); - }); - - describe('pauseModelDeploymentMonitoringJob', () => { - it('invokes pauseModelDeploymentMonitoringJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PauseModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); - const [response] = await client.pauseModelDeploymentMonitoringJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes pauseModelDeploymentMonitoringJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PauseModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.pauseModelDeploymentMonitoringJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes pauseModelDeploymentMonitoringJob with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PauseModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.pauseModelDeploymentMonitoringJob(request), expectedError); - assert((client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes pauseModelDeploymentMonitoringJob with closed client', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PauseModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.pauseModelDeploymentMonitoringJob(request), expectedError); - }); - }); - - describe('resumeModelDeploymentMonitoringJob', () => { - it('invokes resumeModelDeploymentMonitoringJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ResumeModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); - const [response] = await client.resumeModelDeploymentMonitoringJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes resumeModelDeploymentMonitoringJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ResumeModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.resumeModelDeploymentMonitoringJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes resumeModelDeploymentMonitoringJob with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ResumeModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.resumeModelDeploymentMonitoringJob(request), expectedError); - assert((client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes resumeModelDeploymentMonitoringJob with closed client', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ResumeModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.resumeModelDeploymentMonitoringJob(request), expectedError); - }); - }); - - describe('deleteCustomJob', () => { - it('invokes deleteCustomJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteCustomJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteCustomJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteCustomJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteCustomJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteCustomJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteCustomJob with call error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCustomJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteCustomJob(request), expectedError); - assert((client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteCustomJob with LRO error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteCustomJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCustomJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteCustomJob(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteCustomJobProgress without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteCustomJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteCustomJobProgress with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteCustomJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteDataLabelingJob', () => { - it('invokes deleteDataLabelingJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteDataLabelingJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteDataLabelingJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteDataLabelingJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteDataLabelingJob with call error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteDataLabelingJob(request), expectedError); - assert((client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteDataLabelingJob with LRO error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteDataLabelingJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteDataLabelingJob(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteDataLabelingJobProgress without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteDataLabelingJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteDataLabelingJobProgress with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteDataLabelingJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteHyperparameterTuningJob', () => { - it('invokes deleteHyperparameterTuningJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteHyperparameterTuningJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteHyperparameterTuningJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteHyperparameterTuningJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteHyperparameterTuningJob with call error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteHyperparameterTuningJob(request), expectedError); - assert((client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteHyperparameterTuningJob with LRO error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteHyperparameterTuningJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteHyperparameterTuningJob(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteHyperparameterTuningJobProgress without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteHyperparameterTuningJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteHyperparameterTuningJobProgress with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteHyperparameterTuningJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteBatchPredictionJob', () => { - it('invokes deleteBatchPredictionJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteBatchPredictionJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteBatchPredictionJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteBatchPredictionJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteBatchPredictionJob with call error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteBatchPredictionJob(request), expectedError); - assert((client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteBatchPredictionJob with LRO error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteBatchPredictionJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteBatchPredictionJob(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteBatchPredictionJobProgress without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteBatchPredictionJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteBatchPredictionJobProgress with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteBatchPredictionJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateModelDeploymentMonitoringJob', () => { - it('invokes updateModelDeploymentMonitoringJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateModelDeploymentMonitoringJobRequest()); - request.modelDeploymentMonitoringJob = {}; - request.modelDeploymentMonitoringJob.name = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateModelDeploymentMonitoringJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateModelDeploymentMonitoringJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateModelDeploymentMonitoringJobRequest()); - request.modelDeploymentMonitoringJob = {}; - request.modelDeploymentMonitoringJob.name = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateModelDeploymentMonitoringJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateModelDeploymentMonitoringJob with call error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateModelDeploymentMonitoringJobRequest()); - request.modelDeploymentMonitoringJob = {}; - request.modelDeploymentMonitoringJob.name = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateModelDeploymentMonitoringJob(request), expectedError); - assert((client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateModelDeploymentMonitoringJob with LRO error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateModelDeploymentMonitoringJobRequest()); - request.modelDeploymentMonitoringJob = {}; - request.modelDeploymentMonitoringJob.name = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateModelDeploymentMonitoringJob(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUpdateModelDeploymentMonitoringJobProgress without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateModelDeploymentMonitoringJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateModelDeploymentMonitoringJobProgress with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateModelDeploymentMonitoringJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteModelDeploymentMonitoringJob', () => { - it('invokes deleteModelDeploymentMonitoringJob without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteModelDeploymentMonitoringJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteModelDeploymentMonitoringJob without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteModelDeploymentMonitoringJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteModelDeploymentMonitoringJob with call error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteModelDeploymentMonitoringJob(request), expectedError); - assert((client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteModelDeploymentMonitoringJob with LRO error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelDeploymentMonitoringJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteModelDeploymentMonitoringJob(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteModelDeploymentMonitoringJobProgress without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteModelDeploymentMonitoringJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteModelDeploymentMonitoringJobProgress with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteModelDeploymentMonitoringJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listCustomJobs', () => { - it('invokes listCustomJobs without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListCustomJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), - ]; - client.innerApiCalls.listCustomJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listCustomJobs(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listCustomJobs without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListCustomJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), - ]; - client.innerApiCalls.listCustomJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listCustomJobs( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ICustomJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listCustomJobs with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListCustomJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listCustomJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listCustomJobs(request), expectedError); - assert((client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listCustomJobsStream without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListCustomJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), - ]; - client.descriptors.page.listCustomJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listCustomJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.CustomJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.CustomJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listCustomJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listCustomJobs, request)); - assert.strictEqual( - (client.descriptors.page.listCustomJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listCustomJobsStream with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListCustomJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listCustomJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listCustomJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.CustomJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.CustomJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listCustomJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listCustomJobs, request)); - assert.strictEqual( - (client.descriptors.page.listCustomJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listCustomJobs without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListCustomJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CustomJob()), - ]; - client.descriptors.page.listCustomJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.ICustomJob[] = []; - const iterable = client.listCustomJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listCustomJobs with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListCustomJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listCustomJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listCustomJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.ICustomJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listDataLabelingJobs', () => { - it('invokes listDataLabelingJobs without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataLabelingJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), - ]; - client.innerApiCalls.listDataLabelingJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listDataLabelingJobs(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDataLabelingJobs without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataLabelingJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), - ]; - client.innerApiCalls.listDataLabelingJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDataLabelingJobs( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listDataLabelingJobs with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataLabelingJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listDataLabelingJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDataLabelingJobs(request), expectedError); - assert((client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDataLabelingJobsStream without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataLabelingJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), - ]; - client.descriptors.page.listDataLabelingJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDataLabelingJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.DataLabelingJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DataLabelingJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDataLabelingJobs, request)); - assert.strictEqual( - (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listDataLabelingJobsStream with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataLabelingJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listDataLabelingJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDataLabelingJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.DataLabelingJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DataLabelingJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDataLabelingJobs, request)); - assert.strictEqual( - (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDataLabelingJobs without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataLabelingJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob()), - ]; - client.descriptors.page.listDataLabelingJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob[] = []; - const iterable = client.listDataLabelingJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDataLabelingJobs with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListDataLabelingJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listDataLabelingJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDataLabelingJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IDataLabelingJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listHyperparameterTuningJobs', () => { - it('invokes listHyperparameterTuningJobs without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), - ]; - client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listHyperparameterTuningJobs(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listHyperparameterTuningJobs without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), - ]; - client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listHyperparameterTuningJobs( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listHyperparameterTuningJobs with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listHyperparameterTuningJobs(request), expectedError); - assert((client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listHyperparameterTuningJobsStream without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), - ]; - client.descriptors.page.listHyperparameterTuningJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listHyperparameterTuningJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listHyperparameterTuningJobs, request)); - assert.strictEqual( - (client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listHyperparameterTuningJobsStream with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listHyperparameterTuningJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listHyperparameterTuningJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listHyperparameterTuningJobs, request)); - assert.strictEqual( - (client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listHyperparameterTuningJobs without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob()), - ]; - client.descriptors.page.listHyperparameterTuningJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob[] = []; - const iterable = client.listHyperparameterTuningJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listHyperparameterTuningJobs with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listHyperparameterTuningJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listHyperparameterTuningJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IHyperparameterTuningJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listBatchPredictionJobs', () => { - it('invokes listBatchPredictionJobs without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), - ]; - client.innerApiCalls.listBatchPredictionJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listBatchPredictionJobs(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listBatchPredictionJobs without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), - ]; - client.innerApiCalls.listBatchPredictionJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listBatchPredictionJobs( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listBatchPredictionJobs with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listBatchPredictionJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listBatchPredictionJobs(request), expectedError); - assert((client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listBatchPredictionJobsStream without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), - ]; - client.descriptors.page.listBatchPredictionJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBatchPredictionJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBatchPredictionJobs, request)); - assert.strictEqual( - (client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listBatchPredictionJobsStream with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listBatchPredictionJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listBatchPredictionJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBatchPredictionJobs, request)); - assert.strictEqual( - (client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listBatchPredictionJobs without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob()), - ]; - client.descriptors.page.listBatchPredictionJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob[] = []; - const iterable = client.listBatchPredictionJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listBatchPredictionJobs with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listBatchPredictionJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBatchPredictionJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IBatchPredictionJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('searchModelDeploymentMonitoringStatsAnomalies', () => { - it('invokes searchModelDeploymentMonitoringStatsAnomalies without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), - ]; - client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCall(expectedResponse); - const [response] = await client.searchModelDeploymentMonitoringStatsAnomalies(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes searchModelDeploymentMonitoringStatsAnomalies without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), - ]; - client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.searchModelDeploymentMonitoringStatsAnomalies( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModelMonitoringStatsAnomalies[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes searchModelDeploymentMonitoringStatsAnomalies with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchModelDeploymentMonitoringStatsAnomalies(request), expectedError); - assert((client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes searchModelDeploymentMonitoringStatsAnomaliesStream without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), - ]; - client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchModelDeploymentMonitoringStatsAnomaliesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies, request)); - assert.strictEqual( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes searchModelDeploymentMonitoringStatsAnomaliesStream with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job="; - const expectedError = new Error('expected'); - client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchModelDeploymentMonitoringStatsAnomaliesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies, request)); - assert.strictEqual( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with searchModelDeploymentMonitoringStatsAnomalies without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies()), - ]; - client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IModelMonitoringStatsAnomalies[] = []; - const iterable = client.searchModelDeploymentMonitoringStatsAnomaliesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with searchModelDeploymentMonitoringStatsAnomalies with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest()); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = "model_deployment_monitoring_job=";const expectedError = new Error('expected'); - client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchModelDeploymentMonitoringStatsAnomaliesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IModelMonitoringStatsAnomalies[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listModelDeploymentMonitoringJobs', () => { - it('invokes listModelDeploymentMonitoringJobs without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelDeploymentMonitoringJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), - ]; - client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listModelDeploymentMonitoringJobs(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listModelDeploymentMonitoringJobs without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelDeploymentMonitoringJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), - ]; - client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listModelDeploymentMonitoringJobs( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listModelDeploymentMonitoringJobs with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelDeploymentMonitoringJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModelDeploymentMonitoringJobs(request), expectedError); - assert((client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listModelDeploymentMonitoringJobsStream without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelDeploymentMonitoringJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), - ]; - client.descriptors.page.listModelDeploymentMonitoringJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listModelDeploymentMonitoringJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModelDeploymentMonitoringJobs, request)); - assert.strictEqual( - (client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listModelDeploymentMonitoringJobsStream with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelDeploymentMonitoringJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listModelDeploymentMonitoringJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listModelDeploymentMonitoringJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModelDeploymentMonitoringJobs, request)); - assert.strictEqual( - (client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listModelDeploymentMonitoringJobs without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelDeploymentMonitoringJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob()), - ]; - client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob[] = []; - const iterable = client.listModelDeploymentMonitoringJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listModelDeploymentMonitoringJobs with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelDeploymentMonitoringJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listModelDeploymentMonitoringJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IModelDeploymentMonitoringJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1beta1/test/gapic_metadata_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_metadata_service_v1beta1.ts deleted file mode 100644 index b8e83757..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_metadata_service_v1beta1.ts +++ /dev/null @@ -1,5934 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as metadataserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta1.MetadataServiceClient', () => { - it('has servicePath', () => { - const servicePath = metadataserviceModule.v1beta1.MetadataServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = metadataserviceModule.v1beta1.MetadataServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = metadataserviceModule.v1beta1.MetadataServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.metadataServiceStub, undefined); - await client.initialize(); - assert(client.metadataServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.metadataServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.metadataServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('getMetadataStore', () => { - it('invokes getMetadataStore without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetMetadataStoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()); - client.innerApiCalls.getMetadataStore = stubSimpleCall(expectedResponse); - const [response] = await client.getMetadataStore(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getMetadataStore without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetMetadataStoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()); - client.innerApiCalls.getMetadataStore = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getMetadataStore( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IMetadataStore|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getMetadataStore with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetMetadataStoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getMetadataStore = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getMetadataStore(request), expectedError); - assert((client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getMetadataStore with closed client', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetMetadataStoreRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getMetadataStore(request), expectedError); - }); - }); - - describe('createArtifact', () => { - it('invokes createArtifact without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateArtifactRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()); - client.innerApiCalls.createArtifact = stubSimpleCall(expectedResponse); - const [response] = await client.createArtifact(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createArtifact without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateArtifactRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()); - client.innerApiCalls.createArtifact = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createArtifact( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IArtifact|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createArtifact with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateArtifactRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createArtifact = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createArtifact(request), expectedError); - assert((client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createArtifact with closed client', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateArtifactRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createArtifact(request), expectedError); - }); - }); - - describe('getArtifact', () => { - it('invokes getArtifact without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetArtifactRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()); - client.innerApiCalls.getArtifact = stubSimpleCall(expectedResponse); - const [response] = await client.getArtifact(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getArtifact without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetArtifactRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()); - client.innerApiCalls.getArtifact = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getArtifact( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IArtifact|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getArtifact with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetArtifactRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getArtifact = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getArtifact(request), expectedError); - assert((client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getArtifact with closed client', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetArtifactRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getArtifact(request), expectedError); - }); - }); - - describe('updateArtifact', () => { - it('invokes updateArtifact without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateArtifactRequest()); - request.artifact = {}; - request.artifact.name = ''; - const expectedHeaderRequestParams = "artifact.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()); - client.innerApiCalls.updateArtifact = stubSimpleCall(expectedResponse); - const [response] = await client.updateArtifact(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateArtifact without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateArtifactRequest()); - request.artifact = {}; - request.artifact.name = ''; - const expectedHeaderRequestParams = "artifact.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()); - client.innerApiCalls.updateArtifact = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateArtifact( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IArtifact|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateArtifact with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateArtifactRequest()); - request.artifact = {}; - request.artifact.name = ''; - const expectedHeaderRequestParams = "artifact.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateArtifact = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateArtifact(request), expectedError); - assert((client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateArtifact with closed client', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateArtifactRequest()); - request.artifact = {}; - request.artifact.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateArtifact(request), expectedError); - }); - }); - - describe('createContext', () => { - it('invokes createContext without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateContextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()); - client.innerApiCalls.createContext = stubSimpleCall(expectedResponse); - const [response] = await client.createContext(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createContext without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateContextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()); - client.innerApiCalls.createContext = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createContext( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IContext|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createContext with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateContextRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createContext = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createContext(request), expectedError); - assert((client.innerApiCalls.createContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createContext with closed client', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateContextRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createContext(request), expectedError); - }); - }); - - describe('getContext', () => { - it('invokes getContext without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetContextRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()); - client.innerApiCalls.getContext = stubSimpleCall(expectedResponse); - const [response] = await client.getContext(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getContext without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetContextRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()); - client.innerApiCalls.getContext = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getContext( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IContext|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getContext with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetContextRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getContext = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getContext(request), expectedError); - assert((client.innerApiCalls.getContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getContext with closed client', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetContextRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getContext(request), expectedError); - }); - }); - - describe('updateContext', () => { - it('invokes updateContext without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateContextRequest()); - request.context = {}; - request.context.name = ''; - const expectedHeaderRequestParams = "context.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()); - client.innerApiCalls.updateContext = stubSimpleCall(expectedResponse); - const [response] = await client.updateContext(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateContext without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateContextRequest()); - request.context = {}; - request.context.name = ''; - const expectedHeaderRequestParams = "context.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()); - client.innerApiCalls.updateContext = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateContext( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IContext|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateContext with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateContextRequest()); - request.context = {}; - request.context.name = ''; - const expectedHeaderRequestParams = "context.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateContext = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateContext(request), expectedError); - assert((client.innerApiCalls.updateContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateContext with closed client', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateContextRequest()); - request.context = {}; - request.context.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateContext(request), expectedError); - }); - }); - - describe('addContextArtifactsAndExecutions', () => { - it('invokes addContextArtifactsAndExecutions without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsRequest()); - request.context = ''; - const expectedHeaderRequestParams = "context="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsResponse()); - client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCall(expectedResponse); - const [response] = await client.addContextArtifactsAndExecutions(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes addContextArtifactsAndExecutions without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsRequest()); - request.context = ''; - const expectedHeaderRequestParams = "context="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsResponse()); - client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.addContextArtifactsAndExecutions( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IAddContextArtifactsAndExecutionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes addContextArtifactsAndExecutions with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsRequest()); - request.context = ''; - const expectedHeaderRequestParams = "context="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addContextArtifactsAndExecutions(request), expectedError); - assert((client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes addContextArtifactsAndExecutions with closed client', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsRequest()); - request.context = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.addContextArtifactsAndExecutions(request), expectedError); - }); - }); - - describe('addContextChildren', () => { - it('invokes addContextChildren without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextChildrenRequest()); - request.context = ''; - const expectedHeaderRequestParams = "context="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextChildrenResponse()); - client.innerApiCalls.addContextChildren = stubSimpleCall(expectedResponse); - const [response] = await client.addContextChildren(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes addContextChildren without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextChildrenRequest()); - request.context = ''; - const expectedHeaderRequestParams = "context="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextChildrenResponse()); - client.innerApiCalls.addContextChildren = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.addContextChildren( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IAddContextChildrenResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes addContextChildren with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextChildrenRequest()); - request.context = ''; - const expectedHeaderRequestParams = "context="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.addContextChildren = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addContextChildren(request), expectedError); - assert((client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes addContextChildren with closed client', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddContextChildrenRequest()); - request.context = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.addContextChildren(request), expectedError); - }); - }); - - describe('queryContextLineageSubgraph', () => { - it('invokes queryContextLineageSubgraph without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryContextLineageSubgraphRequest()); - request.context = ''; - const expectedHeaderRequestParams = "context="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph()); - client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCall(expectedResponse); - const [response] = await client.queryContextLineageSubgraph(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryContextLineageSubgraph without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryContextLineageSubgraphRequest()); - request.context = ''; - const expectedHeaderRequestParams = "context="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph()); - client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.queryContextLineageSubgraph( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes queryContextLineageSubgraph with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryContextLineageSubgraphRequest()); - request.context = ''; - const expectedHeaderRequestParams = "context="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryContextLineageSubgraph(request), expectedError); - assert((client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryContextLineageSubgraph with closed client', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryContextLineageSubgraphRequest()); - request.context = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.queryContextLineageSubgraph(request), expectedError); - }); - }); - - describe('createExecution', () => { - it('invokes createExecution without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateExecutionRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()); - client.innerApiCalls.createExecution = stubSimpleCall(expectedResponse); - const [response] = await client.createExecution(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createExecution without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateExecutionRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()); - client.innerApiCalls.createExecution = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createExecution( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IExecution|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createExecution with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateExecutionRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createExecution = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createExecution(request), expectedError); - assert((client.innerApiCalls.createExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createExecution with closed client', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateExecutionRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createExecution(request), expectedError); - }); - }); - - describe('getExecution', () => { - it('invokes getExecution without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetExecutionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()); - client.innerApiCalls.getExecution = stubSimpleCall(expectedResponse); - const [response] = await client.getExecution(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getExecution without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetExecutionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()); - client.innerApiCalls.getExecution = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getExecution( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IExecution|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getExecution with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetExecutionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getExecution = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getExecution(request), expectedError); - assert((client.innerApiCalls.getExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getExecution with closed client', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetExecutionRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getExecution(request), expectedError); - }); - }); - - describe('updateExecution', () => { - it('invokes updateExecution without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateExecutionRequest()); - request.execution = {}; - request.execution.name = ''; - const expectedHeaderRequestParams = "execution.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()); - client.innerApiCalls.updateExecution = stubSimpleCall(expectedResponse); - const [response] = await client.updateExecution(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateExecution without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateExecutionRequest()); - request.execution = {}; - request.execution.name = ''; - const expectedHeaderRequestParams = "execution.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()); - client.innerApiCalls.updateExecution = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateExecution( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IExecution|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateExecution with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateExecutionRequest()); - request.execution = {}; - request.execution.name = ''; - const expectedHeaderRequestParams = "execution.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateExecution = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateExecution(request), expectedError); - assert((client.innerApiCalls.updateExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateExecution with closed client', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateExecutionRequest()); - request.execution = {}; - request.execution.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateExecution(request), expectedError); - }); - }); - - describe('addExecutionEvents', () => { - it('invokes addExecutionEvents without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddExecutionEventsRequest()); - request.execution = ''; - const expectedHeaderRequestParams = "execution="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddExecutionEventsResponse()); - client.innerApiCalls.addExecutionEvents = stubSimpleCall(expectedResponse); - const [response] = await client.addExecutionEvents(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes addExecutionEvents without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddExecutionEventsRequest()); - request.execution = ''; - const expectedHeaderRequestParams = "execution="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddExecutionEventsResponse()); - client.innerApiCalls.addExecutionEvents = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.addExecutionEvents( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IAddExecutionEventsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes addExecutionEvents with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddExecutionEventsRequest()); - request.execution = ''; - const expectedHeaderRequestParams = "execution="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.addExecutionEvents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addExecutionEvents(request), expectedError); - assert((client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes addExecutionEvents with closed client', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddExecutionEventsRequest()); - request.execution = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.addExecutionEvents(request), expectedError); - }); - }); - - describe('queryExecutionInputsAndOutputs', () => { - it('invokes queryExecutionInputsAndOutputs without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryExecutionInputsAndOutputsRequest()); - request.execution = ''; - const expectedHeaderRequestParams = "execution="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph()); - client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCall(expectedResponse); - const [response] = await client.queryExecutionInputsAndOutputs(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryExecutionInputsAndOutputs without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryExecutionInputsAndOutputsRequest()); - request.execution = ''; - const expectedHeaderRequestParams = "execution="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph()); - client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.queryExecutionInputsAndOutputs( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes queryExecutionInputsAndOutputs with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryExecutionInputsAndOutputsRequest()); - request.execution = ''; - const expectedHeaderRequestParams = "execution="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryExecutionInputsAndOutputs(request), expectedError); - assert((client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryExecutionInputsAndOutputs with closed client', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryExecutionInputsAndOutputsRequest()); - request.execution = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.queryExecutionInputsAndOutputs(request), expectedError); - }); - }); - - describe('createMetadataSchema', () => { - it('invokes createMetadataSchema without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateMetadataSchemaRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()); - client.innerApiCalls.createMetadataSchema = stubSimpleCall(expectedResponse); - const [response] = await client.createMetadataSchema(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createMetadataSchema without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateMetadataSchemaRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()); - client.innerApiCalls.createMetadataSchema = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createMetadataSchema( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IMetadataSchema|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createMetadataSchema with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateMetadataSchemaRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createMetadataSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createMetadataSchema(request), expectedError); - assert((client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createMetadataSchema with closed client', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateMetadataSchemaRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createMetadataSchema(request), expectedError); - }); - }); - - describe('getMetadataSchema', () => { - it('invokes getMetadataSchema without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetMetadataSchemaRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()); - client.innerApiCalls.getMetadataSchema = stubSimpleCall(expectedResponse); - const [response] = await client.getMetadataSchema(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getMetadataSchema without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetMetadataSchemaRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()); - client.innerApiCalls.getMetadataSchema = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getMetadataSchema( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IMetadataSchema|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getMetadataSchema with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetMetadataSchemaRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getMetadataSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getMetadataSchema(request), expectedError); - assert((client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getMetadataSchema with closed client', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetMetadataSchemaRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getMetadataSchema(request), expectedError); - }); - }); - - describe('queryArtifactLineageSubgraph', () => { - it('invokes queryArtifactLineageSubgraph without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryArtifactLineageSubgraphRequest()); - request.artifact = ''; - const expectedHeaderRequestParams = "artifact="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph()); - client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCall(expectedResponse); - const [response] = await client.queryArtifactLineageSubgraph(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryArtifactLineageSubgraph without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryArtifactLineageSubgraphRequest()); - request.artifact = ''; - const expectedHeaderRequestParams = "artifact="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph()); - client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.queryArtifactLineageSubgraph( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ILineageSubgraph|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes queryArtifactLineageSubgraph with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryArtifactLineageSubgraphRequest()); - request.artifact = ''; - const expectedHeaderRequestParams = "artifact="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryArtifactLineageSubgraph(request), expectedError); - assert((client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryArtifactLineageSubgraph with closed client', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.QueryArtifactLineageSubgraphRequest()); - request.artifact = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.queryArtifactLineageSubgraph(request), expectedError); - }); - }); - - describe('createMetadataStore', () => { - it('invokes createMetadataStore without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateMetadataStoreRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createMetadataStore = stubLongRunningCall(expectedResponse); - const [operation] = await client.createMetadataStore(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createMetadataStore without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateMetadataStoreRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createMetadataStore = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createMetadataStore( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createMetadataStore with call error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateMetadataStoreRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createMetadataStore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createMetadataStore(request), expectedError); - assert((client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createMetadataStore with LRO error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateMetadataStoreRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createMetadataStore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createMetadataStore(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateMetadataStoreProgress without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateMetadataStoreProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateMetadataStoreProgress with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateMetadataStoreProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteMetadataStore', () => { - it('invokes deleteMetadataStore without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteMetadataStoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteMetadataStore(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteMetadataStore without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteMetadataStoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteMetadataStore = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteMetadataStore( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteMetadataStore with call error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteMetadataStoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteMetadataStore(request), expectedError); - assert((client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteMetadataStore with LRO error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteMetadataStoreRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteMetadataStore(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteMetadataStoreProgress without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteMetadataStoreProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteMetadataStoreProgress with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteMetadataStoreProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteArtifact', () => { - it('invokes deleteArtifact without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteArtifactRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteArtifact = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteArtifact(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteArtifact without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteArtifactRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteArtifact = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteArtifact( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteArtifact with call error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteArtifactRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteArtifact = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteArtifact(request), expectedError); - assert((client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteArtifact with LRO error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteArtifactRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteArtifact = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteArtifact(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteArtifactProgress without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteArtifactProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteArtifactProgress with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteArtifactProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('purgeArtifacts', () => { - it('invokes purgeArtifacts without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.purgeArtifacts = stubLongRunningCall(expectedResponse); - const [operation] = await client.purgeArtifacts(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes purgeArtifacts without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.purgeArtifacts = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.purgeArtifacts( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes purgeArtifacts with call error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeArtifacts = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.purgeArtifacts(request), expectedError); - assert((client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes purgeArtifacts with LRO error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeArtifacts = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.purgeArtifacts(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkPurgeArtifactsProgress without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkPurgeArtifactsProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkPurgeArtifactsProgress with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkPurgeArtifactsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteContext', () => { - it('invokes deleteContext without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteContextRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteContext = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteContext(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteContext without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteContextRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteContext = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteContext( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteContext with call error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteContextRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteContext = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteContext(request), expectedError); - assert((client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteContext with LRO error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteContextRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteContext = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteContext(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteContextProgress without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteContextProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteContextProgress with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteContextProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('purgeContexts', () => { - it('invokes purgeContexts without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.purgeContexts = stubLongRunningCall(expectedResponse); - const [operation] = await client.purgeContexts(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes purgeContexts without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.purgeContexts = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.purgeContexts( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes purgeContexts with call error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeContexts = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.purgeContexts(request), expectedError); - assert((client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes purgeContexts with LRO error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeContexts = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.purgeContexts(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkPurgeContextsProgress without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkPurgeContextsProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkPurgeContextsProgress with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkPurgeContextsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteExecution', () => { - it('invokes deleteExecution without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteExecutionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteExecution = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteExecution(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteExecution without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteExecutionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteExecution = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteExecution( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteExecution with call error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteExecutionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteExecution(request), expectedError); - assert((client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteExecution with LRO error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteExecutionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteExecution(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteExecutionProgress without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteExecutionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteExecutionProgress with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteExecutionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('purgeExecutions', () => { - it('invokes purgeExecutions without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.purgeExecutions = stubLongRunningCall(expectedResponse); - const [operation] = await client.purgeExecutions(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes purgeExecutions without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.purgeExecutions = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.purgeExecutions( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes purgeExecutions with call error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeExecutions = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.purgeExecutions(request), expectedError); - assert((client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes purgeExecutions with LRO error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PurgeExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeExecutions = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.purgeExecutions(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkPurgeExecutionsProgress without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkPurgeExecutionsProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkPurgeExecutionsProgress with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkPurgeExecutionsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listMetadataStores', () => { - it('invokes listMetadataStores without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), - ]; - client.innerApiCalls.listMetadataStores = stubSimpleCall(expectedResponse); - const [response] = await client.listMetadataStores(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listMetadataStores without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), - ]; - client.innerApiCalls.listMetadataStores = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listMetadataStores( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IMetadataStore[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listMetadataStores with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listMetadataStores = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listMetadataStores(request), expectedError); - assert((client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listMetadataStoresStream without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), - ]; - client.descriptors.page.listMetadataStores.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listMetadataStoresStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.MetadataStore[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.MetadataStore) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listMetadataStores.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listMetadataStores, request)); - assert.strictEqual( - (client.descriptors.page.listMetadataStores.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listMetadataStoresStream with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listMetadataStores.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listMetadataStoresStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.MetadataStore[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.MetadataStore) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listMetadataStores.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listMetadataStores, request)); - assert.strictEqual( - (client.descriptors.page.listMetadataStores.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listMetadataStores without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataStore()), - ]; - client.descriptors.page.listMetadataStores.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IMetadataStore[] = []; - const iterable = client.listMetadataStoresAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listMetadataStores with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listMetadataStores.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listMetadataStoresAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IMetadataStore[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listArtifacts', () => { - it('invokes listArtifacts without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), - ]; - client.innerApiCalls.listArtifacts = stubSimpleCall(expectedResponse); - const [response] = await client.listArtifacts(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listArtifacts without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), - ]; - client.innerApiCalls.listArtifacts = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listArtifacts( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IArtifact[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listArtifacts with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listArtifacts = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listArtifacts(request), expectedError); - assert((client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listArtifactsStream without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), - ]; - client.descriptors.page.listArtifacts.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listArtifactsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Artifact[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Artifact) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listArtifacts.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listArtifacts, request)); - assert.strictEqual( - (client.descriptors.page.listArtifacts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listArtifactsStream with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listArtifacts.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listArtifactsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Artifact[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Artifact) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listArtifacts.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listArtifacts, request)); - assert.strictEqual( - (client.descriptors.page.listArtifacts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listArtifacts without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Artifact()), - ]; - client.descriptors.page.listArtifacts.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IArtifact[] = []; - const iterable = client.listArtifactsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listArtifacts with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListArtifactsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listArtifacts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listArtifactsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IArtifact[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listContexts', () => { - it('invokes listContexts without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), - ]; - client.innerApiCalls.listContexts = stubSimpleCall(expectedResponse); - const [response] = await client.listContexts(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listContexts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listContexts without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), - ]; - client.innerApiCalls.listContexts = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listContexts( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IContext[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listContexts as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listContexts with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listContexts = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listContexts(request), expectedError); - assert((client.innerApiCalls.listContexts as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listContextsStream without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), - ]; - client.descriptors.page.listContexts.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listContextsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Context[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Context) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listContexts.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listContexts, request)); - assert.strictEqual( - (client.descriptors.page.listContexts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listContextsStream with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listContexts.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listContextsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Context[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Context) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listContexts.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listContexts, request)); - assert.strictEqual( - (client.descriptors.page.listContexts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listContexts without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Context()), - ]; - client.descriptors.page.listContexts.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IContext[] = []; - const iterable = client.listContextsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listContexts.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listContexts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listContexts with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListContextsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listContexts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listContextsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IContext[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listContexts.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listContexts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listExecutions', () => { - it('invokes listExecutions without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), - ]; - client.innerApiCalls.listExecutions = stubSimpleCall(expectedResponse); - const [response] = await client.listExecutions(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listExecutions without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), - ]; - client.innerApiCalls.listExecutions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listExecutions( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IExecution[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listExecutions with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listExecutions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listExecutions(request), expectedError); - assert((client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listExecutionsStream without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), - ]; - client.descriptors.page.listExecutions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listExecutionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Execution[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Execution) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listExecutions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listExecutions, request)); - assert.strictEqual( - (client.descriptors.page.listExecutions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listExecutionsStream with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listExecutions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listExecutionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Execution[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Execution) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listExecutions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listExecutions, request)); - assert.strictEqual( - (client.descriptors.page.listExecutions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listExecutions without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Execution()), - ]; - client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IExecution[] = []; - const iterable = client.listExecutionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listExecutions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listExecutions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listExecutions with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListExecutionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listExecutionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IExecution[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listExecutions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listExecutions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listMetadataSchemas', () => { - it('invokes listMetadataSchemas without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), - ]; - client.innerApiCalls.listMetadataSchemas = stubSimpleCall(expectedResponse); - const [response] = await client.listMetadataSchemas(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listMetadataSchemas without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), - ]; - client.innerApiCalls.listMetadataSchemas = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listMetadataSchemas( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IMetadataSchema[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listMetadataSchemas with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listMetadataSchemas = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listMetadataSchemas(request), expectedError); - assert((client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listMetadataSchemasStream without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), - ]; - client.descriptors.page.listMetadataSchemas.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listMetadataSchemasStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.MetadataSchema[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.MetadataSchema) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listMetadataSchemas.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listMetadataSchemas, request)); - assert.strictEqual( - (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listMetadataSchemasStream with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listMetadataSchemas.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listMetadataSchemasStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.MetadataSchema[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.MetadataSchema) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listMetadataSchemas.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listMetadataSchemas, request)); - assert.strictEqual( - (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listMetadataSchemas without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MetadataSchema()), - ]; - client.descriptors.page.listMetadataSchemas.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IMetadataSchema[] = []; - const iterable = client.listMetadataSchemasAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listMetadataSchemas with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listMetadataSchemas.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listMetadataSchemasAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IMetadataSchema[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1beta1/test/gapic_migration_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_migration_service_v1beta1.ts deleted file mode 100644 index 72c49a1a..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_migration_service_v1beta1.ts +++ /dev/null @@ -1,2246 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as migrationserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta1.MigrationServiceClient', () => { - it('has servicePath', () => { - const servicePath = migrationserviceModule.v1beta1.MigrationServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = migrationserviceModule.v1beta1.MigrationServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = migrationserviceModule.v1beta1.MigrationServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.migrationServiceStub, undefined); - await client.initialize(); - assert(client.migrationServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.migrationServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.migrationServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('batchMigrateResources', () => { - it('invokes batchMigrateResources without error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchMigrateResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.batchMigrateResources = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchMigrateResources(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchMigrateResources without error using callback', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchMigrateResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.batchMigrateResources = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchMigrateResources( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes batchMigrateResources with call error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchMigrateResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchMigrateResources = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchMigrateResources(request), expectedError); - assert((client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchMigrateResources with LRO error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchMigrateResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchMigrateResources = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchMigrateResources(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkBatchMigrateResourcesProgress without error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkBatchMigrateResourcesProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkBatchMigrateResourcesProgress with error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkBatchMigrateResourcesProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('searchMigratableResources', () => { - it('invokes searchMigratableResources without error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchMigratableResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), - ]; - client.innerApiCalls.searchMigratableResources = stubSimpleCall(expectedResponse); - const [response] = await client.searchMigratableResources(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes searchMigratableResources without error using callback', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchMigratableResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), - ]; - client.innerApiCalls.searchMigratableResources = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.searchMigratableResources( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IMigratableResource[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes searchMigratableResources with error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchMigratableResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.searchMigratableResources = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchMigratableResources(request), expectedError); - assert((client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes searchMigratableResourcesStream without error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchMigratableResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), - ]; - client.descriptors.page.searchMigratableResources.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchMigratableResourcesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.MigratableResource[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.MigratableResource) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.searchMigratableResources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchMigratableResources, request)); - assert.strictEqual( - (client.descriptors.page.searchMigratableResources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes searchMigratableResourcesStream with error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchMigratableResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.searchMigratableResources.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchMigratableResourcesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.MigratableResource[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.MigratableResource) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.searchMigratableResources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchMigratableResources, request)); - assert.strictEqual( - (client.descriptors.page.searchMigratableResources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with searchMigratableResources without error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchMigratableResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MigratableResource()), - ]; - client.descriptors.page.searchMigratableResources.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IMigratableResource[] = []; - const iterable = client.searchMigratableResourcesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with searchMigratableResources with error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SearchMigratableResourcesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.searchMigratableResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchMigratableResourcesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IMigratableResource[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1beta1/test/gapic_model_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_model_service_v1beta1.ts deleted file mode 100644 index d21ab56e..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_model_service_v1beta1.ts +++ /dev/null @@ -1,4077 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as modelserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta1.ModelServiceClient', () => { - it('has servicePath', () => { - const servicePath = modelserviceModule.v1beta1.ModelServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = modelserviceModule.v1beta1.ModelServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = modelserviceModule.v1beta1.ModelServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.modelServiceStub, undefined); - await client.initialize(); - assert(client.modelServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.modelServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.modelServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('getModel', () => { - it('invokes getModel without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()); - client.innerApiCalls.getModel = stubSimpleCall(expectedResponse); - const [response] = await client.getModel(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getModel without error using callback', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()); - client.innerApiCalls.getModel = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getModel( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModel|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getModel with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getModel(request), expectedError); - assert((client.innerApiCalls.getModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getModel with closed client', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getModel(request), expectedError); - }); - }); - - describe('updateModel', () => { - it('invokes updateModel without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateModelRequest()); - request.model = {}; - request.model.name = ''; - const expectedHeaderRequestParams = "model.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()); - client.innerApiCalls.updateModel = stubSimpleCall(expectedResponse); - const [response] = await client.updateModel(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateModel without error using callback', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateModelRequest()); - request.model = {}; - request.model.name = ''; - const expectedHeaderRequestParams = "model.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()); - client.innerApiCalls.updateModel = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateModel( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModel|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateModel with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateModelRequest()); - request.model = {}; - request.model.name = ''; - const expectedHeaderRequestParams = "model.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateModel = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateModel(request), expectedError); - assert((client.innerApiCalls.updateModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateModel with closed client', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateModelRequest()); - request.model = {}; - request.model.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateModel(request), expectedError); - }); - }); - - describe('mergeVersionAliases', () => { - it('invokes mergeVersionAliases without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MergeVersionAliasesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()); - client.innerApiCalls.mergeVersionAliases = stubSimpleCall(expectedResponse); - const [response] = await client.mergeVersionAliases(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes mergeVersionAliases without error using callback', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MergeVersionAliasesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()); - client.innerApiCalls.mergeVersionAliases = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.mergeVersionAliases( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModel|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes mergeVersionAliases with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MergeVersionAliasesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.mergeVersionAliases = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.mergeVersionAliases(request), expectedError); - assert((client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes mergeVersionAliases with closed client', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.MergeVersionAliasesRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.mergeVersionAliases(request), expectedError); - }); - }); - - describe('importModelEvaluation', () => { - it('invokes importModelEvaluation without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportModelEvaluationRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()); - client.innerApiCalls.importModelEvaluation = stubSimpleCall(expectedResponse); - const [response] = await client.importModelEvaluation(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes importModelEvaluation without error using callback', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportModelEvaluationRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()); - client.innerApiCalls.importModelEvaluation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.importModelEvaluation( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModelEvaluation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes importModelEvaluation with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportModelEvaluationRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.importModelEvaluation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.importModelEvaluation(request), expectedError); - assert((client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes importModelEvaluation with closed client', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ImportModelEvaluationRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.importModelEvaluation(request), expectedError); - }); - }); - - describe('getModelEvaluation', () => { - it('invokes getModelEvaluation without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelEvaluationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()); - client.innerApiCalls.getModelEvaluation = stubSimpleCall(expectedResponse); - const [response] = await client.getModelEvaluation(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getModelEvaluation without error using callback', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelEvaluationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()); - client.innerApiCalls.getModelEvaluation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getModelEvaluation( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModelEvaluation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getModelEvaluation with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelEvaluationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getModelEvaluation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getModelEvaluation(request), expectedError); - assert((client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getModelEvaluation with closed client', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelEvaluationRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getModelEvaluation(request), expectedError); - }); - }); - - describe('getModelEvaluationSlice', () => { - it('invokes getModelEvaluationSlice without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelEvaluationSliceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()); - client.innerApiCalls.getModelEvaluationSlice = stubSimpleCall(expectedResponse); - const [response] = await client.getModelEvaluationSlice(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getModelEvaluationSlice without error using callback', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelEvaluationSliceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()); - client.innerApiCalls.getModelEvaluationSlice = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getModelEvaluationSlice( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getModelEvaluationSlice with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelEvaluationSliceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getModelEvaluationSlice = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getModelEvaluationSlice(request), expectedError); - assert((client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getModelEvaluationSlice with closed client', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetModelEvaluationSliceRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getModelEvaluationSlice(request), expectedError); - }); - }); - - describe('uploadModel', () => { - it('invokes uploadModel without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UploadModelRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.uploadModel = stubLongRunningCall(expectedResponse); - const [operation] = await client.uploadModel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes uploadModel without error using callback', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UploadModelRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.uploadModel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.uploadModel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes uploadModel with call error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UploadModelRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.uploadModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.uploadModel(request), expectedError); - assert((client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes uploadModel with LRO error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UploadModelRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.uploadModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.uploadModel(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUploadModelProgress without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUploadModelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUploadModelProgress with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUploadModelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateExplanationDataset', () => { - it('invokes updateExplanationDataset without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest()); - request.model = ''; - const expectedHeaderRequestParams = "model="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateExplanationDataset = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateExplanationDataset(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateExplanationDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateExplanationDataset without error using callback', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest()); - request.model = ''; - const expectedHeaderRequestParams = "model="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateExplanationDataset = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateExplanationDataset( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateExplanationDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateExplanationDataset with call error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest()); - request.model = ''; - const expectedHeaderRequestParams = "model="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateExplanationDataset = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateExplanationDataset(request), expectedError); - assert((client.innerApiCalls.updateExplanationDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateExplanationDataset with LRO error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest()); - request.model = ''; - const expectedHeaderRequestParams = "model="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateExplanationDataset = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateExplanationDataset(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.updateExplanationDataset as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUpdateExplanationDatasetProgress without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateExplanationDatasetProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateExplanationDatasetProgress with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateExplanationDatasetProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteModel', () => { - it('invokes deleteModel without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteModel = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteModel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteModel without error using callback', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteModel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteModel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteModel with call error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteModel(request), expectedError); - assert((client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteModel with LRO error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteModel(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteModelProgress without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteModelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteModelProgress with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteModelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteModelVersion', () => { - it('invokes deleteModelVersion without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelVersionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteModelVersion = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteModelVersion(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteModelVersion without error using callback', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelVersionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteModelVersion = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteModelVersion( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteModelVersion with call error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelVersionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModelVersion = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteModelVersion(request), expectedError); - assert((client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteModelVersion with LRO error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteModelVersionRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModelVersion = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteModelVersion(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteModelVersionProgress without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteModelVersionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteModelVersionProgress with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteModelVersionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('exportModel', () => { - it('invokes exportModel without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.exportModel = stubLongRunningCall(expectedResponse); - const [operation] = await client.exportModel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.exportModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes exportModel without error using callback', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.exportModel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.exportModel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.exportModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes exportModel with call error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.exportModel(request), expectedError); - assert((client.innerApiCalls.exportModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes exportModel with LRO error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportModelRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.exportModel(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.exportModel as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkExportModelProgress without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkExportModelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkExportModelProgress with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkExportModelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listModels', () => { - it('invokes listModels without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - ]; - client.innerApiCalls.listModels = stubSimpleCall(expectedResponse); - const [response] = await client.listModels(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listModels as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listModels without error using callback', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - ]; - client.innerApiCalls.listModels = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listModels( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModel[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listModels as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listModels with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listModels = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModels(request), expectedError); - assert((client.innerApiCalls.listModels as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listModelsStream without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - ]; - client.descriptors.page.listModels.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listModelsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Model[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Model) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listModels.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModels, request)); - assert.strictEqual( - (client.descriptors.page.listModels.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listModelsStream with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listModels.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listModelsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Model[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Model) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listModels.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModels, request)); - assert.strictEqual( - (client.descriptors.page.listModels.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listModels without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - ]; - client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IModel[] = []; - const iterable = client.listModelsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listModels.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listModels.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listModels with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listModelsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IModel[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listModels.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listModels.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listModelVersions', () => { - it('invokes listModelVersions without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - ]; - client.innerApiCalls.listModelVersions = stubSimpleCall(expectedResponse); - const [response] = await client.listModelVersions(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listModelVersions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listModelVersions without error using callback', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - ]; - client.innerApiCalls.listModelVersions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listModelVersions( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModel[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listModelVersions as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listModelVersions with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listModelVersions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModelVersions(request), expectedError); - assert((client.innerApiCalls.listModelVersions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listModelVersionsStream without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - ]; - client.descriptors.page.listModelVersions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listModelVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Model[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Model) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listModelVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModelVersions, request)); - assert.strictEqual( - (client.descriptors.page.listModelVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listModelVersionsStream with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedError = new Error('expected'); - client.descriptors.page.listModelVersions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listModelVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Model[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Model) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listModelVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModelVersions, request)); - assert.strictEqual( - (client.descriptors.page.listModelVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listModelVersions without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Model()), - ]; - client.descriptors.page.listModelVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IModel[] = []; - const iterable = client.listModelVersionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listModelVersions with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name=";const expectedError = new Error('expected'); - client.descriptors.page.listModelVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listModelVersionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IModel[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listModelEvaluations', () => { - it('invokes listModelEvaluations without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), - ]; - client.innerApiCalls.listModelEvaluations = stubSimpleCall(expectedResponse); - const [response] = await client.listModelEvaluations(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listModelEvaluations without error using callback', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), - ]; - client.innerApiCalls.listModelEvaluations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listModelEvaluations( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModelEvaluation[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listModelEvaluations with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listModelEvaluations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModelEvaluations(request), expectedError); - assert((client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listModelEvaluationsStream without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), - ]; - client.descriptors.page.listModelEvaluations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listModelEvaluationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.ModelEvaluation[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ModelEvaluation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listModelEvaluations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModelEvaluations, request)); - assert.strictEqual( - (client.descriptors.page.listModelEvaluations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listModelEvaluationsStream with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listModelEvaluations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listModelEvaluationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.ModelEvaluation[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ModelEvaluation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listModelEvaluations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModelEvaluations, request)); - assert.strictEqual( - (client.descriptors.page.listModelEvaluations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listModelEvaluations without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation()), - ]; - client.descriptors.page.listModelEvaluations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IModelEvaluation[] = []; - const iterable = client.listModelEvaluationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listModelEvaluations with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listModelEvaluations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listModelEvaluationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IModelEvaluation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listModelEvaluationSlices', () => { - it('invokes listModelEvaluationSlices without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), - ]; - client.innerApiCalls.listModelEvaluationSlices = stubSimpleCall(expectedResponse); - const [response] = await client.listModelEvaluationSlices(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listModelEvaluationSlices without error using callback', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), - ]; - client.innerApiCalls.listModelEvaluationSlices = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listModelEvaluationSlices( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listModelEvaluationSlices with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listModelEvaluationSlices = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModelEvaluationSlices(request), expectedError); - assert((client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listModelEvaluationSlicesStream without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), - ]; - client.descriptors.page.listModelEvaluationSlices.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listModelEvaluationSlicesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModelEvaluationSlices, request)); - assert.strictEqual( - (client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listModelEvaluationSlicesStream with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listModelEvaluationSlices.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listModelEvaluationSlicesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModelEvaluationSlices, request)); - assert.strictEqual( - (client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listModelEvaluationSlices without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice()), - ]; - client.descriptors.page.listModelEvaluationSlices.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice[] = []; - const iterable = client.listModelEvaluationSlicesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listModelEvaluationSlices with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listModelEvaluationSlices.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listModelEvaluationSlicesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IModelEvaluationSlice[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1beta1/test/gapic_pipeline_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_pipeline_service_v1beta1.ts deleted file mode 100644 index ae4bfd2c..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_pipeline_service_v1beta1.ts +++ /dev/null @@ -1,3195 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as pipelineserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta1.PipelineServiceClient', () => { - it('has servicePath', () => { - const servicePath = pipelineserviceModule.v1beta1.PipelineServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = pipelineserviceModule.v1beta1.PipelineServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = pipelineserviceModule.v1beta1.PipelineServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.pipelineServiceStub, undefined); - await client.initialize(); - assert(client.pipelineServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.pipelineServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.pipelineServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('createTrainingPipeline', () => { - it('invokes createTrainingPipeline without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTrainingPipelineRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()); - client.innerApiCalls.createTrainingPipeline = stubSimpleCall(expectedResponse); - const [response] = await client.createTrainingPipeline(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTrainingPipeline without error using callback', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTrainingPipelineRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()); - client.innerApiCalls.createTrainingPipeline = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTrainingPipeline( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createTrainingPipeline with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTrainingPipelineRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createTrainingPipeline = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTrainingPipeline(request), expectedError); - assert((client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTrainingPipeline with closed client', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTrainingPipelineRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createTrainingPipeline(request), expectedError); - }); - }); - - describe('getTrainingPipeline', () => { - it('invokes getTrainingPipeline without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()); - client.innerApiCalls.getTrainingPipeline = stubSimpleCall(expectedResponse); - const [response] = await client.getTrainingPipeline(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTrainingPipeline without error using callback', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()); - client.innerApiCalls.getTrainingPipeline = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTrainingPipeline( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getTrainingPipeline with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getTrainingPipeline = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTrainingPipeline(request), expectedError); - assert((client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTrainingPipeline with closed client', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTrainingPipelineRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTrainingPipeline(request), expectedError); - }); - }); - - describe('cancelTrainingPipeline', () => { - it('invokes cancelTrainingPipeline without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall(expectedResponse); - const [response] = await client.cancelTrainingPipeline(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelTrainingPipeline without error using callback', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelTrainingPipeline = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelTrainingPipeline( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes cancelTrainingPipeline with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelTrainingPipeline(request), expectedError); - assert((client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelTrainingPipeline with closed client', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelTrainingPipelineRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelTrainingPipeline(request), expectedError); - }); - }); - - describe('createPipelineJob', () => { - it('invokes createPipelineJob without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreatePipelineJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()); - client.innerApiCalls.createPipelineJob = stubSimpleCall(expectedResponse); - const [response] = await client.createPipelineJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createPipelineJob without error using callback', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreatePipelineJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()); - client.innerApiCalls.createPipelineJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createPipelineJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IPipelineJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createPipelineJob with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreatePipelineJobRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createPipelineJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createPipelineJob(request), expectedError); - assert((client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createPipelineJob with closed client', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreatePipelineJobRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createPipelineJob(request), expectedError); - }); - }); - - describe('getPipelineJob', () => { - it('invokes getPipelineJob without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetPipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()); - client.innerApiCalls.getPipelineJob = stubSimpleCall(expectedResponse); - const [response] = await client.getPipelineJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getPipelineJob without error using callback', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetPipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()); - client.innerApiCalls.getPipelineJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getPipelineJob( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IPipelineJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getPipelineJob with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetPipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getPipelineJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getPipelineJob(request), expectedError); - assert((client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getPipelineJob with closed client', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetPipelineJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getPipelineJob(request), expectedError); - }); - }); - - describe('cancelPipelineJob', () => { - it('invokes cancelPipelineJob without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelPipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelPipelineJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelPipelineJob(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelPipelineJob without error using callback', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelPipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelPipelineJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelPipelineJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes cancelPipelineJob with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelPipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelPipelineJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelPipelineJob(request), expectedError); - assert((client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelPipelineJob with closed client', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CancelPipelineJobRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelPipelineJob(request), expectedError); - }); - }); - - describe('deleteTrainingPipeline', () => { - it('invokes deleteTrainingPipeline without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteTrainingPipeline(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTrainingPipeline without error using callback', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTrainingPipeline( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteTrainingPipeline with call error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTrainingPipeline(request), expectedError); - assert((client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTrainingPipeline with LRO error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTrainingPipelineRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTrainingPipeline(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteTrainingPipelineProgress without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteTrainingPipelineProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteTrainingPipelineProgress with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteTrainingPipelineProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deletePipelineJob', () => { - it('invokes deletePipelineJob without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeletePipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deletePipelineJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deletePipelineJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deletePipelineJob without error using callback', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeletePipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deletePipelineJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deletePipelineJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deletePipelineJob with call error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeletePipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deletePipelineJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deletePipelineJob(request), expectedError); - assert((client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deletePipelineJob with LRO error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeletePipelineJobRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deletePipelineJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deletePipelineJob(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeletePipelineJobProgress without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeletePipelineJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeletePipelineJobProgress with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeletePipelineJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listTrainingPipelines', () => { - it('invokes listTrainingPipelines without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), - ]; - client.innerApiCalls.listTrainingPipelines = stubSimpleCall(expectedResponse); - const [response] = await client.listTrainingPipelines(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTrainingPipelines without error using callback', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), - ]; - client.innerApiCalls.listTrainingPipelines = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTrainingPipelines( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listTrainingPipelines with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listTrainingPipelines = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTrainingPipelines(request), expectedError); - assert((client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTrainingPipelinesStream without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), - ]; - client.descriptors.page.listTrainingPipelines.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTrainingPipelinesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.TrainingPipeline[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TrainingPipeline) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listTrainingPipelines.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTrainingPipelines, request)); - assert.strictEqual( - (client.descriptors.page.listTrainingPipelines.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listTrainingPipelinesStream with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listTrainingPipelines.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTrainingPipelinesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.TrainingPipeline[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TrainingPipeline) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTrainingPipelines.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTrainingPipelines, request)); - assert.strictEqual( - (client.descriptors.page.listTrainingPipelines.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTrainingPipelines without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline()), - ]; - client.descriptors.page.listTrainingPipelines.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline[] = []; - const iterable = client.listTrainingPipelinesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTrainingPipelines with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listTrainingPipelines.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTrainingPipelinesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.ITrainingPipeline[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listPipelineJobs', () => { - it('invokes listPipelineJobs without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), - ]; - client.innerApiCalls.listPipelineJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listPipelineJobs(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listPipelineJobs without error using callback', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), - ]; - client.innerApiCalls.listPipelineJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listPipelineJobs( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IPipelineJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listPipelineJobs with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listPipelineJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listPipelineJobs(request), expectedError); - assert((client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listPipelineJobsStream without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), - ]; - client.descriptors.page.listPipelineJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listPipelineJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.PipelineJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.PipelineJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listPipelineJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listPipelineJobs, request)); - assert.strictEqual( - (client.descriptors.page.listPipelineJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listPipelineJobsStream with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listPipelineJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listPipelineJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.PipelineJob[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.PipelineJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listPipelineJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listPipelineJobs, request)); - assert.strictEqual( - (client.descriptors.page.listPipelineJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listPipelineJobs without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PipelineJob()), - ]; - client.descriptors.page.listPipelineJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IPipelineJob[] = []; - const iterable = client.listPipelineJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listPipelineJobs with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listPipelineJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listPipelineJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IPipelineJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1beta1/test/gapic_prediction_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_prediction_service_v1beta1.ts deleted file mode 100644 index 5678ae35..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_prediction_service_v1beta1.ts +++ /dev/null @@ -1,2069 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as predictionserviceModule from '../src'; - -import {protobuf} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -describe('v1beta1.PredictionServiceClient', () => { - it('has servicePath', () => { - const servicePath = predictionserviceModule.v1beta1.PredictionServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = predictionserviceModule.v1beta1.PredictionServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = predictionserviceModule.v1beta1.PredictionServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.predictionServiceStub, undefined); - await client.initialize(); - assert(client.predictionServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.predictionServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.predictionServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('predict', () => { - it('invokes predict without error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PredictRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PredictResponse()); - client.innerApiCalls.predict = stubSimpleCall(expectedResponse); - const [response] = await client.predict(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.predict as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes predict without error using callback', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PredictRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PredictResponse()); - client.innerApiCalls.predict = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.predict( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IPredictResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.predict as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes predict with error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PredictRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.predict = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.predict(request), expectedError); - assert((client.innerApiCalls.predict as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes predict with closed client', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.PredictRequest()); - request.endpoint = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.predict(request), expectedError); - }); - }); - - describe('rawPredict', () => { - it('invokes rawPredict without error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.RawPredictRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.api.HttpBody()); - client.innerApiCalls.rawPredict = stubSimpleCall(expectedResponse); - const [response] = await client.rawPredict(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.rawPredict as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes rawPredict without error using callback', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.RawPredictRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.api.HttpBody()); - client.innerApiCalls.rawPredict = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.rawPredict( - request, - (err?: Error|null, result?: protos.google.api.IHttpBody|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.rawPredict as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes rawPredict with error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.RawPredictRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.rawPredict = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.rawPredict(request), expectedError); - assert((client.innerApiCalls.rawPredict as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes rawPredict with closed client', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.RawPredictRequest()); - request.endpoint = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.rawPredict(request), expectedError); - }); - }); - - describe('explain', () => { - it('invokes explain without error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExplainRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExplainResponse()); - client.innerApiCalls.explain = stubSimpleCall(expectedResponse); - const [response] = await client.explain(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.explain as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes explain without error using callback', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExplainRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExplainResponse()); - client.innerApiCalls.explain = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.explain( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IExplainResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.explain as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes explain with error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExplainRequest()); - request.endpoint = ''; - const expectedHeaderRequestParams = "endpoint="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.explain = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.explain(request), expectedError); - assert((client.innerApiCalls.explain as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes explain with closed client', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExplainRequest()); - request.endpoint = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.explain(request), expectedError); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts deleted file mode 100644 index deb7af9a..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts +++ /dev/null @@ -1,2635 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as specialistpoolserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta1.SpecialistPoolServiceClient', () => { - it('has servicePath', () => { - const servicePath = specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.specialistPoolServiceStub, undefined); - await client.initialize(); - assert(client.specialistPoolServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.specialistPoolServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.specialistPoolServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('getSpecialistPool', () => { - it('invokes getSpecialistPool without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetSpecialistPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()); - client.innerApiCalls.getSpecialistPool = stubSimpleCall(expectedResponse); - const [response] = await client.getSpecialistPool(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getSpecialistPool without error using callback', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetSpecialistPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()); - client.innerApiCalls.getSpecialistPool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSpecialistPool( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ISpecialistPool|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getSpecialistPool with error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetSpecialistPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getSpecialistPool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSpecialistPool(request), expectedError); - assert((client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getSpecialistPool with closed client', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetSpecialistPoolRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getSpecialistPool(request), expectedError); - }); - }); - - describe('createSpecialistPool', () => { - it('invokes createSpecialistPool without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateSpecialistPoolRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createSpecialistPool = stubLongRunningCall(expectedResponse); - const [operation] = await client.createSpecialistPool(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createSpecialistPool without error using callback', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateSpecialistPoolRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createSpecialistPool = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSpecialistPool( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createSpecialistPool with call error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateSpecialistPoolRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createSpecialistPool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createSpecialistPool(request), expectedError); - assert((client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createSpecialistPool with LRO error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateSpecialistPoolRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createSpecialistPool(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateSpecialistPoolProgress without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateSpecialistPoolProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateSpecialistPoolProgress with error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateSpecialistPoolProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteSpecialistPool', () => { - it('invokes deleteSpecialistPool without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteSpecialistPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteSpecialistPool(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteSpecialistPool without error using callback', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteSpecialistPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteSpecialistPool = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteSpecialistPool( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteSpecialistPool with call error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteSpecialistPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteSpecialistPool(request), expectedError); - assert((client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteSpecialistPool with LRO error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteSpecialistPoolRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteSpecialistPool(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteSpecialistPoolProgress without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteSpecialistPoolProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteSpecialistPoolProgress with error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteSpecialistPoolProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateSpecialistPool', () => { - it('invokes updateSpecialistPool without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateSpecialistPoolRequest()); - request.specialistPool = {}; - request.specialistPool.name = ''; - const expectedHeaderRequestParams = "specialist_pool.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateSpecialistPool(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateSpecialistPool without error using callback', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateSpecialistPoolRequest()); - request.specialistPool = {}; - request.specialistPool.name = ''; - const expectedHeaderRequestParams = "specialist_pool.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateSpecialistPool = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateSpecialistPool( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateSpecialistPool with call error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateSpecialistPoolRequest()); - request.specialistPool = {}; - request.specialistPool.name = ''; - const expectedHeaderRequestParams = "specialist_pool.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateSpecialistPool(request), expectedError); - assert((client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateSpecialistPool with LRO error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateSpecialistPoolRequest()); - request.specialistPool = {}; - request.specialistPool.name = ''; - const expectedHeaderRequestParams = "specialist_pool.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateSpecialistPool(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUpdateSpecialistPoolProgress without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateSpecialistPoolProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateSpecialistPoolProgress with error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateSpecialistPoolProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listSpecialistPools', () => { - it('invokes listSpecialistPools without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListSpecialistPoolsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), - ]; - client.innerApiCalls.listSpecialistPools = stubSimpleCall(expectedResponse); - const [response] = await client.listSpecialistPools(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listSpecialistPools without error using callback', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListSpecialistPoolsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), - ]; - client.innerApiCalls.listSpecialistPools = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSpecialistPools( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ISpecialistPool[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listSpecialistPools with error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListSpecialistPoolsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listSpecialistPools = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSpecialistPools(request), expectedError); - assert((client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listSpecialistPoolsStream without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListSpecialistPoolsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), - ]; - client.descriptors.page.listSpecialistPools.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSpecialistPoolsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.SpecialistPool[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.SpecialistPool) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listSpecialistPools.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSpecialistPools, request)); - assert.strictEqual( - (client.descriptors.page.listSpecialistPools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listSpecialistPoolsStream with error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListSpecialistPoolsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listSpecialistPools.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSpecialistPoolsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.SpecialistPool[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.SpecialistPool) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSpecialistPools.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSpecialistPools, request)); - assert.strictEqual( - (client.descriptors.page.listSpecialistPools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listSpecialistPools without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListSpecialistPoolsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SpecialistPool()), - ]; - client.descriptors.page.listSpecialistPools.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.ISpecialistPool[] = []; - const iterable = client.listSpecialistPoolsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listSpecialistPools with error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListSpecialistPoolsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listSpecialistPools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSpecialistPoolsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.ISpecialistPool[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1beta1/test/gapic_tensorboard_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_tensorboard_service_v1beta1.ts deleted file mode 100644 index f5f87213..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_tensorboard_service_v1beta1.ts +++ /dev/null @@ -1,5557 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as tensorboardserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubServerStreamingCall(response?: ResponseType, error?: Error) { - const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // write something to the stream to trigger transformStub and send the response back to the client - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - return sinon.stub().returns(mockStream); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta1.TensorboardServiceClient', () => { - it('has servicePath', () => { - const servicePath = tensorboardserviceModule.v1beta1.TensorboardServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = tensorboardserviceModule.v1beta1.TensorboardServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = tensorboardserviceModule.v1beta1.TensorboardServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.tensorboardServiceStub, undefined); - await client.initialize(); - assert(client.tensorboardServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.tensorboardServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.tensorboardServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('getTensorboard', () => { - it('invokes getTensorboard without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()); - client.innerApiCalls.getTensorboard = stubSimpleCall(expectedResponse); - const [response] = await client.getTensorboard(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTensorboard without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()); - client.innerApiCalls.getTensorboard = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTensorboard( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboard|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getTensorboard with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getTensorboard = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTensorboard(request), expectedError); - assert((client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTensorboard with closed client', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTensorboard(request), expectedError); - }); - }); - - describe('createTensorboardExperiment', () => { - it('invokes createTensorboardExperiment without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardExperimentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()); - client.innerApiCalls.createTensorboardExperiment = stubSimpleCall(expectedResponse); - const [response] = await client.createTensorboardExperiment(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTensorboardExperiment without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardExperimentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()); - client.innerApiCalls.createTensorboardExperiment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTensorboardExperiment( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createTensorboardExperiment with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardExperimentRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboardExperiment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTensorboardExperiment(request), expectedError); - assert((client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTensorboardExperiment with closed client', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardExperimentRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createTensorboardExperiment(request), expectedError); - }); - }); - - describe('getTensorboardExperiment', () => { - it('invokes getTensorboardExperiment without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardExperimentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()); - client.innerApiCalls.getTensorboardExperiment = stubSimpleCall(expectedResponse); - const [response] = await client.getTensorboardExperiment(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTensorboardExperiment without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardExperimentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()); - client.innerApiCalls.getTensorboardExperiment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTensorboardExperiment( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getTensorboardExperiment with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardExperimentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getTensorboardExperiment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTensorboardExperiment(request), expectedError); - assert((client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTensorboardExperiment with closed client', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardExperimentRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTensorboardExperiment(request), expectedError); - }); - }); - - describe('updateTensorboardExperiment', () => { - it('invokes updateTensorboardExperiment without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardExperimentRequest()); - request.tensorboardExperiment = {}; - request.tensorboardExperiment.name = ''; - const expectedHeaderRequestParams = "tensorboard_experiment.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()); - client.innerApiCalls.updateTensorboardExperiment = stubSimpleCall(expectedResponse); - const [response] = await client.updateTensorboardExperiment(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateTensorboardExperiment without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardExperimentRequest()); - request.tensorboardExperiment = {}; - request.tensorboardExperiment.name = ''; - const expectedHeaderRequestParams = "tensorboard_experiment.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()); - client.innerApiCalls.updateTensorboardExperiment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateTensorboardExperiment( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateTensorboardExperiment with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardExperimentRequest()); - request.tensorboardExperiment = {}; - request.tensorboardExperiment.name = ''; - const expectedHeaderRequestParams = "tensorboard_experiment.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboardExperiment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateTensorboardExperiment(request), expectedError); - assert((client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateTensorboardExperiment with closed client', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardExperimentRequest()); - request.tensorboardExperiment = {}; - request.tensorboardExperiment.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateTensorboardExperiment(request), expectedError); - }); - }); - - describe('createTensorboardRun', () => { - it('invokes createTensorboardRun without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardRunRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()); - client.innerApiCalls.createTensorboardRun = stubSimpleCall(expectedResponse); - const [response] = await client.createTensorboardRun(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTensorboardRun without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardRunRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()); - client.innerApiCalls.createTensorboardRun = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTensorboardRun( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardRun|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createTensorboardRun with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardRunRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboardRun = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTensorboardRun(request), expectedError); - assert((client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTensorboardRun with closed client', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardRunRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createTensorboardRun(request), expectedError); - }); - }); - - describe('batchCreateTensorboardRuns', () => { - it('invokes batchCreateTensorboardRuns without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsResponse()); - client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCall(expectedResponse); - const [response] = await client.batchCreateTensorboardRuns(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchCreateTensorboardRuns without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsResponse()); - client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchCreateTensorboardRuns( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardRunsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes batchCreateTensorboardRuns with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchCreateTensorboardRuns(request), expectedError); - assert((client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchCreateTensorboardRuns with closed client', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchCreateTensorboardRuns(request), expectedError); - }); - }); - - describe('getTensorboardRun', () => { - it('invokes getTensorboardRun without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardRunRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()); - client.innerApiCalls.getTensorboardRun = stubSimpleCall(expectedResponse); - const [response] = await client.getTensorboardRun(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTensorboardRun without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardRunRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()); - client.innerApiCalls.getTensorboardRun = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTensorboardRun( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardRun|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getTensorboardRun with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardRunRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getTensorboardRun = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTensorboardRun(request), expectedError); - assert((client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTensorboardRun with closed client', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardRunRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTensorboardRun(request), expectedError); - }); - }); - - describe('updateTensorboardRun', () => { - it('invokes updateTensorboardRun without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardRunRequest()); - request.tensorboardRun = {}; - request.tensorboardRun.name = ''; - const expectedHeaderRequestParams = "tensorboard_run.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()); - client.innerApiCalls.updateTensorboardRun = stubSimpleCall(expectedResponse); - const [response] = await client.updateTensorboardRun(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateTensorboardRun without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardRunRequest()); - request.tensorboardRun = {}; - request.tensorboardRun.name = ''; - const expectedHeaderRequestParams = "tensorboard_run.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()); - client.innerApiCalls.updateTensorboardRun = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateTensorboardRun( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardRun|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateTensorboardRun with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardRunRequest()); - request.tensorboardRun = {}; - request.tensorboardRun.name = ''; - const expectedHeaderRequestParams = "tensorboard_run.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboardRun = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateTensorboardRun(request), expectedError); - assert((client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateTensorboardRun with closed client', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardRunRequest()); - request.tensorboardRun = {}; - request.tensorboardRun.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateTensorboardRun(request), expectedError); - }); - }); - - describe('batchCreateTensorboardTimeSeries', () => { - it('invokes batchCreateTensorboardTimeSeries without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesResponse()); - client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCall(expectedResponse); - const [response] = await client.batchCreateTensorboardTimeSeries(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchCreateTensorboardTimeSeries without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesResponse()); - client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchCreateTensorboardTimeSeries( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IBatchCreateTensorboardTimeSeriesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes batchCreateTensorboardTimeSeries with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchCreateTensorboardTimeSeries(request), expectedError); - assert((client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchCreateTensorboardTimeSeries with closed client', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchCreateTensorboardTimeSeries(request), expectedError); - }); - }); - - describe('createTensorboardTimeSeries', () => { - it('invokes createTensorboardTimeSeries without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()); - client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCall(expectedResponse); - const [response] = await client.createTensorboardTimeSeries(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTensorboardTimeSeries without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()); - client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTensorboardTimeSeries( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createTensorboardTimeSeries with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTensorboardTimeSeries(request), expectedError); - assert((client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTensorboardTimeSeries with closed client', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createTensorboardTimeSeries(request), expectedError); - }); - }); - - describe('getTensorboardTimeSeries', () => { - it('invokes getTensorboardTimeSeries without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardTimeSeriesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()); - client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCall(expectedResponse); - const [response] = await client.getTensorboardTimeSeries(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTensorboardTimeSeries without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardTimeSeriesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()); - client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTensorboardTimeSeries( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getTensorboardTimeSeries with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardTimeSeriesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTensorboardTimeSeries(request), expectedError); - assert((client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTensorboardTimeSeries with closed client', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTensorboardTimeSeriesRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTensorboardTimeSeries(request), expectedError); - }); - }); - - describe('updateTensorboardTimeSeries', () => { - it('invokes updateTensorboardTimeSeries without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardTimeSeriesRequest()); - request.tensorboardTimeSeries = {}; - request.tensorboardTimeSeries.name = ''; - const expectedHeaderRequestParams = "tensorboard_time_series.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()); - client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCall(expectedResponse); - const [response] = await client.updateTensorboardTimeSeries(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateTensorboardTimeSeries without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardTimeSeriesRequest()); - request.tensorboardTimeSeries = {}; - request.tensorboardTimeSeries.name = ''; - const expectedHeaderRequestParams = "tensorboard_time_series.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()); - client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateTensorboardTimeSeries( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateTensorboardTimeSeries with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardTimeSeriesRequest()); - request.tensorboardTimeSeries = {}; - request.tensorboardTimeSeries.name = ''; - const expectedHeaderRequestParams = "tensorboard_time_series.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateTensorboardTimeSeries(request), expectedError); - assert((client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateTensorboardTimeSeries with closed client', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardTimeSeriesRequest()); - request.tensorboardTimeSeries = {}; - request.tensorboardTimeSeries.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateTensorboardTimeSeries(request), expectedError); - }); - }); - - describe('batchReadTensorboardTimeSeriesData', () => { - it('invokes batchReadTensorboardTimeSeriesData without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataRequest()); - request.tensorboard = ''; - const expectedHeaderRequestParams = "tensorboard="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataResponse()); - client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCall(expectedResponse); - const [response] = await client.batchReadTensorboardTimeSeriesData(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchReadTensorboardTimeSeriesData without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataRequest()); - request.tensorboard = ''; - const expectedHeaderRequestParams = "tensorboard="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataResponse()); - client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchReadTensorboardTimeSeriesData( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IBatchReadTensorboardTimeSeriesDataResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes batchReadTensorboardTimeSeriesData with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataRequest()); - request.tensorboard = ''; - const expectedHeaderRequestParams = "tensorboard="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchReadTensorboardTimeSeriesData(request), expectedError); - assert((client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes batchReadTensorboardTimeSeriesData with closed client', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataRequest()); - request.tensorboard = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchReadTensorboardTimeSeriesData(request), expectedError); - }); - }); - - describe('readTensorboardTimeSeriesData', () => { - it('invokes readTensorboardTimeSeriesData without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataResponse()); - client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCall(expectedResponse); - const [response] = await client.readTensorboardTimeSeriesData(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes readTensorboardTimeSeriesData without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataResponse()); - client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.readTensorboardTimeSeriesData( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IReadTensorboardTimeSeriesDataResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes readTensorboardTimeSeriesData with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.readTensorboardTimeSeriesData(request), expectedError); - assert((client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes readTensorboardTimeSeriesData with closed client', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.readTensorboardTimeSeriesData(request), expectedError); - }); - }); - - describe('writeTensorboardExperimentData', () => { - it('invokes writeTensorboardExperimentData without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataRequest()); - request.tensorboardExperiment = ''; - const expectedHeaderRequestParams = "tensorboard_experiment="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataResponse()); - client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCall(expectedResponse); - const [response] = await client.writeTensorboardExperimentData(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes writeTensorboardExperimentData without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataRequest()); - request.tensorboardExperiment = ''; - const expectedHeaderRequestParams = "tensorboard_experiment="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataResponse()); - client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.writeTensorboardExperimentData( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardExperimentDataResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes writeTensorboardExperimentData with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataRequest()); - request.tensorboardExperiment = ''; - const expectedHeaderRequestParams = "tensorboard_experiment="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.writeTensorboardExperimentData(request), expectedError); - assert((client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes writeTensorboardExperimentData with closed client', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataRequest()); - request.tensorboardExperiment = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.writeTensorboardExperimentData(request), expectedError); - }); - }); - - describe('writeTensorboardRunData', () => { - it('invokes writeTensorboardRunData without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataRequest()); - request.tensorboardRun = ''; - const expectedHeaderRequestParams = "tensorboard_run="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataResponse()); - client.innerApiCalls.writeTensorboardRunData = stubSimpleCall(expectedResponse); - const [response] = await client.writeTensorboardRunData(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes writeTensorboardRunData without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataRequest()); - request.tensorboardRun = ''; - const expectedHeaderRequestParams = "tensorboard_run="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataResponse()); - client.innerApiCalls.writeTensorboardRunData = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.writeTensorboardRunData( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IWriteTensorboardRunDataResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes writeTensorboardRunData with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataRequest()); - request.tensorboardRun = ''; - const expectedHeaderRequestParams = "tensorboard_run="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.writeTensorboardRunData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.writeTensorboardRunData(request), expectedError); - assert((client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes writeTensorboardRunData with closed client', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataRequest()); - request.tensorboardRun = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.writeTensorboardRunData(request), expectedError); - }); - }); - - describe('createTensorboard', () => { - it('invokes createTensorboard without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createTensorboard = stubLongRunningCall(expectedResponse); - const [operation] = await client.createTensorboard(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTensorboard without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createTensorboard = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTensorboard( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createTensorboard with call error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboard = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createTensorboard(request), expectedError); - assert((client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTensorboard with LRO error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboard = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createTensorboard(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateTensorboardProgress without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateTensorboardProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateTensorboardProgress with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateTensorboardProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateTensorboard', () => { - it('invokes updateTensorboard without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardRequest()); - request.tensorboard = {}; - request.tensorboard.name = ''; - const expectedHeaderRequestParams = "tensorboard.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateTensorboard = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateTensorboard(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateTensorboard without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardRequest()); - request.tensorboard = {}; - request.tensorboard.name = ''; - const expectedHeaderRequestParams = "tensorboard.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateTensorboard = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateTensorboard( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateTensorboard with call error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardRequest()); - request.tensorboard = {}; - request.tensorboard.name = ''; - const expectedHeaderRequestParams = "tensorboard.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboard = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateTensorboard(request), expectedError); - assert((client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateTensorboard with LRO error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardRequest()); - request.tensorboard = {}; - request.tensorboard.name = ''; - const expectedHeaderRequestParams = "tensorboard.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboard = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateTensorboard(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUpdateTensorboardProgress without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateTensorboardProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateTensorboardProgress with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateTensorboardProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteTensorboard', () => { - it('invokes deleteTensorboard without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTensorboard = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteTensorboard(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTensorboard without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTensorboard = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTensorboard( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteTensorboard with call error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboard = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTensorboard(request), expectedError); - assert((client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTensorboard with LRO error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboard = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTensorboard(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteTensorboardProgress without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteTensorboardProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteTensorboardProgress with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteTensorboardProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteTensorboardExperiment', () => { - it('invokes deleteTensorboardExperiment without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardExperimentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteTensorboardExperiment(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTensorboardExperiment without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardExperimentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTensorboardExperiment( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteTensorboardExperiment with call error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardExperimentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTensorboardExperiment(request), expectedError); - assert((client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTensorboardExperiment with LRO error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardExperimentRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTensorboardExperiment(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteTensorboardExperimentProgress without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteTensorboardExperimentProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteTensorboardExperimentProgress with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteTensorboardExperimentProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteTensorboardRun', () => { - it('invokes deleteTensorboardRun without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardRunRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteTensorboardRun(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTensorboardRun without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardRunRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTensorboardRun = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTensorboardRun( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteTensorboardRun with call error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardRunRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTensorboardRun(request), expectedError); - assert((client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTensorboardRun with LRO error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardRunRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTensorboardRun(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteTensorboardRunProgress without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteTensorboardRunProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteTensorboardRunProgress with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteTensorboardRunProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteTensorboardTimeSeries', () => { - it('invokes deleteTensorboardTimeSeries without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardTimeSeriesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteTensorboardTimeSeries(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTensorboardTimeSeries without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardTimeSeriesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTensorboardTimeSeries( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteTensorboardTimeSeries with call error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardTimeSeriesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTensorboardTimeSeries(request), expectedError); - assert((client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTensorboardTimeSeries with LRO error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTensorboardTimeSeriesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTensorboardTimeSeries(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteTensorboardTimeSeriesProgress without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteTensorboardTimeSeriesProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteTensorboardTimeSeriesProgress with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteTensorboardTimeSeriesProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('readTensorboardBlobData', () => { - it('invokes readTensorboardBlobData without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataRequest()); - request.timeSeries = ''; - const expectedHeaderRequestParams = "time_series="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataResponse()); - client.innerApiCalls.readTensorboardBlobData = stubServerStreamingCall(expectedResponse); - const stream = client.readTensorboardBlobData(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.readTensorboardBlobData as SinonStub) - .getCall(0).calledWith(request, expectedOptions)); - }); - - it('invokes readTensorboardBlobData with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataRequest()); - request.timeSeries = ''; - const expectedHeaderRequestParams = "time_series="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.readTensorboardBlobData = stubServerStreamingCall(undefined, expectedError); - const stream = client.readTensorboardBlobData(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.innerApiCalls.readTensorboardBlobData as SinonStub) - .getCall(0).calledWith(request, expectedOptions)); - }); - - it('invokes readTensorboardBlobData with closed client', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataRequest()); - request.timeSeries = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - const stream = client.readTensorboardBlobData(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - }); - }); - - describe('listTensorboards', () => { - it('invokes listTensorboards without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), - ]; - client.innerApiCalls.listTensorboards = stubSimpleCall(expectedResponse); - const [response] = await client.listTensorboards(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTensorboards without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), - ]; - client.innerApiCalls.listTensorboards = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTensorboards( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboard[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listTensorboards with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listTensorboards = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTensorboards(request), expectedError); - assert((client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTensorboardsStream without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), - ]; - client.descriptors.page.listTensorboards.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTensorboardsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Tensorboard[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Tensorboard) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listTensorboards.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTensorboards, request)); - assert.strictEqual( - (client.descriptors.page.listTensorboards.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listTensorboardsStream with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listTensorboards.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTensorboardsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Tensorboard[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Tensorboard) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTensorboards.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTensorboards, request)); - assert.strictEqual( - (client.descriptors.page.listTensorboards.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTensorboards without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Tensorboard()), - ]; - client.descriptors.page.listTensorboards.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.ITensorboard[] = []; - const iterable = client.listTensorboardsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTensorboards with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listTensorboards.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTensorboardsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.ITensorboard[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listTensorboardExperiments', () => { - it('invokes listTensorboardExperiments without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), - ]; - client.innerApiCalls.listTensorboardExperiments = stubSimpleCall(expectedResponse); - const [response] = await client.listTensorboardExperiments(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTensorboardExperiments without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), - ]; - client.innerApiCalls.listTensorboardExperiments = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTensorboardExperiments( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listTensorboardExperiments with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listTensorboardExperiments = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTensorboardExperiments(request), expectedError); - assert((client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTensorboardExperimentsStream without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), - ]; - client.descriptors.page.listTensorboardExperiments.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTensorboardExperimentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTensorboardExperiments, request)); - assert.strictEqual( - (client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listTensorboardExperimentsStream with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listTensorboardExperiments.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTensorboardExperimentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTensorboardExperiments, request)); - assert.strictEqual( - (client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTensorboardExperiments without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment()), - ]; - client.descriptors.page.listTensorboardExperiments.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment[] = []; - const iterable = client.listTensorboardExperimentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTensorboardExperiments with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listTensorboardExperiments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTensorboardExperimentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.ITensorboardExperiment[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listTensorboardRuns', () => { - it('invokes listTensorboardRuns without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), - ]; - client.innerApiCalls.listTensorboardRuns = stubSimpleCall(expectedResponse); - const [response] = await client.listTensorboardRuns(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTensorboardRuns without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), - ]; - client.innerApiCalls.listTensorboardRuns = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTensorboardRuns( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardRun[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listTensorboardRuns with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listTensorboardRuns = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTensorboardRuns(request), expectedError); - assert((client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTensorboardRunsStream without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), - ]; - client.descriptors.page.listTensorboardRuns.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTensorboardRunsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.TensorboardRun[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TensorboardRun) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listTensorboardRuns.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTensorboardRuns, request)); - assert.strictEqual( - (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listTensorboardRunsStream with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listTensorboardRuns.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTensorboardRunsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.TensorboardRun[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TensorboardRun) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTensorboardRuns.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTensorboardRuns, request)); - assert.strictEqual( - (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTensorboardRuns without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardRun()), - ]; - client.descriptors.page.listTensorboardRuns.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.ITensorboardRun[] = []; - const iterable = client.listTensorboardRunsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTensorboardRuns with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listTensorboardRuns.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTensorboardRunsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.ITensorboardRun[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listTensorboardTimeSeries', () => { - it('invokes listTensorboardTimeSeries without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), - ]; - client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCall(expectedResponse); - const [response] = await client.listTensorboardTimeSeries(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTensorboardTimeSeries without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), - ]; - client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTensorboardTimeSeries( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listTensorboardTimeSeries with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTensorboardTimeSeries(request), expectedError); - assert((client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTensorboardTimeSeriesStream without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), - ]; - client.descriptors.page.listTensorboardTimeSeries.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTensorboardTimeSeriesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTensorboardTimeSeries, request)); - assert.strictEqual( - (client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listTensorboardTimeSeriesStream with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listTensorboardTimeSeries.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTensorboardTimeSeriesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTensorboardTimeSeries, request)); - assert.strictEqual( - (client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTensorboardTimeSeries without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries()), - ]; - client.descriptors.page.listTensorboardTimeSeries.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries[] = []; - const iterable = client.listTensorboardTimeSeriesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTensorboardTimeSeries with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listTensorboardTimeSeries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTensorboardTimeSeriesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.ITensorboardTimeSeries[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('exportTensorboardTimeSeriesData', () => { - it('invokes exportTensorboardTimeSeriesData without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), - ]; - client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCall(expectedResponse); - const [response] = await client.exportTensorboardTimeSeriesData(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes exportTensorboardTimeSeriesData without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), - ]; - client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.exportTensorboardTimeSeriesData( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITimeSeriesDataPoint[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes exportTensorboardTimeSeriesData with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.exportTensorboardTimeSeriesData(request), expectedError); - assert((client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes exportTensorboardTimeSeriesDataStream without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), - ]; - client.descriptors.page.exportTensorboardTimeSeriesData.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.exportTensorboardTimeSeriesDataStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.exportTensorboardTimeSeriesData, request)); - assert.strictEqual( - (client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes exportTensorboardTimeSeriesDataStream with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series="; - const expectedError = new Error('expected'); - client.descriptors.page.exportTensorboardTimeSeriesData.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.exportTensorboardTimeSeriesDataStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.exportTensorboardTimeSeriesData, request)); - assert.strictEqual( - (client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with exportTensorboardTimeSeriesData without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint()), - ]; - client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.ITimeSeriesDataPoint[] = []; - const iterable = client.exportTensorboardTimeSeriesDataAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with exportTensorboardTimeSeriesData with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest()); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = "tensorboard_time_series=";const expectedError = new Error('expected'); - client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.exportTensorboardTimeSeriesDataAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.ITimeSeriesDataPoint[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1beta1/test/gapic_vizier_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_vizier_service_v1beta1.ts deleted file mode 100644 index cc9db7ec..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_vizier_service_v1beta1.ts +++ /dev/null @@ -1,3680 +0,0 @@ -// 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 -// -// https://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. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as vizierserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta1.VizierServiceClient', () => { - it('has servicePath', () => { - const servicePath = vizierserviceModule.v1beta1.VizierServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = vizierserviceModule.v1beta1.VizierServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = vizierserviceModule.v1beta1.VizierServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.vizierServiceStub, undefined); - await client.initialize(); - assert(client.vizierServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.vizierServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.vizierServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('createStudy', () => { - it('invokes createStudy without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateStudyRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()); - client.innerApiCalls.createStudy = stubSimpleCall(expectedResponse); - const [response] = await client.createStudy(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createStudy without error using callback', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateStudyRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()); - client.innerApiCalls.createStudy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createStudy( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IStudy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createStudy with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateStudyRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createStudy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createStudy(request), expectedError); - assert((client.innerApiCalls.createStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createStudy with closed client', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateStudyRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createStudy(request), expectedError); - }); - }); - - describe('getStudy', () => { - it('invokes getStudy without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetStudyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()); - client.innerApiCalls.getStudy = stubSimpleCall(expectedResponse); - const [response] = await client.getStudy(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getStudy without error using callback', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetStudyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()); - client.innerApiCalls.getStudy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getStudy( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IStudy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getStudy with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetStudyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getStudy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getStudy(request), expectedError); - assert((client.innerApiCalls.getStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getStudy with closed client', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetStudyRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getStudy(request), expectedError); - }); - }); - - describe('deleteStudy', () => { - it('invokes deleteStudy without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteStudyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteStudy = stubSimpleCall(expectedResponse); - const [response] = await client.deleteStudy(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteStudy without error using callback', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteStudyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteStudy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteStudy( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteStudy with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteStudyRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteStudy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteStudy(request), expectedError); - assert((client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteStudy with closed client', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteStudyRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteStudy(request), expectedError); - }); - }); - - describe('lookupStudy', () => { - it('invokes lookupStudy without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LookupStudyRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()); - client.innerApiCalls.lookupStudy = stubSimpleCall(expectedResponse); - const [response] = await client.lookupStudy(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes lookupStudy without error using callback', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LookupStudyRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()); - client.innerApiCalls.lookupStudy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.lookupStudy( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IStudy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes lookupStudy with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LookupStudyRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.lookupStudy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.lookupStudy(request), expectedError); - assert((client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes lookupStudy with closed client', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.LookupStudyRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.lookupStudy(request), expectedError); - }); - }); - - describe('createTrial', () => { - it('invokes createTrial without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTrialRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); - client.innerApiCalls.createTrial = stubSimpleCall(expectedResponse); - const [response] = await client.createTrial(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTrial without error using callback', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTrialRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); - client.innerApiCalls.createTrial = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTrial( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITrial|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createTrial with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTrialRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTrial(request), expectedError); - assert((client.innerApiCalls.createTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createTrial with closed client', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CreateTrialRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createTrial(request), expectedError); - }); - }); - - describe('getTrial', () => { - it('invokes getTrial without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); - client.innerApiCalls.getTrial = stubSimpleCall(expectedResponse); - const [response] = await client.getTrial(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTrial without error using callback', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); - client.innerApiCalls.getTrial = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTrial( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITrial|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getTrial with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTrial(request), expectedError); - assert((client.innerApiCalls.getTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getTrial with closed client', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.GetTrialRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTrial(request), expectedError); - }); - }); - - describe('addTrialMeasurement', () => { - it('invokes addTrialMeasurement without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddTrialMeasurementRequest()); - request.trialName = ''; - const expectedHeaderRequestParams = "trial_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); - client.innerApiCalls.addTrialMeasurement = stubSimpleCall(expectedResponse); - const [response] = await client.addTrialMeasurement(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes addTrialMeasurement without error using callback', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddTrialMeasurementRequest()); - request.trialName = ''; - const expectedHeaderRequestParams = "trial_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); - client.innerApiCalls.addTrialMeasurement = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.addTrialMeasurement( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITrial|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes addTrialMeasurement with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddTrialMeasurementRequest()); - request.trialName = ''; - const expectedHeaderRequestParams = "trial_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.addTrialMeasurement = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addTrialMeasurement(request), expectedError); - assert((client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes addTrialMeasurement with closed client', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.AddTrialMeasurementRequest()); - request.trialName = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.addTrialMeasurement(request), expectedError); - }); - }); - - describe('completeTrial', () => { - it('invokes completeTrial without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CompleteTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); - client.innerApiCalls.completeTrial = stubSimpleCall(expectedResponse); - const [response] = await client.completeTrial(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.completeTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes completeTrial without error using callback', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CompleteTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); - client.innerApiCalls.completeTrial = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.completeTrial( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITrial|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.completeTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes completeTrial with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CompleteTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.completeTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.completeTrial(request), expectedError); - assert((client.innerApiCalls.completeTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes completeTrial with closed client', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CompleteTrialRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.completeTrial(request), expectedError); - }); - }); - - describe('deleteTrial', () => { - it('invokes deleteTrial without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteTrial = stubSimpleCall(expectedResponse); - const [response] = await client.deleteTrial(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTrial without error using callback', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteTrial = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTrial( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteTrial with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteTrial(request), expectedError); - assert((client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteTrial with closed client', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeleteTrialRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteTrial(request), expectedError); - }); - }); - - describe('stopTrial', () => { - it('invokes stopTrial without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.StopTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); - client.innerApiCalls.stopTrial = stubSimpleCall(expectedResponse); - const [response] = await client.stopTrial(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.stopTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes stopTrial without error using callback', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.StopTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()); - client.innerApiCalls.stopTrial = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.stopTrial( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITrial|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.stopTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes stopTrial with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.StopTrialRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.stopTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.stopTrial(request), expectedError); - assert((client.innerApiCalls.stopTrial as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes stopTrial with closed client', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.StopTrialRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.stopTrial(request), expectedError); - }); - }); - - describe('listOptimalTrials', () => { - it('invokes listOptimalTrials without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListOptimalTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListOptimalTrialsResponse()); - client.innerApiCalls.listOptimalTrials = stubSimpleCall(expectedResponse); - const [response] = await client.listOptimalTrials(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listOptimalTrials without error using callback', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListOptimalTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListOptimalTrialsResponse()); - client.innerApiCalls.listOptimalTrials = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listOptimalTrials( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IListOptimalTrialsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listOptimalTrials with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListOptimalTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listOptimalTrials = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listOptimalTrials(request), expectedError); - assert((client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listOptimalTrials with closed client', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListOptimalTrialsRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listOptimalTrials(request), expectedError); - }); - }); - - describe('suggestTrials', () => { - it('invokes suggestTrials without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SuggestTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.suggestTrials = stubLongRunningCall(expectedResponse); - const [operation] = await client.suggestTrials(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes suggestTrials without error using callback', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SuggestTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.suggestTrials = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.suggestTrials( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes suggestTrials with call error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SuggestTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.suggestTrials = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.suggestTrials(request), expectedError); - assert((client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes suggestTrials with LRO error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SuggestTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.suggestTrials = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.suggestTrials(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkSuggestTrialsProgress without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkSuggestTrialsProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkSuggestTrialsProgress with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkSuggestTrialsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('checkTrialEarlyStoppingState', () => { - it('invokes checkTrialEarlyStoppingState without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CheckTrialEarlyStoppingStateRequest()); - request.trialName = ''; - const expectedHeaderRequestParams = "trial_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(expectedResponse); - const [operation] = await client.checkTrialEarlyStoppingState(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkTrialEarlyStoppingState without error using callback', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CheckTrialEarlyStoppingStateRequest()); - request.trialName = ''; - const expectedHeaderRequestParams = "trial_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.checkTrialEarlyStoppingState( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes checkTrialEarlyStoppingState with call error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CheckTrialEarlyStoppingStateRequest()); - request.trialName = ''; - const expectedHeaderRequestParams = "trial_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.checkTrialEarlyStoppingState(request), expectedError); - assert((client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkTrialEarlyStoppingState with LRO error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.CheckTrialEarlyStoppingStateRequest()); - request.trialName = ''; - const expectedHeaderRequestParams = "trial_name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.checkTrialEarlyStoppingState(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCheckTrialEarlyStoppingStateProgress without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage(new operationsProtos.google.longrunning.Operation()); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCheckTrialEarlyStoppingStateProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCheckTrialEarlyStoppingStateProgress with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCheckTrialEarlyStoppingStateProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listStudies', () => { - it('invokes listStudies without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListStudiesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), - ]; - client.innerApiCalls.listStudies = stubSimpleCall(expectedResponse); - const [response] = await client.listStudies(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listStudies as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listStudies without error using callback', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListStudiesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), - ]; - client.innerApiCalls.listStudies = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listStudies( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IStudy[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listStudies as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listStudies with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListStudiesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listStudies = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listStudies(request), expectedError); - assert((client.innerApiCalls.listStudies as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listStudiesStream without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListStudiesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), - ]; - client.descriptors.page.listStudies.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listStudiesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Study[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Study) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listStudies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listStudies, request)); - assert.strictEqual( - (client.descriptors.page.listStudies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listStudiesStream with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListStudiesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listStudies.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listStudiesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Study[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Study) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listStudies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listStudies, request)); - assert.strictEqual( - (client.descriptors.page.listStudies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listStudies without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListStudiesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Study()), - ]; - client.descriptors.page.listStudies.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IStudy[] = []; - const iterable = client.listStudiesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listStudies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listStudies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listStudies with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListStudiesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listStudies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listStudiesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IStudy[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listStudies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listStudies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listTrials', () => { - it('invokes listTrials without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), - ]; - client.innerApiCalls.listTrials = stubSimpleCall(expectedResponse); - const [response] = await client.listTrials(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTrials without error using callback', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), - ]; - client.innerApiCalls.listTrials = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTrials( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ITrial[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listTrials with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listTrials = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTrials(request), expectedError); - assert((client.innerApiCalls.listTrials as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listTrialsStream without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), - ]; - client.descriptors.page.listTrials.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTrialsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Trial[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Trial) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listTrials.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTrials, request)); - assert.strictEqual( - (client.descriptors.page.listTrials.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listTrialsStream with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listTrials.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTrialsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.Trial[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.Trial) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTrials.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTrials, request)); - assert.strictEqual( - (client.descriptors.page.listTrials.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTrials without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.Trial()), - ]; - client.descriptors.page.listTrials.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.ITrial[] = []; - const iterable = client.listTrialsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTrials.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTrials.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listTrials with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.ListTrialsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listTrials.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTrialsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.ITrial[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTrials.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listTrials.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('annotation', () => { - const fakePath = "/rendered/path/annotation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - annotation: "annotationValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationPath', () => { - const result = client.annotationPath("projectValue", "locationValue", "datasetValue", "dataItemValue", "annotationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationName', () => { - const result = client.matchProjectFromAnnotationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationName', () => { - const result = client.matchLocationFromAnnotationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationName', () => { - const result = client.matchDatasetFromAnnotationName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromAnnotationName', () => { - const result = client.matchDataItemFromAnnotationName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationFromAnnotationName', () => { - const result = client.matchAnnotationFromAnnotationName(fakePath); - assert.strictEqual(result, "annotationValue"); - assert((client.pathTemplates.annotationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('annotationSpec', () => { - const fakePath = "/rendered/path/annotationSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - annotation_spec: "annotationSpecValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.annotationSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.annotationSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('annotationSpecPath', () => { - const result = client.annotationSpecPath("projectValue", "locationValue", "datasetValue", "annotationSpecValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnnotationSpecName', () => { - const result = client.matchProjectFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnnotationSpecName', () => { - const result = client.matchLocationFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromAnnotationSpecName', () => { - const result = client.matchDatasetFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnnotationSpecFromAnnotationSpecName', () => { - const result = client.matchAnnotationSpecFromAnnotationSpecName(fakePath); - assert.strictEqual(result, "annotationSpecValue"); - assert((client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('artifact', () => { - const fakePath = "/rendered/path/artifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - artifact: "artifactValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.artifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.artifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('artifactPath', () => { - const result = client.artifactPath("projectValue", "locationValue", "metadataStoreValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.artifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromArtifactName', () => { - const result = client.matchProjectFromArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromArtifactName', () => { - const result = client.matchLocationFromArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromArtifactName', () => { - const result = client.matchMetadataStoreFromArtifactName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromArtifactName', () => { - const result = client.matchArtifactFromArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.artifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('batchPredictionJob', () => { - const fakePath = "/rendered/path/batchPredictionJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch_prediction_job: "batchPredictionJobValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.batchPredictionJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPredictionJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPredictionJobPath', () => { - const result = client.batchPredictionJobPath("projectValue", "locationValue", "batchPredictionJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPredictionJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchPredictionJobName', () => { - const result = client.matchProjectFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchPredictionJobName', () => { - const result = client.matchLocationFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchPredictionJobFromBatchPredictionJobName', () => { - const result = client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); - assert.strictEqual(result, "batchPredictionJobValue"); - assert((client.pathTemplates.batchPredictionJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('context', () => { - const fakePath = "/rendered/path/context"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - context: "contextValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.contextPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.contextPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('contextPath', () => { - const result = client.contextPath("projectValue", "locationValue", "metadataStoreValue", "contextValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.contextPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromContextName', () => { - const result = client.matchProjectFromContextName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromContextName', () => { - const result = client.matchLocationFromContextName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromContextName', () => { - const result = client.matchMetadataStoreFromContextName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchContextFromContextName', () => { - const result = client.matchContextFromContextName(fakePath); - assert.strictEqual(result, "contextValue"); - assert((client.pathTemplates.contextPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('customJob', () => { - const fakePath = "/rendered/path/customJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - custom_job: "customJobValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.customJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.customJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('customJobPath', () => { - const result = client.customJobPath("projectValue", "locationValue", "customJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.customJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCustomJobName', () => { - const result = client.matchProjectFromCustomJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCustomJobName', () => { - const result = client.matchLocationFromCustomJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCustomJobFromCustomJobName', () => { - const result = client.matchCustomJobFromCustomJobName(fakePath); - assert.strictEqual(result, "customJobValue"); - assert((client.pathTemplates.customJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataItem', () => { - const fakePath = "/rendered/path/dataItem"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - data_item: "dataItemValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataItemPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataItemPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataItemPath', () => { - const result = client.dataItemPath("projectValue", "locationValue", "datasetValue", "dataItemValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataItemPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataItemName', () => { - const result = client.matchProjectFromDataItemName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataItemName', () => { - const result = client.matchLocationFromDataItemName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDataItemName', () => { - const result = client.matchDatasetFromDataItemName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataItemFromDataItemName', () => { - const result = client.matchDataItemFromDataItemName(fakePath); - assert.strictEqual(result, "dataItemValue"); - assert((client.pathTemplates.dataItemPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataLabelingJob', () => { - const fakePath = "/rendered/path/dataLabelingJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_labeling_job: "dataLabelingJobValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dataLabelingJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataLabelingJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataLabelingJobPath', () => { - const result = client.dataLabelingJobPath("projectValue", "locationValue", "dataLabelingJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataLabelingJobName', () => { - const result = client.matchProjectFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataLabelingJobName', () => { - const result = client.matchLocationFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataLabelingJobFromDataLabelingJobName', () => { - const result = client.matchDataLabelingJobFromDataLabelingJobName(fakePath); - assert.strictEqual(result, "dataLabelingJobValue"); - assert((client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataset', () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "datasetValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromDatasetName', () => { - const result = client.matchDatasetFromDatasetName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('endpoint', () => { - const fakePath = "/rendered/path/endpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - endpoint: "endpointValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.endpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.endpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('endpointPath', () => { - const result = client.endpointPath("projectValue", "locationValue", "endpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.endpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEndpointName', () => { - const result = client.matchProjectFromEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEndpointName', () => { - const result = client.matchLocationFromEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEndpointFromEndpointName', () => { - const result = client.matchEndpointFromEndpointName(fakePath); - assert.strictEqual(result, "endpointValue"); - assert((client.pathTemplates.endpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('entityType', () => { - const fakePath = "/rendered/path/entityType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.entityTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.entityTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('entityTypePath', () => { - const result = client.entityTypePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.entityTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEntityTypeName', () => { - const result = client.matchProjectFromEntityTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEntityTypeName', () => { - const result = client.matchLocationFromEntityTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromEntityTypeName', () => { - const result = client.matchFeaturestoreFromEntityTypeName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromEntityTypeName', () => { - const result = client.matchEntityTypeFromEntityTypeName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.entityTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - execution: "executionValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "metadataStoreValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromExecutionName', () => { - const result = client.matchMetadataStoreFromExecutionName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('feature', () => { - const fakePath = "/rendered/path/feature"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - entity_type: "entityTypeValue", - feature: "featureValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurePath', () => { - const result = client.featurePath("projectValue", "locationValue", "featurestoreValue", "entityTypeValue", "featureValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeatureName', () => { - const result = client.matchProjectFromFeatureName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeatureName', () => { - const result = client.matchLocationFromFeatureName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeatureName', () => { - const result = client.matchFeaturestoreFromFeatureName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEntityTypeFromFeatureName', () => { - const result = client.matchEntityTypeFromFeatureName(fakePath); - assert.strictEqual(result, "entityTypeValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeatureFromFeatureName', () => { - const result = client.matchFeatureFromFeatureName(fakePath); - assert.strictEqual(result, "featureValue"); - assert((client.pathTemplates.featurePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('featurestore', () => { - const fakePath = "/rendered/path/featurestore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - featurestore: "featurestoreValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.featurestorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.featurestorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('featurestorePath', () => { - const result = client.featurestorePath("projectValue", "locationValue", "featurestoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.featurestorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromFeaturestoreName', () => { - const result = client.matchProjectFromFeaturestoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromFeaturestoreName', () => { - const result = client.matchLocationFromFeaturestoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFeaturestoreFromFeaturestoreName', () => { - const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); - assert.strictEqual(result, "featurestoreValue"); - assert((client.pathTemplates.featurestorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hyperparameterTuningJob', () => { - const fakePath = "/rendered/path/hyperparameterTuningJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - hyperparameter_tuning_job: "hyperparameterTuningJobValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hyperparameterTuningJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hyperparameterTuningJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hyperparameterTuningJobPath', () => { - const result = client.hyperparameterTuningJobPath("projectValue", "locationValue", "hyperparameterTuningJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHyperparameterTuningJobName', () => { - const result = client.matchProjectFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHyperparameterTuningJobName', () => { - const result = client.matchLocationFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { - const result = client.matchHyperparameterTuningJobFromHyperparameterTuningJobName(fakePath); - assert.strictEqual(result, "hyperparameterTuningJobValue"); - assert((client.pathTemplates.hyperparameterTuningJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('index', () => { - const fakePath = "/rendered/path/index"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index: "indexValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexPath', () => { - const result = client.indexPath("projectValue", "locationValue", "indexValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexName', () => { - const result = client.matchProjectFromIndexName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexName', () => { - const result = client.matchLocationFromIndexName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexFromIndexName', () => { - const result = client.matchIndexFromIndexName(fakePath); - assert.strictEqual(result, "indexValue"); - assert((client.pathTemplates.indexPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('indexEndpoint', () => { - const fakePath = "/rendered/path/indexEndpoint"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - index_endpoint: "indexEndpointValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.indexEndpointPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.indexEndpointPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('indexEndpointPath', () => { - const result = client.indexEndpointPath("projectValue", "locationValue", "indexEndpointValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIndexEndpointName', () => { - const result = client.matchProjectFromIndexEndpointName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIndexEndpointName', () => { - const result = client.matchLocationFromIndexEndpointName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIndexEndpointFromIndexEndpointName', () => { - const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); - assert.strictEqual(result, "indexEndpointValue"); - assert((client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataSchema', () => { - const fakePath = "/rendered/path/metadataSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - metadata_schema: "metadataSchemaValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataSchemaPath', () => { - const result = client.metadataSchemaPath("projectValue", "locationValue", "metadataStoreValue", "metadataSchemaValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataSchemaName', () => { - const result = client.matchProjectFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataSchemaName', () => { - const result = client.matchLocationFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataSchemaName', () => { - const result = client.matchMetadataStoreFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataSchemaFromMetadataSchemaName', () => { - const result = client.matchMetadataSchemaFromMetadataSchemaName(fakePath); - assert.strictEqual(result, "metadataSchemaValue"); - assert((client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('metadataStore', () => { - const fakePath = "/rendered/path/metadataStore"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - metadata_store: "metadataStoreValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.metadataStorePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.metadataStorePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('metadataStorePath', () => { - const result = client.metadataStorePath("projectValue", "locationValue", "metadataStoreValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.metadataStorePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMetadataStoreName', () => { - const result = client.matchProjectFromMetadataStoreName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMetadataStoreName', () => { - const result = client.matchLocationFromMetadataStoreName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMetadataStoreFromMetadataStoreName', () => { - const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); - assert.strictEqual(result, "metadataStoreValue"); - assert((client.pathTemplates.metadataStorePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('model', () => { - const fakePath = "/rendered/path/model"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelPath', () => { - const result = client.modelPath("projectValue", "locationValue", "modelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelName', () => { - const result = client.matchProjectFromModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelName', () => { - const result = client.matchLocationFromModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelName', () => { - const result = client.matchModelFromModelName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelDeploymentMonitoringJob', () => { - const fakePath = "/rendered/path/modelDeploymentMonitoringJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model_deployment_monitoring_job: "modelDeploymentMonitoringJobValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelDeploymentMonitoringJobPath', () => { - const result = client.modelDeploymentMonitoringJobPath("projectValue", "locationValue", "modelDeploymentMonitoringJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelDeploymentMonitoringJobName', () => { - const result = client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelDeploymentMonitoringJobName', () => { - const result = client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { - const result = client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName(fakePath); - assert.strictEqual(result, "modelDeploymentMonitoringJobValue"); - assert((client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluation', () => { - const fakePath = "/rendered/path/modelEvaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationPath', () => { - const result = client.modelEvaluationPath("projectValue", "locationValue", "modelValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationName', () => { - const result = client.matchProjectFromModelEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationName', () => { - const result = client.matchLocationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationName', () => { - const result = client.matchModelFromModelEvaluationName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationName', () => { - const result = client.matchEvaluationFromModelEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('modelEvaluationSlice', () => { - const fakePath = "/rendered/path/modelEvaluationSlice"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - model: "modelValue", - evaluation: "evaluationValue", - slice: "sliceValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.modelEvaluationSlicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.modelEvaluationSlicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('modelEvaluationSlicePath', () => { - const result = client.modelEvaluationSlicePath("projectValue", "locationValue", "modelValue", "evaluationValue", "sliceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromModelEvaluationSliceName', () => { - const result = client.matchProjectFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromModelEvaluationSliceName', () => { - const result = client.matchLocationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchModelFromModelEvaluationSliceName', () => { - const result = client.matchModelFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "modelValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromModelEvaluationSliceName', () => { - const result = client.matchEvaluationFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSliceFromModelEvaluationSliceName', () => { - const result = client.matchSliceFromModelEvaluationSliceName(fakePath); - assert.strictEqual(result, "sliceValue"); - assert((client.pathTemplates.modelEvaluationSlicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('pipelineJob', () => { - const fakePath = "/rendered/path/pipelineJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - pipeline_job: "pipelineJobValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pipelineJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pipelineJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pipelineJobPath', () => { - const result = client.pipelineJobPath("projectValue", "locationValue", "pipelineJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPipelineJobName', () => { - const result = client.matchProjectFromPipelineJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPipelineJobName', () => { - const result = client.matchLocationFromPipelineJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPipelineJobFromPipelineJobName', () => { - const result = client.matchPipelineJobFromPipelineJobName(fakePath); - assert.strictEqual(result, "pipelineJobValue"); - assert((client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('specialistPool', () => { - const fakePath = "/rendered/path/specialistPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - specialist_pool: "specialistPoolValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specialistPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specialistPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specialistPoolPath', () => { - const result = client.specialistPoolPath("projectValue", "locationValue", "specialistPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecialistPoolName', () => { - const result = client.matchProjectFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecialistPoolName', () => { - const result = client.matchLocationFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecialistPoolFromSpecialistPoolName', () => { - const result = client.matchSpecialistPoolFromSpecialistPoolName(fakePath); - assert.strictEqual(result, "specialistPoolValue"); - assert((client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('study', () => { - const fakePath = "/rendered/path/study"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.studyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.studyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('studyPath', () => { - const result = client.studyPath("projectValue", "locationValue", "studyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.studyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStudyName', () => { - const result = client.matchProjectFromStudyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStudyName', () => { - const result = client.matchLocationFromStudyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromStudyName', () => { - const result = client.matchStudyFromStudyName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.studyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboard', () => { - const fakePath = "/rendered/path/tensorboard"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardPath', () => { - const result = client.tensorboardPath("projectValue", "locationValue", "tensorboardValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardName', () => { - const result = client.matchProjectFromTensorboardName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardName', () => { - const result = client.matchLocationFromTensorboardName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardName', () => { - const result = client.matchTensorboardFromTensorboardName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardExperiment', () => { - const fakePath = "/rendered/path/tensorboardExperiment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardExperimentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardExperimentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardExperimentPath', () => { - const result = client.tensorboardExperimentPath("projectValue", "locationValue", "tensorboardValue", "experimentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardExperimentName', () => { - const result = client.matchProjectFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardExperimentName', () => { - const result = client.matchLocationFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardExperimentName', () => { - const result = client.matchTensorboardFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardExperimentName', () => { - const result = client.matchExperimentFromTensorboardExperimentName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardExperimentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardRun', () => { - const fakePath = "/rendered/path/tensorboardRun"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardRunPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardRunPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardRunPath', () => { - const result = client.tensorboardRunPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardRunName', () => { - const result = client.matchProjectFromTensorboardRunName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardRunName', () => { - const result = client.matchLocationFromTensorboardRunName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardRunName', () => { - const result = client.matchTensorboardFromTensorboardRunName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardRunName', () => { - const result = client.matchExperimentFromTensorboardRunName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardRunName', () => { - const result = client.matchRunFromTensorboardRunName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('tensorboardTimeSeries', () => { - const fakePath = "/rendered/path/tensorboardTimeSeries"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - tensorboard: "tensorboardValue", - experiment: "experimentValue", - run: "runValue", - time_series: "timeSeriesValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tensorboardTimeSeriesPath', () => { - const result = client.tensorboardTimeSeriesPath("projectValue", "locationValue", "tensorboardValue", "experimentValue", "runValue", "timeSeriesValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTensorboardTimeSeriesName', () => { - const result = client.matchProjectFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTensorboardTimeSeriesName', () => { - const result = client.matchLocationFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTensorboardFromTensorboardTimeSeriesName', () => { - const result = client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "tensorboardValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExperimentFromTensorboardTimeSeriesName', () => { - const result = client.matchExperimentFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "experimentValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRunFromTensorboardTimeSeriesName', () => { - const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "runValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { - const result = client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); - assert.strictEqual(result, "timeSeriesValue"); - assert((client.pathTemplates.tensorboardTimeSeriesPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trainingPipeline', () => { - const fakePath = "/rendered/path/trainingPipeline"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - training_pipeline: "trainingPipelineValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trainingPipelinePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trainingPipelinePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trainingPipelinePath', () => { - const result = client.trainingPipelinePath("projectValue", "locationValue", "trainingPipelineValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trainingPipelinePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrainingPipelineName', () => { - const result = client.matchProjectFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrainingPipelineName', () => { - const result = client.matchLocationFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrainingPipelineFromTrainingPipelineName', () => { - const result = client.matchTrainingPipelineFromTrainingPipelineName(fakePath); - assert.strictEqual(result, "trainingPipelineValue"); - assert((client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('trial', () => { - const fakePath = "/rendered/path/trial"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - study: "studyValue", - trial: "trialValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.trialPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.trialPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('trialPath', () => { - const result = client.trialPath("projectValue", "locationValue", "studyValue", "trialValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.trialPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTrialName', () => { - const result = client.matchProjectFromTrialName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTrialName', () => { - const result = client.matchLocationFromTrialName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchStudyFromTrialName', () => { - const result = client.matchStudyFromTrialName(fakePath); - assert.strictEqual(result, "studyValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTrialFromTrialName', () => { - const result = client.matchTrialFromTrialName(fakePath); - assert.strictEqual(result, "trialValue"); - assert((client.pathTemplates.trialPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1beta1/tsconfig.json b/owl-bot-staging/v1beta1/tsconfig.json deleted file mode 100644 index c78f1c88..00000000 --- a/owl-bot-staging/v1beta1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/v1beta1/webpack.config.js b/owl-bot-staging/v1beta1/webpack.config.js deleted file mode 100644 index f4947d41..00000000 --- a/owl-bot-staging/v1beta1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 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 -// -// https://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. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'DatasetService', - filename: './dataset-service.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/protos/google/cloud/aiplatform/v1beta1/explanation.proto b/protos/google/cloud/aiplatform/v1beta1/explanation.proto index 1f3b2512..11e4c6c5 100644 --- a/protos/google/cloud/aiplatform/v1beta1/explanation.proto +++ b/protos/google/cloud/aiplatform/v1beta1/explanation.proto @@ -47,6 +47,12 @@ message Explanation { // the attributions are stored by [Attribution.output_index][google.cloud.aiplatform.v1beta1.Attribution.output_index] in the same // order as they appear in the output_indices. repeated Attribution attributions = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of the nearest neighbors for example-based explanations. + // + // For models deployed with the examples explanations feature enabled, the + // attributions field is empty and instead the neighbors field is populated. + repeated Neighbor neighbors = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Aggregated explanation metrics for a Model over a set of instances. @@ -163,6 +169,15 @@ message Attribution { string output_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } +// Neighbors for example-based explanations. +message Neighbor { + // Output only. The neighbor id. + string neighbor_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The neighbor distance. + double neighbor_distance = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + // Specification of Model explanation. message ExplanationSpec { // Required. Parameters that configure explaining of the Model's predictions. @@ -373,17 +388,57 @@ message BlurBaselineConfig { // Example-based explainability that returns the nearest neighbors from the // provided dataset. message Examples { + oneof config { + // The configuration for the generated index, the semantics are the same as + // [metadata][google.cloud.aiplatform.v1beta1.Index.metadata] and should match NearestNeighborSearchConfig. + google.protobuf.Value nearest_neighbor_search_config = 2; + + // Preset config based on the desired query speed-precision trade-off + // and modality + Preset preset = 4; + } + // The Cloud Storage location for the input instances. GcsSource gcs_source = 1; - // The configuration for the generated index, the semantics are the same as - // [metadata][google.cloud.aiplatform.v1beta1.Index.metadata] and should match NearestNeighborSearchConfig. - google.protobuf.Value nearest_neighbor_search_config = 2; - // The number of neighbors to return. int32 neighbor_count = 3; } +// Preset configuration for example-based explanations +message Preset { + // Preset option controlling parameters for query speed-precision trade-off + enum Query { + // More precise neighbors as a trade-off against slower response. + // This is also the default value (field-number 0). + PRECISE = 0; + + // Faster response as a trade-off against less precise neighbors. + FAST = 1; + } + + // Preset option controlling parameters for different modalities + enum Modality { + // Should not be set. Added as a recommended best practice for enums + MODALITY_UNSPECIFIED = 0; + + // IMAGE modality + IMAGE = 1; + + // TEXT modality + TEXT = 2; + + // TABULAR modality + TABULAR = 3; + } + + // Preset option controlling parameters for query speed-precision trade-off + optional Query query = 1; + + // Preset option controlling parameters for different modalities + Modality modality = 2; +} + // The [ExplanationSpec][google.cloud.aiplatform.v1beta1.ExplanationSpec] entries that can be overridden at // [online explanation][google.cloud.aiplatform.v1beta1.PredictionService.Explain] time. message ExplanationSpecOverride { @@ -394,6 +449,9 @@ message ExplanationSpecOverride { // The metadata to be overridden. If not specified, no metadata is overridden. ExplanationMetadataOverride metadata = 2; + + // The example-based explanations parameter overrides. + ExamplesOverride examples_override = 3; } // The [ExplanationMetadata][google.cloud.aiplatform.v1beta1.ExplanationMetadata] entries that can be overridden at @@ -418,3 +476,45 @@ message ExplanationMetadataOverride { // overridden. map inputs = 1 [(google.api.field_behavior) = REQUIRED]; } + +// Overrides for example-based explanations. +message ExamplesOverride { + // Data format enum. + enum DataFormat { + // Unspecified format. Must not be used. + DATA_FORMAT_UNSPECIFIED = 0; + + // Provided data is a set of model inputs. + INSTANCES = 1; + + // Provided data is a set of embeddings. + EMBEDDINGS = 2; + } + + // The number of neighbors to return. + int32 neighbor_count = 1; + + // The number of neighbors to return that have the same crowding tag. + int32 crowding_count = 2; + + // Restrict the resulting nearest neighbors to respect these constraints. + repeated ExamplesRestrictionsNamespace restrictions = 3; + + // If true, return the embeddings instead of neighbors. + bool return_embeddings = 4; + + // The format of the data being provided with each call. + DataFormat data_format = 5; +} + +// Restrictions namespace for example-based explanations overrides. +message ExamplesRestrictionsNamespace { + // The namespace name. + string namespace_name = 1; + + // The list of allowed tags. + repeated string allow = 2; + + // The list of deny tags. + repeated string deny = 3; +} diff --git a/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto b/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto index 8d59f088..ef962a51 100644 --- a/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto +++ b/protos/google/cloud/aiplatform/v1beta1/explanation_metadata.proto @@ -392,4 +392,7 @@ message ExplanationMetadata { // than the one given on input. The output URI will point to a location where // the user only has a read access. string feature_attributions_schema_uri = 3; + + // Name of the source to generate embeddings for example based explanations. + string latent_space_source = 5; } diff --git a/protos/google/cloud/aiplatform/v1beta1/model_service.proto b/protos/google/cloud/aiplatform/v1beta1/model_service.proto index 4bc803b0..273718e0 100644 --- a/protos/google/cloud/aiplatform/v1beta1/model_service.proto +++ b/protos/google/cloud/aiplatform/v1beta1/model_service.proto @@ -20,6 +20,7 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/explanation.proto"; import "google/cloud/aiplatform/v1beta1/io.proto"; import "google/cloud/aiplatform/v1beta1/model.proto"; import "google/cloud/aiplatform/v1beta1/model_evaluation.proto"; @@ -87,6 +88,19 @@ service ModelService { option (google.api.method_signature) = "model,update_mask"; } + // Incremental update the dataset used for a examples model. + rpc UpdateExplanationDataset(UpdateExplanationDatasetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{model=projects/*/locations/*/models/*}:updateExplanationDataset" + body: "*" + }; + option (google.api.method_signature) = "model"; + option (google.longrunning.operation_info) = { + response_type: "UpdateExplanationDatasetResponse" + metadata_type: "UpdateExplanationDatasetOperationMetadata" + }; + } + // Deletes a Model. // // A model cannot be deleted if any [Endpoint][google.cloud.aiplatform.v1beta1.Endpoint] resource has a @@ -233,6 +247,16 @@ message UploadModelResponse { message GetModelRequest { // Required. The name of the Model resource. // Format: `projects/{project}/locations/{location}/models/{model}` + // + // In order to retrieve a specific version of the model, also provide + // the version ID or version alias. + // Example: projects/{project}/locations/{location}/models/{model}@2 + // or + // projects/{project}/locations/{location}/models/{model}@golden + // If no version ID or alias is specified, the "default" version will be + // returned. The "default" version alias is created for the first version of + // the model, and can be moved to other versions later on. There will be + // exactly one default version. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -366,6 +390,29 @@ message UpdateModelRequest { google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; } +// Request message for +// [ModelService.UpdateExplanationDataset][google.cloud.aiplatform.v1beta1.ModelService.UpdateExplanationDataset]. +message UpdateExplanationDatasetRequest { + // Required. The resource name of the Model to update. + // Format: `projects/{project}/locations/{location}/models/{model}` + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // The example config containing the location of the dataset. + Examples examples = 2; +} + +// Runtime operation information for +// [ModelService.UpdateExplanationDataset][google.cloud.aiplatform.v1beta1.ModelService.UpdateExplanationDataset]. +message UpdateExplanationDatasetOperationMetadata { + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; +} + // Request message for [ModelService.DeleteModel][google.cloud.aiplatform.v1beta1.ModelService.DeleteModel]. message DeleteModelRequest { // Required. The name of the Model resource to be deleted. @@ -448,6 +495,8 @@ message ExportModelRequest { } // Required. The resource name of the Model to export. + // The resource name may contain version id or version alias to specify the + // version, if no version is specified, the default version will be exported. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -481,6 +530,11 @@ message ExportModelOperationMetadata { OutputInfo output_info = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; } +// Response message of [ModelService.UpdateExplanationDataset][google.cloud.aiplatform.v1beta1.ModelService.UpdateExplanationDataset] operation. +message UpdateExplanationDatasetResponse { + +} + // Response message of [ModelService.ExportModel][google.cloud.aiplatform.v1beta1.ModelService.ExportModel] operation. message ExportModelResponse { diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 806c7345..e696d548 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -63019,6 +63019,9 @@ export namespace google { /** Explanation attributions */ attributions?: (google.cloud.aiplatform.v1beta1.IAttribution[]|null); + + /** Explanation neighbors */ + neighbors?: (google.cloud.aiplatform.v1beta1.INeighbor[]|null); } /** Represents an Explanation. */ @@ -63033,6 +63036,9 @@ export namespace google { /** Explanation attributions. */ public attributions: google.cloud.aiplatform.v1beta1.IAttribution[]; + /** Explanation neighbors. */ + public neighbors: google.cloud.aiplatform.v1beta1.INeighbor[]; + /** * Creates a new Explanation instance using the specified properties. * @param [properties] Properties to set @@ -63320,6 +63326,102 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a Neighbor. */ + interface INeighbor { + + /** Neighbor neighborId */ + neighborId?: (string|null); + + /** Neighbor neighborDistance */ + neighborDistance?: (number|null); + } + + /** Represents a Neighbor. */ + class Neighbor implements INeighbor { + + /** + * Constructs a new Neighbor. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.INeighbor); + + /** Neighbor neighborId. */ + public neighborId: string; + + /** Neighbor neighborDistance. */ + public neighborDistance: number; + + /** + * Creates a new Neighbor instance using the specified properties. + * @param [properties] Properties to set + * @returns Neighbor instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.INeighbor): google.cloud.aiplatform.v1beta1.Neighbor; + + /** + * Encodes the specified Neighbor message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Neighbor.verify|verify} messages. + * @param message Neighbor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.INeighbor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Neighbor message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Neighbor.verify|verify} messages. + * @param message Neighbor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.INeighbor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Neighbor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Neighbor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.Neighbor; + + /** + * Decodes a Neighbor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Neighbor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.Neighbor; + + /** + * Verifies a Neighbor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Neighbor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Neighbor + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.Neighbor; + + /** + * Creates a plain object from a Neighbor message. Also converts values to other types if specified. + * @param message Neighbor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.Neighbor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Neighbor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an ExplanationSpec. */ interface IExplanationSpec { @@ -64220,12 +64322,15 @@ export namespace google { /** Properties of an Examples. */ interface IExamples { - /** Examples gcsSource */ - gcsSource?: (google.cloud.aiplatform.v1beta1.IGcsSource|null); - /** Examples nearestNeighborSearchConfig */ nearestNeighborSearchConfig?: (google.protobuf.IValue|null); + /** Examples preset */ + preset?: (google.cloud.aiplatform.v1beta1.IPreset|null); + + /** Examples gcsSource */ + gcsSource?: (google.cloud.aiplatform.v1beta1.IGcsSource|null); + /** Examples neighborCount */ neighborCount?: (number|null); } @@ -64239,15 +64344,21 @@ export namespace google { */ constructor(properties?: google.cloud.aiplatform.v1beta1.IExamples); - /** Examples gcsSource. */ - public gcsSource?: (google.cloud.aiplatform.v1beta1.IGcsSource|null); - /** Examples nearestNeighborSearchConfig. */ public nearestNeighborSearchConfig?: (google.protobuf.IValue|null); + /** Examples preset. */ + public preset?: (google.cloud.aiplatform.v1beta1.IPreset|null); + + /** Examples gcsSource. */ + public gcsSource?: (google.cloud.aiplatform.v1beta1.IGcsSource|null); + /** Examples neighborCount. */ public neighborCount: number; + /** Examples config. */ + public config?: ("nearestNeighborSearchConfig"|"preset"); + /** * Creates a new Examples instance using the specified properties. * @param [properties] Properties to set @@ -64319,6 +64430,122 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a Preset. */ + interface IPreset { + + /** Preset query */ + query?: (google.cloud.aiplatform.v1beta1.Preset.Query|keyof typeof google.cloud.aiplatform.v1beta1.Preset.Query|null); + + /** Preset modality */ + modality?: (google.cloud.aiplatform.v1beta1.Preset.Modality|keyof typeof google.cloud.aiplatform.v1beta1.Preset.Modality|null); + } + + /** Represents a Preset. */ + class Preset implements IPreset { + + /** + * Constructs a new Preset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IPreset); + + /** Preset query. */ + public query?: (google.cloud.aiplatform.v1beta1.Preset.Query|keyof typeof google.cloud.aiplatform.v1beta1.Preset.Query|null); + + /** Preset modality. */ + public modality: (google.cloud.aiplatform.v1beta1.Preset.Modality|keyof typeof google.cloud.aiplatform.v1beta1.Preset.Modality); + + /** Preset _query. */ + public _query?: "query"; + + /** + * Creates a new Preset instance using the specified properties. + * @param [properties] Properties to set + * @returns Preset instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IPreset): google.cloud.aiplatform.v1beta1.Preset; + + /** + * Encodes the specified Preset message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Preset.verify|verify} messages. + * @param message Preset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IPreset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Preset message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Preset.verify|verify} messages. + * @param message Preset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IPreset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Preset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Preset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.Preset; + + /** + * Decodes a Preset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Preset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.Preset; + + /** + * Verifies a Preset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Preset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Preset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.Preset; + + /** + * Creates a plain object from a Preset message. Also converts values to other types if specified. + * @param message Preset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.Preset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Preset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Preset { + + /** Query enum. */ + enum Query { + PRECISE = 0, + FAST = 1 + } + + /** Modality enum. */ + enum Modality { + MODALITY_UNSPECIFIED = 0, + IMAGE = 1, + TEXT = 2, + TABULAR = 3 + } + } + /** Properties of an ExplanationSpecOverride. */ interface IExplanationSpecOverride { @@ -64327,6 +64554,9 @@ export namespace google { /** ExplanationSpecOverride metadata */ metadata?: (google.cloud.aiplatform.v1beta1.IExplanationMetadataOverride|null); + + /** ExplanationSpecOverride examplesOverride */ + examplesOverride?: (google.cloud.aiplatform.v1beta1.IExamplesOverride|null); } /** Represents an ExplanationSpecOverride. */ @@ -64344,6 +64574,9 @@ export namespace google { /** ExplanationSpecOverride metadata. */ public metadata?: (google.cloud.aiplatform.v1beta1.IExplanationMetadataOverride|null); + /** ExplanationSpecOverride examplesOverride. */ + public examplesOverride?: (google.cloud.aiplatform.v1beta1.IExamplesOverride|null); + /** * Creates a new ExplanationSpecOverride instance using the specified properties. * @param [properties] Properties to set @@ -64598,6 +64831,232 @@ export namespace google { } } + /** Properties of an ExamplesOverride. */ + interface IExamplesOverride { + + /** ExamplesOverride neighborCount */ + neighborCount?: (number|null); + + /** ExamplesOverride crowdingCount */ + crowdingCount?: (number|null); + + /** ExamplesOverride restrictions */ + restrictions?: (google.cloud.aiplatform.v1beta1.IExamplesRestrictionsNamespace[]|null); + + /** ExamplesOverride returnEmbeddings */ + returnEmbeddings?: (boolean|null); + + /** ExamplesOverride dataFormat */ + dataFormat?: (google.cloud.aiplatform.v1beta1.ExamplesOverride.DataFormat|keyof typeof google.cloud.aiplatform.v1beta1.ExamplesOverride.DataFormat|null); + } + + /** Represents an ExamplesOverride. */ + class ExamplesOverride implements IExamplesOverride { + + /** + * Constructs a new ExamplesOverride. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IExamplesOverride); + + /** ExamplesOverride neighborCount. */ + public neighborCount: number; + + /** ExamplesOverride crowdingCount. */ + public crowdingCount: number; + + /** ExamplesOverride restrictions. */ + public restrictions: google.cloud.aiplatform.v1beta1.IExamplesRestrictionsNamespace[]; + + /** ExamplesOverride returnEmbeddings. */ + public returnEmbeddings: boolean; + + /** ExamplesOverride dataFormat. */ + public dataFormat: (google.cloud.aiplatform.v1beta1.ExamplesOverride.DataFormat|keyof typeof google.cloud.aiplatform.v1beta1.ExamplesOverride.DataFormat); + + /** + * Creates a new ExamplesOverride instance using the specified properties. + * @param [properties] Properties to set + * @returns ExamplesOverride instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IExamplesOverride): google.cloud.aiplatform.v1beta1.ExamplesOverride; + + /** + * Encodes the specified ExamplesOverride message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ExamplesOverride.verify|verify} messages. + * @param message ExamplesOverride message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IExamplesOverride, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExamplesOverride message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ExamplesOverride.verify|verify} messages. + * @param message ExamplesOverride message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IExamplesOverride, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExamplesOverride message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExamplesOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.ExamplesOverride; + + /** + * Decodes an ExamplesOverride message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExamplesOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.ExamplesOverride; + + /** + * Verifies an ExamplesOverride message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExamplesOverride message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExamplesOverride + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.ExamplesOverride; + + /** + * Creates a plain object from an ExamplesOverride message. Also converts values to other types if specified. + * @param message ExamplesOverride + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.ExamplesOverride, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExamplesOverride to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ExamplesOverride { + + /** DataFormat enum. */ + enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0, + INSTANCES = 1, + EMBEDDINGS = 2 + } + } + + /** Properties of an ExamplesRestrictionsNamespace. */ + interface IExamplesRestrictionsNamespace { + + /** ExamplesRestrictionsNamespace namespaceName */ + namespaceName?: (string|null); + + /** ExamplesRestrictionsNamespace allow */ + allow?: (string[]|null); + + /** ExamplesRestrictionsNamespace deny */ + deny?: (string[]|null); + } + + /** Represents an ExamplesRestrictionsNamespace. */ + class ExamplesRestrictionsNamespace implements IExamplesRestrictionsNamespace { + + /** + * Constructs a new ExamplesRestrictionsNamespace. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IExamplesRestrictionsNamespace); + + /** ExamplesRestrictionsNamespace namespaceName. */ + public namespaceName: string; + + /** ExamplesRestrictionsNamespace allow. */ + public allow: string[]; + + /** ExamplesRestrictionsNamespace deny. */ + public deny: string[]; + + /** + * Creates a new ExamplesRestrictionsNamespace instance using the specified properties. + * @param [properties] Properties to set + * @returns ExamplesRestrictionsNamespace instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IExamplesRestrictionsNamespace): google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace; + + /** + * Encodes the specified ExamplesRestrictionsNamespace message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace.verify|verify} messages. + * @param message ExamplesRestrictionsNamespace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IExamplesRestrictionsNamespace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExamplesRestrictionsNamespace message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace.verify|verify} messages. + * @param message ExamplesRestrictionsNamespace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IExamplesRestrictionsNamespace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExamplesRestrictionsNamespace message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExamplesRestrictionsNamespace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace; + + /** + * Decodes an ExamplesRestrictionsNamespace message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExamplesRestrictionsNamespace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace; + + /** + * Verifies an ExamplesRestrictionsNamespace message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExamplesRestrictionsNamespace message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExamplesRestrictionsNamespace + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace; + + /** + * Creates a plain object from an ExamplesRestrictionsNamespace message. Also converts values to other types if specified. + * @param message ExamplesRestrictionsNamespace + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExamplesRestrictionsNamespace to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an ExplanationMetadata. */ interface IExplanationMetadata { @@ -64609,6 +65068,9 @@ export namespace google { /** ExplanationMetadata featureAttributionsSchemaUri */ featureAttributionsSchemaUri?: (string|null); + + /** ExplanationMetadata latentSpaceSource */ + latentSpaceSource?: (string|null); } /** Represents an ExplanationMetadata. */ @@ -64629,6 +65091,9 @@ export namespace google { /** ExplanationMetadata featureAttributionsSchemaUri. */ public featureAttributionsSchemaUri: string; + /** ExplanationMetadata latentSpaceSource. */ + public latentSpaceSource: string; + /** * Creates a new ExplanationMetadata instance using the specified properties. * @param [properties] Properties to set @@ -102239,6 +102704,20 @@ export namespace google { */ public updateModel(request: google.cloud.aiplatform.v1beta1.IUpdateModelRequest): Promise; + /** + * Calls UpdateExplanationDataset. + * @param request UpdateExplanationDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateExplanationDataset(request: google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest, callback: google.cloud.aiplatform.v1beta1.ModelService.UpdateExplanationDatasetCallback): void; + + /** + * Calls UpdateExplanationDataset. + * @param request UpdateExplanationDatasetRequest message or plain object + * @returns Promise + */ + public updateExplanationDataset(request: google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest): Promise; + /** * Calls DeleteModel. * @param request DeleteModelRequest message or plain object @@ -102403,6 +102882,13 @@ export namespace google { */ type UpdateModelCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1beta1.Model) => void; + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.ModelService#updateExplanationDataset}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateExplanationDatasetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.aiplatform.v1beta1.ModelService#deleteModel}. * @param error Error, if any @@ -103367,6 +103853,192 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of an UpdateExplanationDatasetRequest. */ + interface IUpdateExplanationDatasetRequest { + + /** UpdateExplanationDatasetRequest model */ + model?: (string|null); + + /** UpdateExplanationDatasetRequest examples */ + examples?: (google.cloud.aiplatform.v1beta1.IExamples|null); + } + + /** Represents an UpdateExplanationDatasetRequest. */ + class UpdateExplanationDatasetRequest implements IUpdateExplanationDatasetRequest { + + /** + * Constructs a new UpdateExplanationDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest); + + /** UpdateExplanationDatasetRequest model. */ + public model: string; + + /** UpdateExplanationDatasetRequest examples. */ + public examples?: (google.cloud.aiplatform.v1beta1.IExamples|null); + + /** + * Creates a new UpdateExplanationDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateExplanationDatasetRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest): google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest; + + /** + * Encodes the specified UpdateExplanationDatasetRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest.verify|verify} messages. + * @param message UpdateExplanationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExplanationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest.verify|verify} messages. + * @param message UpdateExplanationDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateExplanationDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateExplanationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest; + + /** + * Decodes an UpdateExplanationDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateExplanationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest; + + /** + * Verifies an UpdateExplanationDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateExplanationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateExplanationDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest; + + /** + * Creates a plain object from an UpdateExplanationDatasetRequest message. Also converts values to other types if specified. + * @param message UpdateExplanationDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExplanationDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateExplanationDatasetOperationMetadata. */ + interface IUpdateExplanationDatasetOperationMetadata { + + /** UpdateExplanationDatasetOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null); + } + + /** Represents an UpdateExplanationDatasetOperationMetadata. */ + class UpdateExplanationDatasetOperationMetadata implements IUpdateExplanationDatasetOperationMetadata { + + /** + * Constructs a new UpdateExplanationDatasetOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetOperationMetadata); + + /** UpdateExplanationDatasetOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null); + + /** + * Creates a new UpdateExplanationDatasetOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateExplanationDatasetOperationMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetOperationMetadata): google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata; + + /** + * Encodes the specified UpdateExplanationDatasetOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata.verify|verify} messages. + * @param message UpdateExplanationDatasetOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExplanationDatasetOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata.verify|verify} messages. + * @param message UpdateExplanationDatasetOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateExplanationDatasetOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateExplanationDatasetOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata; + + /** + * Decodes an UpdateExplanationDatasetOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateExplanationDatasetOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata; + + /** + * Verifies an UpdateExplanationDatasetOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateExplanationDatasetOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateExplanationDatasetOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata; + + /** + * Creates a plain object from an UpdateExplanationDatasetOperationMetadata message. Also converts values to other types if specified. + * @param message UpdateExplanationDatasetOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExplanationDatasetOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a DeleteModelRequest. */ interface IDeleteModelRequest { @@ -104039,6 +104711,90 @@ export namespace google { } } + /** Properties of an UpdateExplanationDatasetResponse. */ + interface IUpdateExplanationDatasetResponse { + } + + /** Represents an UpdateExplanationDatasetResponse. */ + class UpdateExplanationDatasetResponse implements IUpdateExplanationDatasetResponse { + + /** + * Constructs a new UpdateExplanationDatasetResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetResponse); + + /** + * Creates a new UpdateExplanationDatasetResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateExplanationDatasetResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetResponse): google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse; + + /** + * Encodes the specified UpdateExplanationDatasetResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse.verify|verify} messages. + * @param message UpdateExplanationDatasetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExplanationDatasetResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse.verify|verify} messages. + * @param message UpdateExplanationDatasetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateExplanationDatasetResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateExplanationDatasetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse; + + /** + * Decodes an UpdateExplanationDatasetResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateExplanationDatasetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse; + + /** + * Verifies an UpdateExplanationDatasetResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateExplanationDatasetResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateExplanationDatasetResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse; + + /** + * Creates a plain object from an UpdateExplanationDatasetResponse message. Also converts values to other types if specified. + * @param message UpdateExplanationDatasetResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExplanationDatasetResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an ExportModelResponse. */ interface IExportModelResponse { } diff --git a/protos/protos.js b/protos/protos.js index e2547c91..d293feb3 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -150708,6 +150708,7 @@ * @memberof google.cloud.aiplatform.v1beta1 * @interface IExplanation * @property {Array.|null} [attributions] Explanation attributions + * @property {Array.|null} [neighbors] Explanation neighbors */ /** @@ -150720,6 +150721,7 @@ */ function Explanation(properties) { this.attributions = []; + this.neighbors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -150734,6 +150736,14 @@ */ Explanation.prototype.attributions = $util.emptyArray; + /** + * Explanation neighbors. + * @member {Array.} neighbors + * @memberof google.cloud.aiplatform.v1beta1.Explanation + * @instance + */ + Explanation.prototype.neighbors = $util.emptyArray; + /** * Creates a new Explanation instance using the specified properties. * @function create @@ -150761,6 +150771,9 @@ if (message.attributions != null && message.attributions.length) for (var i = 0; i < message.attributions.length; ++i) $root.google.cloud.aiplatform.v1beta1.Attribution.encode(message.attributions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.neighbors != null && message.neighbors.length) + for (var i = 0; i < message.neighbors.length; ++i) + $root.google.cloud.aiplatform.v1beta1.Neighbor.encode(message.neighbors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -150800,6 +150813,11 @@ message.attributions = []; message.attributions.push($root.google.cloud.aiplatform.v1beta1.Attribution.decode(reader, reader.uint32())); break; + case 2: + if (!(message.neighbors && message.neighbors.length)) + message.neighbors = []; + message.neighbors.push($root.google.cloud.aiplatform.v1beta1.Neighbor.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -150844,6 +150862,15 @@ return "attributions." + error; } } + if (message.neighbors != null && message.hasOwnProperty("neighbors")) { + if (!Array.isArray(message.neighbors)) + return "neighbors: array expected"; + for (var i = 0; i < message.neighbors.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.Neighbor.verify(message.neighbors[i]); + if (error) + return "neighbors." + error; + } + } return null; }; @@ -150869,6 +150896,16 @@ message.attributions[i] = $root.google.cloud.aiplatform.v1beta1.Attribution.fromObject(object.attributions[i]); } } + if (object.neighbors) { + if (!Array.isArray(object.neighbors)) + throw TypeError(".google.cloud.aiplatform.v1beta1.Explanation.neighbors: array expected"); + message.neighbors = []; + for (var i = 0; i < object.neighbors.length; ++i) { + if (typeof object.neighbors[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Explanation.neighbors: object expected"); + message.neighbors[i] = $root.google.cloud.aiplatform.v1beta1.Neighbor.fromObject(object.neighbors[i]); + } + } return message; }; @@ -150885,13 +150922,20 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.attributions = []; + object.neighbors = []; + } if (message.attributions && message.attributions.length) { object.attributions = []; for (var j = 0; j < message.attributions.length; ++j) object.attributions[j] = $root.google.cloud.aiplatform.v1beta1.Attribution.toObject(message.attributions[j], options); } + if (message.neighbors && message.neighbors.length) { + object.neighbors = []; + for (var j = 0; j < message.neighbors.length; ++j) + object.neighbors[j] = $root.google.cloud.aiplatform.v1beta1.Neighbor.toObject(message.neighbors[j], options); + } return object; }; @@ -151467,6 +151511,216 @@ return Attribution; })(); + v1beta1.Neighbor = (function() { + + /** + * Properties of a Neighbor. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface INeighbor + * @property {string|null} [neighborId] Neighbor neighborId + * @property {number|null} [neighborDistance] Neighbor neighborDistance + */ + + /** + * Constructs a new Neighbor. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a Neighbor. + * @implements INeighbor + * @constructor + * @param {google.cloud.aiplatform.v1beta1.INeighbor=} [properties] Properties to set + */ + function Neighbor(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Neighbor neighborId. + * @member {string} neighborId + * @memberof google.cloud.aiplatform.v1beta1.Neighbor + * @instance + */ + Neighbor.prototype.neighborId = ""; + + /** + * Neighbor neighborDistance. + * @member {number} neighborDistance + * @memberof google.cloud.aiplatform.v1beta1.Neighbor + * @instance + */ + Neighbor.prototype.neighborDistance = 0; + + /** + * Creates a new Neighbor instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.Neighbor + * @static + * @param {google.cloud.aiplatform.v1beta1.INeighbor=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.Neighbor} Neighbor instance + */ + Neighbor.create = function create(properties) { + return new Neighbor(properties); + }; + + /** + * Encodes the specified Neighbor message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Neighbor.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.Neighbor + * @static + * @param {google.cloud.aiplatform.v1beta1.INeighbor} message Neighbor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Neighbor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.neighborId != null && Object.hasOwnProperty.call(message, "neighborId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.neighborId); + if (message.neighborDistance != null && Object.hasOwnProperty.call(message, "neighborDistance")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.neighborDistance); + return writer; + }; + + /** + * Encodes the specified Neighbor message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Neighbor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Neighbor + * @static + * @param {google.cloud.aiplatform.v1beta1.INeighbor} message Neighbor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Neighbor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Neighbor message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.Neighbor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.Neighbor} Neighbor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Neighbor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.Neighbor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.neighborId = reader.string(); + break; + case 2: + message.neighborDistance = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Neighbor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Neighbor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.Neighbor} Neighbor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Neighbor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Neighbor message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.Neighbor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Neighbor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.neighborId != null && message.hasOwnProperty("neighborId")) + if (!$util.isString(message.neighborId)) + return "neighborId: string expected"; + if (message.neighborDistance != null && message.hasOwnProperty("neighborDistance")) + if (typeof message.neighborDistance !== "number") + return "neighborDistance: number expected"; + return null; + }; + + /** + * Creates a Neighbor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.Neighbor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.Neighbor} Neighbor + */ + Neighbor.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.Neighbor) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.Neighbor(); + if (object.neighborId != null) + message.neighborId = String(object.neighborId); + if (object.neighborDistance != null) + message.neighborDistance = Number(object.neighborDistance); + return message; + }; + + /** + * Creates a plain object from a Neighbor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.Neighbor + * @static + * @param {google.cloud.aiplatform.v1beta1.Neighbor} message Neighbor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Neighbor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.neighborId = ""; + object.neighborDistance = 0; + } + if (message.neighborId != null && message.hasOwnProperty("neighborId")) + object.neighborId = message.neighborId; + if (message.neighborDistance != null && message.hasOwnProperty("neighborDistance")) + object.neighborDistance = options.json && !isFinite(message.neighborDistance) ? String(message.neighborDistance) : message.neighborDistance; + return object; + }; + + /** + * Converts this Neighbor to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.Neighbor + * @instance + * @returns {Object.} JSON object + */ + Neighbor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Neighbor; + })(); + v1beta1.ExplanationSpec = (function() { /** @@ -153595,8 +153849,9 @@ * Properties of an Examples. * @memberof google.cloud.aiplatform.v1beta1 * @interface IExamples - * @property {google.cloud.aiplatform.v1beta1.IGcsSource|null} [gcsSource] Examples gcsSource * @property {google.protobuf.IValue|null} [nearestNeighborSearchConfig] Examples nearestNeighborSearchConfig + * @property {google.cloud.aiplatform.v1beta1.IPreset|null} [preset] Examples preset + * @property {google.cloud.aiplatform.v1beta1.IGcsSource|null} [gcsSource] Examples gcsSource * @property {number|null} [neighborCount] Examples neighborCount */ @@ -153616,20 +153871,28 @@ } /** - * Examples gcsSource. - * @member {google.cloud.aiplatform.v1beta1.IGcsSource|null|undefined} gcsSource + * Examples nearestNeighborSearchConfig. + * @member {google.protobuf.IValue|null|undefined} nearestNeighborSearchConfig * @memberof google.cloud.aiplatform.v1beta1.Examples * @instance */ - Examples.prototype.gcsSource = null; + Examples.prototype.nearestNeighborSearchConfig = null; /** - * Examples nearestNeighborSearchConfig. - * @member {google.protobuf.IValue|null|undefined} nearestNeighborSearchConfig + * Examples preset. + * @member {google.cloud.aiplatform.v1beta1.IPreset|null|undefined} preset * @memberof google.cloud.aiplatform.v1beta1.Examples * @instance */ - Examples.prototype.nearestNeighborSearchConfig = null; + Examples.prototype.preset = null; + + /** + * Examples gcsSource. + * @member {google.cloud.aiplatform.v1beta1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.aiplatform.v1beta1.Examples + * @instance + */ + Examples.prototype.gcsSource = null; /** * Examples neighborCount. @@ -153639,6 +153902,20 @@ */ Examples.prototype.neighborCount = 0; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Examples config. + * @member {"nearestNeighborSearchConfig"|"preset"|undefined} config + * @memberof google.cloud.aiplatform.v1beta1.Examples + * @instance + */ + Object.defineProperty(Examples.prototype, "config", { + get: $util.oneOfGetter($oneOfFields = ["nearestNeighborSearchConfig", "preset"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new Examples instance using the specified properties. * @function create @@ -153669,6 +153946,8 @@ $root.google.protobuf.Value.encode(message.nearestNeighborSearchConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.neighborCount != null && Object.hasOwnProperty.call(message, "neighborCount")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.neighborCount); + if (message.preset != null && Object.hasOwnProperty.call(message, "preset")) + $root.google.cloud.aiplatform.v1beta1.Preset.encode(message.preset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -153703,12 +153982,15 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.gcsSource = $root.google.cloud.aiplatform.v1beta1.GcsSource.decode(reader, reader.uint32()); - break; case 2: message.nearestNeighborSearchConfig = $root.google.protobuf.Value.decode(reader, reader.uint32()); break; + case 4: + message.preset = $root.google.cloud.aiplatform.v1beta1.Preset.decode(reader, reader.uint32()); + break; + case 1: + message.gcsSource = $root.google.cloud.aiplatform.v1beta1.GcsSource.decode(reader, reader.uint32()); + break; case 3: message.neighborCount = reader.int32(); break; @@ -153747,16 +154029,30 @@ Examples.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.nearestNeighborSearchConfig != null && message.hasOwnProperty("nearestNeighborSearchConfig")) { + properties.config = 1; + { + var error = $root.google.protobuf.Value.verify(message.nearestNeighborSearchConfig); + if (error) + return "nearestNeighborSearchConfig." + error; + } + } + if (message.preset != null && message.hasOwnProperty("preset")) { + if (properties.config === 1) + return "config: multiple values"; + properties.config = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.Preset.verify(message.preset); + if (error) + return "preset." + error; + } + } if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { var error = $root.google.cloud.aiplatform.v1beta1.GcsSource.verify(message.gcsSource); if (error) return "gcsSource." + error; } - if (message.nearestNeighborSearchConfig != null && message.hasOwnProperty("nearestNeighborSearchConfig")) { - var error = $root.google.protobuf.Value.verify(message.nearestNeighborSearchConfig); - if (error) - return "nearestNeighborSearchConfig." + error; - } if (message.neighborCount != null && message.hasOwnProperty("neighborCount")) if (!$util.isInteger(message.neighborCount)) return "neighborCount: integer expected"; @@ -153775,16 +154071,21 @@ if (object instanceof $root.google.cloud.aiplatform.v1beta1.Examples) return object; var message = new $root.google.cloud.aiplatform.v1beta1.Examples(); - if (object.gcsSource != null) { - if (typeof object.gcsSource !== "object") - throw TypeError(".google.cloud.aiplatform.v1beta1.Examples.gcsSource: object expected"); - message.gcsSource = $root.google.cloud.aiplatform.v1beta1.GcsSource.fromObject(object.gcsSource); - } if (object.nearestNeighborSearchConfig != null) { if (typeof object.nearestNeighborSearchConfig !== "object") throw TypeError(".google.cloud.aiplatform.v1beta1.Examples.nearestNeighborSearchConfig: object expected"); message.nearestNeighborSearchConfig = $root.google.protobuf.Value.fromObject(object.nearestNeighborSearchConfig); } + if (object.preset != null) { + if (typeof object.preset !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Examples.preset: object expected"); + message.preset = $root.google.cloud.aiplatform.v1beta1.Preset.fromObject(object.preset); + } + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Examples.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.aiplatform.v1beta1.GcsSource.fromObject(object.gcsSource); + } if (object.neighborCount != null) message.neighborCount = object.neighborCount | 0; return message; @@ -153805,15 +154106,22 @@ var object = {}; if (options.defaults) { object.gcsSource = null; - object.nearestNeighborSearchConfig = null; object.neighborCount = 0; } if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) object.gcsSource = $root.google.cloud.aiplatform.v1beta1.GcsSource.toObject(message.gcsSource, options); - if (message.nearestNeighborSearchConfig != null && message.hasOwnProperty("nearestNeighborSearchConfig")) + if (message.nearestNeighborSearchConfig != null && message.hasOwnProperty("nearestNeighborSearchConfig")) { object.nearestNeighborSearchConfig = $root.google.protobuf.Value.toObject(message.nearestNeighborSearchConfig, options); + if (options.oneofs) + object.config = "nearestNeighborSearchConfig"; + } if (message.neighborCount != null && message.hasOwnProperty("neighborCount")) object.neighborCount = message.neighborCount; + if (message.preset != null && message.hasOwnProperty("preset")) { + object.preset = $root.google.cloud.aiplatform.v1beta1.Preset.toObject(message.preset, options); + if (options.oneofs) + object.config = "preset"; + } return object; }; @@ -153831,6 +154139,302 @@ return Examples; })(); + v1beta1.Preset = (function() { + + /** + * Properties of a Preset. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IPreset + * @property {google.cloud.aiplatform.v1beta1.Preset.Query|null} [query] Preset query + * @property {google.cloud.aiplatform.v1beta1.Preset.Modality|null} [modality] Preset modality + */ + + /** + * Constructs a new Preset. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a Preset. + * @implements IPreset + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IPreset=} [properties] Properties to set + */ + function Preset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Preset query. + * @member {google.cloud.aiplatform.v1beta1.Preset.Query|null|undefined} query + * @memberof google.cloud.aiplatform.v1beta1.Preset + * @instance + */ + Preset.prototype.query = null; + + /** + * Preset modality. + * @member {google.cloud.aiplatform.v1beta1.Preset.Modality} modality + * @memberof google.cloud.aiplatform.v1beta1.Preset + * @instance + */ + Preset.prototype.modality = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Preset _query. + * @member {"query"|undefined} _query + * @memberof google.cloud.aiplatform.v1beta1.Preset + * @instance + */ + Object.defineProperty(Preset.prototype, "_query", { + get: $util.oneOfGetter($oneOfFields = ["query"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Preset instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.Preset + * @static + * @param {google.cloud.aiplatform.v1beta1.IPreset=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.Preset} Preset instance + */ + Preset.create = function create(properties) { + return new Preset(properties); + }; + + /** + * Encodes the specified Preset message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Preset.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.Preset + * @static + * @param {google.cloud.aiplatform.v1beta1.IPreset} message Preset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Preset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.query); + if (message.modality != null && Object.hasOwnProperty.call(message, "modality")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.modality); + return writer; + }; + + /** + * Encodes the specified Preset message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Preset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Preset + * @static + * @param {google.cloud.aiplatform.v1beta1.IPreset} message Preset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Preset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Preset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.Preset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.Preset} Preset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Preset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.Preset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.query = reader.int32(); + break; + case 2: + message.modality = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Preset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Preset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.Preset} Preset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Preset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Preset message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.Preset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Preset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.query != null && message.hasOwnProperty("query")) { + properties._query = 1; + switch (message.query) { + default: + return "query: enum value expected"; + case 0: + case 1: + break; + } + } + if (message.modality != null && message.hasOwnProperty("modality")) + switch (message.modality) { + default: + return "modality: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a Preset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.Preset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.Preset} Preset + */ + Preset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.Preset) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.Preset(); + switch (object.query) { + case "PRECISE": + case 0: + message.query = 0; + break; + case "FAST": + case 1: + message.query = 1; + break; + } + switch (object.modality) { + case "MODALITY_UNSPECIFIED": + case 0: + message.modality = 0; + break; + case "IMAGE": + case 1: + message.modality = 1; + break; + case "TEXT": + case 2: + message.modality = 2; + break; + case "TABULAR": + case 3: + message.modality = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a Preset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.Preset + * @static + * @param {google.cloud.aiplatform.v1beta1.Preset} message Preset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Preset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.modality = options.enums === String ? "MODALITY_UNSPECIFIED" : 0; + if (message.query != null && message.hasOwnProperty("query")) { + object.query = options.enums === String ? $root.google.cloud.aiplatform.v1beta1.Preset.Query[message.query] : message.query; + if (options.oneofs) + object._query = "query"; + } + if (message.modality != null && message.hasOwnProperty("modality")) + object.modality = options.enums === String ? $root.google.cloud.aiplatform.v1beta1.Preset.Modality[message.modality] : message.modality; + return object; + }; + + /** + * Converts this Preset to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.Preset + * @instance + * @returns {Object.} JSON object + */ + Preset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Query enum. + * @name google.cloud.aiplatform.v1beta1.Preset.Query + * @enum {number} + * @property {number} PRECISE=0 PRECISE value + * @property {number} FAST=1 FAST value + */ + Preset.Query = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRECISE"] = 0; + values[valuesById[1] = "FAST"] = 1; + return values; + })(); + + /** + * Modality enum. + * @name google.cloud.aiplatform.v1beta1.Preset.Modality + * @enum {number} + * @property {number} MODALITY_UNSPECIFIED=0 MODALITY_UNSPECIFIED value + * @property {number} IMAGE=1 IMAGE value + * @property {number} TEXT=2 TEXT value + * @property {number} TABULAR=3 TABULAR value + */ + Preset.Modality = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODALITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "IMAGE"] = 1; + values[valuesById[2] = "TEXT"] = 2; + values[valuesById[3] = "TABULAR"] = 3; + return values; + })(); + + return Preset; + })(); + v1beta1.ExplanationSpecOverride = (function() { /** @@ -153839,6 +154443,7 @@ * @interface IExplanationSpecOverride * @property {google.cloud.aiplatform.v1beta1.IExplanationParameters|null} [parameters] ExplanationSpecOverride parameters * @property {google.cloud.aiplatform.v1beta1.IExplanationMetadataOverride|null} [metadata] ExplanationSpecOverride metadata + * @property {google.cloud.aiplatform.v1beta1.IExamplesOverride|null} [examplesOverride] ExplanationSpecOverride examplesOverride */ /** @@ -153872,6 +154477,14 @@ */ ExplanationSpecOverride.prototype.metadata = null; + /** + * ExplanationSpecOverride examplesOverride. + * @member {google.cloud.aiplatform.v1beta1.IExamplesOverride|null|undefined} examplesOverride + * @memberof google.cloud.aiplatform.v1beta1.ExplanationSpecOverride + * @instance + */ + ExplanationSpecOverride.prototype.examplesOverride = null; + /** * Creates a new ExplanationSpecOverride instance using the specified properties. * @function create @@ -153900,6 +154513,8 @@ $root.google.cloud.aiplatform.v1beta1.ExplanationParameters.encode(message.parameters, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) $root.google.cloud.aiplatform.v1beta1.ExplanationMetadataOverride.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.examplesOverride != null && Object.hasOwnProperty.call(message, "examplesOverride")) + $root.google.cloud.aiplatform.v1beta1.ExamplesOverride.encode(message.examplesOverride, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -153940,6 +154555,9 @@ case 2: message.metadata = $root.google.cloud.aiplatform.v1beta1.ExplanationMetadataOverride.decode(reader, reader.uint32()); break; + case 3: + message.examplesOverride = $root.google.cloud.aiplatform.v1beta1.ExamplesOverride.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -153985,6 +154603,11 @@ if (error) return "metadata." + error; } + if (message.examplesOverride != null && message.hasOwnProperty("examplesOverride")) { + var error = $root.google.cloud.aiplatform.v1beta1.ExamplesOverride.verify(message.examplesOverride); + if (error) + return "examplesOverride." + error; + } return null; }; @@ -154010,6 +154633,11 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.ExplanationSpecOverride.metadata: object expected"); message.metadata = $root.google.cloud.aiplatform.v1beta1.ExplanationMetadataOverride.fromObject(object.metadata); } + if (object.examplesOverride != null) { + if (typeof object.examplesOverride !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.ExplanationSpecOverride.examplesOverride: object expected"); + message.examplesOverride = $root.google.cloud.aiplatform.v1beta1.ExamplesOverride.fromObject(object.examplesOverride); + } return message; }; @@ -154029,11 +154657,14 @@ if (options.defaults) { object.parameters = null; object.metadata = null; + object.examplesOverride = null; } if (message.parameters != null && message.hasOwnProperty("parameters")) object.parameters = $root.google.cloud.aiplatform.v1beta1.ExplanationParameters.toObject(message.parameters, options); if (message.metadata != null && message.hasOwnProperty("metadata")) object.metadata = $root.google.cloud.aiplatform.v1beta1.ExplanationMetadataOverride.toObject(message.metadata, options); + if (message.examplesOverride != null && message.hasOwnProperty("examplesOverride")) + object.examplesOverride = $root.google.cloud.aiplatform.v1beta1.ExamplesOverride.toObject(message.examplesOverride, options); return object; }; @@ -154488,6 +155119,603 @@ return ExplanationMetadataOverride; })(); + v1beta1.ExamplesOverride = (function() { + + /** + * Properties of an ExamplesOverride. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IExamplesOverride + * @property {number|null} [neighborCount] ExamplesOverride neighborCount + * @property {number|null} [crowdingCount] ExamplesOverride crowdingCount + * @property {Array.|null} [restrictions] ExamplesOverride restrictions + * @property {boolean|null} [returnEmbeddings] ExamplesOverride returnEmbeddings + * @property {google.cloud.aiplatform.v1beta1.ExamplesOverride.DataFormat|null} [dataFormat] ExamplesOverride dataFormat + */ + + /** + * Constructs a new ExamplesOverride. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an ExamplesOverride. + * @implements IExamplesOverride + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IExamplesOverride=} [properties] Properties to set + */ + function ExamplesOverride(properties) { + this.restrictions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExamplesOverride neighborCount. + * @member {number} neighborCount + * @memberof google.cloud.aiplatform.v1beta1.ExamplesOverride + * @instance + */ + ExamplesOverride.prototype.neighborCount = 0; + + /** + * ExamplesOverride crowdingCount. + * @member {number} crowdingCount + * @memberof google.cloud.aiplatform.v1beta1.ExamplesOverride + * @instance + */ + ExamplesOverride.prototype.crowdingCount = 0; + + /** + * ExamplesOverride restrictions. + * @member {Array.} restrictions + * @memberof google.cloud.aiplatform.v1beta1.ExamplesOverride + * @instance + */ + ExamplesOverride.prototype.restrictions = $util.emptyArray; + + /** + * ExamplesOverride returnEmbeddings. + * @member {boolean} returnEmbeddings + * @memberof google.cloud.aiplatform.v1beta1.ExamplesOverride + * @instance + */ + ExamplesOverride.prototype.returnEmbeddings = false; + + /** + * ExamplesOverride dataFormat. + * @member {google.cloud.aiplatform.v1beta1.ExamplesOverride.DataFormat} dataFormat + * @memberof google.cloud.aiplatform.v1beta1.ExamplesOverride + * @instance + */ + ExamplesOverride.prototype.dataFormat = 0; + + /** + * Creates a new ExamplesOverride instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.ExamplesOverride + * @static + * @param {google.cloud.aiplatform.v1beta1.IExamplesOverride=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.ExamplesOverride} ExamplesOverride instance + */ + ExamplesOverride.create = function create(properties) { + return new ExamplesOverride(properties); + }; + + /** + * Encodes the specified ExamplesOverride message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ExamplesOverride.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.ExamplesOverride + * @static + * @param {google.cloud.aiplatform.v1beta1.IExamplesOverride} message ExamplesOverride message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExamplesOverride.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.neighborCount != null && Object.hasOwnProperty.call(message, "neighborCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.neighborCount); + if (message.crowdingCount != null && Object.hasOwnProperty.call(message, "crowdingCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.crowdingCount); + if (message.restrictions != null && message.restrictions.length) + for (var i = 0; i < message.restrictions.length; ++i) + $root.google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace.encode(message.restrictions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.returnEmbeddings != null && Object.hasOwnProperty.call(message, "returnEmbeddings")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.returnEmbeddings); + if (message.dataFormat != null && Object.hasOwnProperty.call(message, "dataFormat")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.dataFormat); + return writer; + }; + + /** + * Encodes the specified ExamplesOverride message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ExamplesOverride.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ExamplesOverride + * @static + * @param {google.cloud.aiplatform.v1beta1.IExamplesOverride} message ExamplesOverride message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExamplesOverride.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExamplesOverride message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.ExamplesOverride + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.ExamplesOverride} ExamplesOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExamplesOverride.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.ExamplesOverride(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.neighborCount = reader.int32(); + break; + case 2: + message.crowdingCount = reader.int32(); + break; + case 3: + if (!(message.restrictions && message.restrictions.length)) + message.restrictions = []; + message.restrictions.push($root.google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace.decode(reader, reader.uint32())); + break; + case 4: + message.returnEmbeddings = reader.bool(); + break; + case 5: + message.dataFormat = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExamplesOverride message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ExamplesOverride + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.ExamplesOverride} ExamplesOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExamplesOverride.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExamplesOverride message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.ExamplesOverride + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExamplesOverride.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.neighborCount != null && message.hasOwnProperty("neighborCount")) + if (!$util.isInteger(message.neighborCount)) + return "neighborCount: integer expected"; + if (message.crowdingCount != null && message.hasOwnProperty("crowdingCount")) + if (!$util.isInteger(message.crowdingCount)) + return "crowdingCount: integer expected"; + if (message.restrictions != null && message.hasOwnProperty("restrictions")) { + if (!Array.isArray(message.restrictions)) + return "restrictions: array expected"; + for (var i = 0; i < message.restrictions.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace.verify(message.restrictions[i]); + if (error) + return "restrictions." + error; + } + } + if (message.returnEmbeddings != null && message.hasOwnProperty("returnEmbeddings")) + if (typeof message.returnEmbeddings !== "boolean") + return "returnEmbeddings: boolean expected"; + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + switch (message.dataFormat) { + default: + return "dataFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ExamplesOverride message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.ExamplesOverride + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.ExamplesOverride} ExamplesOverride + */ + ExamplesOverride.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.ExamplesOverride) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.ExamplesOverride(); + if (object.neighborCount != null) + message.neighborCount = object.neighborCount | 0; + if (object.crowdingCount != null) + message.crowdingCount = object.crowdingCount | 0; + if (object.restrictions) { + if (!Array.isArray(object.restrictions)) + throw TypeError(".google.cloud.aiplatform.v1beta1.ExamplesOverride.restrictions: array expected"); + message.restrictions = []; + for (var i = 0; i < object.restrictions.length; ++i) { + if (typeof object.restrictions[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.ExamplesOverride.restrictions: object expected"); + message.restrictions[i] = $root.google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace.fromObject(object.restrictions[i]); + } + } + if (object.returnEmbeddings != null) + message.returnEmbeddings = Boolean(object.returnEmbeddings); + switch (object.dataFormat) { + case "DATA_FORMAT_UNSPECIFIED": + case 0: + message.dataFormat = 0; + break; + case "INSTANCES": + case 1: + message.dataFormat = 1; + break; + case "EMBEDDINGS": + case 2: + message.dataFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExamplesOverride message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.ExamplesOverride + * @static + * @param {google.cloud.aiplatform.v1beta1.ExamplesOverride} message ExamplesOverride + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExamplesOverride.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.restrictions = []; + if (options.defaults) { + object.neighborCount = 0; + object.crowdingCount = 0; + object.returnEmbeddings = false; + object.dataFormat = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; + } + if (message.neighborCount != null && message.hasOwnProperty("neighborCount")) + object.neighborCount = message.neighborCount; + if (message.crowdingCount != null && message.hasOwnProperty("crowdingCount")) + object.crowdingCount = message.crowdingCount; + if (message.restrictions && message.restrictions.length) { + object.restrictions = []; + for (var j = 0; j < message.restrictions.length; ++j) + object.restrictions[j] = $root.google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace.toObject(message.restrictions[j], options); + } + if (message.returnEmbeddings != null && message.hasOwnProperty("returnEmbeddings")) + object.returnEmbeddings = message.returnEmbeddings; + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + object.dataFormat = options.enums === String ? $root.google.cloud.aiplatform.v1beta1.ExamplesOverride.DataFormat[message.dataFormat] : message.dataFormat; + return object; + }; + + /** + * Converts this ExamplesOverride to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.ExamplesOverride + * @instance + * @returns {Object.} JSON object + */ + ExamplesOverride.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * DataFormat enum. + * @name google.cloud.aiplatform.v1beta1.ExamplesOverride.DataFormat + * @enum {number} + * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value + * @property {number} INSTANCES=1 INSTANCES value + * @property {number} EMBEDDINGS=2 EMBEDDINGS value + */ + ExamplesOverride.DataFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSTANCES"] = 1; + values[valuesById[2] = "EMBEDDINGS"] = 2; + return values; + })(); + + return ExamplesOverride; + })(); + + v1beta1.ExamplesRestrictionsNamespace = (function() { + + /** + * Properties of an ExamplesRestrictionsNamespace. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IExamplesRestrictionsNamespace + * @property {string|null} [namespaceName] ExamplesRestrictionsNamespace namespaceName + * @property {Array.|null} [allow] ExamplesRestrictionsNamespace allow + * @property {Array.|null} [deny] ExamplesRestrictionsNamespace deny + */ + + /** + * Constructs a new ExamplesRestrictionsNamespace. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an ExamplesRestrictionsNamespace. + * @implements IExamplesRestrictionsNamespace + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IExamplesRestrictionsNamespace=} [properties] Properties to set + */ + function ExamplesRestrictionsNamespace(properties) { + this.allow = []; + this.deny = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExamplesRestrictionsNamespace namespaceName. + * @member {string} namespaceName + * @memberof google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace + * @instance + */ + ExamplesRestrictionsNamespace.prototype.namespaceName = ""; + + /** + * ExamplesRestrictionsNamespace allow. + * @member {Array.} allow + * @memberof google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace + * @instance + */ + ExamplesRestrictionsNamespace.prototype.allow = $util.emptyArray; + + /** + * ExamplesRestrictionsNamespace deny. + * @member {Array.} deny + * @memberof google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace + * @instance + */ + ExamplesRestrictionsNamespace.prototype.deny = $util.emptyArray; + + /** + * Creates a new ExamplesRestrictionsNamespace instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace + * @static + * @param {google.cloud.aiplatform.v1beta1.IExamplesRestrictionsNamespace=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace} ExamplesRestrictionsNamespace instance + */ + ExamplesRestrictionsNamespace.create = function create(properties) { + return new ExamplesRestrictionsNamespace(properties); + }; + + /** + * Encodes the specified ExamplesRestrictionsNamespace message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace + * @static + * @param {google.cloud.aiplatform.v1beta1.IExamplesRestrictionsNamespace} message ExamplesRestrictionsNamespace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExamplesRestrictionsNamespace.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.namespaceName != null && Object.hasOwnProperty.call(message, "namespaceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namespaceName); + if (message.allow != null && message.allow.length) + for (var i = 0; i < message.allow.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allow[i]); + if (message.deny != null && message.deny.length) + for (var i = 0; i < message.deny.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deny[i]); + return writer; + }; + + /** + * Encodes the specified ExamplesRestrictionsNamespace message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace + * @static + * @param {google.cloud.aiplatform.v1beta1.IExamplesRestrictionsNamespace} message ExamplesRestrictionsNamespace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExamplesRestrictionsNamespace.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExamplesRestrictionsNamespace message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace} ExamplesRestrictionsNamespace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExamplesRestrictionsNamespace.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namespaceName = reader.string(); + break; + case 2: + if (!(message.allow && message.allow.length)) + message.allow = []; + message.allow.push(reader.string()); + break; + case 3: + if (!(message.deny && message.deny.length)) + message.deny = []; + message.deny.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExamplesRestrictionsNamespace message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace} ExamplesRestrictionsNamespace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExamplesRestrictionsNamespace.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExamplesRestrictionsNamespace message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExamplesRestrictionsNamespace.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.namespaceName != null && message.hasOwnProperty("namespaceName")) + if (!$util.isString(message.namespaceName)) + return "namespaceName: string expected"; + if (message.allow != null && message.hasOwnProperty("allow")) { + if (!Array.isArray(message.allow)) + return "allow: array expected"; + for (var i = 0; i < message.allow.length; ++i) + if (!$util.isString(message.allow[i])) + return "allow: string[] expected"; + } + if (message.deny != null && message.hasOwnProperty("deny")) { + if (!Array.isArray(message.deny)) + return "deny: array expected"; + for (var i = 0; i < message.deny.length; ++i) + if (!$util.isString(message.deny[i])) + return "deny: string[] expected"; + } + return null; + }; + + /** + * Creates an ExamplesRestrictionsNamespace message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace} ExamplesRestrictionsNamespace + */ + ExamplesRestrictionsNamespace.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace(); + if (object.namespaceName != null) + message.namespaceName = String(object.namespaceName); + if (object.allow) { + if (!Array.isArray(object.allow)) + throw TypeError(".google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace.allow: array expected"); + message.allow = []; + for (var i = 0; i < object.allow.length; ++i) + message.allow[i] = String(object.allow[i]); + } + if (object.deny) { + if (!Array.isArray(object.deny)) + throw TypeError(".google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace.deny: array expected"); + message.deny = []; + for (var i = 0; i < object.deny.length; ++i) + message.deny[i] = String(object.deny[i]); + } + return message; + }; + + /** + * Creates a plain object from an ExamplesRestrictionsNamespace message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace + * @static + * @param {google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace} message ExamplesRestrictionsNamespace + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExamplesRestrictionsNamespace.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allow = []; + object.deny = []; + } + if (options.defaults) + object.namespaceName = ""; + if (message.namespaceName != null && message.hasOwnProperty("namespaceName")) + object.namespaceName = message.namespaceName; + if (message.allow && message.allow.length) { + object.allow = []; + for (var j = 0; j < message.allow.length; ++j) + object.allow[j] = message.allow[j]; + } + if (message.deny && message.deny.length) { + object.deny = []; + for (var j = 0; j < message.deny.length; ++j) + object.deny[j] = message.deny[j]; + } + return object; + }; + + /** + * Converts this ExamplesRestrictionsNamespace to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.ExamplesRestrictionsNamespace + * @instance + * @returns {Object.} JSON object + */ + ExamplesRestrictionsNamespace.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExamplesRestrictionsNamespace; + })(); + v1beta1.ExplanationMetadata = (function() { /** @@ -154497,6 +155725,7 @@ * @property {Object.|null} [inputs] ExplanationMetadata inputs * @property {Object.|null} [outputs] ExplanationMetadata outputs * @property {string|null} [featureAttributionsSchemaUri] ExplanationMetadata featureAttributionsSchemaUri + * @property {string|null} [latentSpaceSource] ExplanationMetadata latentSpaceSource */ /** @@ -154540,6 +155769,14 @@ */ ExplanationMetadata.prototype.featureAttributionsSchemaUri = ""; + /** + * ExplanationMetadata latentSpaceSource. + * @member {string} latentSpaceSource + * @memberof google.cloud.aiplatform.v1beta1.ExplanationMetadata + * @instance + */ + ExplanationMetadata.prototype.latentSpaceSource = ""; + /** * Creates a new ExplanationMetadata instance using the specified properties. * @function create @@ -154576,6 +155813,8 @@ } if (message.featureAttributionsSchemaUri != null && Object.hasOwnProperty.call(message, "featureAttributionsSchemaUri")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.featureAttributionsSchemaUri); + if (message.latentSpaceSource != null && Object.hasOwnProperty.call(message, "latentSpaceSource")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.latentSpaceSource); return writer; }; @@ -154657,6 +155896,9 @@ case 3: message.featureAttributionsSchemaUri = reader.string(); break; + case 5: + message.latentSpaceSource = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -154715,6 +155957,9 @@ if (message.featureAttributionsSchemaUri != null && message.hasOwnProperty("featureAttributionsSchemaUri")) if (!$util.isString(message.featureAttributionsSchemaUri)) return "featureAttributionsSchemaUri: string expected"; + if (message.latentSpaceSource != null && message.hasOwnProperty("latentSpaceSource")) + if (!$util.isString(message.latentSpaceSource)) + return "latentSpaceSource: string expected"; return null; }; @@ -154752,6 +155997,8 @@ } if (object.featureAttributionsSchemaUri != null) message.featureAttributionsSchemaUri = String(object.featureAttributionsSchemaUri); + if (object.latentSpaceSource != null) + message.latentSpaceSource = String(object.latentSpaceSource); return message; }; @@ -154772,8 +156019,10 @@ object.inputs = {}; object.outputs = {}; } - if (options.defaults) + if (options.defaults) { object.featureAttributionsSchemaUri = ""; + object.latentSpaceSource = ""; + } var keys2; if (message.inputs && (keys2 = Object.keys(message.inputs)).length) { object.inputs = {}; @@ -154787,6 +156036,8 @@ } if (message.featureAttributionsSchemaUri != null && message.hasOwnProperty("featureAttributionsSchemaUri")) object.featureAttributionsSchemaUri = message.featureAttributionsSchemaUri; + if (message.latentSpaceSource != null && message.hasOwnProperty("latentSpaceSource")) + object.latentSpaceSource = message.latentSpaceSource; return object; }; @@ -244698,6 +245949,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.ModelService#updateExplanationDataset}. + * @memberof google.cloud.aiplatform.v1beta1.ModelService + * @typedef UpdateExplanationDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateExplanationDataset. + * @function updateExplanationDataset + * @memberof google.cloud.aiplatform.v1beta1.ModelService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest} request UpdateExplanationDatasetRequest message or plain object + * @param {google.cloud.aiplatform.v1beta1.ModelService.UpdateExplanationDatasetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.updateExplanationDataset = function updateExplanationDataset(request, callback) { + return this.rpcCall(updateExplanationDataset, $root.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateExplanationDataset" }); + + /** + * Calls UpdateExplanationDataset. + * @function updateExplanationDataset + * @memberof google.cloud.aiplatform.v1beta1.ModelService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest} request UpdateExplanationDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.aiplatform.v1beta1.ModelService#deleteModel}. * @memberof google.cloud.aiplatform.v1beta1.ModelService @@ -247090,6 +248374,413 @@ return UpdateModelRequest; })(); + v1beta1.UpdateExplanationDatasetRequest = (function() { + + /** + * Properties of an UpdateExplanationDatasetRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IUpdateExplanationDatasetRequest + * @property {string|null} [model] UpdateExplanationDatasetRequest model + * @property {google.cloud.aiplatform.v1beta1.IExamples|null} [examples] UpdateExplanationDatasetRequest examples + */ + + /** + * Constructs a new UpdateExplanationDatasetRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an UpdateExplanationDatasetRequest. + * @implements IUpdateExplanationDatasetRequest + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest=} [properties] Properties to set + */ + function UpdateExplanationDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateExplanationDatasetRequest model. + * @member {string} model + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest + * @instance + */ + UpdateExplanationDatasetRequest.prototype.model = ""; + + /** + * UpdateExplanationDatasetRequest examples. + * @member {google.cloud.aiplatform.v1beta1.IExamples|null|undefined} examples + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest + * @instance + */ + UpdateExplanationDatasetRequest.prototype.examples = null; + + /** + * Creates a new UpdateExplanationDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest} UpdateExplanationDatasetRequest instance + */ + UpdateExplanationDatasetRequest.create = function create(properties) { + return new UpdateExplanationDatasetRequest(properties); + }; + + /** + * Encodes the specified UpdateExplanationDatasetRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest} message UpdateExplanationDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExplanationDatasetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.examples != null && Object.hasOwnProperty.call(message, "examples")) + $root.google.cloud.aiplatform.v1beta1.Examples.encode(message.examples, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateExplanationDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest} message UpdateExplanationDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExplanationDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateExplanationDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest} UpdateExplanationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExplanationDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.model = reader.string(); + break; + case 2: + message.examples = $root.google.cloud.aiplatform.v1beta1.Examples.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateExplanationDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest} UpdateExplanationDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExplanationDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateExplanationDatasetRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateExplanationDatasetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.examples != null && message.hasOwnProperty("examples")) { + var error = $root.google.cloud.aiplatform.v1beta1.Examples.verify(message.examples); + if (error) + return "examples." + error; + } + return null; + }; + + /** + * Creates an UpdateExplanationDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest} UpdateExplanationDatasetRequest + */ + UpdateExplanationDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.examples != null) { + if (typeof object.examples !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest.examples: object expected"); + message.examples = $root.google.cloud.aiplatform.v1beta1.Examples.fromObject(object.examples); + } + return message; + }; + + /** + * Creates a plain object from an UpdateExplanationDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest} message UpdateExplanationDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateExplanationDatasetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.examples = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.examples != null && message.hasOwnProperty("examples")) + object.examples = $root.google.cloud.aiplatform.v1beta1.Examples.toObject(message.examples, options); + return object; + }; + + /** + * Converts this UpdateExplanationDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateExplanationDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateExplanationDatasetRequest; + })(); + + v1beta1.UpdateExplanationDatasetOperationMetadata = (function() { + + /** + * Properties of an UpdateExplanationDatasetOperationMetadata. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IUpdateExplanationDatasetOperationMetadata + * @property {google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null} [genericMetadata] UpdateExplanationDatasetOperationMetadata genericMetadata + */ + + /** + * Constructs a new UpdateExplanationDatasetOperationMetadata. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an UpdateExplanationDatasetOperationMetadata. + * @implements IUpdateExplanationDatasetOperationMetadata + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetOperationMetadata=} [properties] Properties to set + */ + function UpdateExplanationDatasetOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateExplanationDatasetOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata + * @instance + */ + UpdateExplanationDatasetOperationMetadata.prototype.genericMetadata = null; + + /** + * Creates a new UpdateExplanationDatasetOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata} UpdateExplanationDatasetOperationMetadata instance + */ + UpdateExplanationDatasetOperationMetadata.create = function create(properties) { + return new UpdateExplanationDatasetOperationMetadata(properties); + }; + + /** + * Encodes the specified UpdateExplanationDatasetOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetOperationMetadata} message UpdateExplanationDatasetOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExplanationDatasetOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateExplanationDatasetOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetOperationMetadata} message UpdateExplanationDatasetOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExplanationDatasetOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateExplanationDatasetOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata} UpdateExplanationDatasetOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExplanationDatasetOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateExplanationDatasetOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata} UpdateExplanationDatasetOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExplanationDatasetOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateExplanationDatasetOperationMetadata message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateExplanationDatasetOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; + } + return null; + }; + + /** + * Creates an UpdateExplanationDatasetOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata} UpdateExplanationDatasetOperationMetadata + */ + UpdateExplanationDatasetOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.fromObject(object.genericMetadata); + } + return message; + }; + + /** + * Creates a plain object from an UpdateExplanationDatasetOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata} message UpdateExplanationDatasetOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateExplanationDatasetOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.genericMetadata = null; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.toObject(message.genericMetadata, options); + return object; + }; + + /** + * Converts this UpdateExplanationDatasetOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateExplanationDatasetOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateExplanationDatasetOperationMetadata; + })(); + v1beta1.DeleteModelRequest = (function() { /** @@ -248577,6 +250268,166 @@ return ExportModelOperationMetadata; })(); + v1beta1.UpdateExplanationDatasetResponse = (function() { + + /** + * Properties of an UpdateExplanationDatasetResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IUpdateExplanationDatasetResponse + */ + + /** + * Constructs a new UpdateExplanationDatasetResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an UpdateExplanationDatasetResponse. + * @implements IUpdateExplanationDatasetResponse + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetResponse=} [properties] Properties to set + */ + function UpdateExplanationDatasetResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new UpdateExplanationDatasetResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse} UpdateExplanationDatasetResponse instance + */ + UpdateExplanationDatasetResponse.create = function create(properties) { + return new UpdateExplanationDatasetResponse(properties); + }; + + /** + * Encodes the specified UpdateExplanationDatasetResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetResponse} message UpdateExplanationDatasetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExplanationDatasetResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UpdateExplanationDatasetResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetResponse} message UpdateExplanationDatasetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExplanationDatasetResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateExplanationDatasetResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse} UpdateExplanationDatasetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExplanationDatasetResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateExplanationDatasetResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse} UpdateExplanationDatasetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExplanationDatasetResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateExplanationDatasetResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateExplanationDatasetResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UpdateExplanationDatasetResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse} UpdateExplanationDatasetResponse + */ + UpdateExplanationDatasetResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse) + return object; + return new $root.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse(); + }; + + /** + * Creates a plain object from an UpdateExplanationDatasetResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse} message UpdateExplanationDatasetResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateExplanationDatasetResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UpdateExplanationDatasetResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse + * @instance + * @returns {Object.} JSON object + */ + UpdateExplanationDatasetResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateExplanationDatasetResponse; + })(); + v1beta1.ExportModelResponse = (function() { /** diff --git a/protos/protos.json b/protos/protos.json index 39e746d7..8fb1a4fc 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -17144,6 +17144,14 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "neighbors": { + "rule": "repeated", + "type": "Neighbor", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -17213,6 +17221,24 @@ } } }, + "Neighbor": { + "fields": { + "neighborId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "neighborDistance": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, "ExplanationSpec": { "fields": { "parameters": { @@ -17374,21 +17400,71 @@ } }, "Examples": { + "oneofs": { + "config": { + "oneof": [ + "nearestNeighborSearchConfig", + "preset" + ] + } + }, "fields": { - "gcsSource": { - "type": "GcsSource", - "id": 1 - }, "nearestNeighborSearchConfig": { "type": "google.protobuf.Value", "id": 2 }, + "preset": { + "type": "Preset", + "id": 4 + }, + "gcsSource": { + "type": "GcsSource", + "id": 1 + }, "neighborCount": { "type": "int32", "id": 3 } } }, + "Preset": { + "oneofs": { + "_query": { + "oneof": [ + "query" + ] + } + }, + "fields": { + "query": { + "type": "Query", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "modality": { + "type": "Modality", + "id": 2 + } + }, + "nested": { + "Query": { + "values": { + "PRECISE": 0, + "FAST": 1 + } + }, + "Modality": { + "values": { + "MODALITY_UNSPECIFIED": 0, + "IMAGE": 1, + "TEXT": 2, + "TABULAR": 3 + } + } + } + }, "ExplanationSpecOverride": { "fields": { "parameters": { @@ -17398,6 +17474,10 @@ "metadata": { "type": "ExplanationMetadataOverride", "id": 2 + }, + "examplesOverride": { + "type": "ExamplesOverride", + "id": 3 } } }, @@ -17424,6 +17504,58 @@ } } }, + "ExamplesOverride": { + "fields": { + "neighborCount": { + "type": "int32", + "id": 1 + }, + "crowdingCount": { + "type": "int32", + "id": 2 + }, + "restrictions": { + "rule": "repeated", + "type": "ExamplesRestrictionsNamespace", + "id": 3 + }, + "returnEmbeddings": { + "type": "bool", + "id": 4 + }, + "dataFormat": { + "type": "DataFormat", + "id": 5 + } + }, + "nested": { + "DataFormat": { + "values": { + "DATA_FORMAT_UNSPECIFIED": 0, + "INSTANCES": 1, + "EMBEDDINGS": 2 + } + } + } + }, + "ExamplesRestrictionsNamespace": { + "fields": { + "namespaceName": { + "type": "string", + "id": 1 + }, + "allow": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "deny": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, "ExplanationMetadata": { "fields": { "inputs": { @@ -17445,6 +17577,10 @@ "featureAttributionsSchemaUri": { "type": "string", "id": 3 + }, + "latentSpaceSource": { + "type": "string", + "id": 5 } }, "nested": { @@ -27973,6 +28109,34 @@ } ] }, + "UpdateExplanationDataset": { + "requestType": "UpdateExplanationDatasetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{model=projects/*/locations/*/models/*}:updateExplanationDataset", + "(google.api.http).body": "*", + "(google.api.method_signature)": "model", + "(google.longrunning.operation_info).response_type": "UpdateExplanationDatasetResponse", + "(google.longrunning.operation_info).metadata_type": "UpdateExplanationDatasetOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{model=projects/*/locations/*/models/*}:updateExplanationDataset", + "body": "*" + } + }, + { + "(google.api.method_signature)": "model" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "UpdateExplanationDatasetResponse", + "metadata_type": "UpdateExplanationDatasetOperationMetadata" + } + } + ] + }, "DeleteModel": { "requestType": "DeleteModelRequest", "responseType": "google.longrunning.Operation", @@ -28338,6 +28502,30 @@ } } }, + "UpdateExplanationDatasetRequest": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Model" + } + }, + "examples": { + "type": "Examples", + "id": 2 + } + } + }, + "UpdateExplanationDatasetOperationMetadata": { + "fields": { + "genericMetadata": { + "type": "GenericOperationMetadata", + "id": 1 + } + } + }, "DeleteModelRequest": { "fields": { "name": { @@ -28454,6 +28642,9 @@ } } }, + "UpdateExplanationDatasetResponse": { + "fields": {} + }, "ExportModelResponse": { "fields": {} }, diff --git a/samples/generated/v1beta1/model_service.export_model.js b/samples/generated/v1beta1/model_service.export_model.js index 470c5b25..01f38fdc 100644 --- a/samples/generated/v1beta1/model_service.export_model.js +++ b/samples/generated/v1beta1/model_service.export_model.js @@ -27,6 +27,8 @@ function main(name, outputConfig) { */ /** * Required. The resource name of the Model to export. + * The resource name may contain version id or version alias to specify the + * version, if no version is specified, the default version will be exported. */ // const name = 'abc123' /** diff --git a/samples/generated/v1beta1/model_service.get_model.js b/samples/generated/v1beta1/model_service.get_model.js index 8841f719..e9c2de6e 100644 --- a/samples/generated/v1beta1/model_service.get_model.js +++ b/samples/generated/v1beta1/model_service.get_model.js @@ -28,6 +28,15 @@ function main(name) { /** * Required. The name of the Model resource. * Format: `projects/{project}/locations/{location}/models/{model}` + * In order to retrieve a specific version of the model, also provide + * the version ID or version alias. + * Example: projects/{project}/locations/{location}/models/{model}@2 + * or + * projects/{project}/locations/{location}/models/{model}@golden + * If no version ID or alias is specified, the "default" version will be + * returned. The "default" version alias is created for the first version of + * the model, and can be moved to other versions later on. There will be + * exactly one default version. */ // const name = 'abc123' diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.update_explanation_dataset.js b/samples/generated/v1beta1/model_service.update_explanation_dataset.js similarity index 100% rename from owl-bot-staging/v1beta1/samples/generated/v1beta1/model_service.update_explanation_dataset.js rename to samples/generated/v1beta1/model_service.update_explanation_dataset.js diff --git a/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json b/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json index 5e087b4e..b832c34f 100644 --- a/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json +++ b/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json @@ -5342,7 +5342,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 60, "type": "FULL" } ], @@ -5527,6 +5527,50 @@ } } }, + { + "regionTag": "aiplatform_v1beta1_generated_ModelService_UpdateExplanationDataset_async", + "title": "DatasetService updateExplanationDataset Sample", + "origin": "API_DEFINITION", + "description": " Incremental update the dataset used for a examples model.", + "canonical": true, + "file": "model_service.update_explanation_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateExplanationDataset", + "fullName": "google.cloud.aiplatform.v1beta1.ModelService.UpdateExplanationDataset", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "examples", + "type": ".google.cloud.aiplatform.v1beta1.Examples" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ModelServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.ModelServiceClient" + }, + "method": { + "shortName": "UpdateExplanationDataset", + "fullName": "google.cloud.aiplatform.v1beta1.ModelService.UpdateExplanationDataset", + "service": { + "shortName": "ModelService", + "fullName": "google.cloud.aiplatform.v1beta1.ModelService" + } + } + } + }, { "regionTag": "aiplatform_v1beta1_generated_ModelService_DeleteModel_async", "title": "DatasetService deleteModel Sample", @@ -5662,7 +5706,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 58, "type": "FULL" } ], diff --git a/src/v1beta1/gapic_metadata.json b/src/v1beta1/gapic_metadata.json index 52343ee5..a8aca391 100644 --- a/src/v1beta1/gapic_metadata.json +++ b/src/v1beta1/gapic_metadata.json @@ -1384,6 +1384,11 @@ "uploadModel" ] }, + "UpdateExplanationDataset": { + "methods": [ + "updateExplanationDataset" + ] + }, "DeleteModel": { "methods": [ "deleteModel" @@ -1467,6 +1472,11 @@ "uploadModel" ] }, + "UpdateExplanationDataset": { + "methods": [ + "updateExplanationDataset" + ] + }, "DeleteModel": { "methods": [ "deleteModel" diff --git a/src/v1beta1/model_service_client.ts b/src/v1beta1/model_service_client.ts index c16ccca2..a43309a4 100644 --- a/src/v1beta1/model_service_client.ts +++ b/src/v1beta1/model_service_client.ts @@ -312,6 +312,12 @@ export class ModelServiceClient { const uploadModelMetadata = protoFilesRoot.lookup( '.google.cloud.aiplatform.v1beta1.UploadModelOperationMetadata' ) as gax.protobuf.Type; + const updateExplanationDatasetResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse' + ) as gax.protobuf.Type; + const updateExplanationDatasetMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata' + ) as gax.protobuf.Type; const deleteModelResponse = protoFilesRoot.lookup( '.google.protobuf.Empty' ) as gax.protobuf.Type; @@ -337,6 +343,15 @@ export class ModelServiceClient { uploadModelResponse.decode.bind(uploadModelResponse), uploadModelMetadata.decode.bind(uploadModelMetadata) ), + updateExplanationDataset: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateExplanationDatasetResponse.decode.bind( + updateExplanationDatasetResponse + ), + updateExplanationDatasetMetadata.decode.bind( + updateExplanationDatasetMetadata + ) + ), deleteModel: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteModelResponse.decode.bind(deleteModelResponse), @@ -409,6 +424,7 @@ export class ModelServiceClient { 'listModels', 'listModelVersions', 'updateModel', + 'updateExplanationDataset', 'deleteModel', 'deleteModelVersion', 'mergeVersionAliases', @@ -511,6 +527,16 @@ export class ModelServiceClient { * @param {string} request.name * Required. The name of the Model resource. * Format: `projects/{project}/locations/{location}/models/{model}` + * + * In order to retrieve a specific version of the model, also provide + * the version ID or version alias. + * Example: projects/{project}/locations/{location}/models/{model}@2 + * or + * projects/{project}/locations/{location}/models/{model}@golden + * If no version ID or alias is specified, the "default" version will be + * returned. The "default" version alias is created for the first version of + * the model, and can be moved to other versions later on. There will be + * exactly one default version. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1271,6 +1297,150 @@ export class ModelServiceClient { protos.google.cloud.aiplatform.v1beta1.UploadModelOperationMetadata >; } + /** + * Incremental update the dataset used for a examples model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The resource name of the Model to update. + * Format: `projects/{project}/locations/{location}/models/{model}` + * @param {google.cloud.aiplatform.v1beta1.Examples} request.examples + * The example config containing the location of the dataset. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_UpdateExplanationDataset_async + */ + updateExplanationDataset( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateExplanationDataset( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateExplanationDataset( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateExplanationDataset( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + model: request.model || '', + }); + this.initialize(); + return this.innerApiCalls.updateExplanationDataset( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateExplanationDataset()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * region_tag:aiplatform_v1beta1_generated_ModelService_UpdateExplanationDataset_async + */ + async checkUpdateExplanationDatasetProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.updateExplanationDataset, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata + >; + } /** * Deletes a Model. * @@ -1566,6 +1736,8 @@ export class ModelServiceClient { * The request object that will be sent. * @param {string} request.name * Required. The resource name of the Model to export. + * The resource name may contain version id or version alias to specify the + * version, if no version is specified, the default version will be exported. * @param {google.cloud.aiplatform.v1beta1.ExportModelRequest.OutputConfig} request.outputConfig * Required. The desired output location and configuration. * @param {object} [options] diff --git a/src/v1beta1/model_service_client_config.json b/src/v1beta1/model_service_client_config.json index 40806050..5d0c4612 100644 --- a/src/v1beta1/model_service_client_config.json +++ b/src/v1beta1/model_service_client_config.json @@ -44,6 +44,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "UpdateExplanationDataset": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "DeleteModel": { "timeout_millis": 5000, "retry_codes_name": "non_idempotent", diff --git a/test/gapic_model_service_v1beta1.ts b/test/gapic_model_service_v1beta1.ts index 82029a2e..e05a8d16 100644 --- a/test/gapic_model_service_v1beta1.ts +++ b/test/gapic_model_service_v1beta1.ts @@ -1205,6 +1205,204 @@ describe('v1beta1.ModelServiceClient', () => { }); }); + describe('updateExplanationDataset', () => { + it('invokes updateExplanationDataset without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest() + ); + request.model = ''; + const expectedHeaderRequestParams = 'model='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateExplanationDataset = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateExplanationDataset(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateExplanationDataset as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateExplanationDataset without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest() + ); + request.model = ''; + const expectedHeaderRequestParams = 'model='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateExplanationDataset = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExplanationDataset( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.IUpdateExplanationDatasetOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateExplanationDataset as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateExplanationDataset with call error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest() + ); + request.model = ''; + const expectedHeaderRequestParams = 'model='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExplanationDataset = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateExplanationDataset(request), + expectedError + ); + assert( + (client.innerApiCalls.updateExplanationDataset as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateExplanationDataset with LRO error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetRequest() + ); + request.model = ''; + const expectedHeaderRequestParams = 'model='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExplanationDataset = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateExplanationDataset(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.updateExplanationDataset as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkUpdateExplanationDatasetProgress without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkUpdateExplanationDatasetProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateExplanationDatasetProgress with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateExplanationDatasetProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('deleteModel', () => { it('invokes deleteModel without error', async () => { const client = new modelserviceModule.v1beta1.ModelServiceClient({
include:samples/generated/v1beta1/dataset_service.get_dataset.jsinclude:samples/generated/v1beta1/dataset_service.update_dataset.jsinclude:samples/generated/v1beta1/dataset_service.get_annotation_spec.jsinclude:samples/generated/v1beta1/dataset_service.create_dataset.jsinclude:samples/generated/v1beta1/dataset_service.create_dataset.jsinclude:samples/generated/v1beta1/dataset_service.delete_dataset.jsinclude:samples/generated/v1beta1/dataset_service.delete_dataset.jsinclude:samples/generated/v1beta1/dataset_service.import_data.jsinclude:samples/generated/v1beta1/dataset_service.import_data.jsinclude:samples/generated/v1beta1/dataset_service.export_data.jsinclude:samples/generated/v1beta1/dataset_service.export_data.jsinclude:samples/generated/v1beta1/dataset_service.list_datasets.jsinclude:samples/generated/v1beta1/dataset_service.list_data_items.jsinclude:samples/generated/v1beta1/dataset_service.list_annotations.jsinclude:samples/generated/v1beta1/endpoint_service.get_endpoint.jsinclude:samples/generated/v1beta1/endpoint_service.update_endpoint.jsinclude:samples/generated/v1beta1/endpoint_service.create_endpoint.jsinclude:samples/generated/v1beta1/endpoint_service.create_endpoint.jsinclude:samples/generated/v1beta1/endpoint_service.delete_endpoint.jsinclude:samples/generated/v1beta1/endpoint_service.delete_endpoint.jsinclude:samples/generated/v1beta1/endpoint_service.deploy_model.jsinclude:samples/generated/v1beta1/endpoint_service.deploy_model.jsinclude:samples/generated/v1beta1/endpoint_service.undeploy_model.jsinclude:samples/generated/v1beta1/endpoint_service.undeploy_model.jsinclude:samples/generated/v1beta1/endpoint_service.list_endpoints.jsinclude:samples/generated/v1beta1/featurestore_online_serving_service.read_feature_values.jsinclude:samples/generated/v1beta1/featurestore_online_serving_service.streaming_read_feature_values.jsinclude:samples/generated/v1beta1/featurestore_service.get_featurestore.jsinclude:samples/generated/v1beta1/featurestore_service.get_entity_type.jsinclude:samples/generated/v1beta1/featurestore_service.update_entity_type.jsinclude:samples/generated/v1beta1/featurestore_service.get_feature.jsinclude:samples/generated/v1beta1/featurestore_service.update_feature.jsinclude:samples/generated/v1beta1/featurestore_service.create_featurestore.jsinclude:samples/generated/v1beta1/featurestore_service.create_featurestore.jsinclude:samples/generated/v1beta1/featurestore_service.update_featurestore.jsinclude:samples/generated/v1beta1/featurestore_service.update_featurestore.jsinclude:samples/generated/v1beta1/featurestore_service.delete_featurestore.jsinclude:samples/generated/v1beta1/featurestore_service.delete_featurestore.jsinclude:samples/generated/v1beta1/featurestore_service.create_entity_type.jsinclude:samples/generated/v1beta1/featurestore_service.create_entity_type.jsinclude:samples/generated/v1beta1/featurestore_service.delete_entity_type.jsinclude:samples/generated/v1beta1/featurestore_service.delete_entity_type.jsinclude:samples/generated/v1beta1/featurestore_service.create_feature.jsinclude:samples/generated/v1beta1/featurestore_service.create_feature.jsinclude:samples/generated/v1beta1/featurestore_service.batch_create_features.jsinclude:samples/generated/v1beta1/featurestore_service.batch_create_features.jsinclude:samples/generated/v1beta1/featurestore_service.delete_feature.jsinclude:samples/generated/v1beta1/featurestore_service.delete_feature.jsinclude:samples/generated/v1beta1/featurestore_service.import_feature_values.jsinclude:samples/generated/v1beta1/featurestore_service.import_feature_values.jsinclude:samples/generated/v1beta1/featurestore_service.batch_read_feature_values.jsinclude:samples/generated/v1beta1/featurestore_service.batch_read_feature_values.jsinclude:samples/generated/v1beta1/featurestore_service.export_feature_values.jsinclude:samples/generated/v1beta1/featurestore_service.export_feature_values.jsinclude:samples/generated/v1beta1/featurestore_service.list_featurestores.jsinclude:samples/generated/v1beta1/featurestore_service.list_entity_types.jsinclude:samples/generated/v1beta1/featurestore_service.list_features.jsinclude:samples/generated/v1beta1/featurestore_service.search_features.jsinclude:samples/generated/v1beta1/index_endpoint_service.get_index_endpoint.jsinclude:samples/generated/v1beta1/index_endpoint_service.update_index_endpoint.jsinclude:samples/generated/v1beta1/index_endpoint_service.create_index_endpoint.jsinclude:samples/generated/v1beta1/index_endpoint_service.create_index_endpoint.jsinclude:samples/generated/v1beta1/index_endpoint_service.delete_index_endpoint.jsinclude:samples/generated/v1beta1/index_endpoint_service.delete_index_endpoint.jsinclude:samples/generated/v1beta1/index_endpoint_service.deploy_index.jsinclude:samples/generated/v1beta1/index_endpoint_service.deploy_index.jsinclude:samples/generated/v1beta1/index_endpoint_service.undeploy_index.jsinclude:samples/generated/v1beta1/index_endpoint_service.undeploy_index.jsinclude:samples/generated/v1beta1/index_endpoint_service.mutate_deployed_index.jsinclude:samples/generated/v1beta1/index_endpoint_service.mutate_deployed_index.jsinclude:samples/generated/v1beta1/index_endpoint_service.list_index_endpoints.jsinclude:samples/generated/v1beta1/index_service.get_index.jsinclude:samples/generated/v1beta1/index_service.create_index.jsinclude:samples/generated/v1beta1/index_service.create_index.jsinclude:samples/generated/v1beta1/index_service.update_index.jsinclude:samples/generated/v1beta1/index_service.update_index.jsinclude:samples/generated/v1beta1/index_service.delete_index.jsinclude:samples/generated/v1beta1/index_service.delete_index.jsinclude:samples/generated/v1beta1/index_service.list_indexes.jsinclude:samples/generated/v1beta1/job_service.create_custom_job.jsinclude:samples/generated/v1beta1/job_service.get_custom_job.jsinclude:samples/generated/v1beta1/job_service.cancel_custom_job.jsinclude:samples/generated/v1beta1/job_service.create_data_labeling_job.jsinclude:samples/generated/v1beta1/job_service.get_data_labeling_job.jsinclude:samples/generated/v1beta1/job_service.cancel_data_labeling_job.jsinclude:samples/generated/v1beta1/job_service.create_hyperparameter_tuning_job.jsinclude:samples/generated/v1beta1/job_service.get_hyperparameter_tuning_job.jsinclude:samples/generated/v1beta1/job_service.cancel_hyperparameter_tuning_job.jsinclude:samples/generated/v1beta1/job_service.create_batch_prediction_job.jsinclude:samples/generated/v1beta1/job_service.get_batch_prediction_job.jsinclude:samples/generated/v1beta1/job_service.cancel_batch_prediction_job.jsinclude:samples/generated/v1beta1/job_service.create_model_deployment_monitoring_job.jsinclude:samples/generated/v1beta1/job_service.get_model_deployment_monitoring_job.jsinclude:samples/generated/v1beta1/job_service.pause_model_deployment_monitoring_job.jsinclude:samples/generated/v1beta1/job_service.resume_model_deployment_monitoring_job.jsinclude:samples/generated/v1beta1/job_service.delete_custom_job.jsinclude:samples/generated/v1beta1/job_service.delete_custom_job.jsinclude:samples/generated/v1beta1/job_service.delete_data_labeling_job.jsinclude:samples/generated/v1beta1/job_service.delete_data_labeling_job.jsinclude:samples/generated/v1beta1/job_service.delete_hyperparameter_tuning_job.jsinclude:samples/generated/v1beta1/job_service.delete_hyperparameter_tuning_job.jsinclude:samples/generated/v1beta1/job_service.delete_batch_prediction_job.jsinclude:samples/generated/v1beta1/job_service.delete_batch_prediction_job.jsinclude:samples/generated/v1beta1/job_service.update_model_deployment_monitoring_job.jsinclude:samples/generated/v1beta1/job_service.update_model_deployment_monitoring_job.jsinclude:samples/generated/v1beta1/job_service.delete_model_deployment_monitoring_job.jsinclude:samples/generated/v1beta1/job_service.delete_model_deployment_monitoring_job.jsinclude:samples/generated/v1beta1/job_service.list_custom_jobs.jsinclude:samples/generated/v1beta1/job_service.list_data_labeling_jobs.jsinclude:samples/generated/v1beta1/job_service.list_hyperparameter_tuning_jobs.jsinclude:samples/generated/v1beta1/job_service.list_batch_prediction_jobs.jsinclude:samples/generated/v1beta1/job_service.search_model_deployment_monitoring_stats_anomalies.jsinclude:samples/generated/v1beta1/job_service.list_model_deployment_monitoring_jobs.jsinclude:samples/generated/v1beta1/metadata_service.get_metadata_store.jsinclude:samples/generated/v1beta1/metadata_service.create_artifact.jsinclude:samples/generated/v1beta1/metadata_service.get_artifact.jsinclude:samples/generated/v1beta1/metadata_service.update_artifact.jsinclude:samples/generated/v1beta1/metadata_service.create_context.jsinclude:samples/generated/v1beta1/metadata_service.get_context.jsinclude:samples/generated/v1beta1/metadata_service.update_context.jsinclude:samples/generated/v1beta1/metadata_service.add_context_artifacts_and_executions.jsinclude:samples/generated/v1beta1/metadata_service.add_context_children.jsinclude:samples/generated/v1beta1/metadata_service.query_context_lineage_subgraph.jsinclude:samples/generated/v1beta1/metadata_service.create_execution.jsinclude:samples/generated/v1beta1/metadata_service.get_execution.jsinclude:samples/generated/v1beta1/metadata_service.update_execution.jsinclude:samples/generated/v1beta1/metadata_service.add_execution_events.jsinclude:samples/generated/v1beta1/metadata_service.query_execution_inputs_and_outputs.jsinclude:samples/generated/v1beta1/metadata_service.create_metadata_schema.jsinclude:samples/generated/v1beta1/metadata_service.get_metadata_schema.jsinclude:samples/generated/v1beta1/metadata_service.query_artifact_lineage_subgraph.jsinclude:samples/generated/v1beta1/metadata_service.create_metadata_store.jsinclude:samples/generated/v1beta1/metadata_service.create_metadata_store.jsinclude:samples/generated/v1beta1/metadata_service.delete_metadata_store.jsinclude:samples/generated/v1beta1/metadata_service.delete_metadata_store.jsinclude:samples/generated/v1beta1/metadata_service.delete_artifact.jsinclude:samples/generated/v1beta1/metadata_service.delete_artifact.jsinclude:samples/generated/v1beta1/metadata_service.purge_artifacts.jsinclude:samples/generated/v1beta1/metadata_service.purge_artifacts.jsinclude:samples/generated/v1beta1/metadata_service.delete_context.jsinclude:samples/generated/v1beta1/metadata_service.delete_context.jsinclude:samples/generated/v1beta1/metadata_service.purge_contexts.jsinclude:samples/generated/v1beta1/metadata_service.purge_contexts.jsinclude:samples/generated/v1beta1/metadata_service.delete_execution.jsinclude:samples/generated/v1beta1/metadata_service.delete_execution.jsinclude:samples/generated/v1beta1/metadata_service.purge_executions.jsinclude:samples/generated/v1beta1/metadata_service.purge_executions.jsinclude:samples/generated/v1beta1/metadata_service.list_metadata_stores.jsinclude:samples/generated/v1beta1/metadata_service.list_artifacts.jsinclude:samples/generated/v1beta1/metadata_service.list_contexts.jsinclude:samples/generated/v1beta1/metadata_service.list_executions.jsinclude:samples/generated/v1beta1/metadata_service.list_metadata_schemas.jsinclude:samples/generated/v1beta1/migration_service.batch_migrate_resources.jsinclude:samples/generated/v1beta1/migration_service.batch_migrate_resources.jsinclude:samples/generated/v1beta1/migration_service.search_migratable_resources.jsinclude:samples/generated/v1beta1/model_service.get_model.jsinclude:samples/generated/v1beta1/model_service.update_model.jsinclude:samples/generated/v1beta1/model_service.merge_version_aliases.jsinclude:samples/generated/v1beta1/model_service.import_model_evaluation.jsinclude:samples/generated/v1beta1/model_service.get_model_evaluation.jsinclude:samples/generated/v1beta1/model_service.get_model_evaluation_slice.jsinclude:samples/generated/v1beta1/model_service.upload_model.jsinclude:samples/generated/v1beta1/model_service.upload_model.jsinclude:samples/generated/v1beta1/model_service.update_explanation_dataset.jsinclude:samples/generated/v1beta1/model_service.update_explanation_dataset.jsinclude:samples/generated/v1beta1/model_service.delete_model.jsinclude:samples/generated/v1beta1/model_service.delete_model.jsinclude:samples/generated/v1beta1/model_service.delete_model_version.jsinclude:samples/generated/v1beta1/model_service.delete_model_version.jsinclude:samples/generated/v1beta1/model_service.export_model.jsinclude:samples/generated/v1beta1/model_service.export_model.jsinclude:samples/generated/v1beta1/model_service.list_models.jsinclude:samples/generated/v1beta1/model_service.list_model_versions.jsinclude:samples/generated/v1beta1/model_service.list_model_evaluations.jsinclude:samples/generated/v1beta1/model_service.list_model_evaluation_slices.jsinclude:samples/generated/v1beta1/pipeline_service.create_training_pipeline.jsinclude:samples/generated/v1beta1/pipeline_service.get_training_pipeline.jsinclude:samples/generated/v1beta1/pipeline_service.cancel_training_pipeline.jsinclude:samples/generated/v1beta1/pipeline_service.create_pipeline_job.jsinclude:samples/generated/v1beta1/pipeline_service.get_pipeline_job.jsinclude:samples/generated/v1beta1/pipeline_service.cancel_pipeline_job.jsinclude:samples/generated/v1beta1/pipeline_service.delete_training_pipeline.jsinclude:samples/generated/v1beta1/pipeline_service.delete_training_pipeline.jsinclude:samples/generated/v1beta1/pipeline_service.delete_pipeline_job.jsinclude:samples/generated/v1beta1/pipeline_service.delete_pipeline_job.jsinclude:samples/generated/v1beta1/pipeline_service.list_training_pipelines.jsinclude:samples/generated/v1beta1/pipeline_service.list_pipeline_jobs.jsinclude:samples/generated/v1beta1/prediction_service.predict.jsinclude:samples/generated/v1beta1/prediction_service.raw_predict.jsinclude:samples/generated/v1beta1/prediction_service.explain.jsinclude:samples/generated/v1beta1/specialist_pool_service.get_specialist_pool.jsinclude:samples/generated/v1beta1/specialist_pool_service.create_specialist_pool.jsinclude:samples/generated/v1beta1/specialist_pool_service.create_specialist_pool.jsinclude:samples/generated/v1beta1/specialist_pool_service.delete_specialist_pool.jsinclude:samples/generated/v1beta1/specialist_pool_service.delete_specialist_pool.jsinclude:samples/generated/v1beta1/specialist_pool_service.update_specialist_pool.jsinclude:samples/generated/v1beta1/specialist_pool_service.update_specialist_pool.jsinclude:samples/generated/v1beta1/specialist_pool_service.list_specialist_pools.jsinclude:samples/generated/v1beta1/tensorboard_service.get_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.get_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_runs.jsinclude:samples/generated/v1beta1/tensorboard_service.get_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.get_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.batch_read_tensorboard_time_series_data.jsinclude:samples/generated/v1beta1/tensorboard_service.read_tensorboard_time_series_data.jsinclude:samples/generated/v1beta1/tensorboard_service.write_tensorboard_experiment_data.jsinclude:samples/generated/v1beta1/tensorboard_service.write_tensorboard_run_data.jsinclude:samples/generated/v1beta1/tensorboard_service.read_tensorboard_blob_data.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.create_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.update_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_experiment.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_run.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.delete_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.list_tensorboards.jsinclude:samples/generated/v1beta1/tensorboard_service.list_tensorboard_experiments.jsinclude:samples/generated/v1beta1/tensorboard_service.list_tensorboard_runs.jsinclude:samples/generated/v1beta1/tensorboard_service.list_tensorboard_time_series.jsinclude:samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.jsinclude:samples/generated/v1beta1/vizier_service.create_study.jsinclude:samples/generated/v1beta1/vizier_service.get_study.jsinclude:samples/generated/v1beta1/vizier_service.delete_study.jsinclude:samples/generated/v1beta1/vizier_service.lookup_study.jsinclude:samples/generated/v1beta1/vizier_service.create_trial.jsinclude:samples/generated/v1beta1/vizier_service.get_trial.jsinclude:samples/generated/v1beta1/vizier_service.add_trial_measurement.jsinclude:samples/generated/v1beta1/vizier_service.complete_trial.jsinclude:samples/generated/v1beta1/vizier_service.delete_trial.jsinclude:samples/generated/v1beta1/vizier_service.stop_trial.jsinclude:samples/generated/v1beta1/vizier_service.list_optimal_trials.jsinclude:samples/generated/v1beta1/vizier_service.suggest_trials.jsinclude:samples/generated/v1beta1/vizier_service.suggest_trials.jsinclude:samples/generated/v1beta1/vizier_service.check_trial_early_stopping_state.jsinclude:samples/generated/v1beta1/vizier_service.check_trial_early_stopping_state.jsinclude:samples/generated/v1beta1/vizier_service.list_studies.jsinclude:samples/generated/v1beta1/vizier_service.list_trials.jsinclude:samples/generated/v1beta1/model_service.update_explanation_dataset.jsinclude:samples/generated/v1beta1/model_service.update_explanation_dataset.js